AnticaptchaServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 49
dl 0
loc 85
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 10 1
A register() 0 56 1
A boot() 0 8 1
1
<?php
2
3
namespace LaravelAnticaptcha;
4
5
use Illuminate\Support\ServiceProvider;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\ServiceProvider was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use LaravelAnticaptcha\Anticaptcha\CustomCaptcha;
7
use LaravelAnticaptcha\Anticaptcha\FunCaptcha;
8
use LaravelAnticaptcha\Anticaptcha\FunCaptchaProxyless;
9
use LaravelAnticaptcha\Anticaptcha\GeeTest;
10
use LaravelAnticaptcha\Anticaptcha\GeeTestProxyless;
11
use LaravelAnticaptcha\Anticaptcha\ImageToText;
12
use LaravelAnticaptcha\Anticaptcha\NoCaptcha;
13
use LaravelAnticaptcha\Anticaptcha\NoCaptchaProxyless;
14
15
class AnticaptchaServiceProvider extends ServiceProvider {
16
    public $defer = true;
17
18
    public function boot() {
19
        $this->publishes([
20
            __DIR__.'/../config/anticaptcha.php' => config_path('anticaptcha.php'),
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
            __DIR__.'/../config/anticaptcha.php' => /** @scrutinizer ignore-call */ config_path('anticaptcha.php'),
Loading history...
21
        ], 'anticaptcha');
22
23
        $this->mergeConfigFrom(
24
            __DIR__.'/../config/anticaptcha.php',
25
            'anticaptcha'
26
        );
27
28
    }
29
30
    public function register() {
31
32
        $this->app->singleton(NoCaptchaProxyless::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
        $this->app->singleton(NoCaptchaProxyless::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
            $instance = new NoCaptchaProxyless();
34
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
35
36
            return $instance;
37
        } );
38
39
        $this->app->singleton(NoCaptcha::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

39
        $this->app->singleton(NoCaptcha::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
            $instance = new NoCaptcha();
41
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
42
43
            return $instance;
44
        } );
45
46
        $this->app->singleton(ImageToText::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

46
        $this->app->singleton(ImageToText::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
47
            $instance = new ImageToText();
48
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

48
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
49
50
            return $instance;
51
        } );
52
53
        $this->app->singleton(GeeTestProxyless::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
        $this->app->singleton(GeeTestProxyless::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
            $instance = new GeeTestProxyless();
55
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

55
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
56
57
            return $instance;
58
        } );
59
60
        $this->app->singleton(GeeTest::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

60
        $this->app->singleton(GeeTest::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
            $instance = new GeeTest();
62
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

62
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
63
64
            return $instance;
65
        } );
66
67
        $this->app->singleton(FunCaptchaProxyless::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

67
        $this->app->singleton(FunCaptchaProxyless::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
68
            $instance = new FunCaptchaProxyless();
69
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

69
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
70
71
            return $instance;
72
        } );
73
74
        $this->app->singleton(FunCaptcha::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

74
        $this->app->singleton(FunCaptcha::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
75
            $instance = new FunCaptcha();
76
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

76
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
77
78
            return $instance;
79
        } );
80
81
        $this->app->singleton(CustomCaptcha::class, function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

81
        $this->app->singleton(CustomCaptcha::class, function(/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
82
            $instance = new CustomCaptcha();
83
            $instance->setKey(config('anticaptcha.key'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

83
            $instance->setKey(/** @scrutinizer ignore-call */ config('anticaptcha.key'));
Loading history...
84
85
            return $instance;
86
        } );
87
88
    }
89
90
    public function provides() {
91
        return [
92
            NoCaptchaProxyless::class,
93
            NoCaptcha::class,
94
            ImageToText::class,
95
            GeeTestProxyless::class,
96
            GeeTest::class,
97
            FunCaptchaProxyless::class,
98
            FunCaptcha::class,
99
            CustomCaptcha::class
100
        ];
101
    }
102
103
}
104