Passed
Push — main ( f43f35...70d1da )
by Daryl
02:42
created

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