summaryrefslogtreecommitdiff
path: root/plugins/jobs/tests/Jobs/Local/Job.php
blob: 2f5803c84432a6a0c96363379f88d10ac034658b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

/**
 * Spiral Framework.
 *
 * @license   MIT
 * @author    Anton Titov (Wolfy-J)
 */

declare(strict_types=1);

namespace Spiral\Jobs\Tests\Local;

use Spiral\Jobs\JobHandler;

class Job extends JobHandler
{
    public const JOB_FILE = __DIR__ . '/../../local.job';

    public function invoke(string $id, array $payload): void
    {
        file_put_contents(self::JOB_FILE, json_encode(
            $payload + compact('id')
        ));
    }
}