Total Complexity | 5 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class PrototypesTest extends TestCase |
||
11 | { |
||
12 | public function testPrototypeCanBeCreated(): void |
||
13 | { |
||
14 | $this->assertNull(DemoClassTest::addMethod('prototypeMethod', fn() => $this->property)); |
||
15 | } |
||
16 | |||
17 | public function testPrototypeCanBeCalled(): void |
||
20 | } |
||
21 | |||
22 | public function testErrorIsThrownInNonExistentMethods(): void |
||
26 | } |
||
27 | |||
28 | public function testCantOverridePrototypes(): void |
||
29 | { |
||
30 | $this->expectException(Exception::class); |
||
31 | DemoClassTest::addMethod('prototypeMethod', fn() => $this->property); |
||
32 | } |
||
33 | |||
34 | public function testCantOverrideMethods(): void |
||
38 | } |
||
39 | |||
40 | } |
||
41 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.