ReadOnlyTransition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 25
ccs 5
cts 9
cp 0.5556
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A onRegister() 0 3 1
A __construct() 0 3 1
A getDestinationState() 0 3 1
1
<?php declare(strict_types=1);
0 ignored issues
show
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 "ReadOnlyTransition.php" doesn't match the expected filename "readonlytransition.php"
Loading history...
2
3
namespace Star\Component\State\Transitions;
4
5
use Star\Component\State\RegistryBuilder;
6
use Star\Component\State\StateTransition;
7
8
final class ReadOnlyTransition implements StateTransition
0 ignored issues
show
Coding Style Documentation 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 ReadOnlyTransition
Loading history...
10
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
11
     * @var string
12
     */
13
    private $destination;
0 ignored issues
show
Coding Style introduced by
Private member variable "destination" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "destination" must be prefixed with an underscore
Loading history...
14
15 30
    public function __construct(string $destination)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
16
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
17 30
        $this->destination = $destination;
18 30
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 __construct()
Loading history...
19
20
    public function getName(): string
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
21
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
22
        throw new \RuntimeException('Method ' . __METHOD__ . ' not implemented yet.');
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
23
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 getName()
Loading history...
24
25
    public function onRegister(RegistryBuilder $registry): void
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
26
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
27
        throw new \RuntimeException('Method ' . __METHOD__ . ' not implemented yet.');
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
28
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 onRegister()
Loading history...
29
30 29
    public function getDestinationState(): string
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
31
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
32 29
        return $this->destination;
33
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines 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 getDestinationState()
Loading history...
34
}
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...
35