Completed
Push — master ( b00238...0260be )
by Andrii
12:25
created

src/console/PhpunitXmlController.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * PHPUnit plugin for HiDev.
4
 *
5
 * @link      https://github.com/hiqdev/hidev-phpunit
6
 * @package   hidev-phpunit
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\phpunit\console;
12
13
/**
14
 * `phpunit.xml` generation.
15
 * @author Andrii Vasyliev <[email protected]>
16
 */
17
class PhpunitXmlController extends \hidev\base\Controller
18
{
19
    public function actionIndex()
20
    {
21
        $this->take('phpunit.xml')->save();
0 ignored issues
show
Documentation Bug introduced by
The method take does not exist on object<hidev\phpunit\con...e\PhpunitXmlController>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
22
    }
23
}
24