Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function create($className, $args, $queue) |
||
17 | { |
||
18 | if (!class_exists($className)) { |
||
19 | throw new ResqueException( |
||
20 | 'Could not find job class ' . $className . '.' |
||
21 | ); |
||
22 | } |
||
23 | |||
24 | if (!method_exists($className, 'perform')) { |
||
25 | throw new ResqueException( |
||
26 | 'Job class ' . $className . ' does not contain a perform method.' |
||
27 | ); |
||
28 | } |
||
29 | |||
30 | $instance = new $className(); |
||
31 | $instance->args = $args; |
||
32 | $instance->queue = $queue; |
||
33 | return $instance; |
||
34 | } |
||
36 |