diff --git a/src/Plugin/VersionNegotiation/VersionByRel.php b/src/Plugin/VersionNegotiation/VersionByRel.php index aa39b83..92b72de 100644 --- a/src/Plugin/VersionNegotiation/VersionByRel.php +++ b/src/Plugin/VersionNegotiation/VersionByRel.php @@ -8,7 +8,6 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\jsonapi\Revisions\InvalidVersionIdentifierException; use Drupal\jsonapi\Revisions\PluginNegotiationBase; use Drupal\jsonapi\Revisions\VersionNegotiationInterface; -use Drupal\jsonapi\Revisions\VersionNegotiationManager; /** * Revision ID implementation for the current or latest revisions. diff --git a/src/ResourceType/ResourceType.php b/src/ResourceType/ResourceType.php index 40bda08..ec7bbbd 100644 --- a/src/ResourceType/ResourceType.php +++ b/src/ResourceType/ResourceType.php @@ -274,7 +274,7 @@ class ResourceType { * @param bool $is_mutable * (optional) Whether the resource type is mutable. * @param bool $is_versionable - + (optional) Whether the resource type is versionable. + * (optional) Whether the resource type is versionable. * @param array $field_mapping * (optional) The field mapping to use. */ diff --git a/src/Revisions/PluginNegotiationBase.php b/src/Revisions/PluginNegotiationBase.php index 2bc4eb9..9a56a70 100644 --- a/src/Revisions/PluginNegotiationBase.php +++ b/src/Revisions/PluginNegotiationBase.php @@ -76,7 +76,7 @@ abstract class PluginNegotiationBase extends PluginBase implements ContainerFact * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity for which to load a revision. - * @param $revision_id + * @param int $revision_id * The revision ID to be loaded. * * @return \Drupal\Core\Entity\EntityInterface|null @@ -97,7 +97,7 @@ abstract class PluginNegotiationBase extends PluginBase implements ContainerFact /** * Helper method that ensures that a version exists. * - * @param int|\Drupal\Core\Entity\EntityInterface $revision + * @param int|\Drupal\Core\Entity\EntityInterface $revision * A revision ID, or NULL if one was not found. * * @return int|\Drupal\Core\Entity\EntityInterface diff --git a/src/Revisions/VersionNotFoundException.php b/src/Revisions/VersionNotFoundException.php index 1f6d901..aa12bf4 100644 --- a/src/Revisions/VersionNotFoundException.php +++ b/src/Revisions/VersionNotFoundException.php @@ -2,8 +2,6 @@ namespace Drupal\jsonapi\Revisions; -use Throwable; - /** * Used when a version ID is valid, but the requested version does not exist. * @@ -14,8 +12,8 @@ class VersionNotFoundException extends \InvalidArgumentException { /** * {@inheritdoc} */ - public function __construct(string $message = 'The identified version could not be found.', int $code = 0, \Throwable $previous = NULL) { - parent::__construct($message, $code, $previous); + public function __construct($message = NULL, $code = 0, \Exception $previous = NULL) { + parent::__construct(!is_null($message) ? $message : 'The identified version could not be found.', $code, $previous); } }