Skip to content

Commit

Permalink
handle bools
Browse files Browse the repository at this point in the history
  • Loading branch information
sergix44 committed Sep 16, 2023
1 parent 5ffdb10 commit ee97b7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/docs/alterations/interlace.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `interlace()`

```
->interlace([bool $interlace = 1]): self
->interlace([bool $interlace = true]): self
```
## Parameters

Expand All @@ -18,6 +18,6 @@ Instance of `SergiX44\ImageZen\Image`.
use SergiX44\ImageZen\Image;

$image = Image::make('path/to/image.jpg')
->interlace([bool $interlace = 1]);
->interlace([bool $interlace = true]);

```
4 changes: 2 additions & 2 deletions docs/docs/alterations/resizeCanvas.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `resizeCanvas()`

```
->resizeCanvas(?int $width, ?int $height, [SergiX44\ImageZen\Draws\Position $anchor = SergiX44\ImageZen\Draws\Position::CENTER], [bool $relative = ], [?SergiX44\ImageZen\Draws\Color $background = null]): self
->resizeCanvas(?int $width, ?int $height, [SergiX44\ImageZen\Draws\Position $anchor = SergiX44\ImageZen\Draws\Position::CENTER], [bool $relative = false], [?SergiX44\ImageZen\Draws\Color $background = null]): self
```
## Parameters

Expand All @@ -22,6 +22,6 @@ Instance of `SergiX44\ImageZen\Image`.
use SergiX44\ImageZen\Image;

$image = Image::make('path/to/image.jpg')
->resizeCanvas(?int $width, ?int $height, [SergiX44\ImageZen\Draws\Position $anchor = SergiX44\ImageZen\Draws\Position::CENTER], [bool $relative = ], [?SergiX44\ImageZen\Draws\Color $background = null]);
->resizeCanvas(?int $width, ?int $height, [SergiX44\ImageZen\Draws\Position $anchor = SergiX44\ImageZen\Draws\Position::CENTER], [bool $relative = false], [?SergiX44\ImageZen\Draws\Color $background = null]);

```
6 changes: 5 additions & 1 deletion generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

$file = __DIR__ . "/docs/docs/alterations/$id.md";
if (file_exists($file) && AVOID_OVERWRITE) {
return;
continue;
}


Expand Down Expand Up @@ -67,6 +67,10 @@
$val = "{$e->getDeclaringClass()->getName()}::{$e->getName()}";
}

if (is_bool($val)) {
$val = $val ? 'true' : 'false';
}

$params .= "[{$parameter->getType()} \${$parameter->getName()} = {$val}]";
} else {
$params .= "{$parameter->getType()} \${$parameter->getName()}";
Expand Down

0 comments on commit ee97b7d

Please sign in to comment.