Skip to content
Permalink
Browse files

Fix: showing list of registered non static jobs and doc updated (#11)

  • Loading branch information...
petrparolek authored and f3l1x committed Jan 13, 2019
1 parent 5c3173f commit 84c58891e5fc99c10b83726772ef39bdd95527f4
Showing with 15 additions and 3 deletions.
  1. +6 −2 .docs/README.md
  2. +1 −0 phpstan.neon
  3. +8 −1 src/Command/ListCommand.php
@@ -31,10 +31,14 @@ scheduler:
Set cron expression and php callback.

```yaml
services:
foo: App\Model\Foo
scheduler:
jobs:
- {cron: '* * * * *', callback: App\Model\Pirate::arrgghh}
- {cron: '*/2 * * * *', callback: App\Model\Parrot::echo}
- {cron: '* * * * *', callback: [@foo, echo]}}
- {cron: '*/2 * * * *', callback: App\Model\Bar::echo}
```

Cron expression:
@@ -8,3 +8,4 @@ parameters:
ignoreErrors:
# Typecasting to resource is too complicated
- '#^Parameter \#1 \$fp of function (flock|fclose) expects resource, resource\|false given\.$#'
- '#^Cannot access offset \d+ on callable\.$#'
@@ -68,7 +68,14 @@ private static function formatRow(string $key, IJob $job, DateTime $dateTime): a
// Callback
if ($job instanceof CallbackJob) {
$row[] = $job->getCallback();
$callback = $job->getCallback();
if (is_string($callback)) {
$row[] = $callback;
} else {
$class = $callback[0];
$callback = $callback[1];
$row[] = get_class($class) . '->' . $callback . '()';
}
} else {
$row[] = 'Dynamic';
}

0 comments on commit 84c5889

Please sign in to comment.
You can’t perform that action at this time.