for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bdf\Prime\Schema\Bag;
use Bdf\Prime\Schema\Adapter\AbstractIndex;
use Bdf\Prime\Schema\IndexInterface;
/**
* Index using simple array of fields
*
* @psalm-immutable
*/
final class Index extends AbstractIndex
{
* @var array<string, array>
private $fields;
* @var IndexInterface::TYPE_*
private $type;
* @var string|null
private $name;
* @var array
private $options;
* ArrayIndex constructor.
* @param array<string,array> $fields The fields as key, and option as value
* @param IndexInterface::TYPE_* $type
* @param string|null $name
* @param array $options
public function __construct(array $fields, int $type = self::TYPE_SIMPLE, ?string $name = null, array $options = [])
$this->fields = $fields;
$this->type = $type;
$type
integer
Bdf\Prime\Schema\IndexInterface
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->name = $name;
$this->options = $options;
}
* {@inheritdoc}
public function name(): ?string
return $this->name;
public function type(): int
return $this->type;
return $this->type
public function fields(): array
return array_keys($this->fields);
public function options(): array
return $this->options;
public function fieldOptions(string $field): array
return $this->fields[$field] ?? [];
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..