GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Failed Conditions
Push — develop ( 97d950...17c62d )
by Maxime
19:32
created

src/Rocketeer/Binaries/Php.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
/*
4
 * This file is part of Rocketeer
5
 *
6
 * (c) Maxime Fabre <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 */
12
13
namespace Rocketeer\Binaries;
14
15
/**
16
 * Represents the "php" binary.
17
 */
18
class Php extends AbstractBinary
19
{
20
    /**
21
     * Get an array of default paths to look for.
22
     *
23
     * @return string[]
24
     */
25 14
    protected function getKnownPaths()
26
    {
27 14
        return ['php'];
28
    }
29
30
    /**
31
     * Get the running version of PHP.
32
     *
33
     * @return string
34
     */
35 2
    public function version()
36
    {
37 2
        $constant = $this->isHhvm() ? 'HHVM_VERSION' : 'PHP_VERSION';
38
39 2
        return $this->getCommand(null, null, '-r "print '.$constant.';"');
40
    }
41
42
    /**
43
     * Get the installed extensions.
44
     *
45
     * @return string
46
     */
47 1
    public function extensions()
48
    {
49 1
        return $this->getCommand(null, null, ['-m' => null]);
50
    }
51
52
    /**
53
     * Whether this PHP installation is an HHVM one or not.
54
     *
55
     * @return bool
56
     */
57 6
    public function isHhvm()
58
    {
59 6
        $isHhvm = $this->getCommand(null, null, '-r "print defined(\'HHVM_VERSION\');"');
60 6
        $isHhvm = $this->bash->runRaw($isHhvm);
0 ignored issues
show
Documentation Bug introduced by Maxime Fabre
The method runRaw does not exist on object<Rocketeer\Services\Connections\Shell\Bash>? 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...
61 6
        $isHhvm = $isHhvm === '1';
62
63 6
        return $isHhvm;
64
    }
65
}
66