| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 38 | 2 | public function getResolverForPart(EmailPart $part): EmailPartResolver |
|
| 39 | { |
||
| 40 | 2 | $identifier = get_class($part); |
|
| 41 | |||
| 42 | 2 | if (!array_key_exists($identifier, $this->resolvers)) { |
|
| 43 | 1 | throw new InvalidArgumentException(sprintf( |
|
| 44 | 1 | 'Resolver for the part "%s" does not exists. Please choose one of the following: %s', |
|
| 45 | $identifier, |
||
| 46 | 1 | implode(', ', array_keys($this->resolvers)) |
|
| 47 | )); |
||
| 48 | } |
||
| 49 | |||
| 50 | 1 | return $this->resolvers[$identifier]; |
|
| 51 | } |
||
| 52 | } |
||
| 53 |