-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Allow multiple declare on DeclareStrictTypesRector (#…
…3628) Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
8605fb9
commit 14cc7d4
Showing
3 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...tion/Rector/StmtsAwareInterface/DeclareStrictTypesRector/Fixture/multiple_declare.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,43 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector\Fixture; | ||
|
||
$count = 0; | ||
function example() { | ||
global $count; | ||
$count++; | ||
echo "$count instructions executed<br>"; | ||
} | ||
|
||
register_tick_function('example'); | ||
|
||
declare(ticks=1) { | ||
$cars = ["Ford", "Volvo", "BMW"]; | ||
foreach($cars as $car) { | ||
echo "$car <br>"; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector\Fixture; | ||
|
||
$count = 0; | ||
function example() { | ||
global $count; | ||
$count++; | ||
echo "$count instructions executed<br>"; | ||
} | ||
|
||
register_tick_function('example'); | ||
|
||
declare(ticks=1) { | ||
$cars = ["Ford", "Volvo", "BMW"]; | ||
foreach($cars as $car) { | ||
echo "$car <br>"; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ector/StmtsAwareInterface/DeclareStrictTypesRector/Fixture/multiple_declare2.php copy.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,10 @@ | ||
<?php | ||
|
||
declare(ticks=1); | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
declare(ticks=1); |
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