| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function testBodyStructure() : void |
||
| 25 | { |
||
| 26 | $reflection = new ReflectionClass(EmptyClass::class); |
||
| 27 | $adapter = $this->createMock(PropertyGenerator::class); |
||
|
|
|||
| 28 | $adapter->method('getName')->willReturn('foo'); |
||
| 29 | |||
| 30 | $magicGet = new MagicUnset($reflection, $adapter); |
||
| 31 | |||
| 32 | self::assertSame('__unset', $magicGet->getName()); |
||
| 33 | self::assertCount(1, $magicGet->getParameters()); |
||
| 34 | self::assertStringMatchesFormat( |
||
| 35 | '$return = $this->foo->call(\'ProxyManagerTestAsset\\\EmptyClass\', \'__unset\', array($name));' |
||
| 36 | . "\n\nreturn \$return;", |
||
| 37 | $magicGet->getBody() |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
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.