class InvalidLibraryDependencyException in Libraries API 8.3
Provides an exception for an invalid library exception.
Hierarchy
- class \Drupal\libraries\ExternalLibrary\Exception\InvalidLibraryDependencyException extends \Drupal\libraries\ExternalLibrary\Exception\UnexpectedValueException implements LibraryAccessorInterface uses LibraryAccessorTrait
Expanded class hierarchy of InvalidLibraryDependencyException
File
- src/
ExternalLibrary/ Exception/ InvalidLibraryDependencyException.php, line 13
Namespace
Drupal\libraries\ExternalLibrary\ExceptionView source
class InvalidLibraryDependencyException extends \UnexpectedValueException implements LibraryAccessorInterface {
use LibraryAccessorTrait, DependencyAccessorTrait {
LibraryAccessorTrait::getLibrary insteadof DependencyAccessorTrait;
DependencyAccessorTrait::getLibrary as libraryAccessor;
}
/**
* Constructs a library exception.
*
* @param \Drupal\libraries\ExternalLibrary\LibraryInterface $library
* The library with the invalid dependency.
* @param \Drupal\libraries\ExternalLibrary\LibraryInterface $dependency
* The dependency.
* @param string $message
* (optional) The exception message.
* @param int $code
* (optional) The error code.
* @param \Exception $previous
* (optional) The previous exception.
*/
public function __construct(LibraryInterface $library, LibraryInterface $dependency, $message = '', $code = 0, \Exception $previous = NULL) {
$this->library = $library;
$this->dependency = $dependency;
$message = $message ?: "The library '{$this->library->getId()}' cannot depend on the library '{$this->dependency->getId()}'.";
parent::__construct($message, $code, $previous);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InvalidLibraryDependencyException:: |
public | function | Constructs a library exception. | |
LibraryAccessorInterface:: |
public | function | Returns the library. | |
LibraryAccessorTrait:: |
protected | property | The library. | |
LibraryAccessorTrait:: |
public | function | Returns the library. Aliased as: libraryAccessor |