Skip to content

Commit 12de639

Browse files
author
catch
committed
Issue #3507052 by quietone, borisson_, alexpott: Enable LineLength for core/includes, lib, profiles, recipes and themes
1 parent 043a10a commit 12de639

38 files changed

+89
-53
lines changed

includes/common.inc

+9-4
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,19 @@ const CSS_BASE = -200;
8484
const CSS_LAYOUT = -100;
8585

8686
/**
87-
* The default weight for CSS rules that style design components (and their associated states and themes.)
87+
* The default weight for CSS rules that style design components.
88+
*
89+
* This applies to the associated states and themes of the component.
8890
*/
8991
const CSS_COMPONENT = 0;
9092

9193
/**
92-
* The default weight for CSS rules that style states and are not included with components.
94+
* The default weight for rules that style states not included with components.
9395
*/
9496
const CSS_STATE = 100;
9597

9698
/**
97-
* The default weight for CSS rules that style themes and are not included with components.
99+
* The default weight for rules that style themes not included with components.
98100
*/
99101
const CSS_THEME = 200;
100102

@@ -342,7 +344,10 @@ function show(&$element) {
342344
}
343345

344346
/**
345-
* Rebuilds the container, flushes all persistent caches, resets all variables, and rebuilds all data structures.
347+
* Re-initializes the entire system.
348+
*
349+
* To re-initialize the system, the container is rebuilt, all persistent caches
350+
* are flushed, all variables are reset and all data structures are rebuilt.
346351
*
347352
* At times, it is necessary to re-initialize the entire system to account for
348353
* changed or new code. This function:

lib/Drupal/Component/Plugin/Factory/DefaultFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class DefaultFactory implements FactoryInterface {
1818

1919
/**
20-
* The object that retrieves the definitions of the plugins that this factory instantiates.
20+
* The object that gets the plugin definitions that this factory instantiates.
2121
*
2222
* The plugin definition includes the plugin class and possibly other
2323
* information necessary for proper instantiation.

lib/Drupal/Component/Plugin/Factory/ReflectionFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function createInstance($plugin_id, array $configuration = []) {
3232
}
3333

3434
/**
35-
* Inspects the plugin class and build a list of arguments for the constructor.
35+
* Inspects the plugin class and builds a list of constructor arguments.
3636
*
3737
* This is provided as a helper method so factories extending this class can
3838
* replace this and insert their own reflection logic.

lib/Drupal/Core/Access/AccessManagerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
interface AccessManagerInterface {
1313

1414
/**
15-
* Checks a named route with parameters against applicable access check services.
15+
* Checks a named route with parameters against access check services.
1616
*
1717
* Determines whether the route is accessible or not.
1818
*

lib/Drupal/Core/Access/AccessResult.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function forbiddenIf($condition, $reason = NULL) {
9898
}
9999

100100
/**
101-
* Creates an allowed access result if the permission is present, neutral otherwise.
101+
* Creates an access result if the permission is present, neutral otherwise.
102102
*
103103
* Checks the permission and adds a 'user.permissions' cache context.
104104
*
@@ -121,7 +121,7 @@ public static function allowedIfHasPermission(AccountInterface $account, $permis
121121
}
122122

123123
/**
124-
* Creates an allowed access result if the permissions are present, neutral otherwise.
124+
* Creates an access result if the permissions are present, neutral otherwise.
125125
*
126126
* Checks the permission and adds a 'user.permissions' cache contexts.
127127
*

lib/Drupal/Core/Access/AccessResultForbidden.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\Core\Access;
44

55
/**
6-
* Value object indicating a forbidden access result, with cacheability metadata.
6+
* Value object for a forbidden access result, with cacheability metadata.
77
*/
88
class AccessResultForbidden extends AccessResult implements AccessResultReasonInterface {
99

lib/Drupal/Core/Ajax/OpenModalDialogCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\Core\Ajax;
44

55
/**
6-
* Defines an AJAX command to open certain content in a dialog in a modal dialog.
6+
* An AJAX command to open certain content in a dialog in a modal dialog.
77
*
88
* @ingroup ajax
99
*/

lib/Drupal/Core/Asset/LibraryDiscoveryParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,8 @@ protected function setOverrideValue(array &$library, array $sub_key, array $over
634634
protected function resolveThemeAssetPath($theme_path, $overriding_asset) {
635635
if ($overriding_asset[0] !== '/' && !$this->isValidUri($overriding_asset)) {
636636
// The destination is not an absolute path and it's not a URI (e.g.
637-
// public://generated_js/example.js or https://example.com/js/my_js.js), so
638-
// it's relative to the theme.
637+
// public://generated_js/example.js or https://example.com/js/my_js.js),
638+
// so it's relative to the theme.
639639
return '/' . $theme_path . '/' . $overriding_asset;
640640
}
641641
return $overriding_asset;

lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Drupal\Core\Session\PermissionsHashGeneratorInterface;
77

88
/**
9-
* Defines the AccountPermissionsCacheContext service, for "per permission" caching.
9+
* The account permission cache context for "per permission" caching.
1010
*
1111
* Cache context ID: 'user.permissions'.
1212
*/

lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function getLabel();
3636
public function getContext($parameter = NULL);
3737

3838
/**
39-
* Gets the cacheability metadata for the context based on the parameter value.
39+
* Gets cacheability metadata for the context based on the parameter value.
4040
*
4141
* There are three valid cases for the returned CacheableMetadata object:
4242
* - An empty object means this can be optimized away safely.

lib/Drupal/Core/Cache/MemoryCache/LruMemoryCache.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []):
7979
}
8080
elseif (count($this->cache) > $this->allowedSlots - 1) {
8181
// Remove one item from the cache to ensure we remain within the allowed
82-
// number of slots. Avoid using array_slice() because it makes a copy of the
83-
// array, and avoid using array_splice() or array_shift() because they
82+
// number of slots. Avoid using array_slice() because it makes a copy of
83+
// the array, and avoid using array_splice() or array_shift() because they
8484
// re-index numeric keys.
8585
unset($this->cache[array_key_first($this->cache)]);
8686
}

lib/Drupal/Core/Config/ConfigManagerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function findConfigEntityDependencies($type, array $names);
134134
public function findConfigEntityDependenciesAsEntities($type, array $names);
135135

136136
/**
137-
* Lists which config entities to update and delete on removal of a dependency.
137+
* Lists config entities to update and delete on removal of a dependency.
138138
*
139139
* @param string $type
140140
* The type of dependency being checked. Either 'module', 'theme', 'config'

lib/Drupal/Core/Config/Entity/ConfigEntityBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function createDuplicate() {
233233
}
234234

235235
/**
236-
* Helper callback for uasort() to sort configuration entities by weight and label.
236+
* Callback for uasort() to sort configuration entities by weight and label.
237237
*/
238238
public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
239239
$a_weight = $a->weight ?? 0;

lib/Drupal/Core/Config/FileStorage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getFilePath($name) {
6363
}
6464

6565
/**
66-
* Returns the file extension used by the file storage for all configuration files.
66+
* Gets the extension used by the file storage for all configuration files.
6767
*
6868
* @return string
6969
* The file extension.

lib/Drupal/Core/Database/Log.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
class Log {
1919

2020
/**
21-
* Cache of logged queries. This will only be used if the query logger is enabled.
21+
* Cache of logged queries.
22+
*
23+
* This will only be used if the query logger is enabled.
2224
*
2325
* @var array
2426
* The structure for the logging array is as follows:

lib/Drupal/Core/Database/Query/SelectInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function escapeLike($string);
152152
public function escapeField($string);
153153

154154
/**
155-
* Compiles and returns an associative array of the arguments for this prepared statement.
155+
* Compiles and returns an array of the arguments for this prepared statement.
156156
*
157157
* @param \Drupal\Core\Database\Query\PlaceholderInterface|null $queryPlaceholder
158158
* When collecting the arguments of a subquery, the main placeholder

lib/Drupal/Core/Database/Schema.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function executeDdlStatement(string $sql, array $arguments = [], array
143143
}
144144

145145
/**
146-
* Build a condition to match a table name against a standard information_schema.
146+
* Builds a condition to match a table name against the information_schema.
147147
*
148148
* The information_schema is a SQL standard that provides information about
149149
* the database server and the databases, schemas, tables, columns and users
@@ -676,7 +676,7 @@ protected function createTableSql($name, $table) {
676676
}
677677

678678
/**
679-
* Return an array of field names from an array of key/index column specifiers.
679+
* Gets an array of field names from an array of key/index column specifiers.
680680
*
681681
* This is usually an identity function but if a key/index uses a column
682682
* prefix specification, this function extracts just the name.

lib/Drupal/Core/Database/StatementInterface.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ public function fetchAssoc();
151151
* @param int|null $column_index
152152
* If $mode is FetchAs::Column, the index of the column to fetch.
153153
* @param array $constructor_arguments
154-
* If $mode is FetchAs::ClassObject, the arguments to pass to the constructor.
154+
* If $mode is FetchAs::ClassObject, the arguments to pass to the
155+
* constructor.
155156
*
156157
* @return array
157158
* An array of results.

lib/Drupal/Core/Database/TransactionOutOfOrderException.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
namespace Drupal\Core\Database;
44

55
/**
6-
* Exception thrown when a rollBack() resulted in other active transactions being rolled-back.
6+
* Exception thrown transactions are out of order.
7+
*
8+
* This is thrown when a rollBack() resulted in other active transactions being
9+
* rolled-back.
710
*/
811
class TransactionOutOfOrderException extends TransactionException implements DatabaseException {}

lib/Drupal/Core/DependencyInjection/Compiler/BackwardsCompatibilityClassLoaderPass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Symfony\Component\DependencyInjection\ContainerBuilder;
99

1010
/**
11-
* Defines a compiler pass to merge moved classes into a single container parameter.
11+
* Compiler pass to merge moved classes into a single container parameter.
1212
*/
1313
class BackwardsCompatibilityClassLoaderPass implements CompilerPassInterface {
1414

lib/Drupal/Core/DrupalKernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ protected function getHttpKernel() {
14681468
}
14691469

14701470
/**
1471-
* Returns the active configuration storage to use during building the container.
1471+
* Gets the active configuration storage to use during building the container.
14721472
*
14731473
* @return \Drupal\Core\Config\StorageInterface
14741474
* The configuration storage.

lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepositoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function deleteLastInstalledDefinition($entity_type_id);
125125
public function getLastInstalledFieldStorageDefinitions($entity_type_id);
126126

127127
/**
128-
* Stores the entity type's field storage definitions in the application state.
128+
* Puts the entity type's field storage definitions in the application state.
129129
*
130130
* @param string $entity_type_id
131131
* The entity type identifier.

lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function countReferenceableEntities($match = NULL, $match_operator = 'CON
6363
public function validateReferenceableEntities(array $ids);
6464

6565
/**
66-
* Allows the selection to alter the SelectQuery generated by EntityFieldQuery.
66+
* Allows altering the SelectQuery generated by EntityFieldQuery.
6767
*
6868
* @param \Drupal\Core\Database\Query\SelectInterface $query
6969
* A Select Query object.

lib/Drupal/Core/Entity/EntityTypeInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,8 @@ public function getListCacheTags();
736736
/**
737737
* The list cache tags associated with a specific bundle.
738738
*
739-
* Enables code listing entities of this type and bundle to ensure that newly created
740-
* entities show up immediately.
739+
* Enables code listing entities of this type and bundle to ensure that newly
740+
* created entities show up immediately.
741741
*
742742
* @return string[]
743743
* An array of the cache tags for this bundle.

lib/Drupal/Core/Entity/EntityTypeListenerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\Core\Entity;
44

55
/**
6-
* Defines an interface for reacting to entity type creation, deletion, and updates.
6+
* Interface for entity type create, delete and update operations.
77
*/
88
interface EntityTypeListenerInterface {
99

lib/Drupal/Core/Entity/Query/ConditionAggregateBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\Core\Entity\Query;
44

55
/**
6-
* Defines a common base class for all aggregation entity condition implementations.
6+
* A common base class for all aggregation entity condition implementations.
77
*/
88
abstract class ConditionAggregateBase extends ConditionFundamentals implements ConditionAggregateInterface {
99

lib/Drupal/Core/Extension/ExtensionNameLengthException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
namespace Drupal\Core\Extension;
44

55
/**
6-
* Exception thrown when the extension's name length exceeds the allowed maximum.
6+
* Exception thrown when the extension's name length exceeds the maximum.
77
*/
88
class ExtensionNameLengthException extends \Exception {}

lib/Drupal/Core/Extension/InstallRequirementsInterface.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ interface InstallRequirementsInterface {
1616
* During the 'install' phase, modules can for example assert that
1717
* library or server versions are available or sufficient.
1818
* Note that the installation of a module can happen during installation of
19-
* Drupal itself (by install.php) with an installation profile or later by hand.
20-
* As a consequence, install-time requirements must be checked without access
21-
* to the full Drupal API, because it is not available during install.php.
22-
* If a requirement has a severity of REQUIREMENT_ERROR, install.php will abort
23-
* or at least the module will not install.
19+
* Drupal itself (by install.php) with an installation profile or later by
20+
* hand. As a consequence, install-time requirements must be checked without
21+
* access to the full Drupal API, because it is not available during
22+
* install.php.
23+
* If a requirement has a severity of REQUIREMENT_ERROR, install.php will
24+
* abort or at least the module will not install.
2425
* Other severity levels have no effect on the installation.
2526
* Module dependencies do not belong to these installation requirements,
2627
* but should be defined in the module's .info.yml file.

lib/Drupal/Core/Extension/ModuleHandler.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ protected function add($type, $name, $path) {
202202
// A module freshly added will not be registered on the container yet.
203203
// ProceduralCall service does not yet know about it.
204204
// Note in HookCollectorPass:
205+
// phpcs:ignore Drupal.Files.LineLength
205206
// - $container->register(ProceduralCall::class, ProceduralCall::class)->addArgument($collector->includes);
206-
// Load all includes so the legacy section of invoke can handle hooks in includes.
207+
// Load all includes so the legacy section of invoke can handle hooks in
208+
// includes.
207209
$hook_collector->loadAllIncludes();
208210
// Register procedural implementations.
209211
foreach ($hook_collector->getImplementations() as $hook => $moduleImplements) {

lib/Drupal/Core/Field/FieldStorageDefinitionListenerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\Core\Field;
44

55
/**
6-
* Defines an interface for reacting to field storage definition creation, deletion, and updates.
6+
* Interface for field storage definition create, delete and update operations.
77
*/
88
interface FieldStorageDefinitionListenerInterface {
99

lib/Drupal/Core/Field/WidgetBase.php

+1
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ public static function setWidgetState(array $parents, $field_name, FormStateInte
625625
*/
626626
protected static function getWidgetStateParents(array $parents, $field_name) {
627627
// Field processing data is placed at
628+
// phpcs:ignore Drupal.Files.LineLength
628629
// $form_state->get(['field_storage', '#parents', ...$parents..., '#fields', $field_name]),
629630
// to avoid clashes between field names and $parents parts.
630631
return array_merge(['field_storage', '#parents'], $parents, ['#fields', $field_name]);

lib/Drupal/Core/Form/FormState.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class FormState implements FormStateInterface {
383383
protected $has_file_element;
384384

385385
/**
386-
* Contains references to details elements to render them within vertical tabs.
386+
* The references to details elements to render them within vertical tabs.
387387
*
388388
* This property is uncacheable.
389389
*

lib/Drupal/Core/Language/LanguageInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface LanguageInterface {
3636
* Should be used when we explicitly know that the data referred has no
3737
* linguistic content.
3838
*
39-
* See https://www.w3.org/International/questions/qa-no-language#nonlinguistic.
39+
* @see https://www.w3.org/International/questions/qa-no-language#nonlinguistic
4040
*/
4141
const LANGCODE_NOT_APPLICABLE = 'zxx';
4242

lib/Drupal/Core/Routing/UrlGenerator.php

+17-6
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,24 @@ protected function doGenerate(array $variables, array $defaults, array $tokens,
196196
// variables up to the start of the path must be supplied to there is no
197197
// gap.
198198
$optional = TRUE;
199-
// Structure of $tokens from the compiled route:
200-
// If the path is /admin/config/user-interface/shortcut/manage/{shortcut_set}/add-link-inline
201-
// [ [ 0 => 'text', 1 => '/add-link-inline' ], [ 0 => 'variable', 1 => '/', 2 => '[^/]++', 3 => 'shortcut_set' ], [ 0 => 'text', 1 => '/admin/config/user-interface/shortcut/manage' ] ]
199+
// The structure of the tokens array varies according to the compiled route.
200+
// Examples:
201+
// @code
202+
// [
203+
// [0 => 'text', 1 => '/add-link-inline'],
204+
// [0 => 'variable', 1 => '/', 2 => '[^/]++', 3 => 'shortcut_set'],
205+
// [0 => 'text', 1 => '/admin/config/user-interface/shortcut/manage'],
206+
// ]
207+
// @endcode
208+
// This is the structure for the "shortcut.link_add_inline" route.
202209
//
203-
// For a simple fixed path, there is just one token.
204-
// If the path is /admin/config
205-
// [ [ 0 => 'text', 1 => '/admin/config' ] ]
210+
// @code
211+
// [
212+
// [ 0 => 'text', 1 => '/admin/config' ]
213+
// ]
214+
// @endcode
215+
// This is the structure for a simple fixed path, "/admin/config:. there is
216+
// just one token.
206217
foreach ($tokens as $token) {
207218
if ('variable' === $token[0]) {
208219
if (!$optional || !array_key_exists($token[3], $defaults) || (isset($mergedParams[$token[3]]) && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]])) {

0 commit comments

Comments
 (0)