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

ProposeMatch::proposedBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
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 "ProposeMatch.php" doesn't match the expected filename "proposematch.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\Proposal;
4
5
use Stratadox\CardGame\Account\AccountId;
6
use Stratadox\CardGame\CorrelationId;
7
8
final class ProposeMatch
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for class ProposeMatch
Loading history...
introduced by
Missing class doc comment
Loading history...
9
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class ProposeMatch
Loading history...
introduced by
Opening brace should be on the same line as the declaration
Loading history...
10
    private $proposedBy;
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 "proposedBy" 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 "proposedBy" must be prefixed with an underscore
Loading history...
11
    private $proposedTo;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "proposedTo" 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 "proposedTo" must be prefixed with an underscore
Loading history...
12
    private $correlationId;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "correlationId" 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 "correlationId" must be prefixed with an underscore
Loading history...
13
14
    private function __construct(
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
introduced by
Missing function doc comment
Loading history...
15
        AccountId $proposedBy,
16
        AccountId $proposedTo,
17
        CorrelationId $correlationId
18
    ) {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
19
        $this->proposedBy = $proposedBy;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 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...
20
        $this->proposedTo = $proposedTo;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 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...
21
        $this->correlationId = $correlationId;
22
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
23
24
    public static function between(
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function between()
Loading history...
introduced by
Missing function doc comment
Loading history...
25
        AccountId $proposedBy,
26
        AccountId $proposedTo,
27
        CorrelationId $correlationId
28
    ): ProposeMatch {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
29
        return new self($proposedBy, $proposedTo, $correlationId);
30
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
31
32
    public function proposedBy(): AccountId
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function proposedBy()
Loading history...
introduced by
Missing function doc comment
Loading history...
33
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
34
        return $this->proposedBy;
35
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
36
37
    public function proposedTo(): AccountId
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function proposedTo()
Loading history...
introduced by
Missing function doc comment
Loading history...
38
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
39
        return $this->proposedTo;
40
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
41
42
    public function correlationId(): CorrelationId
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function correlationId()
Loading history...
introduced by
Missing function doc comment
Loading history...
43
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
44
        return $this->correlationId;
45
    }
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...
46
}
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...
47