Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Contracts/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@

class Data implements \ArrayAccess, \Countable, \IteratorAggregate
{
/**
* @var array<mixed>
*/
protected array $data = [];

/**
* @param array<mixed> $data
*/
public function __construct(array $data = [])
{
$this->data = $data;
}

public function offsetSet($offset, $value): void
public function offsetSet(mixed $offset, mixed $value): void
{
$this->data[$offset] = $value;
}

public function offsetExists($offset): bool
public function offsetExists(mixed $offset): bool
{
return isset($this->data[$offset]) || \array_key_exists($offset, $this->data);
}

public function offsetUnset($offset): void
public function offsetUnset(mixed $offset): void
{
unset($this->data[$offset]);
}

public function offsetGet($offset): mixed
public function offsetGet(mixed $offset): mixed
{
return $this->data[$offset] ?? null;
}
Expand Down
Loading