Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #29920 [Debug][DebugClassLoader] Match more cases for final, depr…
…ecated and internal classes / methods extends (fancyweb) This PR was merged into the 3.4 branch. Discussion ---------- [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Currently, when there is no comment for a tag and another tag after, the detection does not work. Example : ```php /** * @Final * * @author John */ class A { } ``` AFAIK, those tags must not be in a specific order. That's why we should try to support more cases because we might miss things to report. Also I do not understand why the regex is not the same for the classes and methods detection. I fixed that too. I added a lot of cases in the "extends from final class" test and an easy way to add more when needed. Adding them everywhere might be overkill and useless. WDYT ? I'm considering this as bug fix. Commits ------- c3b670a [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
- Loading branch information
Showing
4 changed files
with
110 additions
and
28 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 was deleted.
Oops, something went wrong.
84 changes: 84 additions & 0 deletions
84
src/Symfony/Component/Debug/Tests/Fixtures/FinalClasses.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,84 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Debug\Tests\Fixtures; | ||
|
||
/** | ||
* @final since version 3.3. | ||
*/ | ||
class FinalClass1 | ||
{ | ||
// simple comment | ||
} | ||
|
||
/** | ||
* @final | ||
*/ | ||
class FinalClass2 | ||
{ | ||
// no comment | ||
} | ||
|
||
/** | ||
* @final comment with @@@ and *** | ||
* | ||
* @author John Doe | ||
*/ | ||
class FinalClass3 | ||
{ | ||
// with comment and a tag after | ||
} | ||
|
||
/** | ||
* @final | ||
* @author John Doe | ||
*/ | ||
class FinalClass4 | ||
{ | ||
// without comment and a tag after | ||
} | ||
|
||
/** | ||
* @author John Doe | ||
* | ||
* | ||
* @final multiline | ||
* comment | ||
*/ | ||
class FinalClass5 | ||
{ | ||
// with comment and a tag before | ||
} | ||
|
||
/** | ||
* @author John Doe | ||
* | ||
* @final | ||
*/ | ||
class FinalClass6 | ||
{ | ||
// without comment and a tag before | ||
} | ||
|
||
/** | ||
* @author John Doe | ||
* | ||
* @final another | ||
* | ||
* multiline comment... | ||
* | ||
* @return string | ||
*/ | ||
class FinalClass7 | ||
{ | ||
// with comment and a tag before and after | ||
} | ||
|
||
/** | ||
* @author John Doe | ||
* @final | ||
* @return string | ||
*/ | ||
class FinalClass8 | ||
{ | ||
// without comment and a tag before and after | ||
} |