Issues (1124)

src/Visitor/TransitionDumper.php (46 issues)

1
<?php declare(strict_types=1);
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 "TransitionDumper.php" doesn't match the expected filename "transitiondumper.php"
Loading history...
2
3
namespace Star\Component\State\Visitor;
4
5
use Star\Component\State\TransitionVisitor;
6
7
final class TransitionDumper implements TransitionVisitor
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
8
{
0 ignored issues
show
Opening brace should be on the same line as the declaration for class TransitionDumper
Loading history...
9
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
10
     * @var string[][][]
11
     */
12
    private $structure = [];
0 ignored issues
show
Private member variable "structure" must contain a leading underscore
Loading history...
Expected 1 blank line before member var; 0 found
Loading history...
Private member variable "structure" must be prefixed with an underscore
Loading history...
Short array syntax is not allowed
Loading history...
13
14
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
15
     * @var string
16
     */
17
    private $currentTransition;
0 ignored issues
show
Private member variable "currentTransition" must contain a leading underscore
Loading history...
Private member variable "currentTransition" must be prefixed with an underscore
Loading history...
18
19
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
20
     * @return string[][][]
21
     */
22 2
    public function getStructure(): array
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
23
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
24 2
        return $this->structure;
25
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end getStructure()
Loading history...
26
27 2
    public function visitTransition(string $name): void
0 ignored issues
show
Missing function doc comment
Loading history...
28
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
29 2
        $this->currentTransition = $name;
30 2
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end visitTransition()
Loading history...
31
32
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
33
     * @param string $state
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 3 spaces after parameter type; 1 found
Loading history...
34
     * @param string[] $attributes
0 ignored issues
show
Missing parameter comment
Loading history...
35
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
36 2
    public function visitFromState(string $state, array $attributes): void
0 ignored issues
show
The method parameter $attributes is never used
Loading history...
37
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
38 2
        $this->structure[$this->currentTransition]['from'][] = $state;
39 2
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end visitFromState()
Loading history...
40
41
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
42
     * @param string $state
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 3 spaces after parameter type; 1 found
Loading history...
43
     * @param string[] $attributes
0 ignored issues
show
Missing parameter comment
Loading history...
44
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
45 2
    public function visitToState(string $state, array $attributes): void
0 ignored issues
show
The method parameter $attributes is never used
Loading history...
46
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
47 2
        $this->structure[$this->currentTransition]['to'][] = $state;
48 2
    }
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 visitToState()
Loading history...
49
}
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...
50