ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 16 2
A boot() 0 4 1
1
<?php
2
3
namespace Kaylyu\Alipay\F2fpay;
4
5
use Laravel\Lumen\Application as LumenApplication;
6
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
7
8
class ServiceProvider extends LaravelServiceProvider
9
{
10
    /**
11
     * Register any application services.
12
     *
13
     * @return void
14
     */
15
    public function register()
16
    {
17
        if ($this->app instanceof LumenApplication) {
0 ignored issues
show
Bug introduced by
The class Laravel\Lumen\Application does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
18
            $this->app->configure('kaylu-alipay');
19
        }
20
21
        $this->mergeConfigFrom(
22
            __DIR__ . '/../../config/kaylu-alipay.php', 'kaylu-alipay'
23
        );
24
25
        $this->app->singleton('kaylu.alipay.f2fpay', function ($app) {
26
            return new Application(
27
                $app['config']['kaylu-alipay']
28
            );
29
        });
30
    }
31
32
    /**
33
     * Register the application's event listeners.
34
     *
35
     * @return void
36
     */
37
    public function boot()
38
    {
39
        //
40
    }
41
}