Pages::listLatestPagesBuilds()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace FlexyProject\GitHub\Receiver\Repositories;
3
4
/**
5
 * The Pages API class provides access to repository's pages.
6
 *
7
 * @link    https://developer.github.com/v3/repos/pages/
8
 * @package FlexyProject\GitHub\Receiver\Repositories
9
 */
10 View Code Duplication
class Pages extends AbstractRepositories
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
13
    /**
14
     * Get information about a Pages site
15
     *
16
     * @link https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site
17
     * @return array
18
     */
19
    public function getInformation(): array
20
    {
21
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages',
22
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
23
    }
24
25
    /**
26
     * List Pages builds
27
     *
28
     * @link https://developer.github.com/v3/repos/pages/#list-pages-builds
29
     * @return array
30
     */
31
    public function listPagesBuilds(): array
32
    {
33
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds',
34
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
35
    }
36
37
    /**
38
     * List latest Pages build
39
     *
40
     * @link https://developer.github.com/v3/repos/pages/#list-latest-pages-build
41
     * @return array
42
     */
43
    public function listLatestPagesBuilds(): array
44
    {
45
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds/latest',
46
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
47
    }
48
}