mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #4017 - allow float defaults in namespaced classes
This commit is contained in:
parent
3630b4a2f9
commit
7ac771da48
@ -361,8 +361,7 @@ class TypeTokenizer
|
||||
|
||||
if ($string_type_token[0][0] === '"'
|
||||
|| $string_type_token[0][0] === '\''
|
||||
|| $string_type_token[0] === '0'
|
||||
|| preg_match('/[1-9]/', $string_type_token[0][0])
|
||||
|| preg_match('/[0-9]/', $string_type_token[0][0])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
@ -668,6 +668,32 @@ class MagicMethodAnnotationTest extends TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'parseFloatInDefault' => [
|
||||
'<?php
|
||||
namespace Foo {
|
||||
/**
|
||||
* @method int randomInt()
|
||||
* @method void takesFloat($a = 0.1)
|
||||
*/
|
||||
class G
|
||||
{
|
||||
/**
|
||||
* @param string $method
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $attributes)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Bar {
|
||||
(new \Foo\G)->randomInt();
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user