Gitignore   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A listingAvailableTemplates() 0 4 1
A getSingleTemplate() 0 4 1
1
<?php
2
namespace FlexyProject\GitHub\Receiver\Miscellaneous;
3
4
/**
5
 * The Gitignore API class gives you access to the available gitignore templates.
6
 *
7
 * @link    https://developer.github.com/v3/gitignore/
8
 * @package FlexyProject\GitHub\Receiver\Miscellaneous
9
 */
10
class Gitignore extends AbstractMiscellaneous
11
{
12
13
    /**
14
     * Listing available templates
15
     *
16
     * @link https://developer.github.com/v3/gitignore/#listing-available-templates
17
     * @return array
18
     */
19
    public function listingAvailableTemplates(): array
20
    {
21
        return $this->getApi()->request('/gitignore/templates');
22
    }
23
24
    /**
25
     * Get a single template
26
     *
27
     * @link https://developer.github.com/v3/gitignore/#get-a-single-template
28
     *
29
     * @param string $name
30
     *
31
     * @return array
32
     */
33
    public function getSingleTemplate(string $name): array
34
    {
35
        return $this->getApi()->request($this->getApi()->sprintf('/gitignore/templates/:name', $name));
36
    }
37
}