protected function filterClasses($key, $classes, $internal, $user)
    {
        $ret = [];

        if ($internal) {
            $ret['Internal ' . $key] = \array_filter($classes, function ($class) {
                $refl = new \ReflectionClass($class);

                return $refl->isInternal();
            });
        }

        if ($user) {
            $ret['User ' . $key] = \array_filter($classes, function ($class) {
                $refl = new \ReflectionClass($class);

                return !$refl->isInternal();
            });
        }

        if (!$user && !$internal) {
            $ret[$key] = $classes;
        }

        return $ret;
    }
protected function filterClasses($key, $classes, $internal, $user)
    {
        $ret = [];

        if ($internal) {
            $ret['Internal ' . $key] = \array_filter($classes, function ($class) {
                $refl = new \ReflectionClass($class);

                return $refl->isInternal();
            });
        }

        if ($user) {
            $ret['User ' . $key] = \array_filter($classes, function ($class) {
                $refl = new \ReflectionClass($class);

                return !$refl->isInternal();
            });
        }

        if (!$user && !$internal) {
            $ret[$key] = $classes;
        }

        return $ret;
    }
protected function filterClasses ( $ key , $ classes , $ internal , $ user ) { $ ret = [ ] ; if ( $ internal ) { $ ret [ 'Internal ' . $ key ] = \ array_filter ( $ classes , function ( $ class ) { $ refl = new \ ReflectionClass ( $ class ) ; return $ refl -> isInternal ( ) ; } ) ; } if ( $ user ) { $ ret [ 'User ' . $ key ] = \ array_filter ( $ classes , function ( $ class ) { $ refl = new \ ReflectionClass ( $ class ) ; return ! $ refl -> isInternal ( ) ; } ) ; } if ( ! $ user && ! $ internal ) { $ ret [ $ key ] = $ classes ; } return $ ret ; }
Filter a list of classes, interfaces or traits.

If $internal or $user is defined, results will be limited to internal or
user-defined classes as appropriate.

@param string $key
@param array  $classes
@param bool   $internal
@param bool   $user

@return array
Filter a list of classes interfaces or traits .