-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
By doing this there is no error when composer installing or updating. This doesn't matter most of the time. But on slower hardware this is hella slow.
- Loading branch information
1 parent
8393144
commit d4ec151
Showing
4 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
var/* | ||
!var/.gitkeep | ||
src/Generated/* | ||
!src/Generated/.gitkeep | ||
vendor/ | ||
etc/qa/.phpunit.result.cache |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mammatus\Cron\Generated; | ||
|
||
use Mammatus\Cron\Action; | ||
|
||
// phpcs:disable | ||
/** | ||
* @internal | ||
* Autogenerated file, do not edit. Changes will be overwritten on the next composer (install|update) | ||
*/ | ||
abstract readonly class AbstractList | ||
{ | ||
/** @return iterable<string, Action> */ | ||
final protected function crons(): iterable | ||
{ | ||
/** | ||
* @see \Mammatus\Cron\BuildIn\Noop | ||
* | ||
* @psalm-suppress MixedArgument Because we addOns argument comes from json_decode, Psalm doesn't like it. TODO: Drop the need for json_encode/json_decode | ||
*/ | ||
yield 'internal-no.op-Mammatus-Cron-BuildIn-Noop' => new Action( | ||
type: 'internal', | ||
name: 'no.op', | ||
schedule: '* * * * *', | ||
class: \Mammatus\Cron\BuildIn\Noop::class, | ||
addOns: \json_decode('[]', true), /** @phpstan-ignore-line */ | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mammatus\Cron\Generated; | ||
|
||
use WyriHaximus\React\Cron; | ||
use WyriHaximus\React\Cron\Action; | ||
use WyriHaximus\React\Mutex\Contracts\MutexInterface; | ||
|
||
// phpcs:disable | ||
/** | ||
* @internal | ||
* Autogenerated file, do not edit. Changes will be overwritten on the next composer (install|update) | ||
*/ | ||
abstract class AbstractManager | ||
{ | ||
private ?Cron $cron = null; | ||
|
||
final protected function cron(MutexInterface $mutex): Cron | ||
{ | ||
if ($this->cron instanceof Cron) { | ||
return $this->cron; | ||
} | ||
|
||
$this->cron = Cron::createWithMutex( | ||
$mutex, | ||
/** @see \Mammatus\Cron\BuildIn\Noop */ | ||
new Action( | ||
'cron_no.op', | ||
120, | ||
'* * * * *', | ||
fn () => $this->perform(\Mammatus\Cron\BuildIn\Noop::class), | ||
), | ||
); | ||
|
||
return $this->cron; | ||
} | ||
|
||
abstract protected function perform(string $class): void; | ||
} |