From 7254d6f83082c5108cb8490d14e85597ce464320 Mon Sep 17 00:00:00 2001 From: Lee Rowlands <lee.rowlands@previousnext.com.au> Date: Fri, 3 Jan 2025 10:12:51 +1000 Subject: [PATCH] Issue #3489348 by quietone, daffie, smustgrave, larowlan: Fix Drupal.Commenting.FunctionComment.MissingReturnComment in core/lib/Drupal/Core/f-z --- .../Drupal/Core/Field/Entity/BaseFieldOverride.php | 1 + .../Drupal/Core/Field/FieldDefinitionInterface.php | 2 ++ .../Core/Field/FieldStorageDefinitionEvent.php | 2 ++ .../Core/Field/FieldStorageDefinitionInterface.php | 1 + core/lib/Drupal/Core/Form/FormBase.php | 2 ++ core/lib/Drupal/Core/Form/FormBuilderInterface.php | 3 +++ core/lib/Drupal/Core/Form/FormState.php | 2 ++ core/lib/Drupal/Core/Form/FormStateInterface.php | 2 ++ core/lib/Drupal/Core/Form/FormSubmitterInterface.php | 2 ++ core/lib/Drupal/Core/Form/FormValidator.php | 2 ++ core/lib/Drupal/Core/Form/SubformState.php | 1 + core/lib/Drupal/Core/Form/SubformStateInterface.php | 1 + core/lib/Drupal/Core/GeneratedLink.php | 1 + core/lib/Drupal/Core/GeneratedUrl.php | 1 + core/lib/Drupal/Core/Hook/HookCollectorPass.php | 12 ++---------- .../Drupal/Core/Http/LinkRelationTypeInterface.php | 2 ++ .../Core/ImageToolkit/ImageToolkitOperationBase.php | 1 + .../Core/Installer/Exception/InstallerException.php | 1 + .../Drupal/Core/Installer/InstallerRedirectTrait.php | 1 + core/lib/Drupal/Core/Layout/LayoutDefault.php | 1 + core/lib/Drupal/Core/Layout/LayoutInterface.php | 1 + core/lib/Drupal/Core/Layout/LayoutPluginManager.php | 2 ++ .../Core/Layout/LayoutPluginManagerInterface.php | 5 +++++ core/lib/Drupal/Core/Link.php | 1 + core/lib/Drupal/Core/Lock/LockBackendInterface.php | 3 +++ core/lib/Drupal/Core/Menu/LocalActionInterface.php | 1 + core/lib/Drupal/Core/Menu/MenuLinkManager.php | 2 ++ .../Context/ContextAwarePluginManagerTrait.php | 1 + .../Drupal/Core/Plugin/Context/ContextInterface.php | 2 ++ .../Plugin/ContextAwarePluginAssignmentTrait.php | 1 + .../Drupal/Core/Plugin/ContextAwarePluginTrait.php | 2 ++ core/lib/Drupal/Core/Queue/QueueWorkerManager.php | 1 + core/lib/Drupal/Core/Render/Element/HtmlTag.php | 1 + .../Drupal/Core/Render/Element/InlineTemplate.php | 1 + core/lib/Drupal/Core/Render/Element/Pager.php | 1 + core/lib/Drupal/Core/Render/Element/StatusReport.php | 2 ++ core/lib/Drupal/Core/Render/Element/Table.php | 1 + core/lib/Drupal/Core/Render/ElementInfoManager.php | 3 +++ .../Core/Render/PageDisplayVariantSelectionEvent.php | 2 ++ .../Core/Render/PlaceholderGeneratorInterface.php | 2 ++ .../Routing/Enhancer/EntityRevisionRouteEnhancer.php | 1 + .../Core/Routing/Enhancer/FormRouteEnhancer.php | 1 + .../Core/Routing/RedirectDestinationInterface.php | 1 + core/lib/Drupal/Core/Routing/RouteProvider.php | 1 + .../Core/Routing/StackedRouteMatchInterface.php | 2 ++ .../RefinableCalculatedPermissionsInterface.php | 8 ++++---- core/lib/Drupal/Core/Session/SessionManager.php | 1 + core/lib/Drupal/Core/Site/Settings.php | 2 +- .../Drupal/Core/StackMiddleware/AjaxPageState.php | 2 ++ .../Core/StreamWrapper/StreamWrapperInterface.php | 2 ++ .../StringTranslation/PluralTranslatableMarkup.php | 3 +++ .../lib/Drupal/Core/Template/TwigPhpStorageCache.php | 1 + core/lib/Drupal/Core/Theme/ActiveTheme.php | 11 +++++++++-- core/lib/Drupal/Core/Theme/Registry.php | 4 ++++ core/lib/Drupal/Core/Theme/ThemeInitialization.php | 1 + core/lib/Drupal/Core/Theme/ThemeManagerInterface.php | 2 ++ core/lib/Drupal/Core/TypedData/DataDefinition.php | 1 + .../Core/TypedData/Plugin/DataType/ItemList.php | 1 + .../Core/TypedData/Plugin/DataType/Language.php | 3 ++- .../lib/Drupal/Core/TypedData/PrimitiveInterface.php | 2 ++ core/lib/Drupal/Core/Update/UpdateRegistry.php | 1 + core/lib/Drupal/Core/Updater/Module.php | 1 + core/lib/Drupal/Core/Updater/Theme.php | 1 + core/lib/Drupal/Core/Updater/UpdaterInterface.php | 1 + core/lib/Drupal/Core/Url.php | 5 +++++ core/phpcs.xml.dist | 2 +- 66 files changed, 118 insertions(+), 19 deletions(-) diff --git a/core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php b/core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php index 973105dea630..0f28e265203b 100644 --- a/core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php +++ b/core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php @@ -177,6 +177,7 @@ public function getUniqueIdentifier() { * Gets the base field definition. * * @return \Drupal\Core\Field\BaseFieldDefinition + * An associative array of the base field definition. */ protected function getBaseFieldDefinition() { if (!isset($this->baseFieldDefinition)) { diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php index 369f07e1503c..b24279ab00f2 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php @@ -258,6 +258,7 @@ public function getFieldStorageDefinition(); * The bundle to get the configurable field for. * * @return \Drupal\Core\Field\FieldConfigInterface + * The configuration entity for the field. */ public function getConfig($bundle); @@ -265,6 +266,7 @@ public function getConfig($bundle); * Returns a unique identifier for the field. * * @return string + * The unique ID for the field. */ public function getUniqueIdentifier(); diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionEvent.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionEvent.php index ce3f17897209..fdb1db0d21eb 100644 --- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionEvent.php +++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionEvent.php @@ -41,6 +41,7 @@ public function __construct(FieldStorageDefinitionInterface $field_storage_defin * The field storage definition. * * @return \Drupal\Core\Field\FieldStorageDefinitionInterface + * The field storage definition for the entity. */ public function getFieldStorageDefinition() { return $this->fieldStorageDefinition; @@ -50,6 +51,7 @@ public function getFieldStorageDefinition() { * The original field storage definition. * * @return \Drupal\Core\Field\FieldStorageDefinitionInterface + * The field storage definition for the original entity. */ public function getOriginal() { return $this->original; diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php index ead716800865..36b7e4eaf384 100644 --- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php @@ -326,6 +326,7 @@ public function isBaseField(); * Returns a unique identifier for the field storage. * * @return string + * A unique identifier for the field storage. */ public function getUniqueStorageIdentifier(); diff --git a/core/lib/Drupal/Core/Form/FormBase.php b/core/lib/Drupal/Core/Form/FormBase.php index 6e6e5e5327b8..3688de7c35cc 100644 --- a/core/lib/Drupal/Core/Form/FormBase.php +++ b/core/lib/Drupal/Core/Form/FormBase.php @@ -116,6 +116,7 @@ protected function config($name) { * when the config factory needs to be manipulated directly. * * @return \Drupal\Core\Config\ConfigFactoryInterface + * The configuration factory for this form. */ protected function configFactory() { if (!$this->configFactory) { @@ -161,6 +162,7 @@ protected function getRequest() { * Gets the route match. * * @return \Drupal\Core\Routing\RouteMatchInterface + * The currently active route match object. */ protected function getRouteMatch() { if (!$this->routeMatch) { diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php index 66d9da4c2f1e..0f785819d359 100644 --- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php +++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php @@ -185,6 +185,7 @@ public function submitForm($form_arg, FormStateInterface &$form_state, mixed ... * array. * * @return mixed|\Symfony\Component\HttpFoundation\Response + * The form array or a response object. */ public function retrieveForm($form_id, FormStateInterface &$form_state); @@ -205,6 +206,7 @@ public function retrieveForm($form_id, FormStateInterface &$form_state); * sanitized \Drupal::request()->request data, is also accumulated here. * * @return \Symfony\Component\HttpFoundation\RedirectResponse|null + * The form response or NULL when the form was submitted programmatically. */ public function processForm($form_id, &$form, FormStateInterface &$form_state); @@ -318,6 +320,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state); * as well as the sanitized \Drupal::request()->request data. * * @return array + * The completely built form. */ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state); diff --git a/core/lib/Drupal/Core/Form/FormState.php b/core/lib/Drupal/Core/Form/FormState.php index edb8ec781cac..a83fcc323e0a 100644 --- a/core/lib/Drupal/Core/Form/FormState.php +++ b/core/lib/Drupal/Core/Form/FormState.php @@ -660,6 +660,8 @@ public function setRequestMethod($method) { * have side-effects, such as persisting $form_state changes. * * @return bool + * TRUE if the request method is considered a safe HTTP method. Otherwise + * FALSE. * * @see \Symfony\Component\HttpFoundation\Request::isMethodSafe() * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.1 diff --git a/core/lib/Drupal/Core/Form/FormStateInterface.php b/core/lib/Drupal/Core/Form/FormStateInterface.php index d517666cf29b..f4a9e114e383 100644 --- a/core/lib/Drupal/Core/Form/FormStateInterface.php +++ b/core/lib/Drupal/Core/Form/FormStateInterface.php @@ -748,6 +748,7 @@ public function setGroups(array $groups); * Returns references to details elements to render them within vertical tabs. * * @return array + * References to details elements to render them within vertical tabs. */ public function &getGroups(); @@ -924,6 +925,7 @@ public function setProgrammedBypassAccessCheck($programmed_bypass_access_check = * Determines if this form submission should bypass #access. * * @return bool + * TRUE if this form bypassing access checked, otherwise FALSE. * * @see \Drupal\Core\Form\FormState::$programmed_bypass_access_check */ diff --git a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php index 9d078b3ca332..0d9ac2d62e8a 100644 --- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php +++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php @@ -69,6 +69,8 @@ public function executeSubmitHandlers(&$form, FormStateInterface &$form_state); * The current state of the form. * * @return \Symfony\Component\HttpFoundation\RedirectResponse|null + * The HTTP response if the form submission results in a redirect, otherwise + * NULL. * * @see \Drupal\Core\Form\FormBuilderInterface::processForm() * @see \Drupal\Core\Form\FormBuilderInterface::buildForm() diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php index def5f87191d3..862bf9703d3b 100644 --- a/core/lib/Drupal/Core/Form/FormValidator.php +++ b/core/lib/Drupal/Core/Form/FormValidator.php @@ -386,6 +386,8 @@ protected function performRequiredValidation(&$elements, FormStateInterface &$fo * The current state of the form. * * @return array|null + * An array of validation errors for the triggering element. Defaults to + * NULL, which turns off error suppression. */ protected function determineLimitValidationErrors(FormStateInterface &$form_state) { // While this element is being validated, it may be desired that some diff --git a/core/lib/Drupal/Core/Form/SubformState.php b/core/lib/Drupal/Core/Form/SubformState.php index bec19be62051..ffe4a1d8c034 100644 --- a/core/lib/Drupal/Core/Form/SubformState.php +++ b/core/lib/Drupal/Core/Form/SubformState.php @@ -68,6 +68,7 @@ public static function createForSubform(array &$subform, array &$parent_form, Fo * The property name (#parents or #array_parents). * * @return mixed + * The form parents relative to its parent form. * * @throws \InvalidArgumentException * Thrown when the requested property does not exist. diff --git a/core/lib/Drupal/Core/Form/SubformStateInterface.php b/core/lib/Drupal/Core/Form/SubformStateInterface.php index 99bef57d256a..10e213be39c8 100644 --- a/core/lib/Drupal/Core/Form/SubformStateInterface.php +++ b/core/lib/Drupal/Core/Form/SubformStateInterface.php @@ -45,6 +45,7 @@ interface SubformStateInterface extends FormStateInterface { * Gets the complete form state. * * @return \Drupal\Core\Form\FormStateInterface + * The form state. */ public function getCompleteFormState(); diff --git a/core/lib/Drupal/Core/GeneratedLink.php b/core/lib/Drupal/Core/GeneratedLink.php index 7bebcbaf31d8..19414e2a807d 100644 --- a/core/lib/Drupal/Core/GeneratedLink.php +++ b/core/lib/Drupal/Core/GeneratedLink.php @@ -30,6 +30,7 @@ class GeneratedLink extends BubbleableMetadata implements MarkupInterface, \Coun * Gets the generated link. * * @return string + * The generated link. */ public function getGeneratedLink() { return $this->generatedLink; diff --git a/core/lib/Drupal/Core/GeneratedUrl.php b/core/lib/Drupal/Core/GeneratedUrl.php index 47d0f350a4a8..caa6ae9346ea 100644 --- a/core/lib/Drupal/Core/GeneratedUrl.php +++ b/core/lib/Drupal/Core/GeneratedUrl.php @@ -23,6 +23,7 @@ class GeneratedUrl extends BubbleableMetadata { * Gets the generated URL. * * @return string + * The generated URL. */ public function getGeneratedUrl() { return $this->generatedUrl; diff --git a/core/lib/Drupal/Core/Hook/HookCollectorPass.php b/core/lib/Drupal/Core/Hook/HookCollectorPass.php index 5d99ac772098..abebad92b175 100644 --- a/core/lib/Drupal/Core/Hook/HookCollectorPass.php +++ b/core/lib/Drupal/Core/Hook/HookCollectorPass.php @@ -164,8 +164,6 @@ public static function collectAllHookImplementations(array $module_filenames, ?C * matched first. * @param $skip_procedural * Skip the procedural check for the current module. - * - * @return void */ protected function collectModuleHookImplementations($dir, $module, $module_preg, bool $skip_procedural): void { $hook_file_cache = FileCacheFactory::get('hook_implementations'); @@ -304,10 +302,8 @@ protected static function getHookAttributesInClass(string $class): array { * The class in which said attribute resides in. * @param $module * The module in which the class resides in. - * - * @return void */ - protected function addFromAttribute(Hook $hook, $class, $module) { + protected function addFromAttribute(Hook $hook, $class, $module): void { if ($hook->module) { $module = $hook->module; } @@ -326,10 +322,8 @@ protected function addFromAttribute(Hook $hook, $class, $module) { * The name of the module. (Truly shocking!) * @param string $function * The name of function implementing the hook. (Wow!) - * - * @return void */ - protected function addProceduralImplementation(\SplFileInfo $fileinfo, string $hook, string $module, string $function) { + protected function addProceduralImplementation(\SplFileInfo $fileinfo, string $hook, string $module, string $function): void { $this->addFromAttribute(new Hook($hook, $module . '_' . $hook), ProceduralCall::class, $module); if ($hook === 'hook_info') { $this->hookInfo[] = $function; @@ -369,8 +363,6 @@ public function getImplementations(): array { * The hook to check. * @param string $class * The class the hook is implemented on. - * - * @return void */ public static function checkForProceduralOnlyHooks(Hook $hook, string $class): void { $staticDenyHooks = [ diff --git a/core/lib/Drupal/Core/Http/LinkRelationTypeInterface.php b/core/lib/Drupal/Core/Http/LinkRelationTypeInterface.php index 7faaa0443092..d9ff775f6c43 100644 --- a/core/lib/Drupal/Core/Http/LinkRelationTypeInterface.php +++ b/core/lib/Drupal/Core/Http/LinkRelationTypeInterface.php @@ -17,6 +17,7 @@ interface LinkRelationTypeInterface { * Indicates whether this link relation type is of the 'registered' kind. * * @return bool + * TRUE if the link relation is registered, FALSE otherwise. * * @see https://tools.ietf.org/html/rfc5988#section-4.1 */ @@ -26,6 +27,7 @@ public function isRegistered(); * Indicates whether this link relation type is of the 'extension' kind. * * @return bool + * TRUE if the link relation is an extension type, FALSE otherwise. * * @see https://tools.ietf.org/html/rfc5988#section-4.2 */ diff --git a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php index d7a6f70c54aa..0cca18d6fd48 100644 --- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php +++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php @@ -59,6 +59,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi * image toolkit operation developers. * * @return \Drupal\Core\ImageToolkit\ImageToolkitInterface + * The image toolkit in use. */ protected function getToolkit() { return $this->toolkit; diff --git a/core/lib/Drupal/Core/Installer/Exception/InstallerException.php b/core/lib/Drupal/Core/Installer/Exception/InstallerException.php index d0e0b6be7ff9..beb0e9dc535f 100644 --- a/core/lib/Drupal/Core/Installer/Exception/InstallerException.php +++ b/core/lib/Drupal/Core/Installer/Exception/InstallerException.php @@ -38,6 +38,7 @@ public function __construct($message, $title = 'Error', $code = 0, ?\Exception $ * Returns the exception page title. * * @return string + * The page title. */ public function getTitle() { return $this->title; diff --git a/core/lib/Drupal/Core/Installer/InstallerRedirectTrait.php b/core/lib/Drupal/Core/Installer/InstallerRedirectTrait.php index f6acafb6a8f2..e68e33016d9a 100644 --- a/core/lib/Drupal/Core/Installer/InstallerRedirectTrait.php +++ b/core/lib/Drupal/Core/Installer/InstallerRedirectTrait.php @@ -18,6 +18,7 @@ trait InstallerRedirectTrait { * Returns whether the current PHP process runs on CLI. * * @return bool + * TRUE if the current PHP process is running on CLI, otherwise FALSE. */ protected function isCli() { return PHP_SAPI === 'cli'; diff --git a/core/lib/Drupal/Core/Layout/LayoutDefault.php b/core/lib/Drupal/Core/Layout/LayoutDefault.php index bd3780987a4d..0c9b4063ad74 100644 --- a/core/lib/Drupal/Core/Layout/LayoutDefault.php +++ b/core/lib/Drupal/Core/Layout/LayoutDefault.php @@ -96,6 +96,7 @@ public function calculateDependencies() { * * @return \Drupal\Core\Layout\LayoutDefinition */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getPluginDefinition() { return parent::getPluginDefinition(); } diff --git a/core/lib/Drupal/Core/Layout/LayoutInterface.php b/core/lib/Drupal/Core/Layout/LayoutInterface.php index 33858a546d7f..b3b61a9f74f2 100644 --- a/core/lib/Drupal/Core/Layout/LayoutInterface.php +++ b/core/lib/Drupal/Core/Layout/LayoutInterface.php @@ -30,6 +30,7 @@ public function build(array $regions); * * @return \Drupal\Core\Layout\LayoutDefinition */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getPluginDefinition(); } diff --git a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php index 76140b3af04a..b0fad27e11e9 100644 --- a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php +++ b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php @@ -197,6 +197,7 @@ public function getCategories() { * * @return \Drupal\Core\Layout\LayoutDefinition[] */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getSortedDefinitions(?array $definitions = NULL, $label_key = 'label') { // Sort the plugins first by category, then by label. $definitions = $definitions ?? $this->getDefinitions(); @@ -214,6 +215,7 @@ public function getSortedDefinitions(?array $definitions = NULL, $label_key = 'l * * @return \Drupal\Core\Layout\LayoutDefinition[][] */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getGroupedDefinitions(?array $definitions = NULL, $label_key = 'label') { $definitions = $this->getSortedDefinitions($definitions ?? $this->getDefinitions(), $label_key); $grouped_definitions = []; diff --git a/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php b/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php index 366b1d41f65c..a2b877335a95 100644 --- a/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php +++ b/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php @@ -25,6 +25,7 @@ public function getThemeImplementations(); * * @return \Drupal\Core\Layout\LayoutInterface */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function createInstance($plugin_id, array $configuration = []); /** @@ -32,6 +33,7 @@ public function createInstance($plugin_id, array $configuration = []); * * @return \Drupal\Core\Layout\LayoutDefinition|null */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getDefinition($plugin_id, $exception_on_invalid = TRUE); /** @@ -39,6 +41,7 @@ public function getDefinition($plugin_id, $exception_on_invalid = TRUE); * * @return \Drupal\Core\Layout\LayoutDefinition[] */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getDefinitions(); /** @@ -46,6 +49,7 @@ public function getDefinitions(); * * @return \Drupal\Core\Layout\LayoutDefinition[] */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getSortedDefinitions(?array $definitions = NULL); /** @@ -53,6 +57,7 @@ public function getSortedDefinitions(?array $definitions = NULL); * * @return \Drupal\Core\Layout\LayoutDefinition[][] */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getGroupedDefinitions(?array $definitions = NULL); /** diff --git a/core/lib/Drupal/Core/Link.php b/core/lib/Drupal/Core/Link.php index 28f6ed98f7f5..2b97938d5ecf 100644 --- a/core/lib/Drupal/Core/Link.php +++ b/core/lib/Drupal/Core/Link.php @@ -129,6 +129,7 @@ public function setText($text) { * Returns the URL of the link. * * @return \Drupal\Core\Url + * The URL object. */ public function getUrl() { return $this->url; diff --git a/core/lib/Drupal/Core/Lock/LockBackendInterface.php b/core/lib/Drupal/Core/Lock/LockBackendInterface.php index aa8707478695..f102126ba9f2 100644 --- a/core/lib/Drupal/Core/Lock/LockBackendInterface.php +++ b/core/lib/Drupal/Core/Lock/LockBackendInterface.php @@ -91,6 +91,7 @@ interface LockBackendInterface { * (optional) Lock lifetime in seconds. Defaults to 30.0. * * @return bool + * TRUE if the lock was successfully acquired, FALSE otherwise. */ public function acquire($name, $timeout = 30.0); @@ -101,6 +102,7 @@ public function acquire($name, $timeout = 30.0); * Lock to acquire. * * @return bool + * TRUE if the lock can be acquired, FALSE otherwise. */ public function lockMayBeAvailable($name); @@ -146,6 +148,7 @@ public function releaseAll($lockId = NULL); * Locks will be wiped out at the end of each page request on a token basis. * * @return string + * The lock ID. */ public function getLockId(); diff --git a/core/lib/Drupal/Core/Menu/LocalActionInterface.php b/core/lib/Drupal/Core/Menu/LocalActionInterface.php index 81ff308ae899..83c0f9748f99 100644 --- a/core/lib/Drupal/Core/Menu/LocalActionInterface.php +++ b/core/lib/Drupal/Core/Menu/LocalActionInterface.php @@ -32,6 +32,7 @@ public function getRouteParameters(RouteMatchInterface $route_match); * Returns the weight for the local action. * * @return int + * The weight of this action. */ public function getWeight(); diff --git a/core/lib/Drupal/Core/Menu/MenuLinkManager.php b/core/lib/Drupal/Core/Menu/MenuLinkManager.php index c89dadd7b019..3e019f5069b6 100644 --- a/core/lib/Drupal/Core/Menu/MenuLinkManager.php +++ b/core/lib/Drupal/Core/Menu/MenuLinkManager.php @@ -94,6 +94,7 @@ protected function processDefinition(array &$definition, $plugin_id) { * Gets the plugin discovery. * * @return \Drupal\Component\Plugin\Discovery\DiscoveryInterface + * The discovery service. */ protected function getDiscovery() { if (!isset($this->discovery)) { @@ -109,6 +110,7 @@ protected function getDiscovery() { * Gets the plugin factory. * * @return \Drupal\Component\Plugin\Factory\FactoryInterface + * The plugin factory. */ protected function getFactory() { if (!isset($this->factory)) { diff --git a/core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php b/core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php index afe2aa59e123..cddeeb0e88da 100644 --- a/core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php +++ b/core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php @@ -11,6 +11,7 @@ trait ContextAwarePluginManagerTrait { * Wraps the context handler. * * @return \Drupal\Core\Plugin\Context\ContextHandlerInterface + * The context handler service. */ protected function contextHandler() { return \Drupal::service('context.handler'); diff --git a/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php b/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php index 260cb2c33d25..89ebd9e5ebea 100644 --- a/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php +++ b/core/lib/Drupal/Core/Plugin/Context/ContextInterface.php @@ -18,12 +18,14 @@ interface ContextInterface extends ComponentContextInterface, CacheableDependenc * * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getContextDefinition(); /** * Gets the context value as typed data object. * * @return \Drupal\Core\TypedData\TypedDataInterface + * The typed data object associated with the context. */ public function getContextData(); diff --git a/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php b/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php index 75cbc681f82e..035c69809a31 100644 --- a/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php +++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginAssignmentTrait.php @@ -18,6 +18,7 @@ abstract protected function t($string, array $args = [], array $options = []); * Wraps the context handler. * * @return \Drupal\Core\Plugin\Context\ContextHandlerInterface + * the context handler service. */ protected function contextHandler() { return \Drupal::service('context.handler'); diff --git a/core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php b/core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php index 133c9caf48f7..42a9e1acc4b4 100644 --- a/core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php +++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php @@ -123,6 +123,7 @@ abstract public function getPluginDefinition(); * * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface[] */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getContextDefinitions() { $definition = $this->getPluginDefinition(); if ($definition instanceof ContextAwarePluginDefinitionInterface) { @@ -137,6 +138,7 @@ public function getContextDefinitions() { * * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getContextDefinition($name) { $definition = $this->getPluginDefinition(); if ($definition instanceof ContextAwarePluginDefinitionInterface) { diff --git a/core/lib/Drupal/Core/Queue/QueueWorkerManager.php b/core/lib/Drupal/Core/Queue/QueueWorkerManager.php index 23496592cc92..7bb1797ae569 100644 --- a/core/lib/Drupal/Core/Queue/QueueWorkerManager.php +++ b/core/lib/Drupal/Core/Queue/QueueWorkerManager.php @@ -58,6 +58,7 @@ public function processDefinition(&$definition, $plugin_id) { * {@inheritdoc} * * @return \Drupal\Core\Queue\QueueWorkerInterface + * A fully configured plugin instance. */ public function createInstance($plugin_id, array $configuration = []) { return parent::createInstance($plugin_id, $configuration); diff --git a/core/lib/Drupal/Core/Render/Element/HtmlTag.php b/core/lib/Drupal/Core/Render/Element/HtmlTag.php index 0d69b2f0706f..cde78beb48c6 100644 --- a/core/lib/Drupal/Core/Render/Element/HtmlTag.php +++ b/core/lib/Drupal/Core/Render/Element/HtmlTag.php @@ -80,6 +80,7 @@ public function getInfo() { * any non-empty value here will add the <noscript> tag.) * * @return array + * The element, after the pre-rendering processing run. */ public static function preRenderHtmlTag($element) { $attributes = isset($element['#attributes']) ? new Attribute($element['#attributes']) : ''; diff --git a/core/lib/Drupal/Core/Render/Element/InlineTemplate.php b/core/lib/Drupal/Core/Render/Element/InlineTemplate.php index d9a60d9af79b..9ff9ace07061 100644 --- a/core/lib/Drupal/Core/Render/Element/InlineTemplate.php +++ b/core/lib/Drupal/Core/Render/Element/InlineTemplate.php @@ -48,6 +48,7 @@ public function getInfo() { * * @return array */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public static function preRenderInlineTemplate($element) { /** @var \Drupal\Core\Template\TwigEnvironment $environment */ $environment = \Drupal::service('twig'); diff --git a/core/lib/Drupal/Core/Render/Element/Pager.php b/core/lib/Drupal/Core/Render/Element/Pager.php index 1977b5bf6d39..1f23a11ebcea 100644 --- a/core/lib/Drupal/Core/Render/Element/Pager.php +++ b/core/lib/Drupal/Core/Render/Element/Pager.php @@ -68,6 +68,7 @@ public function getInfo() { * A renderable array of #type => pager. * * @return array + * The render array with cache contexts added. */ public static function preRenderPager(array $pager) { // Note: the default pager theme process function diff --git a/core/lib/Drupal/Core/Render/Element/StatusReport.php b/core/lib/Drupal/Core/Render/Element/StatusReport.php index fe55e9652bb2..579a8c853ee8 100644 --- a/core/lib/Drupal/Core/Render/Element/StatusReport.php +++ b/core/lib/Drupal/Core/Render/Element/StatusReport.php @@ -65,6 +65,8 @@ public static function preRenderGroupRequirements($element) { * Gets the severities. * * @return array + * An associative array of the requirements severities. The keys are the + * requirement constants defined in install.inc. */ public static function getSeverities() { return [ diff --git a/core/lib/Drupal/Core/Render/Element/Table.php b/core/lib/Drupal/Core/Render/Element/Table.php index 9026d05914f8..53767dc7cdd7 100644 --- a/core/lib/Drupal/Core/Render/Element/Table.php +++ b/core/lib/Drupal/Core/Render/Element/Table.php @@ -383,6 +383,7 @@ public static function validateTable(&$element, FormStateInterface $form_state, * $options array. * * @return array + * Associative array of rendered child elements for a table. * * @see template_preprocess_table() * @see \Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments() diff --git a/core/lib/Drupal/Core/Render/ElementInfoManager.php b/core/lib/Drupal/Core/Render/ElementInfoManager.php index e01630258d9a..07a7880743af 100644 --- a/core/lib/Drupal/Core/Render/ElementInfoManager.php +++ b/core/lib/Drupal/Core/Render/ElementInfoManager.php @@ -86,6 +86,7 @@ public function getInfoProperty($type, $property_name, $default = NULL) { * The theme name. * * @return array + * An array containing all element information. */ protected function buildInfo($theme_name) { // Get cached definitions. @@ -137,6 +138,7 @@ protected function buildInfo($theme_name) { * * @return \Drupal\Core\Render\Element\ElementInterface */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function createInstance($plugin_id, array $configuration = []) { return parent::createInstance($plugin_id, $configuration); } @@ -164,6 +166,7 @@ public function clearCachedDefinitions() { * The theme name. * * @return string + * The cache ID. */ protected function getCid($theme_name) { return 'element_info_build:' . $theme_name; diff --git a/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php b/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php index b95ff18b550f..afe9f8bfe2b5 100644 --- a/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php +++ b/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php @@ -81,6 +81,7 @@ public function setPluginId($plugin_id) { * The selected page display variant plugin ID. * * @return string + * The plugin ID. */ public function getPluginId() { return $this->pluginId; @@ -103,6 +104,7 @@ public function setPluginConfiguration(array $configuration) { * Get the configuration for the selected page display variant. * * @return array + * The plugin configuration. */ public function getPluginConfiguration() { return $this->pluginConfiguration; diff --git a/core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php b/core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php index 1e13e5eb7836..1a83553a719c 100644 --- a/core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php +++ b/core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php @@ -24,6 +24,8 @@ interface PlaceholderGeneratorInterface { * analyzed. * * @return bool + * Returns TRUE is the render array can be overwritten with placeholders, + * FALSE otherwise. */ public function canCreatePlaceholder(array $element); diff --git a/core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php b/core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php index 71107c685d77..fb5a5d369cff 100644 --- a/core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php +++ b/core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php @@ -19,6 +19,7 @@ class EntityRevisionRouteEnhancer implements EnhancerInterface { * The current route. * * @return bool + * TRUE if the enhancer runs on the current route, FALSE otherwise. */ protected function applies(Route $route) { // Check whether there is any entity revision parameter. diff --git a/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php b/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php index 6ddb85cb9ec9..998b1319fd7c 100644 --- a/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php +++ b/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php @@ -19,6 +19,7 @@ class FormRouteEnhancer implements EnhancerInterface { * The current route. * * @return bool + * TRUE when the enhancer runs on the current route, FALSE otherwise. */ protected function applies(Route $route) { return $route->hasDefault('_form') && !$route->hasDefault('_controller'); diff --git a/core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php b/core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php index 46e8566d20d8..1efd0f2c0ebd 100644 --- a/core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php +++ b/core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php @@ -38,6 +38,7 @@ public function getAsArray(); * @endcode * * @return string + * The full path of the destination. */ public function get(); diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php index 132f89631b08..eba5bca5bf31 100644 --- a/core/lib/Drupal/Core/Routing/RouteProvider.php +++ b/core/lib/Drupal/Core/Routing/RouteProvider.php @@ -481,6 +481,7 @@ protected function getRouteCollectionCacheId(Request $request) { * Request. * * @return string + * The query parameters identifier for the route collection cache. */ protected function getQueryParametersCacheIdPart(Request $request) { // @todo Use \Symfony\Component\HttpFoundation\Request::normalizeQueryString diff --git a/core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php b/core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php index c20796fe86e6..ea615a8fa4e4 100644 --- a/core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php +++ b/core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php @@ -15,6 +15,7 @@ interface StackedRouteMatchInterface extends RouteMatchInterface { * Gets the current route match. * * @return \Drupal\Core\Routing\RouteMatchInterface + * The route match object for the current route. */ public function getCurrentRouteMatch(); @@ -22,6 +23,7 @@ public function getCurrentRouteMatch(); * Gets the master route match.. * * @return \Drupal\Core\Routing\RouteMatchInterface + * The route match object for the master route. */ public function getMasterRouteMatch(); diff --git a/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php b/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php index 5965d91ce8dc..db8334e99a43 100644 --- a/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php +++ b/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php @@ -19,7 +19,7 @@ interface RefinableCalculatedPermissionsInterface extends RefinableCacheableDepe * given identifier within the scope. Defaults to FALSE, meaning a merge * will take place instead. * - * @return self + * @return $this */ public function addItem(CalculatedPermissionsItemInterface $item, bool $overwrite = FALSE): self; @@ -32,7 +32,7 @@ public function addItem(CalculatedPermissionsItemInterface $item, bool $overwrit * (optional) The scope identifier to remove the item from, defaults to * 'drupal'. * - * @return self + * @return $this */ public function removeItem(string $scope = AccessPolicyInterface::SCOPE_DRUPAL, string|int $identifier = AccessPolicyInterface::SCOPE_DRUPAL): self; @@ -49,7 +49,7 @@ public function removeItems(): self; * @param string $scope * The scope name to remove the items for. * - * @return self + * @return $this */ public function removeItemsByScope(string $scope): self; @@ -61,7 +61,7 @@ public function removeItemsByScope(string $scope): self; * @param \Drupal\Core\Session\CalculatedPermissionsInterface $other * The other calculated permissions object to merge into this one. * - * @return self + * @return $this */ public function merge(CalculatedPermissionsInterface $other): self; diff --git a/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php index 1004b1f6621f..0170626181c0 100644 --- a/core/lib/Drupal/Core/Session/SessionManager.php +++ b/core/lib/Drupal/Core/Session/SessionManager.php @@ -249,6 +249,7 @@ public function setWriteSafeHandler(WriteSafeSessionHandlerInterface $handler) { * Command line clients do not support cookies nor sessions. * * @return bool + * TRUE if the current PHP process runs on CLI, otherwise FALSE> */ protected function isCli() { return PHP_SAPI === 'cli'; diff --git a/core/lib/Drupal/Core/Site/Settings.php b/core/lib/Drupal/Core/Site/Settings.php index 16b70a0c95f3..63b56a865d49 100644 --- a/core/lib/Drupal/Core/Site/Settings.php +++ b/core/lib/Drupal/Core/Site/Settings.php @@ -61,7 +61,7 @@ public function __construct(array $settings) { * A singleton is used because this class is used before the container is * available. * - * @return \Drupal\Core\Site\Settings + * @return $this * * @throws \BadMethodCallException * Thrown when the settings instance has not been initialized yet. diff --git a/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php b/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php index 060d92532080..0deb986c3c9f 100644 --- a/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php +++ b/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php @@ -45,6 +45,8 @@ public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TR * An array of query parameters, where the libraries parameter is compressed. * * @return array + * The input array of query parameters, where the libraries parameter is + * changed to be uncompressed. */ private function parseAjaxPageState(array $ajax_page_state): array { $ajax_page_state['libraries'] = UrlHelper::uncompressQueryParameter($ajax_page_state['libraries']); diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php index ef4245f45485..f9de7760aab4 100644 --- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php +++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php @@ -100,6 +100,8 @@ interface StreamWrapperInterface extends PhpStreamWrapperInterface { * Returns the type of stream wrapper. * * @return int + * The type of stream wrapper. This should be one of the constants in this + * class. */ public static function getType(); diff --git a/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php b/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php index 4255e893368a..49a2e0bfaad2 100644 --- a/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php +++ b/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php @@ -123,6 +123,9 @@ public function render() { * Gets the plural index through the gettext formula. * * @return int + * The numeric index of the plural variant to use for this language and + * count combination. Defaults to -1 when the language was not found or does + * not have a plural formula. */ protected function getPluralIndex() { // We have to test both if the function and the service exist since in diff --git a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php index 336de03794ec..744953dc574f 100644 --- a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php +++ b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php @@ -62,6 +62,7 @@ public function __construct(CacheBackendInterface $cache, $twig_cache_prefix) { * Gets the PHP code storage object to use for the compiled Twig files. * * @return \Drupal\Component\PhpStorage\PhpStorageInterface + * The PhpStorage object used for storing the templates. */ protected function storage() { if (!isset($this->storage)) { diff --git a/core/lib/Drupal/Core/Theme/ActiveTheme.php b/core/lib/Drupal/Core/Theme/ActiveTheme.php index 08eaf9108a79..f417a10a7491 100644 --- a/core/lib/Drupal/Core/Theme/ActiveTheme.php +++ b/core/lib/Drupal/Core/Theme/ActiveTheme.php @@ -127,6 +127,7 @@ public function __construct(array $values) { * Returns the machine name of the theme. * * @return string + * The machine name for the theme. */ public function getName() { return $this->name; @@ -136,6 +137,7 @@ public function getName() { * Returns the path to the theme directory. * * @return string + * The file path of the theme directory. */ public function getPath() { return $this->path; @@ -145,6 +147,7 @@ public function getPath() { * Returns the theme engine. * * @return string + * The engine of the theme. */ public function getEngine() { return $this->engine; @@ -153,9 +156,10 @@ public function getEngine() { /** * Returns the path to the theme engine for root themes. * - * @see \Drupal\Core\Extension\ThemeExtensionList::doList() - * * @return mixed + * The path to the theme engine for root themes. + * + * @see \Drupal\Core\Extension\ThemeExtensionList::doList() */ public function getOwner() { return $this->owner; @@ -165,6 +169,7 @@ public function getOwner() { * Returns the extension object. * * @return \Drupal\Core\Extension\Extension + * The extension object for the theme. */ public function getExtension() { return $this->extension; @@ -174,6 +179,7 @@ public function getExtension() { * Returns the libraries provided by the theme. * * @return mixed + * The libraries provided by the theme. */ public function getLibraries() { return $this->libraries; @@ -187,6 +193,7 @@ public function getLibraries() { * be called first, so this order needs to be reversed with array_reverse() * * @return \Drupal\Core\Extension\Extension[] + * An array of base theme extension objects keyed by name. */ public function getBaseThemeExtensions() { return $this->baseThemeExtensions; diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index 66f4225c945b..1c9c04b8a9c7 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -287,6 +287,10 @@ public function get() { * Gets the theme registry cache. * * @return array|null + * The complete theme registry data array for the active theme for this + * registry. + * + * @see Registry::$registry */ protected function cacheGet(): ?array { $theme_name = $this->theme->getName(); diff --git a/core/lib/Drupal/Core/Theme/ThemeInitialization.php b/core/lib/Drupal/Core/Theme/ThemeInitialization.php index 8f4ef074f57d..10f173a15e70 100644 --- a/core/lib/Drupal/Core/Theme/ThemeInitialization.php +++ b/core/lib/Drupal/Core/Theme/ThemeInitialization.php @@ -262,6 +262,7 @@ public function getActiveTheme(Extension $theme, array $base_themes = []) { * Gets all extensions. * * @return array + * An associative array whose keys are the names of the extensions. */ protected function getExtensions() { if (!isset($this->extensions)) { diff --git a/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php b/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php index 71dc3b56bdfe..e93d4d25382c 100644 --- a/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php +++ b/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php @@ -36,6 +36,7 @@ public function render($hook, array $variables); * The route match. * * @return \Drupal\Core\Theme\ActiveTheme + * The active theme object. */ public function getActiveTheme(?RouteMatchInterface $route_match = NULL); @@ -43,6 +44,7 @@ public function getActiveTheme(?RouteMatchInterface $route_match = NULL); * Determines whether there is an active theme. * * @return bool + * TRUE if there is an active theme, FALSE otherwise. */ public function hasActiveTheme(); diff --git a/core/lib/Drupal/Core/TypedData/DataDefinition.php b/core/lib/Drupal/Core/TypedData/DataDefinition.php index 48058e33ceba..66145088839e 100644 --- a/core/lib/Drupal/Core/TypedData/DataDefinition.php +++ b/core/lib/Drupal/Core/TypedData/DataDefinition.php @@ -361,6 +361,7 @@ public function offsetUnset($offset): void { * Returns all definition values as array. * * @return array + * The array holding values for all definition keys. */ public function toArray() { return $this->definition; diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php index 52b9c47307f0..12a4f211e130 100644 --- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php +++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php @@ -217,6 +217,7 @@ public function appendItem($value = NULL) { * Helper for creating a list item object. * * @return \Drupal\Core\TypedData\TypedDataInterface + * The new property instance. */ protected function createItem($offset = 0, $value = NULL) { return $this->getTypedDataManager()->getPropertyInstance($this, $offset, $value); diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Language.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Language.php index f81358d5b5bc..40d74a8853a6 100644 --- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Language.php +++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Language.php @@ -33,10 +33,11 @@ class Language extends TypedData { protected $language; /** - * Overrides TypedData::getValue(). + * {@inheritdoc} * * @return \Drupal\Core\Language\LanguageInterface|null */ + // phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment public function getValue() { if (!isset($this->language) && $this->id) { $this->language = \Drupal::languageManager()->getLanguage($this->id); diff --git a/core/lib/Drupal/Core/TypedData/PrimitiveInterface.php b/core/lib/Drupal/Core/TypedData/PrimitiveInterface.php index 1df50f78dc44..bf36d72cc229 100644 --- a/core/lib/Drupal/Core/TypedData/PrimitiveInterface.php +++ b/core/lib/Drupal/Core/TypedData/PrimitiveInterface.php @@ -13,6 +13,7 @@ interface PrimitiveInterface { * Gets the primitive data value. * * @return mixed + * The primitive data value. */ public function getValue(); @@ -29,6 +30,7 @@ public function setValue($value); * Gets the primitive data value casted to the correct PHP type. * * @return mixed + * The primitive data value cast to the correct PHP type. */ public function getCastedValue(); diff --git a/core/lib/Drupal/Core/Update/UpdateRegistry.php b/core/lib/Drupal/Core/Update/UpdateRegistry.php index 07e57dd031a1..d315143cb2c1 100644 --- a/core/lib/Drupal/Core/Update/UpdateRegistry.php +++ b/core/lib/Drupal/Core/Update/UpdateRegistry.php @@ -287,6 +287,7 @@ public function filterOutInvokedUpdatesByExtension(string $extension) { /** * @return bool + * TRUE if themes are to be updated, FALSE otherwise. */ protected function includeThemes(): bool { return $this->updateType === 'post_update'; diff --git a/core/lib/Drupal/Core/Updater/Module.php b/core/lib/Drupal/Core/Updater/Module.php index 6c2d58f3a499..3cb0c88cd146 100644 --- a/core/lib/Drupal/Core/Updater/Module.php +++ b/core/lib/Drupal/Core/Updater/Module.php @@ -69,6 +69,7 @@ public static function canUpdateDirectory($directory) { * The project to check. * * @return bool + * TRUE if the the project can be updated, FALSE otherwise. */ public static function canUpdate($project_name) { return (bool) \Drupal::service('extension.list.module')->getPath($project_name); diff --git a/core/lib/Drupal/Core/Updater/Theme.php b/core/lib/Drupal/Core/Updater/Theme.php index 32da14d8feba..2954d5a5085d 100644 --- a/core/lib/Drupal/Core/Updater/Theme.php +++ b/core/lib/Drupal/Core/Updater/Theme.php @@ -70,6 +70,7 @@ public static function canUpdateDirectory($directory) { * The project to check. * * @return bool + * TRUE if the the project can be updated, FALSE otherwise. */ public static function canUpdate($project_name) { return (bool) \Drupal::service('extension.list.theme')->getPath($project_name); diff --git a/core/lib/Drupal/Core/Updater/UpdaterInterface.php b/core/lib/Drupal/Core/Updater/UpdaterInterface.php index e925dd443306..1ebfd31f0f0e 100644 --- a/core/lib/Drupal/Core/Updater/UpdaterInterface.php +++ b/core/lib/Drupal/Core/Updater/UpdaterInterface.php @@ -18,6 +18,7 @@ interface UpdaterInterface { * Checks if the project is installed. * * @return bool + * Return TRUE if the project is installed, FALSE otherwise. */ public function isInstalled(); diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php index d16ef5506517..8f0de5f32244 100644 --- a/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -544,6 +544,7 @@ public function toUriString() { * Indicates if this URL is external. * * @return bool + * TRUE if the URL is external, FALSE otherwise. */ public function isExternal() { return $this->external; @@ -553,6 +554,7 @@ public function isExternal() { * Indicates if this URL has a Drupal route. * * @return bool + * TRUE if there is a Drupal route for the URL, FALSE otherwise. */ public function isRouted() { return !$this->unrouted; @@ -562,6 +564,7 @@ public function isRouted() { * Returns the route name. * * @return string + * The name of the route. * * @throws \UnexpectedValueException * If this is a URI with no corresponding route. @@ -578,6 +581,7 @@ public function getRouteName() { * Returns the route parameters. * * @return array + * An associative array of route parameters. * * @throws \UnexpectedValueException * If this is a URI with no corresponding route. @@ -817,6 +821,7 @@ public function access(?AccountInterface $account = NULL, $return_as_object = FA /** * @return \Drupal\Core\Access\AccessManagerInterface + * The access manager service. */ protected function accessManager() { if (!isset($this->accessManager)) { diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index f63fe23ffa55..1144bf1f37d0 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -81,7 +81,7 @@ <include-pattern>core/lib/Component/*</include-pattern> </rule> <rule ref="Drupal.Commenting.FunctionComment.MissingReturnComment"> - <include-pattern>core/lib/Drupal/Core/[a-e]*/*</include-pattern> + <include-pattern>core/lib/Drupal/Core/*</include-pattern> </rule> <rule ref="Drupal.Commenting.GenderNeutralComment"/> <rule ref="Drupal.Commenting.HookComment"/> -- GitLab