| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testBodyStructure() : void |
||
| 26 | { |
||
| 27 | $reflection = new ReflectionClass(EmptyClass::class); |
||
| 28 | $initializer = $this->createMock(PropertyGenerator::class); |
||
|
|
|||
| 29 | $initCall = $this->createMock(MethodGenerator::class); |
||
| 30 | |||
| 31 | $initializer->method('getName')->willReturn('foo'); |
||
| 32 | $initCall->method('getName')->willReturn('bar'); |
||
| 33 | |||
| 34 | $magicClone = new MagicClone($reflection, $initializer, $initCall); |
||
| 35 | |||
| 36 | self::assertSame('__clone', $magicClone->getName()); |
||
| 37 | self::assertCount(0, $magicClone->getParameters()); |
||
| 38 | self::assertSame( |
||
| 39 | "\$this->foo && \$this->bar('__clone', []);", |
||
| 40 | $magicClone->getBody() |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
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.