Issues (1124)

src/Visitor/AttributeDumper.php (28 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 "AttributeDumper.php" doesn't match the expected filename "attributedumper.php"
Loading history...
2
3
namespace Star\Component\State\Visitor;
4
5
use Star\Component\State\StateVisitor;
6
7
final class AttributeDumper implements StateVisitor
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 AttributeDumper
Loading history...
9
    /**
10
     * An array having the state name as key and the attributes of this state.
11
     * @var string[][]
0 ignored issues
show
There must be exactly one blank line before the tags in a doc comment
Loading history...
12
     */
13
    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...
14
15
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
16
     * @return string[][]
17
     */
18 1
    public function getStructure(): array
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
19
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
20 1
        return $this->structure;
21
    }
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...
22
23
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
24
     * @param string $name
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 3 spaces after parameter type; 1 found
Loading history...
25
     * @param string[] $attributes
0 ignored issues
show
Missing parameter comment
Loading history...
26
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
27 1
    public function visitState(string $name, array $attributes): void
28
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
29 1
        if (! isset($this->structure[$name])) {
30 1
            $this->structure[$name] = [];
0 ignored issues
show
Short array syntax is not allowed
Loading history...
31
        }
32
33 1
        $this->structure[$name] = array_unique(array_merge($this->structure[$name], $attributes));
34 1
    }
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 visitState()
Loading history...
35
}
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...
36