| Conditions | 3 | 
| Paths | 3 | 
| Total Lines | 20 | 
| Code Lines | 12 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 33 | public function parse($id, array $service, $fileName) | ||
| 34 |     { | ||
| 35 |         if (false === isset($service['alias'])) { | ||
| 36 | return null; | ||
| 37 | } | ||
| 38 | |||
| 39 | $aliasName = $service['alias']; | ||
| 40 |         if (false === is_string($aliasName)) { | ||
| 41 | throw new InvalidArgumentException( | ||
| 42 | sprintf( | ||
| 43 | 'Parameter "alias" must be a plain name for service "%s", but found "%s" instead in %s. Check your YAML syntax.', | ||
| 44 | $id, | ||
| 45 | gettype($aliasName), | ||
| 46 | $fileName | ||
| 47 | ) | ||
| 48 | ); | ||
| 49 | } | ||
| 50 | |||
| 51 | return new Alias($aliasName, $id); | ||
| 52 | } | ||
| 53 | } | ||
| 54 |