-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix match static method name in annotation (#446)
- Loading branch information
1 parent
10e545f
commit 75c06ea
Showing
3 changed files
with
69 additions
and
1 deletion.
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
18 changes: 18 additions & 0 deletions
18
...nStaticMethodToStaticCallRector/Fixture/skip_string_not_method_name_in_annotation.php.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,18 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector\Fixture; | ||
|
||
/** | ||
* @method static static create($parameters) some description with parameters | ||
*/ | ||
trait SkipStringNotMethodNameInAnnotation | ||
{ | ||
public function run() | ||
{ | ||
$this->parameters(); | ||
} | ||
|
||
public function parameters(): void | ||
{ | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...Call/ThisCallOnStaticMethodToStaticCallRector/Fixture/static_method_in_annotation.php.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,49 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector\Fixture; | ||
|
||
/** | ||
* @method static static staticReturnStatic() | ||
* @method static static|StaticMethodInAnnotation|string[]|$this staticReturnMixed() | ||
* @method static withoutReturnType() | ||
* @method static withoutParameters | ||
* @method StaticMethodInAnnotation|static returnStatic | ||
*/ | ||
trait StaticMethodInAnnotation | ||
{ | ||
public function run() | ||
{ | ||
$this->staticReturnStatic(); | ||
$this->staticReturnMixed(); | ||
$this->withoutReturnType(); | ||
$this->withoutParameters(); | ||
$this->returnStatic(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector\Fixture; | ||
|
||
/** | ||
* @method static static staticReturnStatic() | ||
* @method static static|StaticMethodInAnnotation|string[]|$this staticReturnMixed() | ||
* @method static withoutReturnType() | ||
* @method static withoutParameters | ||
* @method StaticMethodInAnnotation|static returnStatic | ||
*/ | ||
trait StaticMethodInAnnotation | ||
{ | ||
public function run() | ||
{ | ||
static::staticReturnStatic(); | ||
static::staticReturnMixed(); | ||
static::withoutReturnType(); | ||
static::withoutParameters(); | ||
$this->returnStatic(); | ||
} | ||
} | ||
|
||
?> |