psalm-plugin-laravel/stubs/Collection.stubphp
2021-06-21 17:38:17 -07:00

90 lines
1.7 KiB
Plaintext

<?php
namespace Illuminate\Support;
/**
* @template TKey
* @template TValue
* @implements \ArrayAccess<TKey, TValue>
* @implements Enumerable<TKey, TValue>
*/
class Collection implements \ArrayAccess, Enumerable
{
/**
* The items contained in the collection.
*
* @var array<TKey, TValue>
*/
protected $items = [];
/**
* Create a new collection.
*
* @param array<TKey, TValue> $items
* @return void
*/
public function __construct($items = []) {}
/**
* @param callable|null $callback
* @param mixed $default
* @return TValue|null
*/
public function first(callable $callback = null, $default = null){}
/**
* @return static<TValue, TKey>
*/
public function flip(){}
/**
* @param callable|null $callback
* @param mixed $default
* @return TValue|null
*/
public function last(callable $callback = null, $default = null){}
/**
* @param mixed $key
* @param mixed $default
* @return TValue|null
*/
public function get($key, $default = null) {}
/**
* @return TValue|null
*/
public function pop() {}
/**
* @param mixed $key
* @param mixed $default
* @return TValue|null
*/
public function pull($key, $default = null) {}
/**
* @param mixed $value
* @param bool $strict
* @return TKey|false
*/
public function search($value, $strict = false) {}
/**
* @return TValue|null
*/
public function shift() {}
/**
* @return array<TKey, TValue>
*/
public function all() {}
/**
* @param TKey $key
* @param TValue $value
* @return $this
*/
public function put($key, $value) {}
}