Skip to content

Commit dc27eff

Browse files
committed
Issue #3283794 by mondrake, longwave: Fix 'should return {type} but return statement is missing' PHPStan L0 errors in test code
(cherry picked from commit 9b485ec74db2dfe7c469a9990a7a6e5fe3658e11)
1 parent 9cf6965 commit dc27eff

File tree

92 files changed

+192
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+192
-77
lines changed

modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ protected function getExpectedNormalizedEntity() {
109109
*/
110110
protected function getNormalizedPostEntity() {
111111
// @todo Update in https://www.drupal.org/node/2300677.
112+
return [];
112113
}
113114

114115
/**

modules/block_content/tests/src/Functional/Rest/BlockContentTypeResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ protected function getExpectedNormalizedEntity() {
6666
*/
6767
protected function getNormalizedPostEntity() {
6868
// @todo Update in https://www.drupal.org/node/2300677.
69+
return [];
6970
}
7071

7172
}

modules/comment/tests/src/Functional/CommentNonNodeTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ public function postComment(EntityInterface $entity, $comment, $subject = '', $c
179179
$this->assertArrayHasKey(1, $match);
180180
}
181181

182-
if (isset($match[1])) {
183-
return Comment::load($match[1]);
184-
}
182+
return Comment::load($match[1]);
185183
}
186184

187185
/**

modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,17 @@ public function testPostDxWithoutCriticalBaseFields() {
317317
*/
318318
protected function getExpectedUnauthorizedAccessMessage($method) {
319319
switch ($method) {
320-
case 'GET';
320+
case 'GET':
321321
return "The 'access comments' permission is required and the comment must be published.";
322322

323-
case 'POST';
323+
case 'POST':
324324
return "The 'post comments' permission is required.";
325325

326-
case 'PATCH';
326+
case 'PATCH':
327327
return "The 'edit own comments' permission is required, the user must be the comment author, and the comment must be published.";
328328

329329
case 'DELETE':
330+
default:
330331
// \Drupal\comment\CommentAccessControlHandler::checkAccess() does not
331332
// specify a reason for not allowing a comment to be deleted.
332333
return '';

modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ protected function getExpectedNormalizedEntity() {
7272
*/
7373
protected function getNormalizedPostEntity() {
7474
// @todo Update in https://www.drupal.org/node/2300677.
75+
return [];
7576
}
7677

7778
}

modules/config/tests/config_test/tests/src/Functional/Rest/ConfigTestResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ protected function getExpectedNormalizedEntity() {
6868
*/
6969
protected function getNormalizedPostEntity() {
7070
// @todo Update in https://www.drupal.org/node/2300677.
71+
return [];
7172
}
7273

7374
/**

modules/contact/tests/src/Functional/Rest/ContactFormResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ protected function getExpectedNormalizedEntity() {
8585
*/
8686
protected function getNormalizedPostEntity() {
8787
// @todo Update in https://www.drupal.org/node/2300677.
88+
return [];
8889
}
8990

9091
/**

modules/editor/tests/src/Functional/Rest/EditorResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ protected function getExpectedNormalizedEntity() {
122122
*/
123123
protected function getNormalizedPostEntity() {
124124
// @todo Update in https://www.drupal.org/node/2300677.
125+
return [];
125126
}
126127

127128
/**

modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ protected function getExpectedNormalizedEntity() {
9494
*/
9595
protected function getNormalizedPostEntity() {
9696
// @todo Update in https://www.drupal.org/node/2300677.
97+
return [];
9798
}
9899

99100
/**

modules/field/tests/src/Functional/Rest/FieldStorageConfigResourceTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ protected function getExpectedNormalizedEntity() {
7373
*/
7474
protected function getNormalizedPostEntity() {
7575
// @todo Update in https://www.drupal.org/node/2300677.
76+
return [];
7677
}
7778

7879
/**

0 commit comments

Comments
 (0)