-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
IsTrait
and IsNotTrait
selectors
- Loading branch information
1 parent
4c29e33
commit 737c6de
Showing
5 changed files
with
59 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace PHPat\Selector; | ||
|
||
use PHPStan\Reflection\ClassReflection; | ||
|
||
final class IsNotTrait implements SelectorInterface | ||
{ | ||
public function getName(): string | ||
{ | ||
return '-non trait classes-'; | ||
} | ||
|
||
public function matches(ClassReflection $classReflection): bool | ||
{ | ||
return !$classReflection->isTrait(); | ||
} | ||
} |
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,18 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace PHPat\Selector; | ||
|
||
use PHPStan\Reflection\ClassReflection; | ||
|
||
final class IsTrait implements SelectorInterface | ||
{ | ||
public function getName(): string | ||
{ | ||
return '-all traits-'; | ||
} | ||
|
||
public function matches(ClassReflection $classReflection): bool | ||
{ | ||
return $classReflection->isTrait(); | ||
} | ||
} |
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