You are here

public function Target::__construct in Drupal 7 to 8/9 Module Upgrader 8

Constructs a Target.

Parameters

string $path: The base path of the target module.

\Symfony\Component\DependencyInjection\ContainerInterface $container: The current container, to pull any dependencies out of.

File

src/Target.php, line 62

Class

Target
Default implementation of TargetInterface.

Namespace

Drupal\drupalmoduleupgrader

Code

public function __construct($path, ContainerInterface $container) {
  $this->indexerManager = $container
    ->get('plugin.manager.drupalmoduleupgrader.indexer');
  if (is_dir($path)) {
    $this->basePath = $path;
  }
  else {
    throw new \RuntimeException((new FormattableMarkup('Invalid base path: @path', [
      '@path' => $path,
    ]))
      ->__toString());
  }
}