diff --git a/core/lib/Drupal/Core/Menu/ModuleLocalTask.php b/core/lib/Drupal/Core/Menu/ModuleLocalTask.php index 9a55d27..dd8b2b3 100644 --- a/core/lib/Drupal/Core/Menu/ModuleLocalTask.php +++ b/core/lib/Drupal/Core/Menu/ModuleLocalTask.php @@ -14,6 +14,7 @@ * Default object used for local tasks provided by module links.task.yml files. */ class ModuleLocalTask extends LocalTaskDefault { + use StringTranslationTrait; /** @@ -27,9 +28,9 @@ public function getTitle(Request $request = NULL) { * Returns the localized title to be shown for this tab. * * This method is a private because t() is called on plugin definition. In - * this case title is coming from a YAML file so we know it's safe to call t(). - * However the title may not come from a YAML in a subclass so this method - * needs to be re-implemented to ensure title is handled correctly. + * this case title is coming from a YAML file so we know it's safe to call + * t(). However the title may not come from a YAML in a subclass so this + * method needs to be re-implemented to ensure title is handled correctly. * * @return string * The title of the local task. @@ -46,4 +47,5 @@ private function getLocalizedTitle() { } return $this->t($this->pluginDefinition['title'], $args, $options); } -} \ No newline at end of file + +} diff --git a/core/lib/Drupal/Core/Plugin/Discovery/YamlDistinctDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/YamlDistinctDiscovery.php index bdb386a..b7b94f9 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/YamlDistinctDiscovery.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/YamlDistinctDiscovery.php @@ -7,8 +7,8 @@ namespace Drupal\Core\Plugin\Discovery; -use Drupal\Component\Plugin\Discovery\DiscoveryInterface; use Drupal\Component\Discovery\YamlDiscovery as ComponentYamlDiscovery; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; use Drupal\Component\Plugin\Discovery\DiscoveryTrait; /** @@ -33,7 +33,7 @@ class YamlDistinctDiscovery implements DiscoveryInterface { protected $discovery; /** - * Construct a YamlDiscovery object. + * Constructs a YamlDiscovery object. * * @param string $name * The file name suffix to use for discovery. E.g. 'test' will become @@ -43,7 +43,7 @@ class YamlDistinctDiscovery implements DiscoveryInterface { * @param string $class * Name of the distinct class to be added to definitions from YAML files. */ - function __construct($name, array $directories, $class = '') { + public function __construct($name, array $directories, $class = '') { $this->discovery = new ComponentYamlDiscovery($name, $directories); } @@ -75,4 +75,5 @@ public function getDefinitions() { return $definitions; } + } diff --git a/core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php b/core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php index a66abb9..567d029 100644 --- a/core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php +++ b/core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php @@ -8,8 +8,8 @@ namespace Drupal\comment\Plugin\Menu\LocalTask; use Drupal\comment\CommentStorageInterface; -use Drupal\Core\Menu\ModuleLocalTask; use Drupal\Core\DependencyInjection\DependencySerializationTrait; +use Drupal\Core\Menu\ModuleLocalTask; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -17,6 +17,7 @@ * Provides a local task that shows the amount of unapproved comments. */ class UnapprovedComments extends ModuleLocalTask implements ContainerFactoryPluginInterface { + use DependencySerializationTrait; /** diff --git a/core/modules/config_translation/src/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php b/core/modules/config_translation/src/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php index 9f3fa42..ca1c43c 100644 --- a/core/modules/config_translation/src/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php +++ b/core/modules/config_translation/src/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php @@ -15,6 +15,7 @@ * Defines a local task plugin with a dynamic title. */ class ConfigTranslationLocalTask extends LocalTaskDefault { + use StringTranslationTrait; /** diff --git a/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php b/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php index b91f4e8..67f0427 100644 --- a/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php +++ b/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php @@ -11,7 +11,8 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; class TestTasksSettingsSub1 extends LocalTaskDefault { - use StringTranslationTrait; + + use StringTranslationTrait; /** * {@inheritdoc} diff --git a/core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php b/core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php index d5ebc58..60c062a 100644 --- a/core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php +++ b/core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php @@ -7,7 +7,7 @@ namespace Drupal\tracker\Plugin\Menu; -use \Drupal\Core\Menu\ModuleLocalTask; +use Drupal\Core\Menu\ModuleLocalTask; use Drupal\Core\Routing\RouteMatchInterface; /** diff --git a/core/tests/Drupal/Tests/Core/Menu/ModuleLocalTaskTest.php b/core/tests/Drupal/Tests/Core/Menu/ModuleLocalTaskTest.php index 2956d84..86dae3e 100644 --- a/core/tests/Drupal/Tests/Core/Menu/ModuleLocalTaskTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/ModuleLocalTaskTest.php @@ -54,6 +54,9 @@ class ModuleLocalTaskTest extends UnitTestCase { */ protected $stringTranslation; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); @@ -67,7 +70,6 @@ protected function setupModuleLocalTask() { $this->localTask = new ModuleLocalTask($this->config, $this->pluginId, $this->pluginDefinition); $this->localTask ->setStringTranslation($this->stringTranslation); - } /** @@ -116,4 +118,3 @@ public function testGetTitleWithTitleArguments() { } } -