Issues (1)

tests/Common/DumpableTraitTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace GuillermoandraeTest\Common;
4
5
use Guillermoandrae\Common\DumpableTrait;
6
use PHPUnit\Framework\TestCase;
7
8
class DumpableTraitTest extends TestCase
9
{
10
    public function testDump()
11
    {
12
        $dumpable = $this->getMockForTrait(DumpableTrait::class);
13
        $this->assertSame(var_dump($dumpable), $dumpable->dump());
0 ignored issues
show
Are you sure the usage of var_dump($dumpable) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

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

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

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

Loading history...
14
    }
15
}
16