dev/src/GetComponentsTrait.php
private function getComponentComposer($libraryRootPath, $componentId, $defaultComposerPath = null)
    {
        if (!$defaultComposerPath) {
            $defaultComposerPath = isset($this->defaultComponentComposer)
                ? $this->defaultComponentComposer
                : null;
        }

        $componentsDir = isset($this->components)
            ? $this->components
            : $libraryRootPath;

        $components = $this->getComponents($libraryRootPath, $componentsDir, $defaultComposerPath);

        $components = array_values(array_filter($components, function ($component) use ($componentId) {
            return ($component['id'] === $componentId);
        }));

        if (count($components) === 0) {
            throw new \InvalidArgumentException(sprintf(
                'Given component id %s is not a valid component.',
                $componentId
            ));
        }

        return $components[0];
    }
private function getComponentComposer($libraryRootPath, $componentId, $defaultComposerPath = null)
    {
        if (!$defaultComposerPath) {
            $defaultComposerPath = isset($this->defaultComponentComposer)
                ? $this->defaultComponentComposer
                : null;
        }

        $componentsDir = isset($this->components)
            ? $this->components
            : $libraryRootPath;

        $components = $this->getComponents($libraryRootPath, $componentsDir, $defaultComposerPath);

        $components = array_values(array_filter($components, function ($component) use ($componentId) {
            return ($component['id'] === $componentId);
        }));

        if (count($components) === 0) {
            throw new \InvalidArgumentException(sprintf(
                'Given component id %s is not a valid component.',
                $componentId
            ));
        }

        return $components[0];
    }
private function getComponentComposer ( $ libraryRootPath , $ componentId , $ defaultComposerPath = null ) { if ( ! $ defaultComposerPath ) { $ defaultComposerPath = isset ( $ this -> defaultComponentComposer ) ? $ this -> defaultComponentComposer : null ; } $ componentsDir = isset ( $ this -> components ) ? $ this -> components : $ libraryRootPath ; $ components = $ this -> getComponents ( $ libraryRootPath , $ componentsDir , $ defaultComposerPath ) ; $ components = array_values ( array_filter ( $ components , function ( $ component ) use ( $ componentId ) { return ( $ component [ 'id' ] === $ componentId ) ; } ) ) ; if ( count ( $ components ) === 0 ) { throw new \ InvalidArgumentException ( sprintf ( 'Given component id %s is not a valid component.' , $ componentId ) ) ; } return $ components [ 0 ] ; }
Get the composer.json data for a given component.

@param string $componentId
@return array
Get the composer . json data for a given component .