Issues (632)

src/Providers/SelectServiceProvider.php (38 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Filename "SelectServiceProvider.php" doesn't match the expected filename "selectserviceprovider.php"
Loading history...
2
namespace EddIriarte\Console\Providers;
0 ignored issues
show
Missing file doc comment
Loading history...
3
4
use EddIriarte\Console\Helpers\SelectionHelper;
5
use EddIriarte\Console\Inputs\CheckboxInput;
6
use EddIriarte\Console\Inputs\RadioInput;
7
use Illuminate\Console\Command;
0 ignored issues
show
The type Illuminate\Console\Command 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...
8
use Illuminate\Support\ServiceProvider;
9
10
/**
11
 * Class ConsoleSelectServiceProvider
12
 *
13
 * @package EddIriarte\Console\Providers
0 ignored issues
show
Coding Style Documentation introduced by
@package tag is not allowed in class comment
Loading history...
14
 * @author Eduardo Iriarte <eddiriarte[at]gmail[dot]com>
0 ignored issues
show
Coding Style Documentation introduced by
@author tag is not allowed in class comment
Loading history...
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
15
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
16
class SelectServiceProvider extends ServiceProvider
17
{
0 ignored issues
show
Opening brace should be on the same line as the declaration for class SelectServiceProvider
Loading history...
18
    /**
19
     * {@inheritdoc}
20
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
21
    public function boot()
0 ignored issues
show
Expected 2 blank lines before function; 0 found
Loading history...
22
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
23
        /*
24
         * Returns a select builder.
0 ignored issues
show
First line of comment not aligned correctly; expected 12 spaces but found 9
Loading history...
25
         *
0 ignored issues
show
Comment line indented incorrectly; expected at least 12 spaces but found 9
Loading history...
26
         * @param  string $message
0 ignored issues
show
Comment line indented incorrectly; expected at least 12 spaces but found 9
Loading history...
27
         * @param  array $options
0 ignored issues
show
Comment line indented incorrectly; expected at least 12 spaces but found 9
Loading history...
28
         * @param  bool $allowMultiple
0 ignored issues
show
Comment line indented incorrectly; expected at least 12 spaces but found 9
Loading history...
29
         *
0 ignored issues
show
Comment line indented incorrectly; expected at least 12 spaces but found 9
Loading history...
30
         * @return array
0 ignored issues
show
Comment line indented incorrectly; expected at least 12 spaces but found 9
Loading history...
31
         */
0 ignored issues
show
Last line of comment aligned incorrectly; expected 8 spaces but found 9
Loading history...
Empty line required after block comment
Loading history...
32
        Command::macro(
33
            'select',
34
            function (string $message = '', array $options = [], bool $allowMultiple = true) {
0 ignored issues
show
Short array syntax is not allowed
Loading history...
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
35
                $helper = new SelectionHelper($this->input, $this->output);
0 ignored issues
show
Bug Best Practice introduced by
The property output does not exist on EddIriarte\Console\Providers\SelectServiceProvider. Did you maybe forget to declare it?
Loading history...
Bug Best Practice introduced by
The property input does not exist on EddIriarte\Console\Providers\SelectServiceProvider. Did you maybe forget to declare it?
Loading history...
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
36
                $question = $allowMultiple ? new CheckboxInput($message, $options) : new RadioInput($message, $options);
0 ignored issues
show
The value of a comparison must not be assigned to a variable
Loading history...
Inline IF statements are not allowed
Loading history...
Inline shorthand IF statement requires brackets around comparison
Loading history...
37
38
                return $helper->select($question);
39
            }
40
        );
41
    }
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end boot()
Loading history...
42
}
0 ignored issues
show
Expected //end class
Loading history...
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...
43