You are here

public function ProjectCollector::loadProject in Upgrade Status 8.3

Same name and namespace in other branches
  1. 8 src/ProjectCollector.php \Drupal\upgrade_status\ProjectCollector::loadProject()
  2. 8.2 src/ProjectCollector.php \Drupal\upgrade_status\ProjectCollector::loadProject()

Returns a single extension based on type and machine name.

Parameters

string $project_machine_name: Machine name for the extension.

Return value

\Drupal\Core\Extension\Extension A project if exists.

Throws

\Drupal\Core\Extension\Exception\UnknownExtensionException If there was no identified project with the given name.

File

src/ProjectCollector.php, line 418

Class

ProjectCollector
Collects projects and their associated metadata collated for Upgrade Status.

Namespace

Drupal\upgrade_status

Code

public function loadProject(string $project_machine_name) {
  $projects = $this
    ->collectProjects();
  if (!empty($projects[$project_machine_name])) {
    return $projects[$project_machine_name];
  }
  throw new UnknownExtensionException("The {$project_machine_name} project does not exist.");
}