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

Macro   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 47
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A currentProject() 0 3 1
A __construct() 0 3 1
A getValue() 0 3 1
A currentUser() 0 3 1
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