array_reduce

Supported Versions: PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8
Iteratively reduce the array to a single value using a callback function
<?php array_reduce(array $array, callable $callback, mixed $initial = null): mixed
<?php             $properties,

        );



        $propertiesDocComments = array_reduce(

            array_map(

                fn (ReflectionProperty $property): array => explode(PHP_EOL, $property->getDocComment() ?: ''),

                $properties,

            ),

            fn (array $carry, array $item): array => [

                ...$carry,

                ...$item,

            ],

            [],

        );



        return [

            ...$propertiesNames,