diff --git a/core/lib/Drupal/Core/Annotation/Action.php b/core/lib/Drupal/Core/Annotation/Action.php index 94781c754acbd132d2a35057ffb455785edba400..9f215fc87a4d60ee8c6e503c3976f30f158e7844 100644 --- a/core/lib/Drupal/Core/Annotation/Action.php +++ b/core/lib/Drupal/Core/Annotation/Action.php @@ -39,9 +39,11 @@ class Action extends Plugin { /** * The route name for a confirmation form for this action. * + * This property is optional and it does not need to be declared. + * * @todo Provide a more generic way to allow an action to be confirmed first. * - * @var string (optional) + * @var string */ public $confirm_form_route_name = ''; diff --git a/core/lib/Drupal/Core/Annotation/QueueWorker.php b/core/lib/Drupal/Core/Annotation/QueueWorker.php index 04ec168dc9915148394ffc3004fcf69160d42f9c..1f85cb07871dc9523cac8527ce00b6feaee60b3a 100644 --- a/core/lib/Drupal/Core/Annotation/QueueWorker.php +++ b/core/lib/Drupal/Core/Annotation/QueueWorker.php @@ -52,11 +52,15 @@ class QueueWorker extends Plugin { public $title; /** - * An associative array containing the optional key: - * - time: (optional) How much time Drupal cron should spend on calling - * this worker in seconds. Defaults to 15. + * An associative array containing an optional key. * - * @var array (optional) + * This property is optional and it does not need to be declared. + * + * Available keys: + * - time (optional): How much time Drupal cron should spend on calling this + * worker in seconds. Defaults to 15. + * + * @var array */ public $cron; diff --git a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php index 39e13d8476bf403a69ad5bfe68ecc104286f9043..1006013f5f2dd7fb0c44b9bd93372913bd0dd861 100644 --- a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -31,7 +31,7 @@ class ExtensionInstallStorage extends InstallStorage { * * In the early installer this value can be NULL. * - * @var string|NULL + * @var string|null */ protected $installProfile; diff --git a/core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php b/core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php index a647441bd69c6eac08ac12addd2e9d3f91af7319..110beb1ba17f4ff74222b5c7da648135b833892e 100644 --- a/core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php +++ b/core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php @@ -63,7 +63,9 @@ class EntityReferenceSelection extends Plugin { * An array of entity types that can be referenced by this plugin. Defaults to * all entity types. * - * @var array (optional) + * This property is optional and it does not need to be declared. + * + * @var array */ public $entity_types = []; diff --git a/core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php b/core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php index 1a2439109c0fb13a9b3ee9d6d41c052823fc38d4..9ecac7a348fbeada2376776b24660b923632464b 100644 --- a/core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php +++ b/core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php @@ -68,7 +68,9 @@ class FieldFormatter extends Plugin { * formatter in the Field UI when selecting a formatter for a given field * instance. * - * @var int optional + * This property is optional and it does not need to be declared. + * + * @var int */ public $weight = NULL; diff --git a/core/lib/Drupal/Core/Field/Annotation/FieldWidget.php b/core/lib/Drupal/Core/Field/Annotation/FieldWidget.php index 38d3f869e54f0bdb5568f89b643a165d1af465ae..f17612284a2fc7941061079558442461c6628425 100644 --- a/core/lib/Drupal/Core/Field/Annotation/FieldWidget.php +++ b/core/lib/Drupal/Core/Field/Annotation/FieldWidget.php @@ -73,7 +73,9 @@ class FieldWidget extends Plugin { * An integer to determine the weight of this widget relative to other widgets * in the Field UI when selecting a widget for a given field. * - * @var int optional + * This property is optional and it does not need to be declared. + * + * @var int */ public $weight = NULL; diff --git a/core/lib/Drupal/Core/Layout/Annotation/Layout.php b/core/lib/Drupal/Core/Layout/Annotation/Layout.php index eae930cf4eb1bfe338c6830722e0ed309083bb04..ce7aba42fe513f3c2839ef8dc01c4e4c7115df63 100644 --- a/core/lib/Drupal/Core/Layout/Annotation/Layout.php +++ b/core/lib/Drupal/Core/Layout/Annotation/Layout.php @@ -40,7 +40,9 @@ class Layout extends Plugin { public $label; /** - * An optional description for advanced layouts. + * A description for advanced layouts. + * + * This property is optional and it does not need to be declared. * * Sometimes layouts are so complex that the name is insufficient to describe * a layout such that a visually impaired administrator could layout a page @@ -67,11 +69,13 @@ class Layout extends Plugin { /** * The template file to render this layout (relative to the 'path' given). * + * This property is optional and it does not need to be declared. + * * If specified, then the layout_discovery module will register the template * with hook_theme() and the module or theme registering this layout does not * need to do it. * - * @var string optional + * @var string * * @see hook_theme() */ @@ -80,11 +84,13 @@ class Layout extends Plugin { /** * The theme hook used to render this layout. * + * This property is optional and it does not need to be declared. + * * If specified, it's assumed that the module or theme registering this layout * will also register the theme hook with hook_theme() itself. This is * mutually exclusive with 'template' - you can't specify both. * - * @var string optional + * @var string * * @see hook_theme() */ @@ -93,28 +99,36 @@ class Layout extends Plugin { /** * Path (relative to the module or theme) to resources like icon or template. * - * @var string optional + * This property is optional and it does not need to be declared. + * + * @var string */ public $path; /** * The asset library. * - * @var string optional + * This property is optional and it does not need to be declared. + * + * @var string */ public $library; /** * The path to the preview image (relative to the 'path' given). * - * @var string optional + * This property is optional and it does not need to be declared. + * + * @var string */ public $icon; /** * The icon map. * - * @var string[][] optional + * This property is optional and it does not need to be declared. + * + * @var string[][] * * @see \Drupal\Core\Layout\Icon\IconBuilderInterface::build() */ diff --git a/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php index 68fd7a6073190c2200bb9cc0677e8bf8b591e6f4..f70fd87d0740506d850ff63c796c840db9c0629f 100644 --- a/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php +++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php @@ -45,7 +45,7 @@ class CKEditorTest extends KernelTestBase { /** * The Editor Plugin Manager. * - * @var \Drupal\editor\Plugin\EditorManager; + * @var \Drupal\editor\Plugin\EditorManager */ protected $manager; diff --git a/core/modules/filter/src/Annotation/Filter.php b/core/modules/filter/src/Annotation/Filter.php index c65f9058e697fa4900863169fef97b5d6156ed49..53d607bc2a92f23391978f65a4a8d59e2dde530d 100644 --- a/core/modules/filter/src/Annotation/Filter.php +++ b/core/modules/filter/src/Annotation/Filter.php @@ -48,30 +48,38 @@ class Filter extends Plugin { /** * Additional administrative information about the filter's behavior. * + * This property is optional and it does not need to be declared. + * * @ingroup plugin_translatable * - * @var \Drupal\Core\Annotation\Translation (optional) + * @var \Drupal\Core\Annotation\Translation */ public $description = ''; /** * A default weight for the filter in new text formats. * - * @var int (optional) + * This property is optional and it does not need to be declared. + * + * @var int */ public $weight = 0; /** * Whether this filter is enabled or disabled by default. * - * @var bool (optional) + * This property is optional and it does not need to be declared. + * + * @var bool */ public $status = FALSE; /** * The default settings for the filter. * - * @var array (optional) + * This property is optional and it does not need to be declared. + * + * @var array */ public $settings = []; diff --git a/core/modules/image/src/Annotation/ImageEffect.php b/core/modules/image/src/Annotation/ImageEffect.php index bbe10e6541ca0bfa8adbc7d84eb523341438a7b5..f45977013c6d9be8222d18b6bbcc83d2603e8ad2 100644 --- a/core/modules/image/src/Annotation/ImageEffect.php +++ b/core/modules/image/src/Annotation/ImageEffect.php @@ -44,11 +44,13 @@ class ImageEffect extends Plugin { /** * A brief description of the image effect. * + * This property is optional and it does not need to be declared. + * * This will be shown when adding or configuring this image effect. * * @ingroup plugin_translatable * - * @var \Drupal\Core\Annotation\Translation (optional) + * @var \Drupal\Core\Annotation\Translation */ public $description = ''; diff --git a/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php b/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php index def2fd9d92ba5fba445f0ea2a2a4723e5c28e099..0732bafc3d134b3a2d83f4db13e27ca8d2371dbd 100644 --- a/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php +++ b/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php @@ -35,13 +35,15 @@ class MigrateProcessPlugin extends Plugin { /** * Whether the plugin handles multiples itself. * + * This property is optional and it does not need to be declared. + * * Typically these plugins will expect an array as input and iterate over it * themselves, changing the whole array. For example the 'sub_process' and the * 'flatten' plugins. If the plugin only need to change a single value it * can skip setting this attribute and let * \Drupal\migrate\MigrateExecutable::processRow() handle the iteration. * - * @var bool (optional) + * @var bool */ public $handle_multiples = FALSE; diff --git a/core/modules/rest/src/Annotation/RestResource.php b/core/modules/rest/src/Annotation/RestResource.php index f525ff1c8490fe798fa52da674e77a1427b561f8..832b43b0ced10511c5bcaa1f785ba4ace6bdf9fb 100644 --- a/core/modules/rest/src/Annotation/RestResource.php +++ b/core/modules/rest/src/Annotation/RestResource.php @@ -41,9 +41,11 @@ class RestResource extends Plugin { /** * The serialization class to deserialize serialized data into. * + * This property is optional and it does not need to be declared. + * * @see \Symfony\Component\Serializer\SerializerInterface's "type" parameter. * - * @var string (optional) + * @var string */ public $serialization_class; diff --git a/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php b/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php index 2a9dd5b68df4a55b2b94a8337db7a505492e76aa..76800296df6b27f5714586818899bb253f223fe7 100644 --- a/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php +++ b/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php @@ -21,7 +21,7 @@ class ChainEntityResolverTest extends UnitTestCase { /** * Test data passed to the resolve method. * - * @var \stdClass + * @var object */ protected $testData; diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php index 456dd494054d98006eed5b6f75079394904b6f63..1b0c88b28a8e32767103b32598ce213498974d1a 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php @@ -48,7 +48,7 @@ class TaxonomyFieldVidTest extends ViewsKernelTestBase { /** * An admin user. * - * @var \Drupal\user\Entity\User; + * @var \Drupal\user\Entity\User */ protected $adminUser; diff --git a/core/modules/views/src/Annotation/ViewsPluginAnnotationBase.php b/core/modules/views/src/Annotation/ViewsPluginAnnotationBase.php index ad64c94ed469f682aaaa1aca9de0c0c662da68a2..59d9fb0762ff7730d18cdce00a76a7f2aebec4f2 100644 --- a/core/modules/views/src/Annotation/ViewsPluginAnnotationBase.php +++ b/core/modules/views/src/Annotation/ViewsPluginAnnotationBase.php @@ -12,7 +12,9 @@ abstract class ViewsPluginAnnotationBase extends Plugin { /** * Whether or not to register a theme function automatically. * - * @var bool (optional) + * This property is optional and it does not need to be declared. + * + * @var bool */ public $register_theme = TRUE; diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 6fafc0de1a4d24b157d0bc11267f9b548d30efac..5db0cfbabd86ba9a46f166a0f3bce065b8acb6f8 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -79,8 +79,7 @@ <rule ref="Drupal.Commenting.GenderNeutralComment"/> <rule ref="Drupal.Commenting.InlineVariableComment"/> <rule ref="Drupal.Commenting.VariableComment"> - <!-- Sniff for: DuplicateVar, EmptyVar, InlineVariableName, WrongStyle --> - <exclude name="Drupal.Commenting.VariableComment.IncorrectVarType"/> + <!-- Sniff for: DuplicateVar, EmptyVar, IncorrectVarType, InlineVariableName, WrongStyle --> <exclude name="Drupal.Commenting.VariableComment.Missing"/> <exclude name="Drupal.Commenting.VariableComment.MissingVar"/> <exclude name="Drupal.Commenting.VariableComment.VarOrder"/> diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php index 0f45f18a6d9d9384b560b5b0344e0f1aecd21d55..6c2446e8f5567c0d34bbc59195b80565d5998753 100644 --- a/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php +++ b/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php @@ -79,7 +79,7 @@ class DependencySerializationTestDummy implements ContainerAwareInterface { /** * A test service. * - * @var \stdClass + * @var object */ public $service; diff --git a/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php b/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php index 267a6fdfb31dc46d4abb554fd260f5f8e65e1db5..3586877c35ab9ef08b3fc7da0bb5631e70b30e43 100644 --- a/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php +++ b/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php @@ -53,14 +53,14 @@ class PrivateTempStoreTest extends UnitTestCase { /** * A tempstore object belonging to the owner. * - * @var \stdClass + * @var object */ protected $ownObject; /** * A tempstore object not belonging to the owner. * - * @var \stdClass + * @var object */ protected $otherObject; diff --git a/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php b/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php index ec6d6c0594aeb348a5df15027d06662660edd6dc..97be1742bc115950e152a05dedb2c58d82cf598b 100644 --- a/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php +++ b/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php @@ -59,14 +59,14 @@ class SharedTempStoreTest extends UnitTestCase { /** * A tempstore object belonging to the owner. * - * @var \stdClass + * @var object */ protected $ownObject; /** * A tempstore object not belonging to the owner. * - * @var \stdClass + * @var object */ protected $otherObject;