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