src/ConstructionKitBuildingBlocksDetector.php
protected function getPackagesData()
    {
        $composer = $this->event->getComposer();
        $locker = $composer->getLocker();
        if (isset($locker)) {
            $lockData = $locker->getLockData();
            $allPackages = isset($lockData['packages']) ? $lockData['packages'] : array();
        }

        $packages = array();
        // Only add those packages that we can reasonably
        // assume are components into our packages list
        foreach ($allPackages as $package) {
            if (isset($package['extra']['c33s-building-blocks']) && is_array($package['extra']['c33s-building-blocks'])) {
                $packages[] = $package;
            }
        }

        // Add the root package to the packages list.
        $root = $composer->getPackage();
        if ($root) {
            $dumper = new ArrayDumper();
            $package = $dumper->dump($root);

            if (isset($package['extra']['c33s-building-blocks']) && is_array($package['extra']['c33s-building-blocks'])) {
                $packages[] = $package;
            }
        }

        return $packages;
    }
protected function getPackagesData()
    {
        $composer = $this->event->getComposer();
        $locker = $composer->getLocker();
        if (isset($locker)) {
            $lockData = $locker->getLockData();
            $allPackages = isset($lockData['packages']) ? $lockData['packages'] : array();
        }

        $packages = array();
        // Only add those packages that we can reasonably
        // assume are components into our packages list
        foreach ($allPackages as $package) {
            if (isset($package['extra']['c33s-building-blocks']) && is_array($package['extra']['c33s-building-blocks'])) {
                $packages[] = $package;
            }
        }

        // Add the root package to the packages list.
        $root = $composer->getPackage();
        if ($root) {
            $dumper = new ArrayDumper();
            $package = $dumper->dump($root);

            if (isset($package['extra']['c33s-building-blocks']) && is_array($package['extra']['c33s-building-blocks'])) {
                $packages[] = $package;
            }
        }

        return $packages;
    }
protected function getPackagesData ( ) { $ composer = $ this -> event -> getComposer ( ) ; $ locker = $ composer -> getLocker ( ) ; if ( isset ( $ locker ) ) { $ lockData = $ locker -> getLockData ( ) ; $ allPackages = isset ( $ lockData [ 'packages' ] ) ? $ lockData [ 'packages' ] : array ( ) ; } $ packages = array ( ) ; // Only add those packages that we can reasonably // assume are components into our packages list foreach ( $ allPackages as $ package ) { if ( isset ( $ package [ 'extra' ] [ 'c33s-building-blocks' ] ) && is_array ( $ package [ 'extra' ] [ 'c33s-building-blocks' ] ) ) { $ packages [ ] = $ package ; } } // Add the root package to the packages list. $ root = $ composer -> getPackage ( ) ; if ( $ root ) { $ dumper = new ArrayDumper ( ) ; $ package = $ dumper -> dump ( $ root ) ; if ( isset ( $ package [ 'extra' ] [ 'c33s-building-blocks' ] ) && is_array ( $ package [ 'extra' ] [ 'c33s-building-blocks' ] ) ) { $ packages [ ] = $ package ; } } return $ packages ; }
Get active non-dev packages from composer's locker that include an c33s-building-blocks extra array.

@return array
Get active non - dev packages from composer s locker that include an c33s - building - blocks extra array .