/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Validation/Rules/ArrayRule.php
51 строка
1006 B
Tran Trong Cuong
Update PHPDoc annotations for clarity and accuracy (#56321)
18 июл 2025, 19:05
Не верифицирован
18 июл 2025, 19:05
2f70782
Код
Авторство
О чём код?
<?php namespace Illuminate\Validation\Rules; use Illuminate\Contracts\Support\Arrayable; use Stringable; use function Illuminate\Support\enum_value; class ArrayRule implements Stringable { /** * The accepted keys. * * @var array */ protected $keys; /** * Create a new array rule instance. * * @param \Illuminate\Contracts\Support\Arrayable|array|null $keys */ public function __construct($keys = null) { if ($keys instanceof Arrayable) { $keys = $keys->toArray(); } $this->keys = is_array($keys) ? $keys : func_get_args(); } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { if (empty($this->keys)) { return 'array'; } $keys = array_map( static fn ($key) => enum_value($key), $this->keys, ); return 'array:'.implode(',', $keys); } }