public function generate($className, DependencyGraph $dependencyGraph)
    {
        $lastSeparatorPos = strrpos($className, '\\');
        if ($lastSeparatorPos !== false) {
            $namespace = substr($className, 0, $lastSeparatorPos);
            $shortClassName = substr($className, $lastSeparatorPos + 1);
        } else {
            $namespace = '';
            $shortClassName = $className;
        }

        $serviceDefinitions = [];
        foreach ($dependencyGraph->getAllObjects() as $object) {
            if (!$object->getValue()->isDynamic()) {
                $paramExprs = [];
                foreach ($object->getDependencies() as $dependency)  {
                    $paramExprs[] = $this->dumpParamExpr($dependency);
                }

                $serviceDefinitions[] = $this->dumpServiceDefinition($object, $paramExprs);
            }
        }

        return $this->dumpClass($namespace, $shortClassName, $serviceDefinitions);
    }
public function generate($className, DependencyGraph $dependencyGraph)
    {
        $lastSeparatorPos = strrpos($className, '\\');
        if ($lastSeparatorPos !== false) {
            $namespace = substr($className, 0, $lastSeparatorPos);
            $shortClassName = substr($className, $lastSeparatorPos + 1);
        } else {
            $namespace = '';
            $shortClassName = $className;
        }

        $serviceDefinitions = [];
        foreach ($dependencyGraph->getAllObjects() as $object) {
            if (!$object->getValue()->isDynamic()) {
                $paramExprs = [];
                foreach ($object->getDependencies() as $dependency)  {
                    $paramExprs[] = $this->dumpParamExpr($dependency);
                }

                $serviceDefinitions[] = $this->dumpServiceDefinition($object, $paramExprs);
            }
        }

        return $this->dumpClass($namespace, $shortClassName, $serviceDefinitions);
    }
public function generate ( $ className , DependencyGraph $ dependencyGraph ) { $ lastSeparatorPos = strrpos ( $ className , '\\' ) ; if ( $ lastSeparatorPos !== false ) { $ namespace = substr ( $ className , 0 , $ lastSeparatorPos ) ; $ shortClassName = substr ( $ className , $ lastSeparatorPos + 1 ) ; } else { $ namespace = '' ; $ shortClassName = $ className ; } $ serviceDefinitions = [ ] ; foreach ( $ dependencyGraph -> getAllObjects ( ) as $ object ) { if ( ! $ object -> getValue ( ) -> isDynamic ( ) ) { $ paramExprs = [ ] ; foreach ( $ object -> getDependencies ( ) as $ dependency ) { $ paramExprs [ ] = $ this -> dumpParamExpr ( $ dependency ) ; } $ serviceDefinitions [ ] = $ this -> dumpServiceDefinition ( $ object , $ paramExprs ) ; } } return $ this -> dumpClass ( $ namespace , $ shortClassName , $ serviceDefinitions ) ; }
Dumps the class definition code which can eval from PHP.

@param string $className The service provider's class name.
@param DependencyGraph $dependencyGraph
@return string
Dumps the class definition code which can eval from PHP .