CanBootTraitsTraitTest::test_getBootTraits()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Utility\Tests\Traits;
4
5
use Nip\Utility\Tests\AbstractTest;
6
use Nip\Utility\Tests\Fixtures\BaseClass;
7
8
/**
9
 * Class CanBootTraitsTraitTest
10
 * @package Nip\Utility\Tests\Traits
11
 */
12
class CanBootTraitsTraitTest extends AbstractTest
13
{
14
15
    public function test_getBootTraits()
16
    {
17
        $books = new BaseClass();
18
        $bootTraits = $books->getBootTraits();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $bootTraits is correct as $books->getBootTraits() targeting Nip\Utility\Tests\Fixtur...eClass::getBootTraits() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
19
        self::assertEquals(
20
            ['bootBootableTrait'],
21
            $bootTraits
22
        );
23
    }
24
}