| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function __invoke(Request $request) |
||
| 18 | { |
||
| 19 | Stripe\Stripe::setApiKey(\Config::get('services.stripe.secret')); |
||
| 20 | $plans = Stripe\Plan::all(); |
||
| 21 | $data = request()->all(); |
||
| 22 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
||
| 23 | if ($user) { |
||
| 24 | $plan_nickname = $data['data']['object']['items']['data'][0]['plan']['nickname']; |
||
| 25 | foreach ($plans as $plan) { |
||
| 26 | if ($plan->nickname === $plan_nickname) { |
||
| 27 | $roles= Role::where('name', strtolower($plan->nickname))->first(); |
||
| 28 | if ($roles) { |
||
| 29 | $user->role_id = $roles->id; |
||
| 30 | $user->save(); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | } else { |
||
| 35 | echo 'User not found!'; |
||
| 36 | } |
||
| 39 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths