diff --git a/src/Generator/Operation.php b/src/Generator/Operation.php index 718bfe7..972b667 100644 --- a/src/Generator/Operation.php +++ b/src/Generator/Operation.php @@ -52,9 +52,11 @@ public static function generate(string $path, string $method, string $namespace, $paramterStmt->setType(str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $parameter->schema->type)); } $class->addStmt($paramterStmt); @@ -65,9 +67,11 @@ public static function generate(string $path, string $method, string $namespace, str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $parameter->schema->type) ); } diff --git a/src/Generator/Operations.php b/src/Generator/Operations.php index a5b81ec..a71490f 100644 --- a/src/Generator/Operations.php +++ b/src/Generator/Operations.php @@ -52,9 +52,11 @@ public static function generate(string $path, string $method, string $namespace, setType(str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $parameter->schema->type)) ); @@ -64,9 +66,11 @@ public static function generate(string $path, string $method, string $namespace, str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $parameter->schema->type) ); if ($parameter->schema->default !== null) { diff --git a/src/Generator/Path.php b/src/Generator/Path.php index b70855b..b83af14 100644 --- a/src/Generator/Path.php +++ b/src/Generator/Path.php @@ -36,9 +36,11 @@ public static function generate(string $path, string $namespace, string $baseNam str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $parameter->schema->type) ); } diff --git a/src/Generator/Schema.php b/src/Generator/Schema.php index 49f5458..8eb5d14 100644 --- a/src/Generator/Schema.php +++ b/src/Generator/Schema.php @@ -82,16 +82,20 @@ public static function generate(string $name, string $namespace, string $classNa $propertyStmt->setType(str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $property->type)); $method->setReturnType(str_replace([ 'integer', 'any', + 'boolean', ], [ 'int', '', + 'bool', ], $property->type)); }