Passed
Push — master ( 337d8e...76e5f0 )
by Gabriel
02:33
created

ClassCollectionTest::typeClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Collections\Tests\Typed;
4
5
use Nip\Collections\Tests\AbstractTest;
6
use Nip\Collections\Tests\Fixtures\BaseObject;
7
use Nip\Collections\Typed\ClassCollection;
8
use Nip\Utility\Number;
9
10
/**
11
 * Class ClassCollectionTest
12
 * @package Nip\Collections\Tests\Typed
13
 */
14
class ClassCollectionTest extends AbstractTest
15
{
16
    use AbstractTypeTraitTest {
17
        newCollection as newCollectionTrait;
18
    }
19
20
    /**
21
     * @return \Nip\Collections\Typed\AbstractTypedCollection
22
     */
23
    protected function newCollection()
24
    {
25
        $collection = $this->newCollectionTrait();
26
        $collection->validClass(BaseObject::class);
0 ignored issues
show
Bug introduced by
The method validClass() does not exist on Nip\Collections\Typed\AbstractTypedCollection. It seems like you code against a sub-type of Nip\Collections\Typed\AbstractTypedCollection such as Nip\Collections\Typed\ClassCollection. ( Ignorable by Annotation )

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

26
        $collection->/** @scrutinizer ignore-call */ 
27
                     validClass(BaseObject::class);
Loading history...
27
        return $collection;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    protected function typeClass()
34
    {
35
        return ClassCollection::class;
36
    }
37
38
    protected function typeInvalidValues(): array
39
    {
40
        return ['string', new \stdClass(), new Number()];
41
    }
42
43
    protected function typeValidValues(): array
44
    {
45
        return [new BaseObject()];
46
    }
47
}
48