-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Constructor phpDocs are inherited without remapping parameter names b…
…y position
- Loading branch information
1 parent
6bd522c
commit ca37ebd
Showing
3 changed files
with
44 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,30 @@ | ||
<?php | ||
|
||
namespace InheritDocConstructors; | ||
|
||
use function PHPStan\Analyser\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
/** | ||
* @param string[] $data | ||
*/ | ||
public function __construct($data) | ||
{ | ||
assertType('array<string>', $data); | ||
} | ||
|
||
} | ||
|
||
class Bar extends Foo | ||
{ | ||
|
||
public function __construct($name, $data) | ||
{ | ||
parent::__construct($data); | ||
assertType('mixed', $name); | ||
assertType('array<string>', $data); | ||
} | ||
|
||
} |