-
-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1551 from simPod/type-import-from
feat: support imported array shapes (`@phpstan-import-type`)
- Loading branch information
Showing
4 changed files
with
82 additions
and
9 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
24 changes: 24 additions & 0 deletions
24
tests/Fixtures/DocBlockType/Phpstan/PhpstanArrayShapeImported.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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JMS\Serializer\Tests\Fixtures\DocBlockType\Phpstan; | ||
|
||
use JMS\Serializer\Tests\Fixtures\DocBlockType\Phpstan\Sub\PhpstanArrayShapeToImport; | ||
|
||
/** | ||
* @phpstan-import-type Settings from PhpstanArrayShapeToImport | ||
* @phpstan-import-type Settings from PhpstanArrayShapeToImport as AliasedSettings | ||
*/ | ||
final class PhpstanArrayShapeImported | ||
{ | ||
/** | ||
* @var Settings | ||
*/ | ||
public $data; | ||
|
||
/** | ||
* @var AliasedSettings | ||
*/ | ||
public $dataAliased; | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/Fixtures/DocBlockType/Phpstan/Sub/PhpstanArrayShapeToImport.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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JMS\Serializer\Tests\Fixtures\DocBlockType\Phpstan\Sub; | ||
|
||
/** | ||
* @phpstan-type Settings array{ | ||
* method: string, | ||
* amount: array{type: string, value: string|null} | ||
* } | ||
*/ | ||
final class PhpstanArrayShapeToImport | ||
{ | ||
/** | ||
* @var Settings | ||
*/ | ||
public $data; | ||
} |
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