This repository was archived by the owner on Nov 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Don't allow superfluous prefixes/suffixes #11
Merged
thewilkybarkid
merged 5 commits into
libero:master
from
thewilkybarkid:prefixes-suffixes
Oct 2, 2018
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
026a0b6
Don't allow superfluous prefixes/suffixes
thewilkybarkid 90207a5
Merge branch 'master' into prefixes-suffixes
thewilkybarkid 1fe7043
Fix merge
thewilkybarkid c673980
Merge branch 'master' into prefixes-suffixes
thewilkybarkid 6e4d677
Merge branch 'master' into prefixes-suffixes
thewilkybarkid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,18 @@ | ||
| ---DESCRIPTION--- | ||
| Forbid Abstract prefix | ||
| ---FILENAME--- | ||
| AbstractFoo.php | ||
| ---CONTENTS--- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Vendor; | ||
|
|
||
| abstract class AbstractFoo | ||
| { | ||
| } | ||
|
|
||
| ---MESSAGES--- | ||
| 7:10 SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix | ||
| --- |
This file contains hidden or 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,20 @@ | ||
| ---DESCRIPTION--- | ||
| Forbid Exception suffix | ||
| ---FILENAME--- | ||
| FooException.php | ||
| ---CONTENTS--- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Vendor; | ||
|
|
||
| use Exception; | ||
|
|
||
| class FooException extends Exception | ||
| { | ||
| } | ||
|
|
||
| ---MESSAGES--- | ||
| 9:1 SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix | ||
| --- |
This file contains hidden or 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,18 @@ | ||
| ---DESCRIPTION--- | ||
| Forbid Interface suffix | ||
| ---FILENAME--- | ||
| FooInterface.php | ||
| ---CONTENTS--- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Vendor; | ||
|
|
||
| interface FooInterface | ||
| { | ||
| } | ||
|
|
||
| ---MESSAGES--- | ||
| 7:1 SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix | ||
| --- | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
InterfaceandAbstracthave been in use before and hence are worthy of forbidden.Exceptionis easy to forbid, but people can just name everything*Problemor*Errorso doesn't necessarily have a positive effect.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add more rules as we need. Naming will always require a human review.