Adds generics

This commit is contained in:
luke
2021-06-18 21:52:24 +01:00
parent 3d7b6426a1
commit 4b55de27f1

View File

@ -10,12 +10,14 @@ namespace Pest\Concerns;
trait RetrievesValues trait RetrievesValues
{ {
/** /**
* @template TValue
*
* Safely retrieve the value at the given key from an object or array. * Safely retrieve the value at the given key from an object or array.
* *
* @param array<mixed>|object $value * @param array<string, TValue>|object $value
* @param mixed $default * @param TValue|null $default
* *
* @return mixed * @return TValue|null
*/ */
private function retrieve(string $key, $value, $default = null) private function retrieve(string $key, $value, $default = null)
{ {