Completed
Push — master ( ebf4cc...699a59 )
by Petr
05:58
created

RoboFile::hello()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 11 and the first side effect is on line 3.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
require_once __DIR__ . '/app/environment.php';
4
5
/**
6
 * This is project's console commands configuration for Robo task runner.
7
 *
8
 * @see http://robo.li/
9
 * @author Petr Pliska <[email protected]>
10
 */
11
class RoboFile extends \Robo\Tasks
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
12
{
13
    /**
14
     * Run PHP build-in server
15
     */
16
    public function devtoolsRunPhpServer()
17
    {
18
        // Run PHP build in server
19
        $this->taskServer(8000)
20
            ->host('www.kiss.local')
21
            ->dir('public')
22
            ->printed(true)
23
            ->run();
24
    }
25
26
    /**
27
     * Check syntax of php code
28
     */
29
    public function devtoolsCheckPhpSyntax()
30
    {
31
        $this
32
            ->taskExec('vendor/bin/parallel-lint')
33
            ->option('exclude', 'vendor')
34
            ->arg('.')
35
            ->run();
36
    }
37
38
    /**
39
     * Check PSR-2 coding style
40
     */
41
    public function devtoolsCheckPhpCodingStyle()
42
    {
43
        $this
44
            ->taskExec('vendor/bin/phpcs')
45
            ->option('colors')
46
            ->option('standard=PSR2')
47
            ->option('encoding=utf-8')
48
            ->option('report=full')
49
            ->option('warning-severity=0')
50
            ->arg('app')
51
            ->run();
52
53
    }
54
55
    /**
56
     * Calculate PHP metrics
57
     */
58
    public function devtoolsCalculatePhpMetrics()
59
    {
60
        $this
61
            ->taskExec('vendor/bin/phpmetrics')
62
            ->option('config', 'phpmetrics.yml')
63
            ->option('ansi')
64
            ->option('failure-condition', 'false <> false')
65
            ->arg('.')
66
            ->printed(true)
67
            ->run();
68
    }
69
70
    public function hello($name)
71
    {
72
        echo $name;
73
    }
74
}