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 Reader |
||
41 | * |
||
42 | * Annotation Reader |
||
43 | */ |
||
44 | private $reader; |
||
45 | |||
46 | /** |
||
47 | * @var Finder |
||
48 | * |
||
49 | * Finder |
||
50 | */ |
||
51 | private $finder; |
||
52 | |||
53 | /** |
||
54 | * @var array |
||
55 | * |
||
56 | * Bundles available to perform search |
||
57 | */ |
||
58 | private $bundles; |
||
59 | |||
60 | /** |
||
61 | * @var array |
||
62 | * |
||
63 | * Namespaces paths to be searched |
||
64 | */ |
||
65 | private $resources; |
||
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 | * Root kernel directory |
||
83 | * |
||
84 | * @var string |
||
85 | */ |
||
86 | private $rootDir; |
||
87 | |||
88 | /** |
||
89 | * Construct method |
||
90 | * |
||
91 | * @param KernelInterface $kernel Kernel instance |
||
92 | * @param Reader $reader Reader |
||
93 | * @param Finder $finder Finder |
||
94 | * @param array $bundles Bundle array where to parse workers, defined on condiguration |
||
95 | * @param array $resources Array of namespace paths to be searched for worker annotations |
||
96 | * @param array $servers Server list defined on configuration |
||
97 | * @param array $defaultSettings Default settings defined on configuration |
||
98 | */ |
||
99 | 9 | public function __construct( |
|
118 | |||
119 | /** |
||
120 | * Loads Worker Collection from parsed files |
||
121 | * |
||
122 | * @return WorkerCollection collection of all info |
||
123 | */ |
||
124 | 3 | public function load() |
|
131 | |||
132 | /** |
||
133 | * Return Gearman bundle settings, previously loaded by method load() |
||
134 | * |
||
135 | * If settings are not loaded, a SettingsNotLoadedException Exception is thrown |
||
136 | * |
||
137 | * @param array $kernelBundles Kernel bundles |
||
138 | * @param array $bundles Bundle array of settings |
||
139 | * |
||
140 | * @return array Return an array containing paths and ignore paths |
||
|
|||
141 | */ |
||
142 | 8 | public function loadBundleNamespaceMap(array $kernelBundles, array $bundles) |
|
186 | |||
187 | /** |
||
188 | * Get resource paths |
||
189 | * @param string $rootDir |
||
190 | * @param array $resources |
||
191 | * @return array |
||
192 | */ |
||
193 | public function loadResourceNamespaceMap($rootDir, array $resources) |
||
199 | |||
200 | /** |
||
201 | * Perform a parsing inside all namespace map |
||
202 | * |
||
203 | * Creates an empty worker collection and, if exist some parseable files |
||
204 | * parse them, filling this object |
||
205 | * |
||
206 | * @param Finder $finder Finder |
||
207 | * @param Reader $reader Reader |
||
208 | * @param array $paths Paths where to look for |
||
209 | * @param array $excludedPaths Paths to ignore |
||
210 | * |
||
211 | * @return WorkerCollection collection of all info |
||
212 | */ |
||
213 | 5 | public function parseNamespaceMap( |
|
236 | |||
237 | /** |
||
238 | * Load all workers with their jobs |
||
239 | * |
||
240 | * @param Finder $finder Finder |
||
241 | * @param Reader $reader Reader |
||
242 | * @param WorkerCollection $workerCollection Worker collection |
||
243 | * |
||
244 | * @return GearmanParser self Object |
||
245 | */ |
||
246 | public function parseFiles( |
||
286 | |||
287 | /** |
||
288 | * Returns file class namespace, if exists |
||
289 | * |
||
290 | * @param string $file A PHP file path |
||
291 | * |
||
292 | * @return string|false Full class namespace if found, false otherwise |
||
293 | */ |
||
294 | 2 | public function getFileClassNamespace($file) |
|
306 | } |
||
307 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.