| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function testCanAddANotFinalMethod() : void |
||
| 44 | { |
||
| 45 | $classGenerator = $this->createMock(ClassGenerator::class); |
||
| 46 | $methodGenerator = $this->createMock(MethodGenerator::class); |
||
| 47 | |||
| 48 | $methodGenerator |
||
| 49 | ->expects(self::once()) |
||
| 50 | ->method('getName') |
||
| 51 | ->willReturn('publicMethod'); |
||
| 52 | |||
| 53 | $classGenerator |
||
| 54 | ->expects(self::once()) |
||
| 55 | ->method('addMethodFromGenerator'); |
||
| 56 | |||
| 57 | $reflection = new ReflectionClass(BaseClass::class); |
||
| 58 | |||
| 59 | self::assertTrue(ClassGeneratorUtils::addMethodIfNotFinal($reflection, $classGenerator, $methodGenerator)); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |
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.