diff --git a/recogito_integration.module b/recogito_integration.module index c6bae55..bbddc8b 100644 --- a/recogito_integration.module +++ b/recogito_integration.module @@ -1,5 +1,10 @@ getformObject()), ['Drupal\node\NodeForm', 'Drupal\node\Form\NodeDeleteForm'])) { @@ -174,7 +179,7 @@ function endsWith($haystack, $needle) * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Core\Entity\EntityStorageException */ -function _deleteAnnotations(\Drupal\Core\Entity\EntityInterface $entity) +function _deleteAnnotations(EntityInterface $entity) { if (!in_array($entity->bundle(), array("path_alias", "annotation_collection", "annotation", "annotation_textualbody"))) { @@ -231,7 +236,7 @@ function getAnnotationComponentsByNode($entity) * Query Annotation Collection base on url / alias * @param \Drupal\Core\Entity\EntityInterface $entity */ -function getAnnotationCollection(\Drupal\Core\Entity\EntityInterface $entity) +function getAnnotationCollection(EntityInterface $entity) { $alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $entity->id()); if (!str_starts_with($alias, "/node/")) { @@ -380,7 +385,7 @@ function recogito_integration_entity_operation_alter(array &$operations, $entity * @param $route_name * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $cacheability */ -function recogito_integration_menu_local_tasks_alter(&$data, $route_name, \Drupal\Core\Cache\RefinableCacheableDependencyInterface &$cacheability) +function recogito_integration_menu_local_tasks_alter(&$data, $route_name, RefinableCacheableDependencyInterface &$cacheability) { $anno_contenttypes = \Drupal::config('recogito_integration.settings')->get('recogito_integration.content-type-to-annotated'); $node = \Drupal::routeMatch()->getParameter('node'); @@ -419,7 +424,7 @@ function getNodeIdByAlias(string $alias) $node = NULL; $path = \Drupal::service('path_alias.manager')->getPathByAlias($alias); if (preg_match('/node\/(\d+)/', $path, $matches)) { - $node = \Drupal\node\Entity\Node::load($matches[1]); + $node = Node::load($matches[1]); } return $node; } diff --git a/src/Form/RecogitoIntegrationForm.php b/src/Form/RecogitoIntegrationForm.php index 48b63f5..4178031 100644 --- a/src/Form/RecogitoIntegrationForm.php +++ b/src/Form/RecogitoIntegrationForm.php @@ -2,6 +2,7 @@ namespace Drupal\recogito_integration\Form; +use Drupal\taxonomy\Entity\Vocabulary; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; @@ -155,7 +156,7 @@ class RecogitoIntegrationForm extends ConfigFormBase ];*/ /* Kyle replace preset dropdown list instead of text area for convenience */ - $vocabularies = \Drupal\taxonomy\Entity\Vocabulary::loadMultiple(); + $vocabularies = Vocabulary::loadMultiple(); $options_taxonomy = array(); foreach ($vocabularies as $vocal) { $options_taxonomy[$vocal->id()] = $vocal->label(); diff --git a/tests/src/Functional/RecogitoIntegrationTest.php b/tests/src/Functional/RecogitoIntegrationTest.php index 1dd454d..261744f 100644 --- a/tests/src/Functional/RecogitoIntegrationTest.php +++ b/tests/src/Functional/RecogitoIntegrationTest.php @@ -17,7 +17,7 @@ class RecogitoIntegrationTests extends BrowserTestBase { /** * Perform initial setup tasks that run before every test method. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->drupalCreateUser(array( 'administer site configuration',