for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace W2w\Lib\Apie\ValueObjects;
use erasys\OpenApi\Spec\v3\Schema;
class PhpPrimitive implements ValueObjectInterface
{
const STRING = 'STRING';
const BOOL = 'BOOL';
const INT = 'INT';
const FLOAT = 'FLOAT';
use StringEnumTrait;
public function getSchemaForFilter(): Schema
switch ($this->toNative()) {
case self::BOOL:
return new Schema(['type' => 'boolean']);
case self::INT:
return new Schema(['type' => 'number', 'format' => 'int32']);
case self::FLOAT:
return new Schema(['type' => 'number', 'format' => 'double']);
}
return new Schema(['type' => 'string', 'minimum' => 1]);