Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
22 | public function get( $id_or_slug ) |
||
23 | { |
||
24 | $filter = function( $world, $id ) use ($id_or_slug) { |
||
|
|||
25 | return ($world->getId() == $id_or_slug |
||
26 | or $world->getSlug() == $id_or_slug); |
||
27 | }; |
||
28 | |||
29 | $worlds = new \CallbackFilterIterator( $this->getIterator(), $filter); |
||
30 | $worlds->rewind(); |
||
31 | if ($worlds->valid()): |
||
32 | return $worlds->current(); |
||
33 | else: |
||
34 | throw new WorldNotFoundException("Could not find product world with ID or slug '$id_or_slug'"); |
||
35 | endif; |
||
73 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.