You are here

class BarClass in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/DependencyInjection/Fixture/BarClass.php \Drupal\Tests\Core\DependencyInjection\Fixture\BarClass

Stub class which acts as a service to test the container.

Hierarchy

  • class \Drupal\Tests\Core\DependencyInjection\Fixture\BarClass

Expanded class hierarchy of BarClass

See also

\Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest

\Drupal\Tests\Core\DependencyInjection\Fixture\BazClass

2 files declare their use of BarClass
ContainerBuilderTest.php in core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
ContainerTest.php in core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php

File

core/tests/Drupal/Tests/Core/DependencyInjection/Fixture/BarClass.php, line 11

Namespace

Drupal\Tests\Core\DependencyInjection\Fixture
View source
class BarClass {

  /**
   * Storage for a protected BazClass object.
   *
   * @var Drupal\Tests\Core\DependencyInjection\Fixture\BazClass
   */
  protected $baz;

  /**
   * Setter for our BazClass object.
   *
   * This method is called during the service initialization.
   *
   * @param \Drupal\Tests\Core\DependencyInjection\Fixture\BazClass $baz
   *   A BazClass object to store.
   */
  public function setBaz(BazClass $baz) {
    $this->baz = $baz;
  }

  /**
   * Getter for our BazClass object.
   *
   * @return \Drupal\Tests\Core\DependencyInjection\Fixture\BazClass
   *   The stored BazClass object.
   */
  public function getBaz() {
    return $this->baz;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BarClass::$baz protected property Storage for a protected BazClass object.
BarClass::getBaz public function Getter for our BazClass object.
BarClass::setBaz public function Setter for our BazClass object.