PendingChain.php
834 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Illuminate\Foundation\Bus;
class PendingChain
{
/**
* The class name of the job being dispatched.
*
* @var string
*/
public $class;
/**
* The jobs to be chained.
*
* @var array
*/
public $chain;
/**
* Create a new PendingChain instance.
*
* @param string $class
* @param array $chain
* @return void
*/
public function __construct($class, $chain)
{
$this->class = $class;
$this->chain = $chain;
}
/**
* Dispatch the job with the given arguments.
*
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public function dispatch()
{
return (new PendingDispatch(
new $this->class(...func_get_args())
))->chain($this->chain);
}
}