DI\Definition\ObjectDefinition::getMethodInjections PHP Method

getMethodInjections() public method

public getMethodInjections ( ) : DI\Definition\ObjectDefinition\MethodInjection[]
return DI\Definition\ObjectDefinition\MethodInjection[] Method injections
    public function getMethodInjections()
    {
        // Return array leafs
        $injections = [];
        array_walk_recursive($this->methodInjections, function ($injection) use(&$injections) {
            $injections[] = $injection;
        });
        return $injections;
    }

Usage Example

Exemplo n.º 1
0
 private function dumpMethods($className, ObjectDefinition $definition)
 {
     $str = '';
     foreach ($definition->getMethodInjections() as $methodInjection) {
         $parameters = $this->dumpMethodParameters($className, $methodInjection);
         $str .= sprintf(PHP_EOL . "    %s(" . PHP_EOL . "        %s" . PHP_EOL . "    )", $methodInjection->getMethodName(), $parameters);
     }
     return $str;
 }
All Usage Examples Of DI\Definition\ObjectDefinition::getMethodInjections