|
@@ 151-160 (lines=10) @@
|
| 148 |
|
) |
| 149 |
|
); |
| 150 |
|
} |
| 151 |
|
if (false === is_string($service['class'])) { |
| 152 |
|
throw new InvalidArgumentException( |
| 153 |
|
sprintf( |
| 154 |
|
'Parameter "class" must be a FQCN for service "%s", but found "%s" instead in %s. Check your YAML syntax.', |
| 155 |
|
$id, |
| 156 |
|
gettype($service['class']), |
| 157 |
|
$fileName |
| 158 |
|
) |
| 159 |
|
); |
| 160 |
|
} |
| 161 |
|
|
| 162 |
|
return $service['class']; |
| 163 |
|
} |
|
@@ 312-321 (lines=10) @@
|
| 309 |
|
|
| 310 |
|
$factoryClass = $factory[0]; |
| 311 |
|
$factoryMethod = $factory[1]; |
| 312 |
|
if (false === is_string($factoryClass)) { |
| 313 |
|
throw new InvalidArgumentException( |
| 314 |
|
sprintf( |
| 315 |
|
'The first parameter of "factory" for service "%s" must be a class name or a reference to a service, but found "%s" instead in %s. Check your YAML syntax.', |
| 316 |
|
$service->getName(), |
| 317 |
|
gettype($factoryClass), |
| 318 |
|
$fileName |
| 319 |
|
) |
| 320 |
|
); |
| 321 |
|
} |
| 322 |
|
$factoryClass = $this->serviceResolver->resolve($factoryClass); |
| 323 |
|
|
| 324 |
|
if (false === is_string($factoryMethod)) { |
|
@@ 324-333 (lines=10) @@
|
| 321 |
|
} |
| 322 |
|
$factoryClass = $this->serviceResolver->resolve($factoryClass); |
| 323 |
|
|
| 324 |
|
if (false === is_string($factoryMethod)) { |
| 325 |
|
throw new InvalidArgumentException( |
| 326 |
|
sprintf( |
| 327 |
|
'The second parameter of "factory" for service "%s" must be a class name or a reference to a service, but found "%s" instead in %s. Check your YAML syntax.', |
| 328 |
|
$service->getName(), |
| 329 |
|
gettype($factoryMethod), |
| 330 |
|
$fileName |
| 331 |
|
) |
| 332 |
|
); |
| 333 |
|
} |
| 334 |
|
|
| 335 |
|
return new FactoryService($service, $factoryClass, $factoryMethod); |
| 336 |
|
} |