Passed
Push — master ( d917f3...9bdfff )
by Jesse
02:48
created

Refusals::addFor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
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 "Refusals.php" doesn't match the expected filename "refusals.php"
Loading history...
introduced by
The PHP open tag must be followed by exactly one blank line
Loading history...
introduced by
Expected 1 space before "="; 0 found
Loading history...
introduced by
Expected 1 space after "="; 0 found
Loading history...
2
3
namespace Stratadox\CardGame\ReadModel;
4
5
use Stratadox\CardGame\CorrelationId;
6
7
final class Refusals
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for class Refusals
Loading history...
introduced by
Missing class doc comment
Loading history...
8
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Refusals
Loading history...
introduced by
Opening brace should be on the same line as the declaration
Loading history...
9
    private $errorMessages = [];
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before first member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "errorMessages" must contain a leading underscore
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "errorMessages" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
10
11
    /** @return string[] */
0 ignored issues
show
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $theRequest should have a doc-comment as per coding-style.
Loading history...
introduced by
Description for the @return value is missing
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
12
    public function for(CorrelationId $theRequest): array
13
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
14
//        return ['Cannot open account for unknown entity'];
0 ignored issues
show
Unused Code Comprehensibility introduced by
84% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 0
Loading history...
Coding Style introduced by
Expected 1 space before comment text but found 8; use block comment if you need indentation
Loading history...
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
introduced by
8 spaces found before inline comment; expected "// return ['Cannot open account for unknown entity'];" but found "// return ['Cannot open account for unknown entity'];"
Loading history...
introduced by
Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
Loading history...
15
        return $this->errorMessages[$theRequest->id()] ?? [];
0 ignored issues
show
Coding Style introduced by
Operation must be bracketed
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
16
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
17
18
    public function addFor(CorrelationId $theRequest, string $message): void
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function addFor()
Loading history...
introduced by
Missing function doc comment
Loading history...
19
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
20
        $this->errorMessages[$theRequest->id()][] = $message;
21
    }
0 ignored issues
show
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...
22
}
0 ignored issues
show
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...
23