private function loadAllEndpoints()
    {
        self::$endpointClasses = array_map(function ($classPath) {
            // For ./Api/Endpoints/MatchById -> ('MatchById.php')
            list($endpointClass) = array_slice(explode('/', $classPath), -1, 1);
            
            // Build the full class name with namespace
            $fullClassName = join('\\', [__NAMESPACE__, 'Endpoints', str_replace('.php', '', $endpointClass)]);
            
            /** @var Endpoint $endpoint */
            $endpoint = new $fullClassName($this->region);
            
            self::$endpointDefinitions[$endpoint->getName()] = [
                'class' => $fullClassName,
                'instance' => $endpoint,
            ];
            
            return $fullClassName;
        }, glob(__DIR__.'/Endpoints/*.php'));
    }
private function loadAllEndpoints()
    {
        self::$endpointClasses = array_map(function ($classPath) {
            // For ./Api/Endpoints/MatchById -> ('MatchById.php')
            list($endpointClass) = array_slice(explode('/', $classPath), -1, 1);
            
            // Build the full class name with namespace
            $fullClassName = join('\\', [__NAMESPACE__, 'Endpoints', str_replace('.php', '', $endpointClass)]);
            
            /** @var Endpoint $endpoint */
            $endpoint = new $fullClassName($this->region);
            
            self::$endpointDefinitions[$endpoint->getName()] = [
                'class' => $fullClassName,
                'instance' => $endpoint,
            ];
            
            return $fullClassName;
        }, glob(__DIR__.'/Endpoints/*.php'));
    }
private function loadAllEndpoints ( ) { self :: $ endpointClasses = array_map ( function ( $ classPath ) { // For ./Api/Endpoints/MatchById -> ('MatchById.php') list ( $ endpointClass ) = array_slice ( explode ( '/' , $ classPath ) , - 1 , 1 ) ; // Build the full class name with namespace $ fullClassName = join ( '\\' , [ __NAMESPACE__ , 'Endpoints' , str_replace ( '.php' , '' , $ endpointClass ) ] ) ; /** @var Endpoint $endpoint */ $ endpoint = new $ fullClassName ( $ this -> region ) ; self :: $ endpointDefinitions [ $ endpoint -> getName ( ) ] = [ 'class' => $ fullClassName , 'instance' => $ endpoint , ] ; return $ fullClassName ; } , glob ( __DIR__ . '/Endpoints/*.php' ) ) ; }
Load all available endpoints as an array of full class names with namespace strings.
The endpoints are contained within a folder structure that is only 1 level deep.
Load all available endpoints as an array of full class names with namespace strings . The endpoints are contained within a folder structure that is only 1 level deep .