Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
7 | class PThreadHandler extends \Thread implements ThreadInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var ClassLoader |
||
11 | */ |
||
12 | private $loader; |
||
13 | |||
14 | /** |
||
15 | * @var callable |
||
16 | */ |
||
17 | private $callable; |
||
18 | |||
19 | private $args; |
||
20 | |||
21 | private $result; |
||
22 | |||
23 | /** |
||
24 | * Thread constructor. |
||
25 | */ |
||
26 | public function __construct() |
||
30 | |||
31 | /** |
||
32 | * @return ClassLoader |
||
33 | */ |
||
34 | public function getLoader() |
||
51 | |||
52 | /** |
||
53 | * Here you are in a threaded environment |
||
54 | */ |
||
55 | public function run() |
||
74 | |||
75 | /** |
||
76 | * Start the thread |
||
77 | * |
||
78 | * @throws \RuntimeException |
||
79 | */ |
||
80 | public function execute() |
||
85 | |||
86 | /** |
||
87 | * Get the thread result |
||
88 | * |
||
89 | * @return mixed |
||
90 | * @throws \Exception |
||
91 | */ |
||
92 | public function getResult() |
||
101 | |||
102 | /** |
||
103 | * Kill a thread |
||
104 | * |
||
105 | * @param int $signal |
||
106 | * @param bool $wait |
||
107 | */ |
||
108 | public function stop($signal = SIGKILL, $wait = false) |
||
112 | |||
113 | /** |
||
114 | * Checkif the thread is not Terminated |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function isAlive() |
||
130 | |||
131 | /** |
||
132 | * Set the thread callable method |
||
133 | * @param callable $callable |
||
134 | * @return mixed |
||
135 | */ |
||
136 | public function setCallable(callable $callable) |
||
140 | |||
141 | public function waitFinish() |
||
145 | } |
||
146 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.