protected function parseInjections($type, array $injections)
    {
        // assume no result
        $result = null;

        if (!empty($injections[$type])) {
            $result = [];

            switch ($type) {
                case Doozr_Di_Constants::INJECTION_TYPE_PROPERTY:
                case Doozr_Di_Constants::INJECTION_TYPE_METHOD:
                    foreach ($injections[$type] as $recipe) {
                        $result[] = [
                            'signature' => $recipe['target'],
                            'argument'  => $recipe['instance'],
                        ];
                    }
                    break;
                default:
                    // Break intentionally omitted
                case Doozr_Di_Constants::INJECTION_TYPE_CONSTRUCTOR:
                    return $injections[$type];
                    break;
            }
        }

        // return result
        return $result;
    }
protected function parseInjections($type, array $injections)
    {
        // assume no result
        $result = null;

        if (!empty($injections[$type])) {
            $result = [];

            switch ($type) {
                case Doozr_Di_Constants::INJECTION_TYPE_PROPERTY:
                case Doozr_Di_Constants::INJECTION_TYPE_METHOD:
                    foreach ($injections[$type] as $recipe) {
                        $result[] = [
                            'signature' => $recipe['target'],
                            'argument'  => $recipe['instance'],
                        ];
                    }
                    break;
                default:
                    // Break intentionally omitted
                case Doozr_Di_Constants::INJECTION_TYPE_CONSTRUCTOR:
                    return $injections[$type];
                    break;
            }
        }

        // return result
        return $result;
    }
protected function parseInjections ( $ type , array $ injections ) { // assume no result $ result = null ; if ( ! empty ( $ injections [ $ type ] ) ) { $ result = [ ] ; switch ( $ type ) { case Doozr_Di_Constants :: INJECTION_TYPE_PROPERTY : case Doozr_Di_Constants :: INJECTION_TYPE_METHOD : foreach ( $ injections [ $ type ] as $ recipe ) { $ result [ ] = [ 'signature' => $ recipe [ 'target' ] , 'argument' => $ recipe [ 'instance' ] , ] ; } break ; default : // Break intentionally omitted case Doozr_Di_Constants :: INJECTION_TYPE_CONSTRUCTOR : return $ injections [ $ type ] ; break ; } } // return result return $ result ; }
Parses out the requested type of injection from list of injections.

@param string $type       The type of injection (can be of: constructor, method, property)
@param array  $injections The dependencies to parse from

@author Benjamin Carl <opensource@clickalicious.de>

@return mixed NULL if no dependencies found, otherwise ARRAY containing the dependencies
Parses out the requested type of injection from list of injections .