Completed
Push — master ( 201996...d02f26 )
by PROSPER
03:18
created

GithubController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRepoDetails() 0 4 1
A getPage() 0 6 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
7
use App\Http\Requests;
8
use App\Http\Controllers\Controller;
9
use GrahamCampbell\GitHub\Facades\GitHub;
10
use GrahamCampbell\GitHub\GitHubManager;
11
12
class GithubController extends Controller
13
{
14
    protected $github;
15
    protected $repoName;
16
    protected $githubHandle;
17
18
    public function __construct(GitHubManager $github)
19
    {
20
        $this->github = $github;
21
        $this->repoName = 'laravel-emoji';
22
        $this->githubHandle = 'unicodeveloper';
23
    }
24
25
    private function getRepoDetails()
26
    {
27
        return $this->github->connection('alternative')->repos()->show($this->githubHandle, $this->repoName);
28
    }
29
30
    public function getPage()
31
    {
32
        $details = $this->getRepoDetails();
33
34
        return view('api.github')->withDetails($details);
35
    }
36
}
37