Completed
Pull Request — master (#123)
by Robbie
04:53 queued 02:47
created

DoormanProcessManager::getManager()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
3
namespace SilverStripe\QueuedJobs\Jobs;
4
5
use AsyncPHP\Doorman\Manager\ProcessManager;
6
7
class DoormanProcessManager
8
{
9
    /**
10
     * @var ProcessManager
11
     */
12
    protected $manager;
13
14
    /**
15
     * Get the Doorman ProcessManager with a customised worker path
16
     *
17
     * @return ProcessManager
18
     */
19
    public function getManager()
20
    {
21
        if ($this->manager === null) {
22
            $this->manager = new ProcessManager;
23
            $this->manager->setWorker(BASE_PATH . '/framework/cli-script.php dev/tasks/ProcessJobQueueChildTask');
24
        }
25
        return $this->manager;
26
    }
27
}
28