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 namespace Sofa\Revisionable\Laravel; |
||
2 | |||
3 | use Illuminate\Support\ServiceProvider as BaseProvider; |
||
4 | use ReflectionClass; |
||
5 | |||
6 | /** |
||
7 | * @method void publishes(array $paths, $group = null) |
||
8 | */ |
||
9 | class ServiceProvider extends BaseProvider |
||
10 | { |
||
11 | /** |
||
12 | * Indicates if loading of the provider is deferred. |
||
13 | * |
||
14 | * @var bool |
||
15 | */ |
||
16 | protected $defer = false; |
||
17 | |||
18 | /** |
||
19 | * Bootstrap any application services. |
||
20 | * |
||
21 | * @return void |
||
22 | */ |
||
23 | public function boot() |
||
24 | { |
||
25 | $this->publishes([ |
||
26 | $this->guessPackagePath() . '/config/config.php' => config_path('sofa_revisionable.php'), |
||
27 | $this->guessPackagePath() . '/migrations/' => base_path('/database/migrations'), |
||
28 | ]); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Register the service provider. |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | public function register() |
||
37 | { |
||
38 | $this->bindLogger(); |
||
39 | |||
40 | $this->bindUserProvider(); |
||
41 | |||
42 | $this->bindListener(); |
||
43 | |||
44 | $this->bootModel(); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Bind Revisionable logger implementation to the IoC. |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | protected function bindLogger() |
||
53 | { |
||
54 | $table = $this->app['config']->get('sofa_revisionable.table', 'revisions'); |
||
55 | |||
56 | $this->app->bindShared('revisionable.logger', function ($app) use ($table) { |
||
0 ignored issues
–
show
|
|||
57 | return new \Sofa\Revisionable\Laravel\DbLogger($app['db']->connection(), $table); |
||
58 | }); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * Bind user provider implementation to the IoC. |
||
63 | * |
||
64 | * @return void |
||
65 | */ |
||
66 | protected function bindUserProvider() |
||
67 | { |
||
68 | $userProvider = $this->app['config']->get('sofa_revisionable.userprovider'); |
||
69 | |||
70 | switch ($userProvider) { |
||
71 | case 'sentry': |
||
72 | $this->bindSentryProvider(); |
||
73 | break; |
||
74 | |||
75 | case 'sentinel': |
||
76 | $this->bindSentinelProvider(); |
||
77 | break; |
||
78 | |||
79 | case 'jwt-auth': |
||
80 | $this->bindJwtAuthProvider(); |
||
81 | break; |
||
82 | |||
83 | default: |
||
84 | $this->bindGuardProvider(); |
||
85 | } |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * Bind adapter for Sentry to the IoC. |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | protected function bindSentryProvider() |
||
94 | { |
||
95 | $this->app->bindShared('revisionable.userprovider', function ($app) { |
||
0 ignored issues
–
show
The method
bindShared() does not seem to exist on object<Illuminate\Contra...Foundation\Application> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
96 | $field = $app['config']->get('sofa_revisionable.userfield'); |
||
97 | |||
98 | return new \Sofa\Revisionable\Adapters\Sentry($app['sentry'], $field); |
||
99 | }); |
||
100 | } |
||
101 | |||
102 | /** |
||
103 | * Bind adapter for Sentinel to the IoC. |
||
104 | * |
||
105 | * @return void |
||
106 | */ |
||
107 | protected function bindSentinelProvider() |
||
108 | { |
||
109 | $this->app->bindShared('revisionable.userprovider', function ($app) { |
||
0 ignored issues
–
show
The method
bindShared() does not seem to exist on object<Illuminate\Contra...Foundation\Application> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
110 | $field = $app['config']->get('sofa_revisionable.userfield'); |
||
111 | |||
112 | return new \Sofa\Revisionable\Adapters\Sentinel($app['sentinel'], $field); |
||
113 | }); |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * Bind adapter for JWT Auth to the IoC. |
||
118 | * |
||
119 | * @return void |
||
120 | */ |
||
121 | private function bindJwtAuthProvider() |
||
122 | { |
||
123 | $this->app->bindShared('revisionable.userprovider', function ($app) { |
||
0 ignored issues
–
show
The method
bindShared() does not seem to exist on object<Illuminate\Contra...Foundation\Application> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
124 | $field = $app['config']->get('sofa_revisionable.userfield'); |
||
125 | |||
126 | return new \Sofa\Revisionable\Adapters\JwtAuth($app['tymon.jwt.auth'], $field); |
||
127 | }); |
||
128 | } |
||
129 | |||
130 | /** |
||
131 | * Bind adapter for Illuminate Guard to the IoC. |
||
132 | * |
||
133 | * @return void |
||
134 | */ |
||
135 | protected function bindGuardProvider() |
||
136 | { |
||
137 | $this->app->bindShared('revisionable.userprovider', function ($app) { |
||
0 ignored issues
–
show
The method
bindShared() does not seem to exist on object<Illuminate\Contra...Foundation\Application> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
138 | $field = $app['config']->get('sofa_revisionable.userfield'); |
||
139 | |||
140 | return new \Sofa\Revisionable\Adapters\Guard($app['auth']->driver(), $field); |
||
141 | }); |
||
142 | } |
||
143 | |||
144 | /** |
||
145 | * Bind listener implementation to the Ioc. |
||
146 | * |
||
147 | * @return void |
||
148 | */ |
||
149 | protected function bindListener() |
||
150 | { |
||
151 | $this->app->bind('Sofa\Revisionable\Listener', function ($app) { |
||
152 | return new \Sofa\Revisionable\Laravel\Listener($app['revisionable.userprovider']); |
||
153 | }); |
||
154 | } |
||
155 | |||
156 | /** |
||
157 | * Boot the Revision model. |
||
158 | * |
||
159 | * @return void |
||
160 | */ |
||
161 | protected function bootModel() |
||
162 | { |
||
163 | $table = $this->app['config']->get('sofa_revisionable.table', 'revisions'); |
||
164 | |||
165 | forward_static_call_array(['\Sofa\Revisionable\Laravel\Revision', 'setCustomTable'], [$table]); |
||
166 | } |
||
167 | |||
168 | /** |
||
169 | * Get the services provided by the provider. |
||
170 | * |
||
171 | * @return string[] |
||
172 | */ |
||
173 | public function provides() |
||
174 | { |
||
175 | return [ |
||
176 | 'revisionable.logger', |
||
177 | 'revisionable.userprovider', |
||
178 | ]; |
||
179 | } |
||
180 | |||
181 | /** |
||
182 | * Guess real path of the package. |
||
183 | * |
||
184 | * @return string |
||
185 | */ |
||
186 | public function guessPackagePath() |
||
187 | { |
||
188 | $path = (new ReflectionClass($this))->getFileName(); |
||
189 | |||
190 | return realpath(dirname($path).'/../'); |
||
191 | } |
||
192 | } |
||
193 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.