Passed
Push — main ( 493269...3bd1e6 )
by Daryl
02:43
created

RoboFile::phpcs()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use Robo\Result;
4
5
/**
6
 * This is project's console commands configuration for Robo task runner.
7
 *
8
 * @see https://robo.li/
9
 */
10
class RoboFile extends \Robo\Tasks
11
{
12
    // define public methods as commands
13
    /**
14
     * Run PHPStan static analysis.
15
     */
16
    public function phpstan(): Result
17
    {
18
        return $this->taskExec('vendor/bin/phpstan analyse src --memory-limit=1G')->run();
19
    }
20
21
    /**
22
     * Run PHP CodeSniffer.
23
     */
24
    public function phpcs(): Result
25
    {
26
        return $this->taskExec('vendor/bin/phpcs src')->run();
27
    }
28
29
    /**
30
     * Run PHPUnit tests.
31
     */
32
    public function phpunit(): Result
33
    {
34
        return $this->taskPHPUnit()
35
            ->configFile('tests/phpunit.xml.dist')
36
            ->run();
37
    }
38
39
    /**
40
     * Run all quality checks.
41
     */
42
    public function quality(): void
43
    {
44
        $this->phpstan();
45
        $this->phpcs();
46
        $this->phpunit();
47
    }
48
}
49