Skip to content
Snippets Groups Projects
Commit 8c656c66 authored by git's avatar git Committed by Daniele Piaggesi
Browse files

Issue #2995784 by Aston Victor, g0blin79: Coding standard

parent afc4ef36
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,9 @@
use Drupal\Core\Routing\RouteMatchInterface;
use \Drupal\Core\Url;
use \Drupal\Core\Cache\Cache;
use Drupal\node\Entity\Node;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_help().
......@@ -78,7 +81,7 @@ function prevnext_entity_extra_field_info() {
/**
* Implements hook_ENTITY_TYPE_view().
*/
function prevnext_node_view(array &$build, \Drupal\node\Entity\Node $node, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) {
function prevnext_node_view(array &$build, Node $node, EntityViewDisplayInterface $display, $view_mode) {
/** @var \Drupal\prevnext\PrevnextService $prevnext */
$prevnext = \Drupal::service('prevnext.service');
......@@ -115,7 +118,7 @@ function prevnext_node_view(array &$build, \Drupal\node\Entity\Node $node, \Drup
/**
* Implements hook_ENTITY_TYPE_presave().
*/
function prevnext_node_presave(Drupal\Core\Entity\EntityInterface $entity) {
function prevnext_node_presave(EntityInterface $entity) {
$config = \Drupal::config('prevnext.settings');
$enabled_nodetypes = $config->get('prevnext_enabled_nodetypes');
if (in_array($entity->bundle(), $enabled_nodetypes)) {
......
<?php
/**
* @file
* Contains \Drupal\prevnext\Form\PrevnextSettingsForm.
*/
namespace Drupal\prevnext\Form;
use Drupal\Core\Form\ConfigFormBase;
......@@ -31,7 +26,6 @@ class PrevnextSettingsForm extends ConfigFormBase {
return ['prevnext.settings'];
}
/**
* {@inheritdoc}
*/
......
......@@ -56,7 +56,7 @@ class PrevnextService implements PrevnextServiceInterface {
* @param \Drupal\node\Entity\Node $node
* The node entity.
*
* @return array $nodes
* @return array
* An array of nodes filtered by type, status and language.
*/
protected function getNodesOfType(Node $node) {
......
<?php
namespace Drupal\prevnext;
use Drupal\node\Entity\Node;
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment