Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Runtime.php

function Runtime::construct

@template T of object

@phpstan-param class-string<T> $class @phpstan-return T

Parameters

mixed[] $arguments:

Throws

\ReflectionException

File

vendor/composer/composer/src/Composer/Platform/Runtime.php, line 67

Class

Runtime

Namespace

Composer\Platform

Code

public function construct(string $class, array $arguments = []) : object {
    if (empty($arguments)) {
        return new $class();
    }
    $refl = new \ReflectionClass($class);
    return $refl->newInstanceArgs($arguments);
}
RSS feed
Powered by Drupal