| @@ 186-204 (lines=19) @@ | ||
| 183 | return $this; |
|
| 184 | } |
|
| 185 | ||
| 186 | private function getCollectorClassName($type) |
|
| 187 | { |
|
| 188 | if(false == strpos($type, '_')) { |
|
| 189 | $className = ucfirst($type); |
|
| 190 | } else { |
|
| 191 | $className = implode('', array_map('ucfirst', explode('_', $type))); |
|
| 192 | } |
|
| 193 | ||
| 194 | $className .= 'Collector'; |
|
| 195 | ||
| 196 | foreach($this->collectorNamespaces as $namespace) { |
|
| 197 | $fullyQualifiedClassName = $namespace . '\\' . $className; |
|
| 198 | if(class_exists($fullyQualifiedClassName)) { |
|
| 199 | return $fullyQualifiedClassName; |
|
| 200 | } |
|
| 201 | } |
|
| 202 | ||
| 203 | throw new \Exception('Class ' . $fullyQualifiedClassName . ' not found'); |
|
| 204 | } |
|
| 205 | ||
| 206 | /* |
|
| 207 | * @param int $requestNumber maximum number of allowed requests |
|
| @@ 238-256 (lines=19) @@ | ||
| 235 | ||
| 236 | } |
|
| 237 | ||
| 238 | private function getStorageClassName($type) |
|
| 239 | { |
|
| 240 | if(false == strpos($type, '_')) { |
|
| 241 | $className = ucfirst($type); |
|
| 242 | } else { |
|
| 243 | $className = implode('', array_map('ucfirst', explode('_', $type))); |
|
| 244 | } |
|
| 245 | ||
| 246 | $className .= 'Storage'; |
|
| 247 | ||
| 248 | foreach($this->storageNamespaces as $namespace) { |
|
| 249 | $fullyQualifiedClassName = $namespace . '\\' . $className; |
|
| 250 | if(class_exists($fullyQualifiedClassName)) { |
|
| 251 | return $fullyQualifiedClassName; |
|
| 252 | } |
|
| 253 | } |
|
| 254 | ||
| 255 | throw new \Exception('Class ' . $fullyQualifiedClassName . ' not found'); |
|
| 256 | } |
|
| 257 | ||
| 258 | public function createStorage($type, $configuratorCallable = null) |
|
| 259 | { |
|