Completed
Push — master ( bfd868...ee3a72 )
by Vincent
12:29 queued 10:26
created

AssertMetaObject   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertIsValidMetaObject() 0 9 2
1
<?php
2
namespace VGirol\JsonApiAssert\Asserts;
3
4
use VGirol\JsonApiAssert\Messages;
5
6
trait AssertMetaObject
7
{
8
    /**
9
     * Asserts that a meta object is valid.
10
     *
11
     * @param array $meta
12
     * 
13
     * @throws PHPUnit\Framework\ExpectationFailedException
14
     */
15 15
    public static function assertIsValidMetaObject($meta)
16
    {
17 15
        static::assertIsNotArrayOfObjects(
18 15
            $meta,
19 15
            Messages::META_OBJECT_IS_NOT_ARRAY
20
        );
21
22 10
        foreach (array_keys($meta) as $key) {
23 10
            static::assertIsValidMemberName($key);
0 ignored issues
show
Bug introduced by
The method assertIsValidMemberName() does not exist on VGirol\JsonApiAssert\Asserts\AssertMetaObject. Did you maybe mean assertIsValidMetaObject()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
            static::/** @scrutinizer ignore-call */ 
24
                    assertIsValidMemberName($key);

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.

Loading history...
24
        }
25 8
    }
26
}
27