You are here

public function ContainerBuilder::addClassResource in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::addClassResource()

Adds the given class hierarchy as resources.

Parameters

\ReflectionClass $class:

Return value

ContainerBuilder The current instance

2 calls to ContainerBuilder::addClassResource()
ContainerBuilder::addObjectResource in vendor/symfony/dependency-injection/ContainerBuilder.php
Adds the object class hierarchy as resources.
ContainerBuilder::compile in vendor/symfony/dependency-injection/ContainerBuilder.php
Compiles the container.

File

vendor/symfony/dependency-injection/ContainerBuilder.php, line 251

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function addClassResource(\ReflectionClass $class) {
  if (!$this->trackResources) {
    return $this;
  }
  do {
    $this
      ->addResource(new FileResource($class
      ->getFileName()));
  } while ($class = $class
    ->getParentClass());
  return $this;
}