1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Allow namespaced use of optional callable params

This commit is contained in:
Matthew Brown 2019-02-11 08:41:48 -05:00
parent 8bcb3a76e7
commit 3497ad4765
2 changed files with 21 additions and 2 deletions

View File

@ -766,7 +766,9 @@ abstract class Type
if (in_array(
$string_type_token,
['<', '>', '|', '?', ',', '{', '}', ':', '::', '[', ']', '(', ')', '&'],
[
'<', '>', '|', '?', ',', '{', '}', ':', '::', '[', ']', '(', ')', '&', '=', '...'
],
true
)) {
continue;

View File

@ -11,7 +11,24 @@ class TypeParseTest extends TestCase
*/
public function setUp()
{
//pae::setUp();
$this->file_provider = new \Psalm\Tests\Internal\Provider\FakeFileProvider();
$config = new TestConfig();
$providers = new \Psalm\Internal\Provider\Providers(
$this->file_provider,
new \Psalm\Tests\Internal\Provider\FakeParserCacheProvider()
);
$this->project_analyzer = new \Psalm\Internal\Analyzer\ProjectAnalyzer(
$config,
$providers,
false,
true,
\Psalm\Internal\Analyzer\ProjectAnalyzer::TYPE_CONSOLE,
1,
false
);
}
/**