Passed
Push — master ( f4b885...602f00 )
by stéphane
02:42
created

Tag::checkNameValidity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Dallgoot\Yaml;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
/**
5
 * TODO
6
 * @author [email protected]
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
7
 * @license Apache 2.0
8
 * @link TODO : url to specific online doc
9
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
10
class Tag
11
{
12
    /** @var string */
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
13
    public $tagName;
14
    /** @var Node|null|string */
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
15
    public $value;
16
17
    public function __construct($tagName, $value)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
18
    {
19
        if (is_null($tagName)) {
20
            throw new \Exception(self::class.": a tag MUST have a name", 1);
21
        }
22
        $this->tagName = $tagName;
23
        $this->value = $value;
24
    }
25
26
    private function checkNameValidity($providedName)
0 ignored issues
show
Unused Code introduced by
The method checkNameValidity() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
Unused Code introduced by
The parameter $providedName is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    private function checkNameValidity(/** @scrutinizer ignore-unused */ $providedName)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
Private method name "Tag::checkNameValidity" must be prefixed with an underscore
Loading history...
27
    {
28
        /* TODO  implement and throw Exception if invalid (setName method ???)
29
         *The suffix must not contain any “!” character. This would cause the tag shorthand to be interpreted as having a named tag handle. In addition, the suffix must not contain the “[”, “]”, “{”, “}” and “,” characters. These characters would cause ambiguity with flow collection structures. If the suffix needs to specify any of the above restricted characters, they must be escaped using the “%” character. This behavior is consistent with the URI character escaping rules (specifically, section 2.3 of RFC2396).
30
        */
31
    }
32
}
33