From 33ac865dd3519c21f26f2b06d9aac25c54787d4a Mon Sep 17 00:00:00 2001 From: Chi Date: Sun, 30 Apr 2017 11:53:27 +0300 Subject: [PATCH] Code cleanup. --- src/TwigExtension.php | 6 ++---- tests/twig_tweak_test/twig_tweak_test.info.yml | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/TwigExtension.php b/src/TwigExtension.php index 3108aeb..16ea12f 100644 --- a/src/TwigExtension.php +++ b/src/TwigExtension.php @@ -77,7 +77,6 @@ class TwigExtension extends \Twig_Extension { if ($block && $this->entityAccess($block)) { return $entity_type_manager->getViewBuilder('block')->view($block); } - return NULL; } /** @@ -145,7 +144,6 @@ class TwigExtension extends \Twig_Extension { $render_controller = $entity_type_manager->getViewBuilder($entity_type); return $render_controller->view($entity, $view_mode, $langcode); } - return NULL; } /** @@ -178,7 +176,6 @@ class TwigExtension extends \Twig_Extension { return $entity->{$field_name}->view($view_mode); } } - return NULL; } /** @@ -373,6 +370,7 @@ class TwigExtension extends \Twig_Extension { * in an tag. Requesting the URL will cause the image to be created. */ public function imageStyle($path, $style) { + /** @var \Drupal\Image\ImageStyleInterface $image_style */ if ($image_style = ImageStyle::load($style)) { return file_url_transform_relative($image_style->buildUrl($path)); } @@ -401,7 +399,7 @@ class TwigExtension extends \Twig_Extension { * Checks view access to a given entity. * * @param \Drupal\Core\Entity\EntityInterface $entity - * Entity to check access. + * Entity to check access. * * @return bool * The access check result. diff --git a/tests/twig_tweak_test/twig_tweak_test.info.yml b/tests/twig_tweak_test/twig_tweak_test.info.yml index 5982a93..ce46fa1 100644 --- a/tests/twig_tweak_test/twig_tweak_test.info.yml +++ b/tests/twig_tweak_test/twig_tweak_test.info.yml @@ -4,5 +4,5 @@ description: Support module for Tweak twig testing. package: Testing core: 8.x dependencies: - - twig_tweak - - node + - drupa:twig_tweak + - drupal:node