private static function getBaseNamespace()
    {
        // try to determine the namespace of the
        $composerFile = PSX_PATH_SRC . '/../composer.json';
        $composer = \json_decode(\file_get_contents($composerFile), true);

        if (isset($composer['autoload'])) {
            $paths = $composer['autoload']['psr-4'] ?? [];
            $base  = trim(key($paths), '\\');

            if (!empty($base)) {
                return $base;
            }
        }

        throw new \RuntimeException('Could not determine the base namespace');
    }
private static function getBaseNamespace()
    {
        // try to determine the namespace of the
        $composerFile = PSX_PATH_SRC . '/../composer.json';
        $composer = \json_decode(\file_get_contents($composerFile), true);

        if (isset($composer['autoload'])) {
            $paths = $composer['autoload']['psr-4'] ?? [];
            $base  = trim(key($paths), '\\');

            if (!empty($base)) {
                return $base;
            }
        }

        throw new \RuntimeException('Could not determine the base namespace');
    }
private static function getBaseNamespace ( ) { // try to determine the namespace of the $ composerFile = PSX_PATH_SRC . '/../composer.json' ; $ composer = \ json_decode ( \ file_get_contents ( $ composerFile ) , true ) ; if ( isset ( $ composer [ 'autoload' ] ) ) { $ paths = $ composer [ 'autoload' ] [ 'psr-4' ] ?? [ ] ; $ base = trim ( key ( $ paths ) , '\\' ) ; if ( ! empty ( $ base ) ) { return $ base ; } } throw new \ RuntimeException ( 'Could not determine the base namespace' ) ; }
This method tries to find the base namespace of the current app. We try
to look at the composer.json file and use the first psr-4 autoload key

@return string
This method tries to find the base namespace of the current app . We try to look at the composer . json file and use the first psr - 4 autoload key