-
-
Notifications
You must be signed in to change notification settings - Fork 430
feat: create new SafeDeclareStrictTypesRector #7814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
calebdw
wants to merge
2
commits into
rectorphp:main
Choose a base branch
from
calebdw:calebdw/push-oxpklwvkytpo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| class Test | ||
| { | ||
| } |
23 changes: 23 additions & 0 deletions
23
...or/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/arrow_function_return.php.inc
This file contains hidden or 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,23 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $arrow = fn (): int => 42; | ||
|
|
||
| $arrowWithParam = fn (int $x): int => $x + 1; | ||
|
|
||
| $arrowString = fn (): string => 'hello'; | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $arrow = fn (): int => 42; | ||
|
|
||
| $arrowWithParam = fn (int $x): int => $x + 1; | ||
|
|
||
| $arrowString = fn (): string => 'hello'; |
35 changes: 35 additions & 0 deletions
35
...on/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/closure_return.php.inc
This file contains hidden or 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\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $closure = function (): int { | ||
| return 42; | ||
| }; | ||
|
|
||
| $closureWithParam = function (int $x): int { | ||
| return $x + 1; | ||
| }; | ||
|
|
||
| $closureWithMixedReturn = function (int $x): mixed { | ||
calebdw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return $x + 1; | ||
| }; | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $closure = function (): int { | ||
| return 42; | ||
| }; | ||
|
|
||
| $closureWithParam = function (int $x): int { | ||
| return $x + 1; | ||
| }; | ||
|
|
||
| $closureWithMixedReturn = function (int $x): mixed { | ||
| return $x + 1; | ||
| }; | ||
19 changes: 19 additions & 0 deletions
19
...Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/constructor_calls.php.inc
This file contains hidden or 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,19 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| new TypedClass('John', 25); | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| new TypedClass('John', 25); |
25 changes: 25 additions & 0 deletions
25
...ion/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/explicit_cast.php.inc
This file contains hidden or 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,25 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use function Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\acceptsInt; | ||
|
|
||
| function callWithCast(): void | ||
| { | ||
| acceptsInt((int) '123'); | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use function Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\acceptsInt; | ||
|
|
||
| function callWithCast(): void | ||
| { | ||
| acceptsInt((int) '123'); | ||
| } |
19 changes: 19 additions & 0 deletions
19
...tor/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/first_class_callable.php.inc
This file contains hidden or 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,19 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $fn = strlen(...); | ||
|
|
||
| $upperFn = strtoupper(...); | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $fn = strlen(...); | ||
|
|
||
| $upperFn = strtoupper(...); |
19 changes: 19 additions & 0 deletions
19
...r/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/int_to_float_parameter.php.inc
This file contains hidden or 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,19 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use function Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\acceptsFloat; | ||
|
|
||
| acceptsFloat(123); | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use function Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\acceptsFloat; | ||
|
|
||
| acceptsFloat(123); |
25 changes: 25 additions & 0 deletions
25
...tion/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/method_calls.php.inc
This file contains hidden or 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,25 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function useMethodCalls(TypedClass $obj): void | ||
| { | ||
| $obj->add(1, 2); | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function useMethodCalls(TypedClass $obj): void | ||
| { | ||
| $obj->add(1, 2); | ||
| } |
29 changes: 29 additions & 0 deletions
29
...n/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/named_arguments.php.inc
This file contains hidden or 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,29 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| function acceptsNamedArgs(string $name, int $age): void | ||
| { | ||
| } | ||
|
|
||
| function callWithNamedArgs(): void | ||
| { | ||
| acceptsNamedArgs(age: 25, name: 'John'); | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| function acceptsNamedArgs(string $name, int $age): void | ||
| { | ||
| } | ||
|
|
||
| function callWithNamedArgs(): void | ||
| { | ||
| acceptsNamedArgs(age: 25, name: 'John'); | ||
| } |
27 changes: 27 additions & 0 deletions
27
...on/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/nullable_types.php.inc
This file contains hidden or 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,27 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use function Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\acceptsNullableString; | ||
|
|
||
| function callWithNull(): void | ||
| { | ||
| acceptsNullableString(null); | ||
| acceptsNullableString('hello'); | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use function Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\acceptsNullableString; | ||
|
|
||
| function callWithNull(): void | ||
| { | ||
| acceptsNullableString(null); | ||
| acceptsNullableString('hello'); | ||
| } |
33 changes: 33 additions & 0 deletions
33
...tion/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/object_types.php.inc
This file contains hidden or 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,33 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function acceptsObject(TypedClass $obj): void | ||
| { | ||
| } | ||
|
|
||
| function callWithObject(TypedClass $obj): void | ||
| { | ||
| acceptsObject($obj); | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function acceptsObject(TypedClass $obj): void | ||
| { | ||
| } | ||
|
|
||
| function callWithObject(TypedClass $obj): void | ||
| { | ||
| acceptsObject($obj); | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ctor/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/property_assignment.php.inc
This file contains hidden or 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,25 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function assignProperty(TypedClass $obj): void | ||
| { | ||
| $obj->count = 123; | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function assignProperty(TypedClass $obj): void | ||
| { | ||
| $obj->count = 123; | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ion/Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/return_object.php.inc
This file contains hidden or 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,25 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function createAndReturn(): TypedClass | ||
| { | ||
| return new TypedClass('Widget', 100); | ||
| } | ||
|
|
||
| ?> | ||
| ----- | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function createAndReturn(): TypedClass | ||
| { | ||
| return new TypedClass('Widget', 100); | ||
| } |
5 changes: 5 additions & 0 deletions
5
...reInterface/SafeDeclareStrictTypesRector/Fixture/skip_arrow_function_wrong_return.php.inc
This file contains hidden or 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,5 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $arrow = fn (): int => 'not an int'; |
10 changes: 10 additions & 0 deletions
10
...tmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/skip_attribute_wrong_type.php.inc
This file contains hidden or 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 Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedAttribute; | ||
|
|
||
| #[TypedAttribute('123')] | ||
| class WithAttribute | ||
| { | ||
| } |
7 changes: 7 additions & 0 deletions
7
...tmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/skip_closure_wrong_return.php.inc
This file contains hidden or 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,7 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| $closure = function (): int { | ||
| return 'not an int'; | ||
| }; |
8 changes: 8 additions & 0 deletions
8
...Rector/StmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/skip_dynamic_call.php.inc
This file contains hidden or 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,8 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| function callDynamic(string $func): void | ||
| { | ||
| $func('arg'); | ||
| } |
8 changes: 8 additions & 0 deletions
8
...tmtsAwareInterface/SafeDeclareStrictTypesRector/Fixture/skip_int_return_as_string.php.inc
This file contains hidden or 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,8 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| function returnsString(): string | ||
| { | ||
| return 123; | ||
| } |
12 changes: 12 additions & 0 deletions
12
...wareInterface/SafeDeclareStrictTypesRector/Fixture/skip_named_argument_wrong_type.php.inc
This file contains hidden or 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,12 @@ | ||
| <?php | ||
|
|
||
| namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| function acceptsNamedArgsTyped(string $name, int $age): void | ||
| { | ||
| } | ||
|
|
||
| function callWithWrongNamedArg(): void | ||
| { | ||
| acceptsNamedArgsTyped(age: '25', name: 'John'); | ||
| } |
10 changes: 10 additions & 0 deletions
10
...nterface/SafeDeclareStrictTypesRector/Fixture/skip_property_assignment_wrong_type.php.inc
This file contains hidden or 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 Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Fixture; | ||
|
|
||
| use Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector\Source\TypedClass; | ||
|
|
||
| function assignPropertyWrongType(TypedClass $obj): void | ||
| { | ||
| $obj->count = '123'; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.