Issues (41)

tests/src/Traits/CanBootTraitsTraitTest.php (1 issue)

Labels
Severity
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
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
}