Passed
Push — master ( 81686d...1595cb )
by Kirill
04:41
created

Identifier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of Railt package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Railt\SDL\Frontend\Ast;
13
14
use Phplrt\Contracts\Lexer\TokenInterface;
15
16
/**
17
 * Class Identifier
18
 */
19
class Identifier extends Node
20
{
21
    /**
22
     * @var string
23
     */
24
    public string $value;
25
26
    /**
27
     * Name constructor.
28
     *
29
     * @param string $name
30
     */
31
    public function __construct(string $name)
32
    {
33
        $this->value = $name;
34
    }
35
36
    /**
37
     * @param TokenInterface $token
38
     * @return static
39
     */
40
    public static function create(TokenInterface $token): self
41
    {
42
        return new static($token->getValue());
43
    }
44
}
45