Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Github   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A latestReleaseVersion() 0 13 2
1
<?php
2
3
namespace App\Classes\Library\Services;
4
5
use Cache;
6
7
/**
8
 * Created by PhpStorm.
9
 * User: Mark
10
 * Date: 22/03/2017
11
 * Time: 16:18.
12
 */
13
class Github
14
{
15
    /**
16
     * Get the latest release version.
17
     *
18
     * @param string $repository
19
     * @return string
20
     */
21
    public static function latestReleaseVersion(string $repository)
22
    {
23
        return Cache::remember('github_version', 20, function () use ($repository) {
24
            try {
25
                $agent = ['http' => ['method' => 'GET', 'header' => ['User-Agent: PHP']]];
26
27
                $stream = stream_context_create($agent);
28
29
                $releases = json_decode(file_get_contents('https://api.github.com/repos/'.$repository.'/tags', false, $stream));
30
31
                return $releases[0]->name;
32
            } catch (\ErrorException $e) {
33
                return '';
34
            }
35
        });
36
    }
37
}
38