Symfony\Component\DependencyInjection\ContainerBuilder::isTrackingResources PHP Method

isTrackingResources() public method

Checks if resources are tracked.
public isTrackingResources ( ) : boolean
return boolean true if resources are tracked, false otherwise
    public function isTrackingResources()
    {
        return $this->trackResources;
    }

Usage Example

Example #1
0
    /**
     * Wires the given definition.
     *
     * @param string     $id
     * @param Definition $definition
     * @param string[]   $autowiredMethods
     *
     * @throws RuntimeException
     */
    private function completeDefinition($id, Definition $definition, array $autowiredMethods)
    {
        if (!$reflectionClass = $this->getReflectionClass($id, $definition)) {
            return;
        }

        if ($this->container->isTrackingResources()) {
            $this->container->addResource(static::createResourceForClass($reflectionClass));
        }

        $methodsCalled = array();
        foreach ($definition->getMethodCalls() as $methodCall) {
            $methodsCalled[$methodCall[0]] = true;
        }

        foreach ($this->getMethodsToAutowire($id, $reflectionClass, $autowiredMethods) as $reflectionMethod) {
            if (!isset($methodsCalled[$reflectionMethod->name])) {
                $this->autowireMethod($id, $definition, $reflectionMethod);
            }
        }
    }
All Usage Examples Of Symfony\Component\DependencyInjection\ContainerBuilder::isTrackingResources