-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from andrewnicols/multiline_attributes
Fix docblocks before Multiline attributes
- Loading branch information
Showing
6 changed files
with
162 additions
and
2 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
93 changes: 93 additions & 0 deletions
93
...e/Tests/Sniffs/Commenting/fixtures/MissingDocblock/docblock_with_multiline_attributes.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,93 @@ | ||
<?php | ||
|
||
/** | ||
* This file contains multiple testcases for multi line attributes. | ||
*/ | ||
|
||
namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit; | ||
|
||
defined('MOODLE_INTERNAL') || die(); // Make this always the 1st line in all CS fixtures. | ||
|
||
/** | ||
* Example class. | ||
*/ | ||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
class class_multiline_attribute { | ||
|
||
/** | ||
* Method attribute. | ||
*/ | ||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
function method_multiline_attribute(): void { | ||
} | ||
} | ||
|
||
/** | ||
* Interface with multiline attributes. | ||
*/ | ||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
interface interface_multiline_attribute { | ||
} | ||
|
||
/** | ||
* Trait with multiline attributes. | ||
*/ | ||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
trait trait_multiline_attribute { | ||
} | ||
|
||
/** | ||
* Example class. | ||
*/ | ||
|
||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
class class_multiline_attribute_space_between { | ||
|
||
/** | ||
* Method attribute. | ||
*/ | ||
|
||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
function method_multiline_attribute_space_between(): void { | ||
} | ||
} | ||
|
||
/** | ||
* Interface with multiline attributes. | ||
*/ | ||
|
||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
interface interface_multiline_attribute_space_between { | ||
} | ||
|
||
/** | ||
* Trait with multiline attributes and space between. | ||
*/ | ||
|
||
#[someattribute( | ||
attr1: 'asdf', | ||
attr2: 'asdf', | ||
)] | ||
trait trait_multiline_attribute_space_between { | ||
} |
14 changes: 14 additions & 0 deletions
14
...mmenting/fixtures/MissingDocblock/interface_only_with_attributes_incorrect_whitespace.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,14 @@ | ||
<?php | ||
|
||
namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit; | ||
|
||
use example; | ||
|
||
/** | ||
* Interface level docblock. | ||
*/ | ||
#[example_attribute] | ||
#[with_multiple_attributes, and_another_attribute] | ||
|
||
interface interface_only_with_attributes_incorrect_whitespace { | ||
} |
14 changes: 14 additions & 0 deletions
14
...s/Commenting/fixtures/MissingDocblock/trait_only_with_attributes_incorrect_whitespace.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,14 @@ | ||
<?php | ||
|
||
namespace MoodleHQ\MoodleCS\moodle\Tests\Sniffs\PHPUnit; | ||
|
||
use example; | ||
|
||
/** | ||
* Trait level docblock. | ||
*/ | ||
#[example_attribute] | ||
#[with_multiple_attributes, and_another_attribute] | ||
|
||
trait trait_only_with_attributes_incorrect_whitespace { | ||
} |
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