Add template annotations for Parle\Stack

This commit is contained in:
Alexandre Bouvier 2023-12-29 23:06:29 +01:00 committed by Ivan Fedorov
parent 572cacbaf3
commit cb45670f35
1 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,9 @@ namespace Parle;
use JetBrains\PhpStorm\Immutable;
/**
* @template TValue
*/
class Stack
{
/* Properties */
@ -20,7 +23,7 @@ class Stack
public $size = 0;
/**
* @var mixed Element on the top of the stack.
* @var TValue Element on the top of the stack.
*/
public $top;
@ -37,7 +40,7 @@ class Stack
* Push an item into the stack
*
* @link https://php.net/manual/en/parle-stack.push.php
* @param mixed $item Variable to be pushed.
* @param TValue $item Variable to be pushed.
* @return void
*/
public function push($item) {}