diff --git a/core/lib/Drupal/Component/Diff/Engine/HWLDFWordAccumulator.php b/core/lib/Drupal/Component/Diff/Engine/HWLDFWordAccumulator.php
index 0a55d10..685a03e 100644
--- a/core/lib/Drupal/Component/Diff/Engine/HWLDFWordAccumulator.php
+++ b/core/lib/Drupal/Component/Diff/Engine/HWLDFWordAccumulator.php
@@ -47,7 +47,7 @@ protected function _flushLine($new_tag) {
array_push($this->lines, $this->line);
}
else {
- // Make empty lines visible by inserting an NBSP
+ // Make empty lines visible by inserting an NBSP.
array_push($this->lines, $this::NBSP);
}
$this->line = '';
diff --git a/core/lib/Drupal/Core/Database/StatementInterface.php b/core/lib/Drupal/Core/Database/StatementInterface.php
index c87df6c..ce70994 100644
--- a/core/lib/Drupal/Core/Database/StatementInterface.php
+++ b/core/lib/Drupal/Core/Database/StatementInterface.php
@@ -36,8 +36,11 @@
* complaining about "the access type must not be public" if it is public, and
* "the access type must be omitted" if it is protected; i.e., conflicting
* statements). The access type has to be protected.
+ *
+ * @todo Move out of interface in https://www.drupal.org/node/2168241
+ *
+ * protected function __construct(Connection $dbh);
*/
- //Protected function __construct(Connection $dbh);
/**
* Executes a prepared statement
diff --git a/core/lib/Drupal/Core/FileTransfer/FTPExtension.php b/core/lib/Drupal/Core/FileTransfer/FTPExtension.php
index 40dc895..e117bae 100644
--- a/core/lib/Drupal/Core/FileTransfer/FTPExtension.php
+++ b/core/lib/Drupal/Core/FileTransfer/FTPExtension.php
@@ -108,7 +108,7 @@ function chmodJailed($path, $mode, $recursive) {
if ($this->isDirectory($path) && $recursive) {
$filelist = @ftp_nlist($this->connection, $path);
if (!$filelist) {
- //Empty directory - returns false
+ // Empty directory - returns FALSE.
return;
}
foreach ($filelist as $file) {
diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php
index 51ac663..30ef31b 100644
--- a/core/lib/Drupal/Core/Routing/UrlGenerator.php
+++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php
@@ -166,7 +166,7 @@ protected function doGenerate(array $variables, array $defaults, array $tokens,
$variables = array_flip($variables);
$mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters);
- // All params must be given
+ // All params must be given.
if ($diff = array_diff_key($variables, $mergedParams)) {
throw new MissingMandatoryParametersException(sprintf('Some mandatory parameters are missing ("%s") to generate a URL for route "%s".', implode('", "', array_keys($diff)), $name));
}
@@ -187,7 +187,7 @@ protected function doGenerate(array $variables, array $defaults, array $tokens,
foreach ($tokens as $token) {
if ('variable' === $token[0]) {
if (!$optional || !array_key_exists($token[3], $defaults) || (isset($mergedParams[$token[3]]) && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]])) {
- // Check requirement
+ // Check requirement.
if (!preg_match('#^' . $token[2] . '$#', $mergedParams[$token[3]])) {
$message = sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given) to generate a corresponding URL.', $token[3], $name, $token[2], $mergedParams[$token[3]]);
throw new InvalidParameterException($message);
diff --git a/core/lib/Drupal/Core/StreamWrapper/LocalStream.php b/core/lib/Drupal/Core/StreamWrapper/LocalStream.php
index 98daeb1..2425aea 100644
--- a/core/lib/Drupal/Core/StreamWrapper/LocalStream.php
+++ b/core/lib/Drupal/Core/StreamWrapper/LocalStream.php
@@ -242,8 +242,8 @@ public function stream_eof() {
* {@inheritdoc}
*/
public function stream_seek($offset, $whence = SEEK_SET) {
- // Fseek returns 0 on success and -1 on a failure.
- // stream_seek 1 on success and 0 on a failure.
+ // The fseek() returns 0 on success and -1 on a failure.
+ // The stream_seek() 1 on success and 0 on a failure.
return !fseek($this->handle, $offset, $whence);
}
diff --git a/core/lib/Drupal/Core/Theme/ThemeInitialization.php b/core/lib/Drupal/Core/Theme/ThemeInitialization.php
index a307cea..b829ebe 100644
--- a/core/lib/Drupal/Core/Theme/ThemeInitialization.php
+++ b/core/lib/Drupal/Core/Theme/ThemeInitialization.php
@@ -140,7 +140,7 @@ public function loadActiveTheme(ActiveTheme $active_theme) {
}
}
else {
- // Include non-engine theme files
+ // Include non-engine theme files.
foreach ($active_theme->getBaseThemes() as $base) {
// Include the theme file or the engine.
if ($base->getOwner()) {
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index b5aebbf..ad2f745 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -681,7 +681,7 @@ function _color_shift($given, $ref1, $ref2, $target) {
// We assume that ref2 is a blend of ref1 and target and find
// delta based on the length of the difference vectors.
- // Delta = 1 - |ref2 - ref1| / |white - ref1|
+ // Calculates delta = 1 - |ref2 - ref1| / |white - ref1|.
$target = _color_unpack($target, TRUE);
$ref1 = _color_unpack($ref1, TRUE);
$ref2 = _color_unpack($ref2, TRUE);
diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
index 40684ab..71c8e11 100644
--- a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
+++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
@@ -22,7 +22,7 @@ public function query() {
// last_comment_name only contains data if the user is anonymous. So we
// have to join in a specially related user table.
$this->ensureMyTable();
- // Join 'users' to this table via vid
+ // Join 'users' to this table via 'uid' column.
$definition = array(
'table' => 'users_field_data',
'field' => 'uid',
diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php
index f223196..c2efc17 100644
--- a/core/modules/field/src/Tests/FormTest.php
+++ b/core/modules/field/src/Tests/FormTest.php
@@ -230,14 +230,6 @@ function testFieldFormSingleRequired() {
$this->assertRaw(t('@name field is required.', array('@name' => $this->field['label'])), 'Required field with no value fails validation');
}
-// Function testFieldFormMultiple() {
-// $this->field = $this->field_multiple;
-// $field_name = $this->field['field_name'];
-// $this->instance['field_name'] = $field_name;
-// FieldStorageConfig::create($this->field)->save();
-// FieldConfig::create($this->instance)->save();
-// }
-
function testFieldFormUnlimited() {
$field_storage = $this->fieldStorageUnlimited;
$field_name = $field_storage['field_name'];
diff --git a/core/modules/file/src/Plugin/migrate/source/d7/File.php b/core/modules/file/src/Plugin/migrate/source/d7/File.php
index df6943b..a0d0623 100644
--- a/core/modules/file/src/Plugin/migrate/source/d7/File.php
+++ b/core/modules/file/src/Plugin/migrate/source/d7/File.php
@@ -53,7 +53,6 @@ public function query() {
}
$schemes = array_map([$this->getDatabase(), 'escapeLike'], $schemes);
- // Uri LIKE 'public://%' OR uri LIKE 'private://%'
$conditions = new Condition('OR');
foreach ($schemes as $scheme) {
$conditions->condition('uri', $scheme . '%', 'LIKE');
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 6da6b14..b7f4c0a 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -496,8 +496,8 @@ function _filter_url($text, $filter) {
$valid_url_query_chars = '[a-zA-Z0-9!?\*\'@\(\);:&=\+\$\/%#\[\]\-_\.,~|]';
$valid_url_query_ending_chars = '[a-zA-Z0-9_&=#\/]';
- //Full path
- //and allow @ in a url, but only in the middle. Catch things like http://example.com/@user/
+ // Allow @ in a URL but only in the middle.
+ // Catch things like http://example.com/@user/.
$valid_url_path = '(?:(?:' . $valid_url_path_characters . '*(?:' . $valid_url_balanced_parens . $valid_url_path_characters . '*)*' . $valid_url_ending_characters . ')|(?:@' . $valid_url_path_characters . '+\/))';
// Prepare domain name pattern.
@@ -729,20 +729,28 @@ function _filter_autop($text) {
}
}
elseif (!$ignore) {
- $chunk = preg_replace('|\n*$|', '', $chunk) . "\n\n"; // Just to make things a little easier, pad the end
+ // Just to make things a little easier, pad the end.
+ $chunk = preg_replace('|\n*$|', '', $chunk) . "\n\n";
$chunk = preg_replace('|
\s*
|', "\n\n", $chunk);
- $chunk = preg_replace('!(<' . $block . '[^>]*>)!', "\n$1", $chunk); // Space things out a little
- $chunk = preg_replace('!(' . $block . '>)!', "$1\n\n", $chunk); // Space things out a little
- $chunk = preg_replace("/\n\n+/", "\n\n", $chunk); // take care of duplicates
+ // Space things out a little.
+ $chunk = preg_replace('!(<' . $block . '[^>]*>)!', "\n$1", $chunk);
+ $chunk = preg_replace('!(' . $block . '>)!', "$1\n\n", $chunk);
+ // Take care of duplicates.
+ $chunk = preg_replace("/\n\n+/", "\n\n", $chunk);
$chunk = preg_replace('/^\n|\n\s*\n$/', '', $chunk);
- $chunk = '
' . preg_replace('/\n\s*\n\n?(.)/', "
\n$1", $chunk) . "
\n"; // Make paragraphs, including one at the end
- $chunk = preg_replace("|(
|", "$1", $chunk); // problem with nested lists
+ // Make paragraphs, including one at the end.
+ $chunk = '' . preg_replace('/\n\s*\n\n?(.)/', "
\n$1", $chunk) . "
\n";
+ // Fix problem with nested lists.
+ $chunk = preg_replace("|(
|", "$1", $chunk);
$chunk = preg_replace('|]*)>|i', "", $chunk);
$chunk = str_replace('
', '
', $chunk);
- $chunk = preg_replace('|\s*
\n?|', '', $chunk); // Under certain strange conditions it could create a P of entirely whitespace
+ // Under certain strange conditions it could create a P of entirely
+ // whitespace.
+ $chunk = preg_replace('|\s*
\n?|', '', $chunk);
$chunk = preg_replace('!\s*(?' . $block . '[^>]*>)!', "$1", $chunk);
$chunk = preg_replace('!(?' . $block . '[^>]*>)\s*
!', "$1", $chunk);
- $chunk = preg_replace('|(?)\s*\n|', "
\n", $chunk); // Make line breaks
+ // Make line breaks.
+ $chunk = preg_replace('|(?)\s*\n|', "
\n", $chunk);
$chunk = preg_replace('!(?' . $block . '[^>]*>)\s*
!', "$1", $chunk);
$chunk = preg_replace('!
(\s*?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $chunk);
$chunk = preg_replace('/&([^#])(?![A-Za-z0-9]{1,8};)/', '&$1', $chunk);
diff --git a/core/modules/node/node.views_execution.inc b/core/modules/node/node.views_execution.inc
index 26a612a..8132660 100644
--- a/core/modules/node/node.views_execution.inc
+++ b/core/modules/node/node.views_execution.inc
@@ -30,7 +30,7 @@ function node_views_analyze(ViewExecutable $view) {
if ($view->storage->get('base_table') == 'node') {
foreach ($view->displayHandlers as $display) {
if (!$display->isDefaulted('access') || !$display->isDefaulted('filters')) {
- // Check for no access control
+ // Check for no access control.
$access = $display->getOption('access');
if (empty($access['type']) || $access['type'] == 'none') {
$anonymous_role = Role::load(RoleInterface::ANONYMOUS_ID);
diff --git a/core/modules/node/src/Plugin/migrate/source/d6/Node.php b/core/modules/node/src/Plugin/migrate/source/d6/Node.php
index bad2510..6aacca3 100644
--- a/core/modules/node/src/Plugin/migrate/source/d6/Node.php
+++ b/core/modules/node/src/Plugin/migrate/source/d6/Node.php
@@ -111,7 +111,7 @@ public function fields() {
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
- // Format = 0 can happen when the body field is hidden. Set the format to 1
+ // The format can be 0 when the body field is hidden. Set the format to 1
// to avoid migration map issues (since the body field isn't used anyway).
if ($row->getSourceProperty('format') === '0') {
$row->setSourceProperty('format', $this->filterDefaultFormat);
diff --git a/core/modules/page_cache/src/StackMiddleware/PageCache.php b/core/modules/page_cache/src/StackMiddleware/PageCache.php
index 2a99e22..0121237 100644
--- a/core/modules/page_cache/src/StackMiddleware/PageCache.php
+++ b/core/modules/page_cache/src/StackMiddleware/PageCache.php
@@ -159,8 +159,10 @@ protected function lookup(Request $request, $type = self::MASTER_REQUEST, $catch
$if_none_match = $request->server->has('HTTP_IF_NONE_MATCH') ? stripslashes($request->server->get('HTTP_IF_NONE_MATCH')) : FALSE;
if ($if_modified_since && $if_none_match
- && $if_none_match == $response->getEtag() // Etag must match
- && $if_modified_since == $last_modified->getTimestamp()) { // if-modified-since must match
+ // Response etag must match.
+ && $if_none_match == $response->getEtag()
+ // Server if-modified-since must match.
+ && $if_modified_since == $last_modified->getTimestamp())
$response->setStatusCode(304);
$response->setContent(NULL);
diff --git a/core/modules/path/src/Tests/PathAliasTest.php b/core/modules/path/src/Tests/PathAliasTest.php
index 70c60ec..c836ccf 100644
--- a/core/modules/path/src/Tests/PathAliasTest.php
+++ b/core/modules/path/src/Tests/PathAliasTest.php
@@ -125,7 +125,7 @@ function testAdminAlias() {
// Set alias to second test node.
$edit['source'] = '/node/' . $node2->id();
- // Leave $edit['alias'] the same
+ // Leave $edit['alias'] the same.
$this->drupalPostForm('admin/config/search/path/add', $edit, t('Save'));
// Confirm no duplicate was created.
diff --git a/core/modules/rest/src/Tests/NodeTest.php b/core/modules/rest/src/Tests/NodeTest.php
index e06fa27..309a765 100644
--- a/core/modules/rest/src/Tests/NodeTest.php
+++ b/core/modules/rest/src/Tests/NodeTest.php
@@ -187,7 +187,6 @@ public function testMissingBundle() {
'title' => [['value' => $this->randomString() ]],
];
- // Testing
$this->postNode($data);
// Make sure the response is "Bad Request".
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index d0d5f6e..85afe38 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -295,8 +295,8 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun
$old_cwd = getcwd();
chdir(\Drupal::root() . "/core");
- // Exec in a subshell so that the environment is isolated when running tests
- // via the simpletest UI.
+ // Execute in a subshell so that the environment is isolated when running
+ // tests via the simpletest UI.
$ret = exec(join($command, " "), $output, $status);
chdir($old_cwd);
diff --git a/core/modules/system/src/Tests/Common/SizeUnitTest.php b/core/modules/system/src/Tests/Common/SizeUnitTest.php
index c006230..47cafdc 100644
--- a/core/modules/system/src/Tests/Common/SizeUnitTest.php
+++ b/core/modules/system/src/Tests/Common/SizeUnitTest.php
@@ -31,10 +31,14 @@ protected function setUp() {
);
$this->roundedTestCases = array(
'2 bytes' => 2,
- '1 MB' => ($kb * $kb) - 1, // Rounded to 1 MB (not 1000 or 1024 kilobyte!)
- round(3623651 / ($this->exactTestCases['1 MB']), 2) . ' MB' => 3623651, // megabytes
- round(67234178751368124 / ($this->exactTestCases['1 PB']), 2) . ' PB' => 67234178751368124, // petabytes
- round(235346823821125814962843827 / ($this->exactTestCases['1 YB']), 2) . ' YB' => 235346823821125814962843827, // yottabytes
+ // Rounded to 1 MB (not 1000 or 1024 kilobyte!).
+ '1 MB' => ($kb * $kb) - 1,
+ // Megabytes.
+ round(3623651 / ($this->exactTestCases['1 MB']), 2) . ' MB' => 3623651,
+ // Petabytes.
+ round(67234178751368124 / ($this->exactTestCases['1 PB']), 2) . ' PB' => 67234178751368124,
+ // Yottabytes.
+ round(235346823821125814962843827 / ($this->exactTestCases['1 YB']), 2) . ' YB' => 235346823821125814962843827,
);
}
diff --git a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php b/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
index 1974a79..fd32a12 100644
--- a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
+++ b/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
@@ -21,8 +21,7 @@ function testTableSortQuery() {
array('field' => t('Task ID'), 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'),
array('field' => t('Task'), 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'),
array('field' => t('Task'), 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'),
- // More elements here
-
+ // More elements here.
);
foreach ($sorts as $sort) {
@@ -49,8 +48,7 @@ function testTableSortQueryFirst() {
array('field' => t('Task ID'), 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'),
array('field' => t('Task'), 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'),
array('field' => t('Task'), 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'),
- // More elements here
-
+ // More elements here.
);
foreach ($sorts as $sort) {
diff --git a/core/modules/system/src/Tests/FileTransfer/FileTransferTest.php b/core/modules/system/src/Tests/FileTransfer/FileTransferTest.php
index d60c506..d1b9874 100644
--- a/core/modules/system/src/Tests/FileTransfer/FileTransferTest.php
+++ b/core/modules/system/src/Tests/FileTransfer/FileTransferTest.php
@@ -60,7 +60,7 @@ function _writeDirectory($base, $files = array()) {
$this->_writeDirectory($base . DIRECTORY_SEPARATOR . $key, $file);
}
else {
- //Just write the filename into the file
+ // Just write the filename into the file.
file_put_contents($base . DIRECTORY_SEPARATOR . $file, $file);
}
}
diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php
index 23c6e3b..5d78622 100644
--- a/core/modules/system/src/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeTest.php
@@ -70,8 +70,8 @@ function testThemeDataTypes() {
}
}
- // Suggestionnotimplemented is not an implemented theme hook so \Drupal::theme() service
- // should return FALSE instead of a string.
+ // The 'suggestionnotimplemented' is not an implemented theme hook so
+ // \Drupal::theme() service should return FALSE instead of a string.
$output = \Drupal::theme()->render(array('suggestionnotimplemented'), array());
$this->assertIdentical($output, FALSE, '\Drupal::theme() returns FALSE when a hook suggestion is not implemented.');
}
diff --git a/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php b/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php
index 7af3ba0..6bec099 100644
--- a/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php
+++ b/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php
@@ -15,7 +15,8 @@ public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives[$key] = $base_plugin_definition;
$this->derivatives[$key]['title'] = $title;
$this->derivatives[$key]['route_parameters'] = array('placeholder' => $key);
- $this->derivatives[$key]['weight'] = $weight++; // Ensure weights for testing.
+ // Ensure weights for testing.
+ $this->derivatives[$key]['weight'] = $weight++;
}
return $this->derivatives;
}
diff --git a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
index 8a51961..9821480 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
@@ -200,7 +200,7 @@ public function getArgument() {
}
if (!empty($this->options['limit'])) {
$tids = array();
- // Filter by vocabulary
+ // Filter by vocabulary.
foreach ($taxonomy as $tid => $vocab) {
if (!empty($this->options['vids'][$vocab])) {
$tids[] = $tid;
diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
index 3d4e0df..88f1217 100644
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -356,7 +356,7 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
}
public function adminSummary() {
- // Set up $this->valueOptions for the parent summary
+ // Set up $this->valueOptions for the parent summary.
$this->valueOptions = array();
if ($this->value) {
diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
index a2680af..8db64e4 100644
--- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
+++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
@@ -140,7 +140,7 @@ public function query() {
$join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $def);
- // Use a short alias for this:
+ // Use a short alias for table.
$alias = $def['table'] . '_' . $this->table;
$this->alias = $this->query->addRelationship($alias, $join, 'taxonomy_term_field_data', $this->relationship);
diff --git a/core/modules/taxonomy/src/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php
index 9fd1516..ef0f5ef 100644
--- a/core/modules/taxonomy/src/TermViewsData.php
+++ b/core/modules/taxonomy/src/TermViewsData.php
@@ -137,12 +137,12 @@ public function getViewsData() {
$data['taxonomy_index']['table']['join'] = array(
'taxonomy_term_field_data' => array(
- // Links directly to taxonomy_term_field_data via tid
+ // Links directly to 'taxonomy_term_field_data' via 'tid' column.
'left_field' => 'tid',
'field' => 'tid',
),
'node_field_data' => array(
- // Links directly to node via nid
+ // Links directly to 'node_field_data' via 'nid' column.
'left_field' => 'nid',
'field' => 'nid',
),
diff --git a/core/modules/user/src/Plugin/views/argument_validator/User.php b/core/modules/user/src/Plugin/views/argument_validator/User.php
index 5896fb7..a5176b1 100644
--- a/core/modules/user/src/Plugin/views/argument_validator/User.php
+++ b/core/modules/user/src/Plugin/views/argument_validator/User.php
@@ -75,7 +75,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
* {@inheritdoc}
*/
public function submitOptionsForm(&$form, FormStateInterface $form_state, &$options = array()) {
- // Filter trash out of the options so we don't store giant unnecessary arrays
+ // Filter out empty options so we don't store giant unnecessary arrays.
$options['roles'] = array_filter($options['roles']);
}
diff --git a/core/modules/user/src/Plugin/views/filter/Name.php b/core/modules/user/src/Plugin/views/filter/Name.php
index 598150d..93d9a73 100644
--- a/core/modules/user/src/Plugin/views/filter/Name.php
+++ b/core/modules/user/src/Plugin/views/filter/Name.php
@@ -104,7 +104,7 @@ public function getValueOptions() {
}
public function adminSummary() {
- // Set up $this->valueOptions for the parent summary
+ // Set up $this->valueOptions for the parent summary.
$this->valueOptions = array();
if ($this->value) {
diff --git a/core/modules/user/tests/src/Kernel/UserValidationTest.php b/core/modules/user/tests/src/Kernel/UserValidationTest.php
index 387e381..692e0f5 100644
--- a/core/modules/user/tests/src/Kernel/UserValidationTest.php
+++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php
@@ -40,22 +40,27 @@ protected function setUp() {
* Tests user name validation.
*/
function testUsernames() {
- $test_cases = array( // '' => array('', 'assert'),
+ // Format '' => array('', 'assert').
+ $test_cases = array(
'foo' => array('Valid username', 'assertNull'),
'FOO' => array('Valid username', 'assertNull'),
'Foo O\'Bar' => array('Valid username', 'assertNull'),
'foo@bar' => array('Valid username', 'assertNull'),
'foo@example.com' => array('Valid username', 'assertNull'),
- 'foo@-example.com' => array('Valid username', 'assertNull'), // Invalid domains are allowed in usernames
+ // Invalid domains are allowed in usernames.
+ 'foo@-example.com' => array('Valid username', 'assertNull'),
'þòøÇߪř€' => array('Valid username', 'assertNull'),
- 'ᚠᛇᚻ᛫ᛒᛦᚦ' => array('Valid UTF8 username', 'assertNull'), // Runes
+ // Runes.
+ 'ᚠᛇᚻ᛫ᛒᛦᚦ' => array('Valid UTF8 username', 'assertNull'),
' foo' => array('Invalid username that starts with a space', 'assertNotNull'),
'foo ' => array('Invalid username that ends with a space', 'assertNotNull'),
'foo bar' => array('Invalid username that contains 2 spaces \' \'', 'assertNotNull'),
'' => array('Invalid empty username', 'assertNotNull'),
'foo/' => array('Invalid username containing invalid chars', 'assertNotNull'),
- 'foo' . chr(0) . 'bar' => array('Invalid username containing chr(0)', 'assertNotNull'), // NULL
- 'foo' . chr(13) . 'bar' => array('Invalid username containing chr(13)', 'assertNotNull'), // CR
+ // Tests for NULL characters.
+ 'foo' . chr(0) . 'bar' => array('Invalid username containing chr(0)', 'assertNotNull'),
+ // Tests for CR characters.
+ 'foo' . chr(13) . 'bar' => array('Invalid username containing chr(13)', 'assertNotNull'),
str_repeat('x', USERNAME_MAX_LENGTH + 1) => array('Invalid excessively long username', 'assertNotNull'),
);
foreach ($test_cases as $name => $test_case) {
diff --git a/core/modules/views/src/ManyToOneHelper.php b/core/modules/views/src/ManyToOneHelper.php
index c4719c9..1bbb5c0 100644
--- a/core/modules/views/src/ManyToOneHelper.php
+++ b/core/modules/views/src/ManyToOneHelper.php
@@ -118,7 +118,6 @@ public function summaryJoin() {
$field = $this->handler->relationship . '_' . $this->handler->table . '.' . $this->handler->field;
$join = $this->getJoin();
- // Shortcuts
$options = $this->handler->options;
$view = $this->handler->view;
$query = $this->handler->query;
diff --git a/core/modules/views/src/Plugin/views/HandlerBase.php b/core/modules/views/src/Plugin/views/HandlerBase.php
index 23af236..921f165 100644
--- a/core/modules/views/src/Plugin/views/HandlerBase.php
+++ b/core/modules/views/src/Plugin/views/HandlerBase.php
@@ -734,7 +734,7 @@ public static function breakString($str, $force_int = FALSE) {
*/
public function displayExposedForm($form, FormStateInterface $form_state) {
$item = &$this->options;
- // Flip
+ // Flip value.
$item['exposed'] = empty($item['exposed']);
// If necessary, set new defaults:
diff --git a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
index 70d86e8..000c697 100644
--- a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
+++ b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
@@ -411,7 +411,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
$plugin->validateOptionsForm($form['argument_default'][$default_id], $form_state, $option_values['argument_default'][$default_id]);
}
- // Summary plugin
+ // Summary plugin.
$summary_id = $option_values['summary']['format'];
$plugin = $this->getPlugin('style', $summary_id);
if ($plugin) {
@@ -444,7 +444,7 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) {
$option_values['default_argument_options'] = $options;
}
- // Summary plugin
+ // Summary plugin.
$summary_id = $option_values['summary']['format'];
$plugin = $this->getPlugin('style', $summary_id);
if ($plugin) {
@@ -498,7 +498,8 @@ protected function defaultActions($which = NULL) {
'method' => 'defaultDefault',
'form method' => 'defaultArgumentForm',
'has default argument' => TRUE,
- 'default only' => TRUE, // This can only be used for missing argument, not validation failure
+ // This can only be used for missing argument, not validation failure.
+ 'default only' => TRUE,
),
'not found' => array(
'title' => $this->t('Hide view'),
@@ -669,7 +670,8 @@ public function defaultSummaryForm(&$form, FormStateInterface $form_state) {
'#suffix' => '',
'#id' => 'edit-options-summary-options-' . $id,
'#type' => 'item',
- '#input' => TRUE, // Trick it into checking input to make #process run
+ // Trick it into checking input to make #process run.
+ '#input' => TRUE,
'#states' => array(
'visible' => array(
':input[name="options[default_action]"]' => array('value' => 'summary'),
@@ -1102,8 +1104,7 @@ public function getPlugin($type = 'argument_default', $name = NULL) {
$name = $plugin_name;
}
- // We only fetch the options if we're fetching the plugin actually
- // in use.
+ // We only fetch the options if we're fetching the plugin actually in use.
if ($name == $plugin_name) {
$options = isset($this->options[$options_name]) ? $this->options[$options_name] : [];
}
diff --git a/core/modules/views/src/Plugin/views/argument/DayDate.php b/core/modules/views/src/Plugin/views/argument/DayDate.php
index ced2e8f..aa9369f 100644
--- a/core/modules/views/src/Plugin/views/argument/DayDate.php
+++ b/core/modules/views/src/Plugin/views/argument/DayDate.php
@@ -24,7 +24,7 @@ class DayDate extends Date {
*/
public function summaryName($data) {
$day = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
- // Strtotime respects server timezone, so we need to set the time fixed as utc time
+ // Set time fixed as UTC time because strtotime() respects server timezone.
return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
}
diff --git a/core/modules/views/src/Plugin/views/argument/ManyToOne.php b/core/modules/views/src/Plugin/views/argument/ManyToOne.php
index e2ff8ba..e3f67dd 100644
--- a/core/modules/views/src/Plugin/views/argument/ManyToOne.php
+++ b/core/modules/views/src/Plugin/views/argument/ManyToOne.php
@@ -61,7 +61,6 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
- // Allow + for or, , for and
$form['break_phrase'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Allow multiple values'),
diff --git a/core/modules/views/src/Plugin/views/argument/NumericArgument.php b/core/modules/views/src/Plugin/views/argument/NumericArgument.php
index f8fc56a..cdc490a 100644
--- a/core/modules/views/src/Plugin/views/argument/NumericArgument.php
+++ b/core/modules/views/src/Plugin/views/argument/NumericArgument.php
@@ -38,7 +38,6 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
- // Allow + for or, , for and
$form['break_phrase'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Allow multiple values'),
diff --git a/core/modules/views/src/Plugin/views/argument/StringArgument.php b/core/modules/views/src/Plugin/views/argument/StringArgument.php
index 5f5495b..f82405c 100644
--- a/core/modules/views/src/Plugin/views/argument/StringArgument.php
+++ b/core/modules/views/src/Plugin/views/argument/StringArgument.php
@@ -130,7 +130,6 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
}
- // Allow + for or, , for and
$form['break_phrase'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Allow multiple values'),
diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php
index 210873d..1aa1eba 100644
--- a/core/modules/views/src/Plugin/views/field/Date.php
+++ b/core/modules/views/src/Plugin/views/field/Date.php
@@ -143,7 +143,9 @@ public function render(ResultRow $values) {
if ($value) {
$timezone = !empty($this->options['timezone']) ? $this->options['timezone'] : NULL;
- $time_diff = REQUEST_TIME - $value; // Will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence)
+ // Will be positive for a datetime in the past (ago), and negative for a
+ // datetime in the future (hence).
+ $time_diff = REQUEST_TIME - $value;
switch ($format) {
case 'raw time ago':
return $this->dateFormatter->formatTimeDiffSince($value, array('granularity' => is_numeric($custom_format) ? $custom_format : 2));
diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index 8d527ee..8f9ca45 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -151,7 +151,7 @@ public function query() {
*/
protected function addAdditionalFields($fields = NULL) {
if (!isset($fields)) {
- // Notice check
+ // Notice check.
if (empty($this->additional_fields)) {
return;
}
diff --git a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
index 2d89ff7..e0f0f9d 100644
--- a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
@@ -41,7 +41,7 @@ class BooleanOperator extends FilterPluginBase {
*/
const NOT_EQUAL = '<>';
- // Exposed filter options
+ // Override default value.
protected $alwaysMultiple = TRUE;
// Don't display empty space where the operator would be.
public $no_operator = TRUE;
diff --git a/core/modules/views/src/Plugin/views/filter/Date.php b/core/modules/views/src/Plugin/views/filter/Date.php
index a8e4a90..11c5879 100644
--- a/core/modules/views/src/Plugin/views/filter/Date.php
+++ b/core/modules/views/src/Plugin/views/filter/Date.php
@@ -164,8 +164,10 @@ protected function opBetween($field) {
$b = intval(strtotime($this->value['max'], 0));
if ($this->value['type'] == 'offset') {
- $a = '***CURRENT_TIME***' . sprintf('%+d', $a); // Keep sign
- $b = '***CURRENT_TIME***' . sprintf('%+d', $b); // keep sign
+ // Keep sign.
+ $a = '***CURRENT_TIME***' . sprintf('%+d', $a);
+ // Keep sign.
+ $b = '***CURRENT_TIME***' . sprintf('%+d', $b);
}
// This is safe because we are manually scrubbing the values.
// It is necessary to do it this way because $a and $b are formulas when using an offset.
@@ -176,7 +178,8 @@ protected function opBetween($field) {
protected function opSimple($field) {
$value = intval(strtotime($this->value['value'], 0));
if (!empty($this->value['type']) && $this->value['type'] == 'offset') {
- $value = '***CURRENT_TIME***' . sprintf('%+d', $value); // Keep sign
+ // Keep sign.
+ $value = '***CURRENT_TIME***' . sprintf('%+d', $value);
}
// This is safe because we are manually scrubbing the value.
// It is necessary to do it this way because $value is a formula when using an offset.
diff --git a/core/modules/views/src/Plugin/views/filter/Equality.php b/core/modules/views/src/Plugin/views/filter/Equality.php
index 41ef1ba..bd6a7c2 100644
--- a/core/modules/views/src/Plugin/views/filter/Equality.php
+++ b/core/modules/views/src/Plugin/views/filter/Equality.php
@@ -13,7 +13,7 @@
*/
class Equality extends FilterPluginBase {
- // Exposed filter options
+ // Override default value.
protected $alwaysMultiple = TRUE;
/**
diff --git a/core/modules/views/src/Plugin/views/filter/InOperator.php b/core/modules/views/src/Plugin/views/filter/InOperator.php
index dcee317..04739cb 100644
--- a/core/modules/views/src/Plugin/views/filter/InOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/InOperator.php
@@ -88,7 +88,7 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
'#type' => 'checkbox',
'#title' => $this->t('Limit list to selected items'),
'#description' => $this->t('If checked, the only items presented to the user will be the ones selected here.'),
- '#default_value' => !empty($this->options['expose']['reduce']), // Safety
+ '#default_value' => !empty($this->options['expose']['reduce']),
);
}
diff --git a/core/modules/views/src/Plugin/views/filter/StringFilter.php b/core/modules/views/src/Plugin/views/filter/StringFilter.php
index 598f953..075a58e 100644
--- a/core/modules/views/src/Plugin/views/filter/StringFilter.php
+++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
@@ -14,7 +14,7 @@
*/
class StringFilter extends FilterPluginBase {
- // Exposed filter options
+ // Override default value.
protected $alwaysMultiple = TRUE;
protected function defineOptions() {
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 6f99c9a..67c233a 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -129,7 +129,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
'join' => NULL,
);
- // Init the tables with our primary table
+ // Init the tables with our primary table.
$this->tables[$base_table][$base_table] = array(
'count' => 1,
'alias' => $base_table,
@@ -488,7 +488,7 @@ protected function markTable($table, $relationship, $alias) {
* cannot be ensured.
*/
public function ensureTable($table, $relationship = NULL, JoinPluginBase $join = NULL) {
- // Ensure a relationship
+ // Ensure a relationship.
if (empty($relationship)) {
$relationship = $this->view->storage->get('base_table');
}
@@ -1722,7 +1722,7 @@ public function getDateField($field) {
public function setupTimezone() {
$timezone = drupal_get_user_timezone();
- // Set up the database timezone
+ // Set up the database timezone.
$db_type = Database::getConnection()->databaseType();
if (in_array($db_type, array('mysql', 'pgsql'))) {
$offset = '+00:00';
diff --git a/core/modules/views/src/Plugin/views/relationship/EntityReverse.php b/core/modules/views/src/Plugin/views/relationship/EntityReverse.php
index 21e62b4..098d45e 100644
--- a/core/modules/views/src/Plugin/views/relationship/EntityReverse.php
+++ b/core/modules/views/src/Plugin/views/relationship/EntityReverse.php
@@ -97,7 +97,7 @@ public function query() {
$second_join = $this->joinManager->createInstance($id, $second);
$second_join->adjusted = TRUE;
- // Use a short alias for this:
+ // Use a short alias for table.
$alias = $this->definition['field_name'] . '_' . $this->table;
$this->alias = $this->query->addRelationship($alias, $second_join, $this->definition['base'], $this->relationship);
diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
index 5b91c2f..517221f 100644
--- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
+++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
@@ -378,7 +378,7 @@ public function query() {
}
$join = Views::pluginManager('join')->createInstance($id, $def);
- // Use a short alias for this:
+ // Use a short alias for table.
$alias = $def['table'] . '_' . $this->table;
$this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship);
diff --git a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
index 9f62aa5..5edf3a1 100644
--- a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
+++ b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
@@ -153,7 +153,7 @@ public function query() {
}
$join = Views::pluginManager('join')->createInstance($id, $def);
- // Use a short alias for this:
+ // Use a short alias for table.
$alias = $def['table'] . '_' . $this->table;
$this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship);
diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php
index 19cb25e..2b6ecf7 100644
--- a/core/modules/views/src/Plugin/views/style/Table.php
+++ b/core/modules/views/src/Plugin/views/style/Table.php
@@ -317,7 +317,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#return_value' => $field,
'#parents' => array('style_options', 'default'),
'#id' => $radio_id,
- // Because 'radio' doesn't fully support '#id' =(
+ // Because 'radio' doesn't fully support '#id'.
'#attributes' => array('id' => $radio_id),
'#default_value' => $default,
'#states' => array(
@@ -380,7 +380,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
- // Markup for the field name
+ // Markup for the field name.
$form['info'][$field]['name'] = array(
'#markup' => $field_names[$field],
);
diff --git a/core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php b/core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php
index 0dc8aef..fcd706a 100644
--- a/core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php
+++ b/core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php
@@ -125,11 +125,6 @@ public function testArgumentDefaultFixed() {
}
/**
- * @todo Test php default argument.
- */
- //Function testArgumentDefaultPhp() {}
-
- /**
* Test node default argument.
*/
public function testArgumentDefaultNode() {
diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php
index f3c7f63..3c2c736 100644
--- a/core/modules/views/src/ViewExecutable.php
+++ b/core/modules/views/src/ViewExecutable.php
@@ -680,7 +680,7 @@ public function getExposedInput() {
$this->initDisplay();
$this->exposed_input = \Drupal::request()->query->all();
- // Unset items that are definitely not our input:
+ // Unset items that are definitely not our input.
foreach (array('page', 'q') as $key) {
if (isset($this->exposed_input[$key])) {
unset($this->exposed_input[$key]);
diff --git a/core/modules/views/src/Views.php b/core/modules/views/src/Views.php
index 8b706f7..c4612a7 100644
--- a/core/modules/views/src/Views.php
+++ b/core/modules/views/src/Views.php
@@ -425,7 +425,6 @@ public static function getHandlerTypes() {
if (!isset(static::$handlerTypes)) {
static::$handlerTypes = array(
'field' => array(
- // Title
'title' => static::t('Fields'),
// Lowercase title for mid-sentence.
'ltitle' => static::t('fields'),
diff --git a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
index 7139b91..27ee79f 100644
--- a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
@@ -292,7 +292,7 @@ public function testVariousTableUpdates() {
// base <-> base + revision
// base <-> base + translation + revision
- // Base <-> base + translation
+ // The base <-> base + translation.
$this->updateEntityTypeToTranslatable();
$this->entityDefinitionUpdateManager->applyUpdates();
list($view, $display) = $this->getUpdatedViewAndDisplay();
@@ -311,7 +311,7 @@ public function testVariousTableUpdates() {
$this->resetEntityType();
- // Base + translation <-> base + translation + revision
+ // The base + translation <-> base + translation + revision.
$this->updateEntityTypeToTranslatable();
$this->entityDefinitionUpdateManager->applyUpdates();
list($view, $display) = $this->getUpdatedViewAndDisplay();
@@ -338,7 +338,7 @@ public function testVariousTableUpdates() {
$this->resetEntityType();
- // Base + revision <-> base + translation + revision
+ // The base + revision <-> base + translation + revision.
$this->updateEntityTypeToRevisionable();
list($view, $display) = $this->getUpdatedViewAndDisplay();
@@ -364,7 +364,7 @@ public function testVariousTableUpdates() {
$this->resetEntityType();
- // Base <-> base + revision
+ // The base <-> base + revision.
$this->updateEntityTypeToRevisionable();
$this->entityDefinitionUpdateManager->applyUpdates();
list($view, $display) = $this->getUpdatedViewAndDisplay();
@@ -383,7 +383,7 @@ public function testVariousTableUpdates() {
$this->resetEntityType();
- // Base <-> base + translation + revision
+ // The base <-> base + translation + revision.
$this->updateEntityTypeToRevisionable();
$this->updateEntityTypeToTranslatable();
$this->entityDefinitionUpdateManager->applyUpdates();
@@ -407,7 +407,7 @@ public function testVariousTableUpdates() {
* Tests some possible entity table updates for a revision view.
*/
public function testVariousTableUpdatesForRevisionView() {
- // Base + revision <-> base + translation + revision
+ // The base + revision <-> base + translation + revision.
$this->updateEntityTypeToRevisionable();
// Multiple changes, so we have to invalidate the caches, otherwise
// the second update will revert the first.
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php
index 1ef035a..1f7e71c 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php
@@ -35,7 +35,7 @@ public function testAreaText() {
$view = Views::getView('test_view');
$view->setDisplay();
- // Add a text header
+ // Add a text header.
$string = $this->randomMachineName();
$view->displayHandlers->get('default')->overrideOption('header', array(
'area' => array(
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
index 1bd99e7..78e61f7 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
@@ -123,7 +123,7 @@ public function testFilterNumericBetween() {
);
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
- // Test not between
+ // Test not between.
$view->destroy();
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
index 6c78ad7..374cd69 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@@ -333,12 +333,12 @@ public function providerTestRenderAsLinkWithPathAndOptions() {
// Entity flag.
$entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
$data[] = ['test-path', ['entity' => $entity], 'value'];
- // entity_type flag.
+ // Entity type flag.
$entity_type_id = 'node';
$data[] = ['test-path', ['entity_type' => $entity_type_id], 'value'];
- // Prefix
+ // Prefix.
$data[] = ['test-path', ['prefix' => 'test_prefix'], 'value', 'test_prefixvalue'];
- // suffix.
+ // Suffix.
$data[] = ['test-path', ['suffix' => 'test_suffix'], 'value', 'valuetest_suffix'];
// External URL.
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index a237101..e299477 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -90,7 +90,7 @@ function template_preprocess_views_view_fields(&$variables) {
// Loop through the fields for this view.
$previous_inline = FALSE;
- $variables['fields'] = array(); // Ensure it's at least an empty array.
+ $variables['fields'] = array();
/** @var \Drupal\views\ResultRow $row */
$row = $variables['row'];
foreach ($view->field as $id => $field) {
@@ -123,7 +123,8 @@ function template_preprocess_views_view_fields(&$variables) {
$object->raw = $row->{$view->field[$id]->field_alias};
}
else {
- $object->raw = NULL; // Make sure it exists to reduce NOTICE
+ // Make sure it exists to prevent notices.
+ $object->raw = NULL;
}
if (!empty($variables['options']['separator']) && $previous_inline && $object->inline && $object->content) {
diff --git a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
index 8d80ab6..f97aaad 100644
--- a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
+++ b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
@@ -119,7 +119,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
),
);
- $form['remove_groups'][$id] = array(); // To prevent a notice
+ $form['remove_groups'][$id] = array(); // To prevent a notice.
if ($id != 1) {
$form['remove_groups'][$id] = array(
'#type' => 'submit',
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index 54980f7..a801f4b 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -147,7 +147,8 @@ public function getForm(ViewEntityInterface $view, $display_id, $js) {
$response = $this->ajaxFormWrapper($form_class, $form_state);
}
elseif (!$form_state->get('ajax')) {
- // If nothing on the stack, non-js forms just go back to the main view editor.
+ // If nothing on the stack, non-js forms just go back to the main view
+ // editor.
$display_id = $form_state->get('display_id');
return new RedirectResponse($this->url('entity.view.edit_display_form', ['view' => $view->id(), 'display_id' => $display_id], ['absolute' => TRUE]));
}
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 3c22661..01df7ec 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -457,7 +457,7 @@ public function submitItemAdd($form, FormStateInterface $form_state) {
}
$id = $this->getExecutable()->addHandler($display_id, $type, $table, $field);
- // Check to see if we have group by settings
+ // Check to see if we have group by settings.
$key = $type;
// Footer,header and empty text have a different internal handler type(area).
if (isset($types[$type]['type'])) {
@@ -472,7 +472,8 @@ public function submitItemAdd($form, FormStateInterface $form_state) {
$this->addFormToStack('handler-group', $display_id, $type, $id);
}
- // Check to see if this type has settings, if so add the settings form first
+ // Check to see if this type has settings, if so add the settings form
+ // first.
if ($handler && $handler->hasExtraOptions()) {
$this->addFormToStack('handler-extra', $display_id, $type, $id);
}
diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module
index 0c9bec7..cf1249c 100644
--- a/core/modules/views_ui/views_ui.module
+++ b/core/modules/views_ui/views_ui.module
@@ -62,7 +62,7 @@ function views_ui_entity_type_build(array &$entity_types) {
*/
function views_ui_theme() {
return array(
- // Edit a view
+ // Edit a view.
'views_ui_display_tab_setting' => array(
'variables' => array('description' => '', 'link' => '', 'settings_links' => array(), 'overridden' => FALSE, 'defaulted' => FALSE, 'description_separator' => TRUE, 'class' => array()),
'file' => 'views_ui.theme.inc',
@@ -80,7 +80,7 @@ function views_ui_theme() {
'file' => 'views_ui.theme.inc',
),
- // List views
+ // List views.
'views_ui_view_info' => array(
'variables' => array('view' => NULL, 'displays' => NULL),
'file' => 'views_ui.theme.inc',
diff --git a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.module b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.module
index 9e6b211..11220fc 100644
--- a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.module
+++ b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.module
@@ -5,5 +5,5 @@
* Test module.
*/
-// Return an array to test nested merge in invoke all.
+// Returns an array to test nested merge in invoke all.
function module_handler_test_all1_hook($arg) { return array($arg); }
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
index 2e82d57..c59fbca 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
@@ -66,7 +66,6 @@ protected function getLocalTaskManager($module_dirs, $route_name, $route_params)
$property->setAccessible(TRUE);
$property->setValue($manager, $controllerResolver);
- // Todo mock a request with a route.
$request_stack = new RequestStack();
$property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'requestStack');
$property->setAccessible(TRUE);