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/PackageManagers/Bower.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\PackageManagers;
14
15
/**
16
 * Provides methods to manage a Bower application.
17
 */
18
class Bower extends AbstractPackageManager
19
{
20
    /**
21
     * The name of the manifest file to look for.
22
     *
23
     * @var string
24
     */
25
    protected $manifest = 'bower.json';
26
27
    /**
28
     * Get an array of default paths to look for.
29
     *
30
     * @return string[]
31
     */
32 4
    protected function getKnownPaths()
33
    {
34
        return [
35 4
            'bower',
36 4
            $this->releasesManager->getCurrentReleasePath().'/node_modules/.bin/bower',
37 4
        ];
38
    }
39
40
    /**
41
     * Get where dependencies are installed.
42
     *
43
     * @return string
44
     */
45 7
    public function getDependenciesFolder()
46
    {
47
        // Look for a configuration file
48 7
        $paths = array_filter([
49 7
            $this->paths->getBasePath().'.bowerrc',
50 7
            $this->paths->getUserHomeFolder().'/.bowerrc',
0 ignored issues
show
Documentation Bug introduced by Maxime Fabre
The method getUserHomeFolder does not exist on object<Rocketeer\Services\Environment\Pathfinder>? 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...
51 7
        ], [$this->files, 'has']);
52
53 7
        $file = head($paths);
54 7
        if ($file) {
55 3
            $file = $this->files->read($file);
56 3
            $file = json_decode($file, true);
57 3
        }
58
59 7
        return array_get($file, 'directory', 'bower_components');
60
    }
61
}
62