forked from moodlehq/moodle-cs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore anonymous class docblocks if they have a parent
There's usually little need to document an anonymous class when it is part of another method.
- Loading branch information
1 parent
e92f166
commit 2c94596
Showing
6 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
moodle/Tests/Sniffs/Commenting/fixtures/MissingDocblock/entire_anonymous_class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit; | ||
|
||
return new class() extends \stdClass {}; |
8 changes: 8 additions & 0 deletions
8
...le/Tests/Sniffs/Commenting/fixtures/MissingDocblock/entire_anonymous_class_documented.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit; | ||
|
||
/** | ||
* Class level docblock but incorrect whitespace. | ||
*/ | ||
return new class() extends \stdClass {}; |
15 changes: 15 additions & 0 deletions
15
moodle/Tests/Sniffs/Commenting/fixtures/MissingDocblock/nested_anonymous_class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit; | ||
|
||
/** | ||
* Class level docblock but incorrect whitespace. | ||
*/ | ||
class class_with_anonymous_class_in_method { | ||
/** | ||
* Documented method. | ||
*/ | ||
public function test(): string { | ||
return new class() extends \stdClass {}; | ||
} | ||
} |