Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This PR was squashed before being merged into the 4.3-dev branch (closes #28902). Discussion ---------- [Debug] Detect virtual methods using @method | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #28897 (comment) | License | MIT | Doc PR | symfony/symfony-docs#10504 My first Debug PR, so im still on it. But early feedback welcome. In #28901 we'll introduce a new virtual interface method using `@method` annotation. IIUC the idea is to trigger whenever such a method is overridden. Commits ------- 38877c3 [Debug] Detect virtual methods using @method
- Loading branch information
Showing
7 changed files
with
190 additions
and
0 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
11 changes: 11 additions & 0 deletions
11
src/Symfony/Component/Debug/Tests/Fixtures/VirtualClass.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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
/** | ||
* @method string classMethod() | ||
*/ | ||
class VirtualClass | ||
{ | ||
use VirtualTrait; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Symfony/Component/Debug/Tests/Fixtures/VirtualClassMagicCall.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,18 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
/** | ||
* @method string magicMethod() | ||
* @method static string staticMagicMethod() | ||
*/ | ||
class VirtualClassMagicCall | ||
{ | ||
public static function __callStatic($name, $arguments) | ||
{ | ||
} | ||
|
||
public function __call($name, $arguments) | ||
{ | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Symfony/Component/Debug/Tests/Fixtures/VirtualInterface.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,34 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
/** | ||
* @method string interfaceMethod() | ||
* @method sameLineInterfaceMethod($arg) | ||
* @method sameLineInterfaceMethodNoBraces | ||
* | ||
* Ignored | ||
* @method | ||
* @method | ||
* | ||
* Not ignored | ||
* @method newLineInterfaceMethod() Some description! | ||
* @method \stdClass newLineInterfaceMethodNoBraces Description | ||
* | ||
* Invalid | ||
* @method unknownType invalidInterfaceMethod() | ||
* @method unknownType|string invalidInterfaceMethodNoBraces | ||
* | ||
* Complex | ||
* @method complexInterfaceMethod($arg, ...$args) | ||
* @method string[]|int complexInterfaceMethodTyped($arg, int ...$args) Description ... | ||
* | ||
* Static | ||
* @method static Foo&Bar staticMethod() | ||
* @method static staticMethodNoBraces | ||
* @method static \stdClass staticMethodTyped(int $arg) Description | ||
* @method static \stdClass[] staticMethodTypedNoBraces | ||
*/ | ||
interface VirtualInterface | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Debug/Tests/Fixtures/VirtualSubInterface.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,10 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
/** | ||
* @method string subInterfaceMethod() | ||
*/ | ||
interface VirtualSubInterface extends VirtualInterface | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Debug/Tests/Fixtures/VirtualTrait.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,10 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
/** | ||
* @method string traitMethod() | ||
*/ | ||
trait VirtualTrait | ||
{ | ||
} |