| Conditions | 4 |
| Paths | 4 |
| Total Lines | 31 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 20 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 14 | public static function assertIsValidLinkObject($link) |
|
| 43 | { |
||
| 44 | try { |
||
| 45 | 14 | PHPUnit::assertIsArray($link); |
|
| 46 | 10 | } catch (ExpectationFailedException $e) { |
|
| 47 | try { |
||
| 48 | 10 | PHPUnit::assertIsString($link); |
|
| 49 | 7 | return; |
|
| 50 | 3 | } catch (ExpectationFailedException $e) { |
|
| 51 | 3 | PHPUnit::assertNull( |
|
| 52 | 3 | $link, |
|
| 53 | 3 | Messages::LINK_OBJECT_IS_NOT_ARRAY |
|
| 54 | ); |
||
| 55 | 1 | return; |
|
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | 4 | PHPUnit::assertArrayHasKey( |
|
| 60 | 4 | 'href', |
|
| 61 | 4 | $link, |
|
| 62 | 4 | Messages::LINK_OBJECT_MISS_HREF_MEMBER |
|
| 63 | ); |
||
| 64 | |||
| 65 | 3 | $allowed = ['href', 'meta']; |
|
| 66 | 3 | static::assertContainsOnlyAllowedMembers( |
|
| 67 | 3 | $allowed, |
|
| 68 | 3 | $link |
|
| 69 | ); |
||
| 70 | |||
| 71 | 2 | if (isset($link['meta'])) { |
|
| 72 | 2 | static::assertIsValidMetaObject($link['meta']); |
|
|
|
|||
| 73 | } |
||
| 76 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.