This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace StaticAnalysis\AccessInterceptorScopeLocalizer; |
||
4 | |||
5 | use ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory; |
||
6 | |||
7 | require_once __DIR__ . '/../../vendor/autoload.php'; |
||
8 | |||
9 | class MyProxiedClass |
||
10 | { |
||
11 | public function sayHello() : string |
||
12 | { |
||
13 | return 'Hello!'; |
||
14 | } |
||
15 | } |
||
16 | |||
17 | (static function () : void { |
||
18 | echo (new AccessInterceptorScopeLocalizerFactory()) |
||
19 | ->createProxy( |
||
20 | new MyProxiedClass(), |
||
21 | [ |
||
22 | 'sayHello' => static function ( |
||
23 | object $proxy, |
||
0 ignored issues
–
show
|
|||
24 | MyProxiedClass $realInstance, |
||
0 ignored issues
–
show
|
|||
25 | string $method, |
||
0 ignored issues
–
show
|
|||
26 | array $parameters, |
||
0 ignored issues
–
show
|
|||
27 | bool & $returnEarly |
||
0 ignored issues
–
show
|
|||
28 | ) { |
||
29 | echo 'pre-'; |
||
30 | }, |
||
31 | ], |
||
32 | [ |
||
33 | 'sayHello' => |
||
34 | /** @param mixed $returnValue */ |
||
35 | static function ( |
||
36 | object $proxy, |
||
0 ignored issues
–
show
|
|||
37 | MyProxiedClass $realInstance, |
||
0 ignored issues
–
show
|
|||
38 | string $method, |
||
0 ignored issues
–
show
|
|||
39 | array $parameters, |
||
0 ignored issues
–
show
|
|||
40 | & $returnValue, |
||
0 ignored issues
–
show
|
|||
41 | bool & $overrideReturnValue |
||
0 ignored issues
–
show
|
|||
42 | ) { |
||
43 | echo 'post-'; |
||
44 | }, |
||
45 | ] |
||
46 | ) |
||
47 | ->sayHello(); |
||
48 | |||
49 | $localizedAccessInterceptor = (new AccessInterceptorScopeLocalizerFactory()) |
||
50 | ->createProxy(new MyProxiedClass()); |
||
51 | |||
52 | $localizedAccessInterceptor->setMethodPrefixInterceptor( |
||
53 | 'sayHello', |
||
54 | static function ( |
||
55 | object $proxy, |
||
0 ignored issues
–
show
|
|||
56 | MyProxiedClass $realInstance, |
||
0 ignored issues
–
show
|
|||
57 | string $method, |
||
0 ignored issues
–
show
|
|||
58 | array $parameters, |
||
0 ignored issues
–
show
|
|||
59 | bool & $returnEarly |
||
0 ignored issues
–
show
|
|||
60 | ) { |
||
61 | echo 'pre-'; |
||
62 | } |
||
63 | ); |
||
64 | |||
65 | $localizedAccessInterceptor->setMethodSuffixInterceptor( |
||
66 | 'sayHello', |
||
67 | /** @param mixed $returnValue */ |
||
68 | static function ( |
||
69 | object $proxy, |
||
0 ignored issues
–
show
|
|||
70 | MyProxiedClass $realInstance, |
||
0 ignored issues
–
show
|
|||
71 | string $method, |
||
0 ignored issues
–
show
|
|||
72 | array $parameters, |
||
0 ignored issues
–
show
|
|||
73 | & $returnValue, |
||
0 ignored issues
–
show
|
|||
74 | bool & $returnEarly |
||
0 ignored issues
–
show
|
|||
75 | ) { |
||
76 | echo 'post-'; |
||
77 | } |
||
78 | ); |
||
79 | |||
80 | echo $localizedAccessInterceptor->sayHello(); |
||
81 | })(); |
||
82 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.