You are here

public function MockService::__construct in Service Container 7

Same name and namespace in other branches
  1. 7.2 tests/src/DependencyInjection/MockService.php \Drupal\Tests\service_container\DependencyInjection\MockService::__construct()

Constructs a MockService object.

Parameters

object $some_other_service: (optional) Another injected service.

string $some_parameter: (optional) An injected parameter.

File

tests/src/DependencyInjection/MockService.php, line 48
Contains \Drupal\Tests\service_container\DependencyInjection\MockService

Class

MockService
Helper class to test Container::get() method.

Namespace

Drupal\Tests\service_container\DependencyInjection

Code

public function __construct($some_other_service = NULL, $some_parameter = NULL) {
  if (is_array($some_other_service)) {
    $some_other_service = $some_other_service[0];
  }
  $this->someOtherService = $some_other_service;
  $this->someParameter = $some_parameter;
}