| Conditions | 6 |
| Paths | 5 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 6.0702 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 7 | public function resolve(Request $request) |
|
| 37 | { |
||
| 38 | 7 | foreach ($this->resolvers as $resolver) { |
|
| 39 | 7 | $version = $resolver->resolve($request); |
|
| 40 | |||
| 41 | 7 | if (null !== $version && !is_string($version)) { |
|
| 42 | @trigger_error(sprintf('Not returning a string or null from %s::resolve() when implementing the %s is deprecated since FOSRestBundle 2.8.', get_class($resolver), VersionResolverInterface::class), E_USER_DEPRECATED); |
||
|
|
|||
| 43 | } |
||
| 44 | |||
| 45 | 7 | if (null !== $version && false !== $version) { |
|
| 46 | 4 | return $version; |
|
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | 3 | return null; |
|
| 51 | } |
||
| 52 | |||
| 58 |
If you suppress an error, we recommend checking for the error condition explicitly: