Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | class PrototypesIsPrototypeableTest extends TestCase |
||
11 | { |
||
12 | |||
13 | public function testPrototypeCanBeCreated(): void |
||
14 | { |
||
15 | $this->assertNull(Prototypes::addStaticMethod('prototypeStaticMethod', fn() => true)); |
||
|
|||
16 | } |
||
17 | |||
18 | public function testPrototypeCanBeCalled(): void |
||
19 | { |
||
20 | $this->assertTrue(Prototypes::prototypeStaticMethod()); |
||
21 | } |
||
22 | |||
23 | public function testErrorIsThrownInNonExistentMethods(): void |
||
24 | { |
||
25 | $this->expectException(Error::class); |
||
26 | Prototypes::nonExistentStaticMethod(); |
||
27 | } |
||
28 | |||
29 | public function testCantOverridePrototypes(): void |
||
30 | { |
||
31 | $this->expectException(Exception::class); |
||
32 | Prototypes::addStaticMethod('prototypeStaticMethod', fn() => true); |
||
33 | } |
||
34 | |||
35 | public function testCantOverrideMethods(): void |
||
36 | { |
||
37 | $this->expectException(Exception::class); |
||
38 | // isPrototypeable is an existent static method |
||
39 | Prototypes::addStaticMethod('isPrototypeable', fn() => true); |
||
40 | } |
||
41 | |||
42 | public function testCantAddNonStaticMethods(): void |
||
47 | } |
||
48 | |||
49 | } |
||
50 |
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.