File tree Expand file tree Collapse file tree 4 files changed +107
-1
lines changed Expand file tree Collapse file tree 4 files changed +107
-1
lines changed Original file line number Diff line number Diff line change
1
+ /composer.lock
2
+ /vendor
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " phpstan/phpstan-dibi" ,
3
3
"description" : " Dibi class reflection extension for PHPStan" ,
4
- "license" : [" MIT" ]
4
+ "license" : [" MIT" ],
5
+ "minimum-stability" : " dev" ,
6
+ "prefer-stable" : true ,
7
+ "require" : {
8
+ "php" : " ~7.0" ,
9
+ "phpstan/phpstan" : " dev-dev#8bb7f234a2" ,
10
+ "dibi/dibi" : " ~3.0"
11
+ },
12
+ "autoload" : {
13
+ "psr-4" : {
14
+ "PHPStan\\ " : " src/"
15
+ }
16
+ }
5
17
}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace PHPStan \Reflection \Dibi ;
4
+
5
+ use PHPStan \Reflection \ClassReflection ;
6
+ use PHPStan \Reflection \MethodReflection ;
7
+ use PHPStan \Reflection \MethodsClassReflectionExtension ;
8
+ use PHPStan \Reflection \PropertiesClassReflectionExtension ;
9
+ use PHPStan \Reflection \PropertyReflection ;
10
+
11
+ class DibiFluentClassReflectionExtension implements MethodsClassReflectionExtension
12
+ {
13
+
14
+ public function hasMethod (ClassReflection $ classReflection , string $ methodName ): bool
15
+ {
16
+ return $ classReflection ->getName () === \Dibi \Fluent::class;
17
+ }
18
+
19
+ public function getMethod (ClassReflection $ classReflection , string $ methodName ): MethodReflection
20
+ {
21
+ return new DibiFluentMethodReflection ($ methodName , $ classReflection );
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace PHPStan \Reflection \Dibi ;
4
+
5
+ use PHPStan \Reflection \ClassReflection ;
6
+ use PHPStan \Reflection \MethodReflection ;
7
+ use PHPStan \Type \NullType ;
8
+ use PHPStan \Type \ObjectType ;
9
+ use PHPStan \Type \Type ;
10
+
11
+ class DibiFluentMethodReflection implements MethodReflection
12
+ {
13
+
14
+ /** @var string */
15
+ private $ name ;
16
+
17
+ /** @var \PHPStan\Reflection\ClassReflection */
18
+ private $ dibiFluent ;
19
+
20
+ public function __construct (string $ name , ClassReflection $ dibiFluent )
21
+ {
22
+ $ this ->name = $ name ;
23
+ $ this ->dibiFluent = $ dibiFluent ;
24
+ }
25
+
26
+ public function getName (): string
27
+ {
28
+ return $ this ->name ;
29
+ }
30
+
31
+ public function getDeclaringClass (): ClassReflection
32
+ {
33
+ return $ this ->dibiFluent ;
34
+ }
35
+
36
+ public function isStatic (): bool
37
+ {
38
+ return false ;
39
+ }
40
+
41
+ /**
42
+ * @return \PHPStan\Reflection\ParameterReflection[]
43
+ */
44
+ public function getParameters (): array
45
+ {
46
+ return [];
47
+ }
48
+
49
+ public function isVariadic (): bool
50
+ {
51
+ return true ;
52
+ }
53
+
54
+ public function isPrivate (): bool
55
+ {
56
+ return false ;
57
+ }
58
+
59
+ public function isPublic (): bool
60
+ {
61
+ return true ;
62
+ }
63
+
64
+ public function getReturnType (): Type
65
+ {
66
+ return new ObjectType (\Dibi \Fluent::class, false );
67
+ }
68
+
69
+ }
You can’t perform that action at this time.
0 commit comments