mirror of
https://github.com/danog/psalm.git
synced 2025-01-19 03:54:42 +01:00
Add test that analyses a class with a mapped property
This commit is contained in:
parent
921d0ad75c
commit
d964f96439
@ -39,6 +39,8 @@
|
||||
<directory suffix=".php">./src/Psalm/Stubs/</directory>
|
||||
<file>./src/Psalm/CallMap.php</file>
|
||||
<file>./src/psalm.php</file>
|
||||
<file>./src/Psalm/Provider/Cache/NoParserCacheProvider.php</file>
|
||||
<file>./src/Psalm/Provider/ParserCacheProvider.php</file>
|
||||
<file>./src/Psalm/PropertyMap.php</file>
|
||||
<directory suffix=".php">./src/Psalm/Issue/</directory>
|
||||
</exclude>
|
||||
|
@ -611,6 +611,38 @@ class PropertyTypeTest extends TestCase
|
||||
public function __construct() { }
|
||||
}',
|
||||
],
|
||||
'analyzePropertyMappedClass' => [
|
||||
'<?php
|
||||
namespace PhpParser\Node\Stmt;
|
||||
|
||||
use PhpParser\Node;
|
||||
|
||||
class Finally_ extends Node\Stmt
|
||||
{
|
||||
/** @var Node[] Statements */
|
||||
public $stmts;
|
||||
|
||||
/**
|
||||
* Constructs a finally node.
|
||||
*
|
||||
* @param Node[] $stmts Statements
|
||||
* @param array $attributes Additional attributes
|
||||
*/
|
||||
public function __construct(array $stmts = array(), array $attributes = array()) {
|
||||
parent::__construct($attributes);
|
||||
$this->stmts = $stmts;
|
||||
}
|
||||
|
||||
public function getSubNodeNames() {
|
||||
return array("stmts");
|
||||
}
|
||||
}',
|
||||
'assertions' => [],
|
||||
'error_levels' => [
|
||||
'InvalidPropertyAssignment',
|
||||
'MissingReturnType',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user