-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MethodSignatureRule - look at abstract trait method in Bleeding Edge
- Loading branch information
1 parent
2df14af
commit 5fd8cee
Showing
8 changed files
with
78 additions
and
3 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
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
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
38 changes: 38 additions & 0 deletions
38
tests/PHPStan/Rules/Methods/data/overriding-trait-methods-phpdoc.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,38 @@ | ||
<?php // lint >= 8.0 | ||
|
||
namespace OverridingTraitMethodsPhpDoc; | ||
|
||
trait Foo | ||
{ | ||
|
||
public function doFoo(int $i): int | ||
{ | ||
|
||
} | ||
|
||
abstract public function doBar(string $i): int; | ||
|
||
} | ||
|
||
class Bar | ||
{ | ||
|
||
use Foo; | ||
|
||
/** | ||
* @param positive-int $i | ||
*/ | ||
public function doFoo(int $i): string | ||
{ | ||
// ok, trait method not abstract | ||
} | ||
|
||
/** | ||
* @param non-empty-string $i | ||
*/ | ||
public function doBar(string $i): int | ||
{ | ||
// error | ||
} | ||
|
||
} |