GithubController::getRepoDetails()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Http\Requests;
6
use GrahamCampbell\GitHub\GitHubManager;
7
8
class GithubController extends Controller
9
{
10
    /**
11
     * @var GitHubManager
12
     */
13
    protected $github;
14
15
    const REPO_NAME = 'laravel-emoji';
16
    const GITHUB_HANDLE = 'unicodeveloper';
17
18
    /**
19
     * Initialize the Controller with necessary arguments
20
     *
21
     * @param GitHubManager $github
22
     */
23
    public function __construct(GitHubManager $github)
24
    {
25
        $this->github = $github;
26
    }
27
28
    /**
29
     * @return mixed
30
     */
31
    private function getRepoDetails()
32
    {
33
        return $this->github->connection('alternative')->repos()->show(self::GITHUB_HANDLE, self::REPO_NAME);
34
    }
35
36
    /**
37
     * @return mixed
38
     */
39
    public function getPage()
40
    {
41
        $details = $this->getRepoDetails();
42
43
        return view('api.github')->withDetails($details);
44
    }
45
}
46