src/Console/Command/Docs.php
protected function addControllerIfNotExists(Collection $controllers, $controller)
    {
        $class = get_class($controller);

        if ($controllers->has($class)) {
            return;
        }

        $reflection = new ReflectionClass($controller);

        $interface = Arr::first($reflection->getInterfaces(), function ($key, $value) {
            return ends_with($key, 'Docs');
        });

        if ($interface) {
            $controller = $interface;
        }

        $controllers->put($class, $controller);
    }
protected function addControllerIfNotExists(Collection $controllers, $controller)
    {
        $class = get_class($controller);

        if ($controllers->has($class)) {
            return;
        }

        $reflection = new ReflectionClass($controller);

        $interface = Arr::first($reflection->getInterfaces(), function ($key, $value) {
            return ends_with($key, 'Docs');
        });

        if ($interface) {
            $controller = $interface;
        }

        $controllers->put($class, $controller);
    }
protected function addControllerIfNotExists ( Collection $ controllers , $ controller ) { $ class = get_class ( $ controller ) ; if ( $ controllers -> has ( $ class ) ) { return ; } $ reflection = new ReflectionClass ( $ controller ) ; $ interface = Arr :: first ( $ reflection -> getInterfaces ( ) , function ( $ key , $ value ) { return ends_with ( $ key , 'Docs' ) ; } ) ; if ( $ interface ) { $ controller = $ interface ; } $ controllers -> put ( $ class , $ controller ) ; }
Add a controller to the collection if it does not exist. If the
controller implements an interface suffixed with "Docs" it
will be used instead of the controller.

@param \Illuminate\Support\Collection $controllers
@param object                         $controller

@return void
Add a controller to the collection if it does not exist . If the controller implements an interface suffixed with Docs it will be used instead of the controller .