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

DoormanProcessManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getManager() 0 8 2
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