Supported Versions: PHP 8 >= 8.1.0
Checks whether a given array is a list
<?php array_is_list(array $array): bool
<?php if (is_null($value)) {
$this->event(new CacheMissed($this->getName(), $key));
return (isset($keys[$key]) && ! array_is_list($keys)) ? value($keys[$key]) : null;
}
<?php public static function isAssoc(array $array)
{
return ! array_is_list($array);
}
<?php public static function isList($array)
{
return array_is_list($array);
}
<?php }
}
if (! array_is_list($array)) {
$descending
? krsort($array, $options)
: ksort($array, $options);
<?php $field = 'answer';
if (is_array($rules) && ! array_is_list($rules)) {
[$field, $rules] = [key($rules), current($rules)];
}
<?php {
$answer = $this->components->choice($label, $options, $default);
if (! array_is_list($options) && $answer === (string) (int) $answer) {
return (int) $answer;
}
<?php $default = $default !== [] ? implode(',', $default) : null;
if ($required === false && ! $this->laravel->runningUnitTests()) {
$options = array_is_list($options)
? ['None', ...$options]
: ['' => 'None'] + $options;
<?php $answers = $this->components->choice($label, $options, $default, null, true);
if (! array_is_list($options)) {
$answers = array_map(fn ($value) => $value === (string) (int) $value ? (int) $value : $value, $answers);
}
<?php }
if ($required === false) {
return array_is_list($options)
? array_values(array_filter($answers, fn ($value) => $value !== 'None'))
: array_filter($answers, fn ($value) => $value !== '');
}
<?php {
protected function isAssoc(array $array): bool
{
return ! array_is_list($array);
}
};
}
<?php protected static function buildMorphMapFromModels(?array $models = null)
{
if (is_null($models) || ! array_is_list($models)) {
return $models;
}
<?php $migrationsTable = is_array($migrations) ? ($migrations['table'] ?? null) : $migrations;
if (property_exists($this, 'exceptTables')) {
if (array_is_list($this->exceptTables ?? [])) {
return array_merge(
$this->exceptTables ?? [],
[$migrationsTable],
<?php protected function isStackable($key)
{
return ! $this->has($key) ||
(is_array($this->data[$key]) && array_is_list($this->data[$key]));
}
<?php protected function isHiddenStackable($key)
{
return ! $this->hasHidden($key) ||
(is_array($this->hidden[$key]) && array_is_list($this->hidden[$key]));
}
<?php public function zrangebyscore($key, $min, $max, $options = [])
{
if (isset($options['limit']) && ! array_is_list($options['limit'])) {
$options['limit'] = [
$options['limit']['offset'],
$options['limit']['count'],