From 3eeaeb64908b6aeca06dd23e07e9006c88d4fa91 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Sat, 30 Apr 2016 14:52:19 +0100 Subject: [PATCH] Issue #2707371 by Mile23: Fix several errors in the 'Drupal.Commenting.DocComment' coding standard --- .../Bridge/ZfExtensionManagerSfContainer.php | 8 ++++---- core/lib/Drupal/Component/Utility/UrlHelper.php | 1 - .../Core/Http/TrustedHostsRequestFactory.php | 2 +- core/lib/Drupal/Core/Routing/UrlGenerator.php | 1 - .../action/src/Plugin/Action/EmailAction.php | 3 ++- .../language/src/Form/LanguageFormBase.php | 2 +- .../tests/src/Unit/process/DedupeEntityTest.php | 2 +- .../tests/modules/page_cache_form_test.install | 1 - .../tests/src/Kernel/RequestHandlerTest.php | 4 +++- core/modules/simpletest/src/WebTestBase.php | 3 +-- .../ViewsEntitySchemaSubscriber.php | 1 - core/phpcs.xml.dist | 17 +++++++++++++++++ .../KernelTests/Core/Path/AliasStorageTest.php | 4 +++- .../CustomPageExceptionHtmlSubscriberTest.php | 2 +- .../Drupal/Tests/Core/Form/FormTestBase.php | 1 - .../DerivativeDiscoveryDecoratorTest.php | 2 +- .../RecursiveContextualValidatorTest.php | 1 - 17 files changed, 35 insertions(+), 20 deletions(-) diff --git a/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php b/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php index 3e2711e1d054..3d8f77b176fe 100644 --- a/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php +++ b/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php @@ -15,9 +15,9 @@ class ZfExtensionManagerSfContainer implements ReaderManagerInterface, WriterMan /** * This property was based from Zend Framework (http://framework.zend.com/) * - * @link http://github.com/zendframework/zf2 for the canonical source repository + * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License + * @license http://framework.zend.com/license/new-bsd New BSD License * * A map of characters to be replaced through strtr. * @@ -75,9 +75,9 @@ public function has($extension) { /** * This method was based from Zend Framework (http://framework.zend.com/) * - * @link http://github.com/zendframework/zf2 for the canonical source repository + * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License + * @license http://framework.zend.com/license/new-bsd New BSD License * * Canonicalize the extension name to a service name. * diff --git a/core/lib/Drupal/Component/Utility/UrlHelper.php b/core/lib/Drupal/Component/Utility/UrlHelper.php index a4052490ef0f..1395d818f041 100644 --- a/core/lib/Drupal/Component/Utility/UrlHelper.php +++ b/core/lib/Drupal/Component/Utility/UrlHelper.php @@ -19,7 +19,6 @@ class UrlHelper { /** * Parses an array into a valid, rawurlencoded query string. * - * * rawurlencode() is RFC3986 compliant, and as a consequence RFC3987 * compliant. The latter defines the required format of "URLs" in HTML5. * urlencode() is almost the same as rawurlencode(), except that it encodes diff --git a/core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php b/core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php index 67046e03d91a..59751c06bfdd 100644 --- a/core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php +++ b/core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php @@ -56,7 +56,7 @@ public function __construct($host) { * * @return \Symfony\Component\HttpFoundation\Request * A new request object. - **/ + */ public function createRequest(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) { if (empty($server['HTTP_HOST']) || ($server['HTTP_HOST'] === 'localhost' && $this->host !== 'localhost')) { $server['HTTP_HOST'] = $this->host; diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index af0ad304e334..3cbbd5adf2ef 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -153,7 +153,6 @@ public function getPathFromRoute($name, $parameters = array()) { * @param string $name * The route name or other identifying string from ::getRouteDebugMessage(). * - * * @return string * The url path, without any base path, including possible query string. * diff --git a/core/modules/action/src/Plugin/Action/EmailAction.php b/core/modules/action/src/Plugin/Action/EmailAction.php index 771c04d5e6e5..1ee618417479 100644 --- a/core/modules/action/src/Plugin/Action/EmailAction.php +++ b/core/modules/action/src/Plugin/Action/EmailAction.php @@ -55,7 +55,8 @@ class EmailAction extends ConfigurableActionBase implements ContainerFactoryPlug */ protected $mailManager; - /** The language manager. + /** + * The language manager. * * @var \Drupal\Core\Language\LanguageManagerInterface */ diff --git a/core/modules/language/src/Form/LanguageFormBase.php b/core/modules/language/src/Form/LanguageFormBase.php index 5472bd6fcd34..00771621bee4 100644 --- a/core/modules/language/src/Form/LanguageFormBase.php +++ b/core/modules/language/src/Form/LanguageFormBase.php @@ -24,7 +24,7 @@ abstract class LanguageFormBase extends EntityForm { /** * Constructs a ContentEntityForm object. * - * @param \Drupal\language\ConfigurableLanguageManagerInterface $language_manager + * @param \Drupal\language\ConfigurableLanguageManagerInterface $language_manager * The configurable language manager. */ public function __construct(ConfigurableLanguageManagerInterface $language_manager) { diff --git a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php index d53934adbc82..27aad89b71e1 100644 --- a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php +++ b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php @@ -22,7 +22,7 @@ class DedupeEntityTest extends MigrateProcessTestCase { /** * The mock entity query factory. * - * @var \Drupal\Core\Entity\Query\QueryFactory|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\Query\QueryFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $entityQueryFactory; diff --git a/core/modules/page_cache/tests/modules/page_cache_form_test.install b/core/modules/page_cache/tests/modules/page_cache_form_test.install index ecd7db803e53..72e3d70b4a2f 100644 --- a/core/modules/page_cache/tests/modules/page_cache_form_test.install +++ b/core/modules/page_cache/tests/modules/page_cache_form_test.install @@ -2,7 +2,6 @@ /** * @file - * * Install hooks for page_cache_form_test. */ diff --git a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php index aa01d156b34e..d5d46f3b9b52 100644 --- a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php +++ b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php @@ -126,9 +126,11 @@ public function providerTestSerialization() { } +/** + * Stub class where we can prophesize methods. + */ class StubRequestHandlerResourcePlugin extends ResourceBase { - /** stub methods so they can be prophesied. */ function get() {} function patch() {} } diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 197e1a904cf4..71ca68ef2d75 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1507,7 +1507,7 @@ protected function drupalGetXHR($path, array $options = array(), array $headers * $edit = array(...); * $this->drupalPostForm(NULL, $edit, t('Save')); * @endcode - * @param $edit + * @param $edit * Field data in an associative array. Changes the current input fields * (where possible) to the values indicated. * @@ -2310,7 +2310,6 @@ protected function clickLink($label, $index = 0) { /** * Follows a link by partial name. * - * * If the link is discovered and clicked, the test passes. Fail otherwise. * * @param string|\Drupal\Component\Render\MarkupInterface $label diff --git a/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php b/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php index 5ae0cc00d91b..59ecde692fbf 100644 --- a/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php +++ b/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php @@ -269,7 +269,6 @@ protected function baseTableRename($all_views, $entity_type_id, $old_base_table, } /** - * * Updates views if a data table is renamed. * * @param \Drupal\views\Entity\View[] $all_views diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 43545b7a4ba7..9a5581c1bded 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -16,6 +16,23 @@ <rule ref="Drupal.Classes.UnusedUseStatement"/> <rule ref="Drupal.CSS.ClassDefinitionNameSpacing"/> <rule ref="Drupal.CSS.ColourDefinition"/> + <rule ref="Drupal.Commenting.DocComment"> + <!-- Sniff for these errors: SpacingAfterTagGroup, WrongEnd, SpacingBetween, + ContentAfterOpen, SpacingBeforeShort, TagValueIndent --> + <exclude name="Drupal.Commenting.DocComment.ShortStartSpace"/> + <exclude name="Drupal.Commenting.DocComment.LongNotCapital"/> + <exclude name="Drupal.Commenting.DocComment.ParamGroup"/> + <exclude name="Drupal.Commenting.DocComment.SpacingAfter"/> + <exclude name="Drupal.Commenting.DocComment.ParamNotFirst"/> + <exclude name="Drupal.Commenting.DocComment.SpacingBeforeTags"/> + <exclude name="Drupal.Commenting.DocComment.LongFullStop"/> + <exclude name="Drupal.Commenting.DocComment.ShortNotCapital"/> + <exclude name="Drupal.Commenting.DocComment.ShortFullStop"/> + <exclude name="Drupal.Commenting.DocComment.TagsNotGrouped"/> + <exclude name="Drupal.Commenting.DocComment.ShortSingleLine"/> + <exclude name="Drupal.Commenting.DocComment.TagGroupSpacing"/> + <exclude name="Drupal.Commenting.DocComment.MissingShort"/> + </rule> <rule ref="Drupal.Commenting.DocCommentStar"/> <rule ref="Drupal.Commenting.FileComment"/> <rule ref="Drupal.Commenting.FunctionComment"> diff --git a/core/tests/Drupal/KernelTests/Core/Path/AliasStorageTest.php b/core/tests/Drupal/KernelTests/Core/Path/AliasStorageTest.php index d8044a4e2670..d7b24b497f75 100644 --- a/core/tests/Drupal/KernelTests/Core/Path/AliasStorageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Path/AliasStorageTest.php @@ -16,7 +16,9 @@ class AliasStorageTest extends KernelTestBase { */ public static $modules = ['system']; - /** @var \Drupal\Core\Path\AliasStorage */ + /** + * @var \Drupal\Core\Path\AliasStorage + */ protected $storage; /** diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php index ece089d70752..5d3993d3bb60 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php @@ -31,7 +31,7 @@ class CustomPageExceptionHtmlSubscriberTest extends UnitTestCase { /** * The mocked config factory * - * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $configFactory; diff --git a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php index ddd92e165203..fd88ea22dea6 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php +++ b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php @@ -113,7 +113,6 @@ abstract class FormTestBase extends UnitTestCase { protected $elementInfo; /** - * * The event dispatcher. * * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php index 5b712eb8e5a2..f7a5d981a6d0 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php @@ -29,7 +29,7 @@ protected function setUp() { /** * Tests the getDerivativeFetcher method. * - * @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDerivativeFetcher(). + * @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDerivativeFetcher(). */ public function testGetDerivativeFetcher() { $definitions = array(); diff --git a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php index 91e36bce60af..5e3558e1b141 100644 --- a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php +++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php @@ -315,7 +315,6 @@ public function testValidatePropertyValue() { } /** - * * Builds some example type data object. * * @return \Drupal\Core\TypedData\TypedDataInterface|\PHPUnit_Framework_MockObject_MockObject -- GitLab