Skip to content

Commit 755307b

Browse files
authored
Merge pull request #7 from php-api-clients/fix-boolean-to-bool
Fix boolean to bool
2 parents 5a14c30 + 639e95b commit 755307b

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/Generator/Operation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ public static function generate(string $path, string $method, string $namespace,
5252
$paramterStmt->setType(str_replace([
5353
'integer',
5454
'any',
55+
'boolean',
5556
], [
5657
'int',
5758
'',
59+
'bool',
5860
], $parameter->schema->type));
5961
}
6062
$class->addStmt($paramterStmt);
@@ -65,9 +67,11 @@ public static function generate(string $path, string $method, string $namespace,
6567
str_replace([
6668
'integer',
6769
'any',
70+
'boolean',
6871
], [
6972
'int',
7073
'',
74+
'bool',
7175
], $parameter->schema->type)
7276
);
7377
}

src/Generator/Operations.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ public static function generate(string $path, string $method, string $namespace,
5252
setType(str_replace([
5353
'integer',
5454
'any',
55+
'boolean',
5556
], [
5657
'int',
5758
'',
59+
'bool',
5860
], $parameter->schema->type))
5961
);
6062

@@ -64,9 +66,11 @@ public static function generate(string $path, string $method, string $namespace,
6466
str_replace([
6567
'integer',
6668
'any',
69+
'boolean',
6770
], [
6871
'int',
6972
'',
73+
'bool',
7074
], $parameter->schema->type)
7175
);
7276
if ($parameter->schema->default !== null) {

src/Generator/Path.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ public static function generate(string $path, string $namespace, string $baseNam
3636
str_replace([
3737
'integer',
3838
'any',
39+
'boolean',
3940
], [
4041
'int',
4142
'',
43+
'bool',
4244
], $parameter->schema->type)
4345
);
4446
}

src/Generator/Schema.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,20 @@ public static function generate(string $name, string $namespace, string $classNa
8282
$propertyStmt->setType(str_replace([
8383
'integer',
8484
'any',
85+
'boolean',
8586
], [
8687
'int',
8788
'',
89+
'bool',
8890
], $property->type));
8991
$method->setReturnType(str_replace([
9092
'integer',
9193
'any',
94+
'boolean',
9295
], [
9396
'int',
9497
'',
98+
'bool',
9599
], $property->type));
96100
}
97101

0 commit comments

Comments
 (0)