private function addServiceMethodCalls(Definition $definition, $variableName = 'instance')
    {
        $calls = '';
        foreach ($definition->getMethodCalls() as $call) {
            $arguments = array();
            foreach ($call[1] as $value) {
                $arguments[] = $this->dumpValue($value);
            }

            $calls .= $this->wrapServiceConditionals($call[1], sprintf("        \$%s->%s(%s);\n", $variableName, $call[0], implode(', ', $arguments)));
        }

        return $calls;
    }
private function addServiceMethodCalls(Definition $definition, $variableName = 'instance')
    {
        $calls = '';
        foreach ($definition->getMethodCalls() as $call) {
            $arguments = array();
            foreach ($call[1] as $value) {
                $arguments[] = $this->dumpValue($value);
            }

            $calls .= $this->wrapServiceConditionals($call[1], sprintf("        \$%s->%s(%s);\n", $variableName, $call[0], implode(', ', $arguments)));
        }

        return $calls;
    }
private function addServiceMethodCalls ( Definition $ definition , $ variableName = 'instance' ) { $ calls = '' ; foreach ( $ definition -> getMethodCalls ( ) as $ call ) { $ arguments = array ( ) ; foreach ( $ call [ 1 ] as $ value ) { $ arguments [ ] = $ this -> dumpValue ( $ value ) ; } $ calls .= $ this -> wrapServiceConditionals ( $ call [ 1 ] , sprintf ( "        \$%s->%s(%s);\n" , $ variableName , $ call [ 0 ] , implode ( ', ' , $ arguments ) ) ) ; } return $ calls ; }
Adds method calls to a service definition.

@param Definition $definition
@param string     $variableName

@return string
Adds method calls to a service definition .