src/Factory.php
protected static function extractAutoLoadItemsFromComposerJson(string $sPath): \stdClass
    {
        $oOut = (object) ['helpers' => [], 'services' => []];
        if (file_exists($sPath)) {
            $oAppComposer = json_decode(file_get_contents($sPath));
            if (!empty($oAppComposer->extra->nails->autoload->helpers)) {
                foreach ($oAppComposer->extra->nails->autoload->helpers as $sHelper) {
                    $oOut->helpers[] = $sHelper;
                }
            }
            if (!empty($oAppComposer->extra->nails->autoload->services)) {
                foreach ($oAppComposer->extra->nails->autoload->services as $sService) {
                    $oOut->services[] = $sService;
                }
            }
        }

        return $oOut;
    }
protected static function extractAutoLoadItemsFromComposerJson(string $sPath): \stdClass
    {
        $oOut = (object) ['helpers' => [], 'services' => []];
        if (file_exists($sPath)) {
            $oAppComposer = json_decode(file_get_contents($sPath));
            if (!empty($oAppComposer->extra->nails->autoload->helpers)) {
                foreach ($oAppComposer->extra->nails->autoload->helpers as $sHelper) {
                    $oOut->helpers[] = $sHelper;
                }
            }
            if (!empty($oAppComposer->extra->nails->autoload->services)) {
                foreach ($oAppComposer->extra->nails->autoload->services as $sService) {
                    $oOut->services[] = $sService;
                }
            }
        }

        return $oOut;
    }
protected static function extractAutoLoadItemsFromComposerJson ( string $ sPath ) : \ stdClass { $ oOut = ( object ) [ 'helpers' => [ ] , 'services' => [ ] ] ; if ( file_exists ( $ sPath ) ) { $ oAppComposer = json_decode ( file_get_contents ( $ sPath ) ) ; if ( ! empty ( $ oAppComposer -> extra -> nails -> autoload -> helpers ) ) { foreach ( $ oAppComposer -> extra -> nails -> autoload -> helpers as $ sHelper ) { $ oOut -> helpers [ ] = $ sHelper ; } } if ( ! empty ( $ oAppComposer -> extra -> nails -> autoload -> services ) ) { foreach ( $ oAppComposer -> extra -> nails -> autoload -> services as $ sService ) { $ oOut -> services [ ] = $ sService ; } } } return $ oOut ; }
Extracts the autoload elements from a composer.json file

@param string $sPath The path to the composer.json file

@return \stdClass
Extracts the autoload elements from a composer . json file