forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbug-7388.php
More file actions
67 lines (54 loc) · 1.02 KB
/
bug-7388.php
File metadata and controls
67 lines (54 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php declare(strict_types = 1);
namespace Bug7388;
interface FooInterface
{
public function bar(int $i): void;
}
class ParentFoo
{
public function bar(): void
{
}
}
class Foo extends ParentFoo implements FooInterface
{
}
// Additional cases
interface BazInterface
{
public function baz(string $s, int $i): void;
}
class ParentBaz
{
public function baz(string $s): void
{
}
}
class Baz extends ParentBaz implements BazInterface
{
}
// Case where the parent has more params than the interface (should be ok in some cases)
interface QuxInterface
{
public function qux(): void;
}
class ParentQux
{
public function qux(int $i = 0): void
{
}
}
class Qux extends ParentQux implements QuxInterface
{
}
// Case where the child DOES override (already handled by existing rules)
class OverridingFoo extends ParentFoo implements FooInterface
{
public function bar(int $i): void
{
}
}
// Abstract class should not be checked (it can defer implementation)
abstract class AbstractFoo extends ParentFoo implements FooInterface
{
}