You are here

public static function PluginDefinitionValidator::validateClass in Plugin 8.2

Validates a plugin class.

Parameters

string $class: A fully qualified class name.

Throws

\InvalidArgumentException Thrown when the class is invalid.

6 calls to PluginDefinitionValidator::validateClass()
ArrayPluginDefinitionDecorator::setClass in src/PluginDefinition/ArrayPluginDefinitionDecorator.php
Sets the class.
ArrayPluginDefinitionDecorator::__construct in src/PluginDefinition/ArrayPluginDefinitionDecorator.php
Constructs a new instance.
PluginDefinition::setClass in src/PluginDefinition/PluginDefinition.php
Sets the class.
PluginDefinitionValidator::validateDeriverClass in src/PluginDefinition/PluginDefinitionValidator.php
Validates a plugin deriver class.
PluginDefinitionValidatorTest::testValidateClass in tests/src/Unit/PluginDefinition/PluginDefinitionValidatorTest.php
@covers ::validateClass

... See full list

File

src/PluginDefinition/PluginDefinitionValidator.php, line 24

Class

PluginDefinitionValidator
Provides plugin definition validation.

Namespace

Drupal\plugin\PluginDefinition

Code

public static function validateClass($class) {
  if (!class_exists($class)) {
    throw new \InvalidArgumentException(sprintf('Class %s does not exist.', $class));
  }
}