-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow support for more complex array annotations (#344)
* Test that all different array annotations work. * Adding more complex type * Fix up template variable parsing. * Fix tests. * Fix tests.
- Loading branch information
1 parent
11fd9be
commit 5d7912b
Showing
4 changed files
with
78 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @var \TestApp\View\AppView $this | ||
* @var array $x | ||
* @var array<int> $ints | ||
* @var array{a: int, b: string|null}|null $shaped | ||
*/ | ||
foreach ($x as $y) { | ||
echo $y; | ||
} | ||
foreach ($foo as $int) { | ||
echo $int; | ||
} | ||
?> | ||
<div> | ||
<?php foreach ($ints as $int) { | ||
echo $int; | ||
} ?> | ||
<?php foreach ($shaped as $x) { | ||
echo h($x); | ||
} ?> | ||
</div> |
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,23 @@ | ||
<?php | ||
/** | ||
* @var \TestApp\View\AppView $this | ||
* @var array $x | ||
* @var array<int> $ints | ||
* @var array{a: int, b: string|null}|null $shaped | ||
* @var mixed $foo | ||
*/ | ||
foreach ($x as $y) { | ||
echo $y; | ||
} | ||
foreach ($foo as $int) { | ||
echo $int; | ||
} | ||
?> | ||
<div> | ||
<?php foreach ($ints as $int) { | ||
echo $int; | ||
} ?> | ||
<?php foreach ($shaped as $x) { | ||
echo h($x); | ||
} ?> | ||
</div> |