mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Add method that reflection doesn’t know exists
This commit is contained in:
parent
3e4c63eb9a
commit
819489e68d
@ -750,6 +750,8 @@ class DOMNodeList implements Traversable, Countable {
|
|||||||
*/
|
*/
|
||||||
class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable
|
class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable
|
||||||
{
|
{
|
||||||
|
public function __construct() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add/insert a new value at the specified index
|
* Add/insert a new value at the specified index
|
||||||
* @param TKey $index The index where the new value is to be inserted.
|
* @param TKey $index The index where the new value is to be inserted.
|
||||||
|
@ -1479,6 +1479,20 @@ class TemplateTest extends TestCase
|
|||||||
return a($type);
|
return a($type);
|
||||||
}',
|
}',
|
||||||
],
|
],
|
||||||
|
'doublyLinkedListConstructor' => [
|
||||||
|
'<?php
|
||||||
|
$list = new SplDoublyLinkedList();
|
||||||
|
$list->add(5, "hello");
|
||||||
|
$list->add("hello", 5);
|
||||||
|
|
||||||
|
/** @var SplDoublyLinkedList<int, string> */
|
||||||
|
$templated_list = new SplDoublyLinkedList();
|
||||||
|
$templated_list->add(5, "hello");
|
||||||
|
$a = $templated_list->bottom();',
|
||||||
|
[
|
||||||
|
'$a' => 'string',
|
||||||
|
]
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1931,6 +1945,13 @@ class TemplateTest extends TestCase
|
|||||||
function violate($p) {}',
|
function violate($p) {}',
|
||||||
'error_message' => 'InvalidTemplateParam',
|
'error_message' => 'InvalidTemplateParam',
|
||||||
],
|
],
|
||||||
|
'doublyLinkedListBadParam' => [
|
||||||
|
'<?php
|
||||||
|
/** @var SplDoublyLinkedList<int, string> */
|
||||||
|
$templated_list = new SplDoublyLinkedList();
|
||||||
|
$templated_list->add(5, []);',
|
||||||
|
'error_message' => 'InvalidArgument',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user