-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Add TypedPropertyFromStrictSetUpRector (#2636)
- Loading branch information
1 parent
3f87791
commit 649e511
Showing
12 changed files
with
204 additions
and
153 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
19 changes: 0 additions & 19 deletions
19
...Property/TypedPropertyFromStrictConstructorRector/FixturePhp73/construct_in_trait.php.inc
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...rtyFromStrictConstructorRector/FixturePhp73/constructor_array_param_with_nullable.php.inc
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
...Property/TypedPropertyFromStrictConstructorRector/FixturePhp73/constructor_assign.php.inc
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
...perty/TypedPropertyFromStrictConstructorRector/FixturePhp73/only_var_doc_property.php.inc
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...Declaration/Rector/Property/TypedPropertyFromStrictSetUpRector/Fixture/some_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,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector\Fixture; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class SomeClass extends TestCase | ||
{ | ||
private $value; | ||
|
||
public function setUp() | ||
{ | ||
$this->value = 1000; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector\Fixture; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class SomeClass extends TestCase | ||
{ | ||
private int $value; | ||
|
||
public function setUp() | ||
{ | ||
$this->value = 1000; | ||
} | ||
} | ||
|
||
?> |
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
10 changes: 10 additions & 0 deletions
10
...Declaration/Rector/Property/TypedPropertyFromStrictSetUpRector/config/configured_rule.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 | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->rule(TypedPropertyFromStrictSetUpRector::class); | ||
}; |
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
Oops, something went wrong.