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

GithubController::getPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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