GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 543084...1ec8cb )
by Rob
11:30
created

ShodanServiceProvider::bootForConsole()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 9
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
0 ignored issues
show
Coding Style introduced by
Class found in ".php" file; use ".inc" extension instead
Loading history...
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "ShodanServiceProvider.php" doesn't match the expected filename "shodanserviceprovider.php"
Loading history...
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace RattfieldNz\Shodan;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\Support\ServiceProvider;
7
use RattfieldNz\SafeUrls\SafeUrls;
0 ignored issues
show
Bug introduced by
The type RattfieldNz\SafeUrls\SafeUrls 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...
introduced by
Unused use statement
Loading history...
8
9
class ShodanServiceProvider extends ServiceProvider
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for class ShodanServiceProvider
Loading history...
introduced by
Missing class doc comment
Loading history...
10
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class ShodanServiceProvider
Loading history...
introduced by
Opening brace should be on the same line as the declaration
Loading history...
11 5
    const CONFIG_PATH = __DIR__.'/../config/shodan.php';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Concat operator must be surrounded by a single space
Loading history...
Coding Style introduced by
Expected at least 1 space before "."; 0 found
Loading history...
Coding Style introduced by
Expected at least 1 space after "."; 0 found
Loading history...
12
13 5
    public function boot()
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Missing doc comment for function boot()
Loading history...
introduced by
Missing function doc comment
Loading history...
14 5
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
15 5
        $this->publishes([
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
16 5
            self::CONFIG_PATH => config_path('shodan.php'),
0 ignored issues
show
introduced by
Array indentation error, expected 10 spaces but found 12
Loading history...
17
        ], 'config');
18 5
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end boot()
Loading history...
19
20 5
    public function register()
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Missing doc comment for function register()
Loading history...
introduced by
Missing function doc comment
Loading history...
21 5
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
22 5
        $this->mergeConfigFrom(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
23
            self::CONFIG_PATH,
24
            'shodan'
25
        );
26
27 5
        $this->app->alias(Shodan::class, 'shodan');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
28 5
29
        $this->app->bind('shodan', function () {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
30
            return new Shodan();
31
        });
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
32
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end register()
Loading history...
33
34
    /**
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
35
     * Get the services provided by the provider.
36
     *
37
     * @return array
0 ignored issues
show
introduced by
Description for the @return value is missing
Loading history...
38
     */
39
    public function provides()
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
40
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
41
        return ['shodan'];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
42
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end provides()
Loading history...
43
44
    /**
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
45
     * Console-specific booting.
46
     *
47
     * @return void
0 ignored issues
show
introduced by
If there is no return value for a function, there must not be a @return tag.
Loading history...
introduced by
Description for the @return value is missing
Loading history...
48
     */
49
    public function bootForConsole()
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
50
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
51
        // Publishing the configuration file.
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
52
        $this->publishes([
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
53
            __DIR__.'/../config/shodan.php' => config_path('shodan.php'),
0 ignored issues
show
introduced by
Array indentation error, expected 10 spaces but found 12
Loading history...
Coding Style introduced by
Concat operator must be surrounded by a single space
Loading history...
Coding Style introduced by
Expected at least 1 space before "."; 0 found
Loading history...
Coding Style introduced by
Expected at least 1 space after "."; 0 found
Loading history...
54
        ], 'shodan');
55
56
        // Registering package commands.
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
57
        $this->commands(['shodan']);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
58
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end bootForConsole()
Loading history...
59
60
    /**
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
61
     * Merge the given configuration with the existing configuration.
62
     *
63
     * @param string $path
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
64
     * @param string $key
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
65
     *
66
     * @return void
0 ignored issues
show
introduced by
If there is no return value for a function, there must not be a @return tag.
Loading history...
introduced by
Description for the @return value is missing
Loading history...
67
     */
68
    protected function mergeConfigFrom($path, $key)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Type hint "string" missing for $path
Loading history...
Coding Style introduced by
Type hint "string" missing for $key
Loading history...
69
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
70
        $config = $this->app['config']->get($key, []);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
71
        $this->app['config']->set($key, $this->mergeConfig($config, require $path));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
72
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mergeConfigFrom()
Loading history...
73
74
    /**
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
75
     * Merges the configs together and takes multi-dimensional arrays into account.
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 83 characters
Loading history...
76
     *
77
     * @param array $original
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
78
     * @param array $merging
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
79
     *
80
     * @return array
0 ignored issues
show
introduced by
Description for the @return value is missing
Loading history...
81
     */
82
    protected function mergeConfig(array $original, array $merging)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
83
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
84
        $array = array_merge($original, $merging);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
85
        foreach ($original as $key => $value) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
86
            if (!is_array($value)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
87
                continue;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
88
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
89
            if (!Arr::exists($merging, $key)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
90
                continue;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
91
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
92
            if (is_numeric($key)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
93
                continue;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
94
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
95
            $array[$key] = $this->mergeConfig($value, $merging[$key]);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
96
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
97
98
        return $array;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
99
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mergeConfig()
Loading history...
100
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
101