Projekt

Obecné

Profil

Stáhnout (805 Bajtů) Statistiky
| Větev: | Revize:
1
<?php
2

    
3
use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract;
4

    
5
class IlluminateQueueClosure
6
{
7
    /**
8
     * The encrypter instance.
9
     *
10
     * @var \Illuminate\Contracts\Encryption\Encrypter
11
     */
12
    protected $crypt;
13

    
14
    /**
15
     * Create a new queued Closure job.
16
     *
17
     * @param  \Illuminate\Contracts\Encryption\Encrypter  $crypt
18
     * @return void
19
     */
20
    public function __construct(EncrypterContract $crypt)
21
    {
22
        $this->crypt = $crypt;
23
    }
24

    
25
    /**
26
     * Fire the Closure based queue job.
27
     *
28
     * @param  \Illuminate\Contracts\Queue\Job  $job
29
     * @param  array  $data
30
     * @return void
31
     */
32
    public function fire($job, $data)
33
    {
34
        $closure = unserialize($this->crypt->decrypt($data['closure']));
35

    
36
        $closure($job);
37
    }
38
}
(5-5/18)