Skip to content

Commit

Permalink
♻️ better ecco fieldMethod
Browse files Browse the repository at this point in the history
Signed-off-by: bnomei <[email protected]>
  • Loading branch information
bnomei committed Dec 7, 2023
1 parent 4ff244d commit ca11c38
Show file tree
Hide file tree
Showing 13 changed files with 592 additions and 455 deletions.
6 changes: 3 additions & 3 deletions classes/Janitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class Janitor

private static array $data = [];

public function data(string $command, array $data = null): ?array
public function data(string $command, ?array $data = null): ?array
{
if ($data) {
Janitor::$data[$command] = $data;
Expand All @@ -79,7 +79,7 @@ public function __construct(array $options = [])
}
}

public function option(string $key = null): mixed
public function option(?string $key = null): mixed
{
if ($key) {
return A::get($this->options, $key);
Expand Down Expand Up @@ -150,7 +150,7 @@ public static function parseCommand(string $command): array
return [$name, $args];
}

public static function query(string $template = null, mixed $model = null): string
public static function query(?string $template = null, mixed $model = null): string
{
$page = null;
$file = null;
Expand Down
2 changes: 1 addition & 1 deletion commands/cleancontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JanitorCleanContentCommand
*
* @psalm-param list{string, string,...}|null $ignore
*/
public static function cleanUp(CLI $cli, Kirby\Cms\Pages $collection, array $ignore = null, string $lang = null): int
public static function cleanUp(CLI $cli, Kirby\Cms\Pages $collection, ?array $ignore = null, ?string $lang = null): int
{
$updated = 0;
foreach ($collection as $item) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-janitor",
"type": "kirby-plugin",
"version": "4.0.0",
"version": "4.0.1",
"license": "MIT",
"homepage": "https://github.com/bnomei/kirby3-janitor",
"description": "Kirby 3 Plugin for running commands like cleaning the cache from within the Panel, PHP code or a cronjob",
Expand Down
Loading

0 comments on commit ca11c38

Please sign in to comment.