| 1 | <?php  | 
            ||
| 11 | final class NullSerializerTest extends \PHPUnit\Framework\TestCase  | 
            ||
| 12 | { | 
            ||
| 13 | /**  | 
            ||
| 14 | * @var NullSerializer  | 
            ||
| 15 | */  | 
            ||
| 16 | private $serializer;  | 
            ||
| 17 | |||
| 18 | /**  | 
            ||
| 19 | * Prepare each test  | 
            ||
| 20 | *  | 
            ||
| 21 | * @return void  | 
            ||
| 22 | */  | 
            ||
| 23 | public function setUp()  | 
            ||
| 27 | |||
| 28 | /**  | 
            ||
| 29 | * @test  | 
            ||
| 30 | * @covers ::unserialize  | 
            ||
| 31 | *  | 
            ||
| 32 | * @return void  | 
            ||
| 33 | */  | 
            ||
| 34 | public function unserialize()  | 
            ||
| 39 | |||
| 40 | /**  | 
            ||
| 41 | * @test  | 
            ||
| 42 | * @covers ::serialize  | 
            ||
| 43 | *  | 
            ||
| 44 | * @return void  | 
            ||
| 45 | */  | 
            ||
| 46 | public function serialize()  | 
            ||
| 52 | }  | 
            ||
| 53 | 
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.