Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return all the keys or a subset of the keys of an array
<?php array_keys(array $array): array
<?php public function fill($values)
{
$publicProperties = array_keys($this->all());
if ($values instanceof Model) {
$values = $values->toArray();
<?php if (empty($properties)) {
$properties = array_keys($this->all());
}
$freshInstance = new static;
<?php $properties = $properties[0];
}
$keysToReset = array_diff(array_keys($this->all()), $properties);
$this->reset($keysToReset);
}
<?php ComponentAttributeBag::macro('wire', function ($name) {
$entries = head((array) $this->whereStartsWith('wire:'.$name));
$directive = head(array_keys($entries));
$value = head(array_values($entries));
return new WireDirective($name, $directive, $value);
<?php "/{$this->existingParser->className()}::class/" => $this->className() . '::class',
];
return preg_replace(array_keys($replaces), array_values($replaces), $file_content);
}
}
<?php #[Computed]
public function parentOptions(): array
{
return array_keys($this->options);
}
#[Computed]
<?php }
if ($value instanceof \Livewire\Wireable) {
$keys = array_keys(get_object_vars($value));
foreach ($keys as $key) {
$value->{$key} = $this->dehydratePropertyFromWithFileUploads($value->{$key});
<?php public function fill($values)
{
$publicProperties = array_keys($this->all());
if ($values instanceof Model) {
$values = $values->toArray();
<?php ? $properties[0]
: $properties;
if (empty($properties)) $properties = array_keys($this->all());
$freshInstance = new static($this->getComponent(), $this->getPropertyName());
<?php protected static function processRules($component)
{
$rules = array_keys($component->getRules());
return static::convertDotNotationToArrayNotation($rules);
}
<?php public function updatingBar($value, $key)
{
$expected = array_shift($this->expected['updatingBar']);
$expected_key = array_keys($expected)[0];
$expected_value = $expected[$expected_key];
[$before, $after] = $expected_value;
<?php public function updatedBar($value, $key)
{
$expected = array_shift($this->expected['updatedBar']);
$expected_key = array_keys($expected)[0];
$expected_value = $expected[$expected_key];
PHPUnit::assertNotInstanceOf(Stringable::class, $key);
<?php public function updatingBarBaz($value, $key)
{
$expected = array_shift($this->expected['updatingBarBaz']);
$expected_key = array_keys($expected)[0];
$expected_value = $expected[$expected_key];
[$before, $after] = $expected_value;
<?php public function updatedBarBaz($value, $key)
{
$expected = array_shift($this->expected['updatedBarBaz']);
$expected_key = array_keys($expected)[0];
$expected_value = $expected[$expected_key];
PHPUnit::assertNotInstanceOf(Stringable::class, $key);
<?php Livewire::precompiler(function ($entire) use ($directives) {
$conditions = \Livewire\invade(app('blade.compiler'))->conditions;
foreach (array_keys($conditions) as $conditionalDirective) {
$directives['@'.$conditionalDirective] = '@end'.$conditionalDirective;
}