-
-
Notifications
You must be signed in to change notification settings - Fork 69
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 #653 from PHPCSStandards/feature/generic-duplicate…
…classname-fix-bugs-performance Generic/DuplicateClassName: 4 bug fixes + performance improvement
- Loading branch information
Showing
10 changed files
with
135 additions
and
44 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
6 changes: 6 additions & 0 deletions
6
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.10.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,6 @@ | ||
<?php | ||
namespace Code\IsNamespaced ?> | ||
|
||
<?php | ||
class MyClass {} | ||
interface MyInterface {} |
13 changes: 13 additions & 0 deletions
13
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.11.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,13 @@ | ||
<?php | ||
namespace Code\IsNamespaced; | ||
class FooBar {} | ||
|
||
namespace Code\AnotherNamespace; | ||
|
||
namespace Code\IsNamespaced ?> | ||
|
||
<?php | ||
echo '123'; | ||
?> | ||
<?php | ||
class FooBar {} |
13 changes: 13 additions & 0 deletions
13
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.7.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,13 @@ | ||
<?php | ||
namespace E; | ||
namespace\functionCall(); | ||
class MyClass {} | ||
interface YourInterface {} | ||
|
||
namespace F; | ||
namespace\functionCall(); | ||
class MyClass {} | ||
|
||
namespace /*comment*/ G; | ||
namespace\functionCall(); | ||
class MyClass {} |
8 changes: 8 additions & 0 deletions
8
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.8.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 @@ | ||
<?php | ||
namespace Foo\Bar; | ||
class MyClass {} | ||
interface YourInterface {} | ||
|
||
namespace Foo /*comment*/ \ /*comment*/ Bar; | ||
class MyClass {} | ||
interface YourInterface {} |
5 changes: 5 additions & 0 deletions
5
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.9.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,5 @@ | ||
<?php | ||
namespace { | ||
class MyClass {} | ||
trait YourTrait {} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.97.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 @@ | ||
<?php | ||
|
||
// Intentional parse error/live coding. | ||
// This should be the only test in this file. | ||
// This is a two-file test: test case file 97 and 98 belong together. | ||
// Testing against false positives during live coding and invalid class names being stored in the cache. | ||
|
||
class |
8 changes: 8 additions & 0 deletions
8
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.98.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 @@ | ||
<?php | ||
|
||
// Intentional parse error/live coding. | ||
// This should be the only test in this file. | ||
// This is a two-file test: test case file 97 and 98 belong together. | ||
// Testing against false positives during live coding and invalid class names being stored in the cache. | ||
|
||
class |
7 changes: 7 additions & 0 deletions
7
src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.99.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,7 @@ | ||
<?php | ||
|
||
// Intentional parse error/live coding. | ||
// This should be the only test in this file. | ||
// Testing that the sniff is *not* triggered. | ||
|
||
namespace |
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