GithubController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRepoDetails() 0 4 1
A getPage() 0 6 1
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