Completed
Push — master ( 529bf0...01ea23 )
by Thijs
25s queued 15s
created

Macro::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace TestMonitor\DevOps\Builders\WIQL;
4
5
class Macro
6
{
7
    /**
8
     * The macro's expression value.
9
     *
10
     * @var string
11
     */
12
    protected string $value;
13
14
    /**
15
     * Construct a new macro.
16
     *
17
     * @param string $value
18
     */
19
    public function __construct(string $value)
20
    {
21
        $this->value = $value;
22
    }
23
24
    /**
25
     * Use with an identity or user account field to automatically search for items associated with your user name.
26
     *
27
     * @return static
28
     */
29
    public static function currentUser(): static
30
    {
31
        return new self('@Me');
32
    }
33
34
    /**
35
     * Use with the Team Project field to filter for work items in other projects.
36
     *
37
     * @return static
38
     */
39
    public static function currentProject(): static
40
    {
41
        return new self('@Project');
42
    }
43
44
    /**
45
     * Returns the macro's expression value.
46
     *
47
     * @return string
48
     */
49
    public function getValue(): string
50
    {
51
        return $this->value;
52
    }
53
}
54