| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testBodyStructure() : void |
||
| 26 | { |
||
| 27 | $initializer = $this->createMock(PropertyGenerator::class); |
||
|
|
|||
| 28 | |||
| 29 | $initializer->method('getName')->willReturn('foo'); |
||
| 30 | |||
| 31 | $setter = new SetProxyInitializer($initializer); |
||
| 32 | $parameters = $setter->getParameters(); |
||
| 33 | |||
| 34 | self::assertSame('setProxyInitializer', $setter->getName()); |
||
| 35 | self::assertCount(1, $parameters); |
||
| 36 | |||
| 37 | $initializer = array_shift($parameters); |
||
| 38 | |||
| 39 | self::assertSame('initializer', $initializer->getName()); |
||
| 40 | self::assertSame('$this->foo = $initializer;', $setter->getBody()); |
||
| 41 | self::assertEquals(TypeGenerator::fromTypeString('void'), $setter->getReturnType()); |
||
| 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.