Code Duplication    Length = 14-14 lines in 2 locations

src/Comodojo/Extender/Socket/Commands/Queue/Info.php 1 location

@@ 6-19 (lines=14) @@
3
use \Comodojo\Daemon\Daemon;
4
use \Comodojo\RpcServer\Request\Parameters;
5
6
class Info {
7
8
    public static function execute(Parameters $params, Daemon $daemon) {
9
10
        $configuration = $daemon->getConfiguration();
11
        $base_path = $configuration->get('base-path');
12
        $lock_path = $configuration->get('run-path');
13
        $lock_file = "$base_path/$lock_path/queue.worker.lock";
14
15
        return unserialize(file_get_contents($lock_file));
16
17
    }
18
19
}
20

src/Comodojo/Extender/Socket/Commands/Scheduler/Info.php 1 location

@@ 6-19 (lines=14) @@
3
use \Comodojo\Daemon\Daemon;
4
use \Comodojo\RpcServer\Request\Parameters;
5
6
class Info {
7
8
    public static function execute(Parameters $params, Daemon $daemon) {
9
10
        $configuration = $daemon->getConfiguration();
11
        $base_path = $configuration->get('base-path');
12
        $lock_path = $configuration->get('run-path');
13
        $lock_file = "$base_path/$lock_path/schedule.worker.lock";
14
15
        return unserialize(file_get_contents($lock_file));
16
17
    }
18
19
}
20