mirror of
https://github.com/flarum/framework.git
synced 2025-05-31 04:25:49 +08:00
59 lines
1.3 KiB
Plaintext
59 lines
1.3 KiB
Plaintext
<?php
|
|
|
|
namespace Illuminate\Support;
|
|
|
|
/**
|
|
* @template TKey
|
|
* @template TValue
|
|
*
|
|
* @extends \IteratorAggregate<TKey, TValue>
|
|
*/
|
|
interface Enumerable extends \Countable, \IteratorAggregate, \JsonSerializable
|
|
{
|
|
/**
|
|
* @param string|callable(TValue, TKey): bool $key
|
|
* @param mixed $operator
|
|
* @param mixed $value
|
|
* @return static<static>
|
|
*/
|
|
public function partition($key, $operator = null, $value = null);
|
|
|
|
/**
|
|
* @param string|callable(TValue, TKey): mixed $keyBy
|
|
* @return static<TValue>
|
|
*/
|
|
public function keyBy($keyBy);
|
|
|
|
/**
|
|
* @param callable(TValue, TKey): array<mixed> $callback
|
|
* @return static<mixed>
|
|
*/
|
|
public function mapWithKeys(callable $callback);
|
|
|
|
/**
|
|
* @param callable(TValue, TKey): array<mixed> $callback
|
|
* @return static<array<mixed>>
|
|
*/
|
|
public function mapToDictionary(callable $callback);
|
|
|
|
/**
|
|
* @param string|callable(TValue, TKey): bool $key
|
|
* @param mixed $operator
|
|
* @param mixed $value
|
|
* @return bool
|
|
*/
|
|
public function every($key, $operator = null, $value = null);
|
|
|
|
/**
|
|
* @param int $size
|
|
* @return static<static>
|
|
*/
|
|
public function chunk($size);
|
|
|
|
/**
|
|
* @param callable(static): void $callable
|
|
* @return static
|
|
*/
|
|
public function tap($callable);
|
|
}
|