3063856-11.x
3 open threads
3 open threads
Closes #3063856
Merge request reports
Activity
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
added 540 commits
-
d1b72f29...a6aabb7f - 532 commits from branch
project:11.x
- 18e5e6cb - 3063856-11.x
- 0c43b2a2 - 3063856-11.x
- 91abb416 - Apply 7 suggestion(s) to 3 file(s)
- 25b1a937 - Remove duplicate line
- 052f6518 - Add another Database exception to catch
- 32eec994 - Remove changes from ProfileFieldValues
- 522e9eb1 - Remove changes fro d7/User.php
- bfcc9e9e - Restore code comment
Toggle commit list-
d1b72f29...a6aabb7f - 532 commits from branch
added 94 commits
-
bfcc9e9e...a3edb28e - 86 commits from branch
project:11.x
- 96477ffc - 3063856-11.x
- 094c220b - 3063856-11.x
- f3454823 - Apply 7 suggestion(s) to 3 file(s)
- ee69047d - Remove duplicate line
- 10f923b3 - Add another Database exception to catch
- 902a65ee - Remove changes from ProfileFieldValues
- 44d15daf - Remove changes fro d7/User.php
- d8a753a8 - Restore code comment
Toggle commit list-
bfcc9e9e...a3edb28e - 86 commits from branch
added 136 commits
-
d8a753a8...6dfc9250 - 128 commits from branch
project:11.x
- 0738e5b8 - 3063856-11.x
- fdb89477 - 3063856-11.x
- 92bed0bf - Apply 7 suggestion(s) to 3 file(s)
- df2228d4 - Remove duplicate line
- 2a33ab68 - Add another Database exception to catch
- 27f41234 - Remove changes from ProfileFieldValues
- b9996989 - Remove changes fro d7/User.php
- bfbc835e - Restore code comment
Toggle commit list-
d8a753a8...6dfc9250 - 128 commits from branch
added 54 commits
-
bfbc835e...ca9af3d9 - 46 commits from branch
project:11.x
- aea30fdb - 3063856-11.x
- 20a21960 - 3063856-11.x
- 72acfc26 - Apply 7 suggestion(s) to 3 file(s)
- c126de5a - Remove duplicate line
- 06159629 - Add another Database exception to catch
- d37cc924 - Remove changes from ProfileFieldValues
- 62b7f3b4 - Remove changes fro d7/User.php
- 05673db5 - Restore code comment
Toggle commit list-
bfbc835e...ca9af3d9 - 46 commits from branch
added 13 commits
-
05673db5...68f3bf2d - 10 commits from branch
project:11.x
- 69f73599 - Merge branch '11.x' into 3063856-11.x
- f80280e1 - Use autowiring and add typehints everywhere
- 340a65f4 - Don't use $_SESSION
Toggle commit list-
05673db5...68f3bf2d - 10 commits from branch
added 15 commits
-
6ece5672...b1a87360 - 2 commits from branch
project:11.x
- b1a87360...6487868d - 3 earlier commits
- 6e1f883a - Remove duplicate line
- bf76bd75 - Add another Database exception to catch
- d5d4847b - Remove changes from ProfileFieldValues
- bc9317ba - Remove changes fro d7/User.php
- 8a9df2c8 - Restore code comment
- b4870414 - Use autowiring and add typehints everywhere
- bdbd7403 - Don't use $_SESSION
- b0707f1f - Don't use $_SESSION pt2
- 1b7d15f2 - Fix PHPStan
- 6b876b68 - Add test for MigrateMessageForm
Toggle commit list-
6ece5672...b1a87360 - 2 commits from branch
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
- Resolved by quietone
91 $entries = []; 92 $table = $this->xpath('.//table[@id="admin-migrate-msg"]/tbody/tr'); 93 if ($table) { 94 foreach ($table as $row) { 95 $entry = []; 96 $cells = $row->findAll('css', 'td'); 97 if (count($cells) == 3) { 98 $entry = [ 99 'id' => $cells[0]->getText(), 100 'severity' => array_search($cells[1]->getText(), $levels), 101 'message' => $cells[2]->getText(), 102 ]; 103 $entries[] = $entry; 104 } 105 } 106 } - Comment on lines +93 to +106
86 if ($table) { 87 foreach ($table as $row) { 88 $entry = []; 89 $cells = $row->findAll('css', 'td'); 90 if (count($cells) == 3) { 91 $entry = [ 92 'id' => $cells[0]->getText(), 93 'severity' => array_search($cells[1]->getText(), $levels), 94 'message' => $cells[2]->getText(), 95 ]; 96 $entries[] = $entry; 97 } 98 } 99 } 86 foreach ($table as $row) { 87 $cells = $row->findAll('css', 'td'); 88 if (count($cells) === 3) { 89 $entries[] = [ 90 'id' => $cells[0]->getText(), 91 'severity' => array_search($cells[1]->getText(), $levels, TRUE), 92 'message' => $cells[2]->getText(), 93 ]; 94 } 95 } There are several changes here.
- According to the API docs for $this->xpath(), the return value is always an array. If
NULL
orFALSE
were a possible value, then my personal preference would beforeach ($table ?: [] as $row)
instead of the explicitif
. - Since
$entry
is not referenced outside the innerif
block, there is no need to define it outside that block. Then we can eliminate it. - I have used strict comparison (
===
instead of==
) and added the optional parameter toarray_search()
to use strict comparison. Eventually, we will be using PHPStan at a level where these are required.
- According to the API docs for $this->xpath(), the return value is always an array. If
added 17 commits
-
6b876b68...4b5cc115 - 3 commits from branch
project:11.x
- 4b5cc115...669f5759 - 4 earlier commits
- 3186a1b0 - Add another Database exception to catch
- 8124f66e - Remove changes from ProfileFieldValues
- acc97896 - Remove changes fro d7/User.php
- 846d76d0 - Restore code comment
- 8632abc6 - Use autowiring and add typehints everywhere
- 546bec14 - Don't use $_SESSION
- cad701cf - Don't use $_SESSION pt2
- 340ef1e7 - Fix PHPStan
- 0606cf2e - Add test for MigrateMessageForm
- 02a7f01b - Respond to benjifisher's review
Toggle commit list-
6b876b68...4b5cc115 - 3 commits from branch
60 */ 61 protected function getLevelCounts(array $levels): array { 62 $entries = $this->getMessages(); 63 $count = array_fill(1, count($levels), 0); 64 foreach ($entries as $entry) { 65 if (array_key_exists($entry['severity'], $levels)) { 66 $count[$entry['severity']]++; 67 } 68 } 69 return $count; 70 } 71 72 /** 73 * Gets the migrate messages. 74 * 75 * @return string|int[][] Are you sure about this? From https://www.drupal.org/docs/develop/standards/php/api-documentation-and-comment-standards#types:
... if you know what the array contains, and all the elements are a particular primitive type, indicate that with string[] or \My\Class\Name[] etc. ...
(emphasis added). My suggestion was
(int|string)[][]
, but I guess that is not allowed. I thinkarray[]
is allowed, just less specific.changed this line in version 17 of the diff
71 72 /** 73 * Gets the migrate messages. 74 * 75 * @return string|int[][] 76 * List of log events where each event is an array with following keys: 77 * - msg_id: (string) A message id. 78 * - severity: (int) The MigrationInterface error level. 79 * - message: (string) The migration message. 80 */ 81 protected function getMessages(): array { 82 $levels = [ 83 MigrationInterface::MESSAGE_ERROR => 'Error', 84 MigrationInterface::MESSAGE_WARNING => 'Warning', 85 MigrationInterface::MESSAGE_NOTICE => 'Notice', 86 MigrationInterface::MESSAGE_INFORMATIONAL => 'Info', changed this line in version 17 of the diff
added 69 commits
-
02a7f01b...2e94575d - 54 commits from branch
project:11.x
- 2e94575d...f880b089 - 5 earlier commits
- d72822db - Remove changes from ProfileFieldValues
- a3688e21 - Remove changes fro d7/User.php
- a3140143 - Restore code comment
- c99ba89e - Use autowiring and add typehints everywhere
- 7bfe5273 - Don't use $_SESSION
- 41ff3a53 - Don't use $_SESSION pt2
- 19d609ce - Fix PHPStan
- 622505af - Add test for MigrateMessageForm
- 0ad86d17 - Respond to benjifisher's review
- d78361b9 - several fixes to MigrateMessageFormTest
Toggle commit list-
02a7f01b...2e94575d - 54 commits from branch
Please register or sign in to reply