for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace RoundingWell\Schematic\Schema;
use RoundingWell\Schematic\Schema;
class ArraySchema extends Schema
{
public function phpType(): string
return $this->items()->phpType() . '[]';
}
public function hasItems(): bool
return isset($this->schema->items)
&& isset($this->schema->items->type);
public function items(): ?Schema
return $this->hasItems() ? Schema::make($this->schema->items) : null;