1 | <?php |
||
29 | class GearmanParser |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | * |
||
35 | * Bundles loaded by kernel |
||
36 | */ |
||
37 | private $kernelBundles; |
||
38 | |||
39 | /** |
||
40 | * @var KernelInterface |
||
41 | * |
||
42 | * Kernel object |
||
43 | */ |
||
44 | private $kernel; |
||
45 | |||
46 | /** |
||
47 | * @var Reader |
||
48 | * |
||
49 | * Annotation Reader |
||
50 | */ |
||
51 | private $reader; |
||
52 | |||
53 | /** |
||
54 | * @var Finder |
||
55 | * |
||
56 | * Finder |
||
57 | */ |
||
58 | private $finder; |
||
59 | |||
60 | /** |
||
61 | * @var array |
||
62 | * |
||
63 | * Bundles available to perform search |
||
64 | */ |
||
65 | private $bundles; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | * |
||
70 | * Collection of servers to connect |
||
71 | */ |
||
72 | private $servers; |
||
73 | |||
74 | /** |
||
75 | * @var array |
||
76 | * |
||
77 | * Default settings defined by user in config.yml |
||
78 | */ |
||
79 | private $defaultSettings; |
||
80 | |||
81 | /** |
||
82 | * Construct method |
||
83 | * |
||
84 | * @param KernelInterface $kernel Kernel instance |
||
85 | * @param Reader $reader Reader |
||
86 | * @param Finder $finder Finder |
||
87 | * @param array $bundles Bundle array where to parse workers, defined on condiguration |
||
88 | * @param array $servers Server list defined on configuration |
||
89 | * @param array $defaultSettings Default settings defined on configuration |
||
90 | */ |
||
91 | 5 | public function __construct( |
|
108 | |||
109 | /** |
||
110 | * Loads Worker Collection from parsed files |
||
111 | * |
||
112 | * @return WorkerCollection collection of all info |
||
113 | */ |
||
114 | 1 | public function load() |
|
120 | |||
121 | /** |
||
122 | * Return Gearman bundle settings, previously loaded by method load() |
||
123 | * |
||
124 | * If settings are not loaded, a SettingsNotLoadedException Exception is thrown |
||
125 | * |
||
126 | * @param array $kernelBundles Kernel bundles |
||
127 | * @param array $bundles Bundle array of settings |
||
128 | * |
||
129 | * @return array Return an array containing paths and ignore paths |
||
130 | */ |
||
131 | 6 | public function loadNamespaceMap(array $kernelBundles, array $bundles) |
|
175 | |||
176 | /** |
||
177 | * Perform a parsing inside all namespace map |
||
178 | * |
||
179 | * Creates an empty worker collection and, if exist some parseable files |
||
180 | * parse them, filling this object |
||
181 | * |
||
182 | * @param Finder $finder Finder |
||
183 | * @param Reader $reader Reader |
||
184 | * @param array $paths Paths where to look for |
||
185 | * @param array $excludedPaths Paths to ignore |
||
186 | * |
||
187 | * @return WorkerCollection collection of all info |
||
188 | */ |
||
189 | 3 | public function parseNamespaceMap( |
|
212 | |||
213 | /** |
||
214 | * Load all workers with their jobs |
||
215 | * |
||
216 | * @param Finder $finder Finder |
||
217 | * @param Reader $reader Reader |
||
218 | * @param WorkerCollection $workerCollection Worker collection |
||
219 | * |
||
220 | * @return GearmanParser self Object |
||
221 | */ |
||
222 | public function parseFiles( |
||
262 | |||
263 | /** |
||
264 | * Returns file class namespace, if exists |
||
265 | * |
||
266 | * @param string $file A PHP file path |
||
267 | * |
||
268 | * @return string|false Full class namespace if found, false otherwise |
||
269 | */ |
||
270 | 2 | public function getFileClassNamespace($file) |
|
282 | } |
||
283 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.