1
0
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:
Matthew Brown 2017-12-30 10:42:06 -05:00
parent 921d0ad75c
commit d964f96439
2 changed files with 34 additions and 0 deletions

View File

@ -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>

View File

@ -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',
],
],
];
}