diff --git a/docs/annotating_code/templated_annotations.md b/docs/annotating_code/templated_annotations.md index ed1d8054494..faabefed730 100644 --- a/docs/annotating_code/templated_annotations.md +++ b/docs/annotating_code/templated_annotations.md @@ -448,5 +448,5 @@ Psalm has support for a number of builtin classes and interfaces that you can ex - `class ArrayObject implements IteratorAggregate, ArrayAccess` - `class ArrayIterator implements SeekableIterator, ArrayAccess` - `class DOMNodeList implements Traversable` -- `class SplDoublyLinkedList implements Iterator, ArrayAccess` -- `class SplQueue extends SplDoublyLinkedList` +- `class SplDoublyLinkedList implements Iterator, ArrayAccess` +- `class SplQueue extends SplDoublyLinkedList` diff --git a/stubs/SPL.phpstub b/stubs/SPL.phpstub index 90c06d943e1..97f757cab49 100644 --- a/stubs/SPL.phpstub +++ b/stubs/SPL.phpstub @@ -4,10 +4,9 @@ * The SplDoublyLinkedList class provides the main functionalities of a doubly linked list. * @link https://php.net/manual/en/class.spldoublylinkedlist.php * - * @template TKey * @template TValue - * @template-implements Iterator - * @template-implements ArrayAccess + * @template-implements Iterator + * @template-implements ArrayAccess */ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable { @@ -346,7 +345,7 @@ class SplFixedArray implements Iterator, ArrayAccess, Countable { * @link https://php.net/manual/en/class.splstack.php * * @template TValue - * @template-extends SplDoublyLinkedList + * @template-extends SplDoublyLinkedList */ class SplStack extends SplDoublyLinkedList { } @@ -356,7 +355,7 @@ class SplStack extends SplDoublyLinkedList { * @link https://php.net/manual/en/class.splqueue.php * * @template TValue - * @template-extends SplDoublyLinkedList + * @template-extends SplDoublyLinkedList */ class SplQueue extends SplDoublyLinkedList { /** diff --git a/tests/Template/ClassTemplateTest.php b/tests/Template/ClassTemplateTest.php index 6b94c0f9db0..896af13dae6 100644 --- a/tests/Template/ClassTemplateTest.php +++ b/tests/Template/ClassTemplateTest.php @@ -1022,7 +1022,7 @@ public function partition() {} $list->add(5, "hello"); $list->add("hello", 5); - /** @var SplDoublyLinkedList */ + /** @var SplDoublyLinkedList */ $templated_list = new SplDoublyLinkedList(); $templated_list->add(5, "hello"); $a = $templated_list->bottom();', @@ -3981,7 +3981,7 @@ function violate($p) {}', ], 'doublyLinkedListBadParam' => [ ' */ + /** @var SplDoublyLinkedList */ $templated_list = new SplDoublyLinkedList(); $templated_list->add(5, []);', 'error_message' => 'InvalidArgument',