src/Services/PluginManager.php
private function getNamespace($composerJson)
    {
        if (!file_exists($composerJson)) {
            throw new InvalidArgumentException('"' . $composerJson . '" not found.'); // @codeCoverageIgnore
        }
        $composer = json_decode(file_get_contents($composerJson), true);
        $autoload = isset($composer['autoload']['psr-4']) ? array_flip($composer['autoload']['psr-4']) : [];
        if (!isset($autoload['src/'])) {
            throw new InvalidArgumentException('psr-4 autoload directive for folder "src/" is missing in ' . $composerJson . '.');
        }

        return $autoload['src/'];
    }
private function getNamespace($composerJson)
    {
        if (!file_exists($composerJson)) {
            throw new InvalidArgumentException('"' . $composerJson . '" not found.'); // @codeCoverageIgnore
        }
        $composer = json_decode(file_get_contents($composerJson), true);
        $autoload = isset($composer['autoload']['psr-4']) ? array_flip($composer['autoload']['psr-4']) : [];
        if (!isset($autoload['src/'])) {
            throw new InvalidArgumentException('psr-4 autoload directive for folder "src/" is missing in ' . $composerJson . '.');
        }

        return $autoload['src/'];
    }
private function getNamespace ( $ composerJson ) { if ( ! file_exists ( $ composerJson ) ) { throw new InvalidArgumentException ( '"' . $ composerJson . '" not found.' ) ; // @codeCoverageIgnore } $ composer = json_decode ( file_get_contents ( $ composerJson ) , true ) ; $ autoload = isset ( $ composer [ 'autoload' ] [ 'psr-4' ] ) ? array_flip ( $ composer [ 'autoload' ] [ 'psr-4' ] ) : [ ] ; if ( ! isset ( $ autoload [ 'src/' ] ) ) { throw new InvalidArgumentException ( 'psr-4 autoload directive for folder "src/" is missing in ' . $ composerJson . '.' ) ; } return $ autoload [ 'src/' ] ; }
Read the namespace from composer.json

@param string $composerJson full path of composer.json
@return string
Read the namespace from composer . json