-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Skip __construct in inner class on TypedPropertyFro…
…mStrictConstructorRector (#2010)
- Loading branch information
1 parent
e470787
commit a0ad427
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...Rector/Property/TypedPropertyFromStrictConstructorRector/Fixture/skip_inner_class.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,21 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
class SkipInnerClass | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $name; | ||
|
||
public function __construct(string $name) | ||
{ | ||
new class { | ||
public function __construct(string $name) | ||
{ | ||
$this->name = $name; | ||
} | ||
}; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ector/Property/TypedPropertyFromStrictConstructorRector/Fixture/skip_inner_class2.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,21 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
class SkipInnerClass2 | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $name; | ||
|
||
public function __construct() | ||
{ | ||
new class { | ||
public function __construct() | ||
{ | ||
$this->name = 'value'; | ||
} | ||
}; | ||
} | ||
} |
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