ByPuid   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 17 1
1
<?php namespace Comodojo\Extender\Socket\Commands\Worklog;
2
3
use \Comodojo\Daemon\Daemon;
4
use \Comodojo\RpcServer\Request\Parameters;
5
use \Comodojo\Extender\Worklog\Manager;
6
use \Comodojo\Extender\Transformers\WorklogTransformer;
7
use \League\Fractal\Manager as FractalManager;
8
use \League\Fractal\Resource\Collection;
9
10
class ByPuid {
11
12
    public static function execute(Parameters $params, Daemon $daemon) {
13
14
        $puid = $params->get('puid');
15
16
        $manager = new Manager(
17
            $daemon->getConfiguration(),
0 ignored issues
show
Bug introduced by
The method getConfiguration() does not exist on Comodojo\Daemon\Daemon. It seems like you code against a sub-type of Comodojo\Daemon\Daemon such as Comodojo\Extender\ExtenderDaemon. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            $daemon->/** @scrutinizer ignore-call */ 
18
                     getConfiguration(),
Loading history...
18
            $daemon->getLogger(),
19
            $daemon->getEvents()
20
        );
21
22
        $data = $manager->get(['parent_uid' => $puid]);
23
24
        $resource = new Collection($data, new WorklogTransformer);
25
        $fractal = new FractalManager();
26
        $data = $fractal->createData($resource)->toArray();
27
28
        return $data['data'];
29
30
    }
31
32
}
33