1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Corrected case of Traversable typehints

Affected functions/methods:
* `iterator_apply()`
* `iterator_count()`
* `IteratorIterator::__construct()`
* `iterator_to_array()`

This fixes the following false-positive:
```php
class Iter extends IteratorIterator {
    public function __construct(Traversable $a) {
	parent::__construct($a);
    }
}
```
where psalm previously wanted `parent::__construct()` argument to be
`traversable` (all-lowercase).
This commit is contained in:
Bruce Weirdan 2017-10-12 13:27:05 +03:00 committed by Matthew Brown
parent deb489e82d
commit f080e32ef0

View File

@ -4456,10 +4456,10 @@ return [
'is_uploaded_file' => ['bool', 'path'=>'string'],
'is_writable' => ['bool', 'filename'=>'string'],
'IteratorAggregate::getIterator' => ['Traversable'],
'iterator_apply' => ['int', 'it'=>'traversable', 'function'=>'callable', 'params='=>'array'],
'iterator_count' => ['int', 'it'=>'traversable'],
'iterator_apply' => ['int', 'it'=>'Traversable', 'function'=>'callable', 'params='=>'array'],
'iterator_count' => ['int', 'it'=>'Traversable'],
'Iterator::current' => ['mixed'],
'IteratorIterator::__construct' => ['IteratorIterator', 'it'=>'traversable'],
'IteratorIterator::__construct' => ['IteratorIterator', 'it'=>'Traversable'],
'IteratorIterator::current' => [''],
'IteratorIterator::getInnerIterator' => ['Traversable'],
'IteratorIterator::key' => [''],
@ -4469,7 +4469,7 @@ return [
'Iterator::key' => ['scalar'],
'Iterator::next' => ['void'],
'Iterator::rewind' => ['void'],
'iterator_to_array' => ['array', 'it'=>'traversable', 'use_keys='=>'bool'],
'iterator_to_array' => ['array', 'it'=>'Traversable', 'use_keys='=>'bool'],
'Iterator::valid' => ['bool'],
'java_last_exception_clear' => [''],
'java_last_exception_get' => ['object'],