| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function testBodyStructure() : void |
||
| 23 | { |
||
| 24 | $valueHolder = $this->createMock(PropertyGenerator::class); |
||
|
|
|||
| 25 | |||
| 26 | $valueHolder->method('getName')->willReturn('bar'); |
||
| 27 | |||
| 28 | $isProxyInitialized = new IsProxyInitialized($valueHolder); |
||
| 29 | |||
| 30 | self::assertSame('isProxyInitialized', $isProxyInitialized->getName()); |
||
| 31 | self::assertCount(0, $isProxyInitialized->getParameters()); |
||
| 32 | self::assertSame('return null !== $this->bar;', $isProxyInitialized->getBody()); |
||
| 33 | self::assertStringMatchesFormat('%A : bool%A', $isProxyInitialized->generate(), 'Return type hint is boolean'); |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
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.