-
Notifications
You must be signed in to change notification settings - Fork 2
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 #16 from bigbite/feature/traits-interfaces
Add Sniffing support for interfaces and traits
- Loading branch information
Showing
15 changed files
with
172 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<documentation title="File Names"> | ||
<standard> | ||
<![CDATA[ | ||
Files containing classes should be prefixed with "class-" or "abstract-class", and be named | ||
as the class name in lower-kebab-case. For example: | ||
the file name for abstract class My_Class_Name {} would be "abstract-class-my-class-name.php". | ||
Files containing classes, interfaces, or traits should be prefixed appropriately - prefixed with the type, and then lower-kebab-case matching the name of the type. Examples: | ||
- trait My_Trait {} => trait-my-trait.php | ||
- interface My_Interface {} => interface-my-interface.php | ||
- class My_Class {} => class-my-class.php | ||
- abstract class My_Abstract_Class {} => abstract-class-my-abstract-class.php | ||
]]> | ||
</standard> | ||
</documentation> |
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
3 changes: 3 additions & 0 deletions
3
BigBite/Tests/Files/FileNameUnitTests/InterfaceMyInterface.inc
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,3 @@ | ||
<?php | ||
|
||
interface My_Interface {} |
8 changes: 8 additions & 0 deletions
8
BigBite/Tests/Files/FileNameUnitTests/NonStrictClassNames/InterfaceNonStrictClass.inc
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 @@ | ||
<!-- Annotation has to be on the second line as errors are thrown on line 1 and errors on annotation lines are ignored. --> | ||
phpcs:set BigBite.Files.FileName strict_class_file_names false | ||
|
||
<?php | ||
|
||
interface Non_Strict_Interface {} | ||
|
||
// phpcs:set BigBite.Files.FileName strict_class_file_names true |
8 changes: 8 additions & 0 deletions
8
BigBite/Tests/Files/FileNameUnitTests/NonStrictClassNames/TraitNonStrictClass.inc
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 @@ | ||
<!-- Annotation has to be on the second line as errors are thrown on line 1 and errors on annotation lines are ignored. --> | ||
phpcs:set BigBite.Files.FileName strict_class_file_names false | ||
|
||
<?php | ||
|
||
trait Non_Strict_Trait {} | ||
|
||
// phpcs:set BigBite.Files.FileName strict_class_file_names true |
8 changes: 8 additions & 0 deletions
8
BigBite/Tests/Files/FileNameUnitTests/NonStrictClassNames/non-strict-interface.inc
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 @@ | ||
<!-- Annotation has to be on the second line as errors are thrown on line 1 and errors on annotation lines are ignored. --> | ||
phpcs:set BigBite.Files.FileName strict_class_file_names false | ||
|
||
<?php | ||
|
||
interface Non_Strict_Interface {} | ||
|
||
// phpcs:set BigBite.Files.FileName strict_class_file_names true |
8 changes: 8 additions & 0 deletions
8
BigBite/Tests/Files/FileNameUnitTests/NonStrictClassNames/non-strict-trait.inc
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 @@ | ||
<!-- Annotation has to be on the second line as errors are thrown on line 1 and errors on annotation lines are ignored. --> | ||
phpcs:set BigBite.Files.FileName strict_class_file_names false | ||
|
||
<?php | ||
|
||
trait Non_Strict_Trait {} | ||
|
||
// phpcs:set BigBite.Files.FileName strict_class_file_names true |
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,3 @@ | ||
<?php | ||
|
||
trait My_Trait {} |
3 changes: 3 additions & 0 deletions
3
BigBite/Tests/Files/FileNameUnitTests/interface-different-interface.inc
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,3 @@ | ||
<?php | ||
|
||
interface Not_My_Interface {} |
3 changes: 3 additions & 0 deletions
3
BigBite/Tests/Files/FileNameUnitTests/interface-my-interface.inc
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,3 @@ | ||
<?php | ||
|
||
interface My_Interface {} |
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,3 @@ | ||
<?php | ||
|
||
interface My_Interface {} |
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,3 @@ | ||
<?php | ||
|
||
trait My_Trait {} |
3 changes: 3 additions & 0 deletions
3
BigBite/Tests/Files/FileNameUnitTests/trait-different-trait.inc
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,3 @@ | ||
<?php | ||
|
||
trait Not_My_Trait {} |
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,3 @@ | ||
<?php | ||
|
||
trait My_Trait {} |