Completed
Push — master ( 45e919...3444d0 )
by Andrii
13:59
created

GithubController::actionRelease()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Automation tool mixed with code generator for easier continuous development
4
 *
5
 * @link      https://github.com/hiqdev/hidev
6
 * @package   hidev
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\console;
12
13
/**
14
 * Goal for GitHub.
15
 */
16
class GithubController extends CommonController
17
{
18
    /**
19
     * Create the repo on GitHub.
20
     * If name not given, repo for current project created.
21
     * @param string $repo full name
22
     * @return int exit code
23
     */
24
    public function actionCreate(string $repo = null)
25
    {
26
        return $this->getComponent()->createRepo($repo);
27
    }
28
29
    /**
30
     * Clone repo from github.
31
     * TODO this action must be run without `start`.
32
     * @param string $repo full name vendor/package
33
     * @return int exit code
34
     */
35
    public function actionClone(string $repo)
36
    {
37
        return $this->getComponent()->cloneRepo($repo);
38
    }
39
40
    /**
41
     * Checks if repo exists.
42
     * @param string $repo full name vendor/package defaults to this repo name
43
     * @return int exit code
44
     */
45
    public function actionExists($repo = null)
46
    {
47
        return $this->getComponent()->existsRepo($repo);
48
    }
49
50
    /**
51
     * Creates github release for current project repo.
52
     * @param string $release version number
53
     */
54
    public function actionRelease($release = null)
0 ignored issues
show
Unused Code introduced by
The parameter $release is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

54
    public function actionRelease(/** @scrutinizer ignore-unused */ $release = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        return $this->getComponent()->releaseRepo($repo);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $repo seems to be never defined.
Loading history...
57
    }
58
59
    public function getComponent()
60
    {
61
        return $this->take('github');
62
    }
63
}
64