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.
Passed
Push — master ( 6a3289...514d99 )
by Anton
02:27
created

recipe/deploy/cleanup.php (1 issue)

Labels
Severity
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer;
9
10 8
desc('Cleaning up old releases');
11
task('deploy:cleanup', function () {
12 4
    $releases = get('releases_list');
13 4
    $keep = get('keep_releases');
14 4
    $runOpts = [];
15
16 4
    if ($keep === -1) {
17
        // Keep unlimited releases.
18
        return;
19
    }
20
21 4
    while ($keep > 0) {
22 4
        array_shift($releases);
0 ignored issues
show
It seems like $releases can also be of type string; however, parameter $array of array_shift() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
        array_shift(/** @scrutinizer ignore-type */ $releases);
Loading history...
23 4
        --$keep;
24
    }
25
26 4
    foreach ($releases as $release) {
27 1
        run("rm -rf {{deploy_path}}/releases/$release", $runOpts);
28
    }
29
30 4
    run("cd {{deploy_path}} && if [ -e release ]; then rm release; fi", $runOpts);
31
});
32