Passed
Pull Request — master (#3)
by
unknown
08:48
created
src/Api/Endpoints/EndpointsContainer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-     * @param $endpoint
48
+     * @param string $endpoint
49 49
      * @throws WrongEndpoint
50 50
      */
51 51
     protected function addProvider($endpoint)
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -8,75 +8,75 @@
 block discarded – undo
8 8
 
9 9
 class EndpointsContainer
10 10
 {
11
-    /*
11
+	/*
12 12
     * @var HttpInterface
13 13
     */
14
-    protected $httpClient;
14
+	protected $httpClient;
15 15
 
16
-    /*
16
+	/*
17 17
      * @var array
18 18
      */
19
-    protected $endpoints = [];
19
+	protected $endpoints = [];
20 20
 
21
-    /**
22
-     * @param HttpClient $httpClient
23
-     */
24
-    public function __construct(HttpClient $httpClient)
25
-    {
26
-        $this->httpClient = $httpClient;
27
-    }
21
+	/**
22
+	 * @param HttpClient $httpClient
23
+	 */
24
+	public function __construct(HttpClient $httpClient)
25
+	{
26
+		$this->httpClient = $httpClient;
27
+	}
28 28
 
29
-    /**
30
-     * @param string $endpoint
31
-     * @return Endpoint
32
-     */
33
-    public function resolve($endpoint)
34
-    {
35
-        $endpoint = strtolower($endpoint);
29
+	/**
30
+	 * @param string $endpoint
31
+	 * @return Endpoint
32
+	 */
33
+	public function resolve($endpoint)
34
+	{
35
+		$endpoint = strtolower($endpoint);
36 36
 
37
-        // Check if an instance has already been initiated
38
-        if (!isset($this->endpoints[$endpoint])) {
39
-            $this->addProvider($endpoint);
40
-        }
37
+		// Check if an instance has already been initiated
38
+		if (!isset($this->endpoints[$endpoint])) {
39
+			$this->addProvider($endpoint);
40
+		}
41 41
 
42
-        return $this->endpoints[$endpoint];
43
-    }
42
+		return $this->endpoints[$endpoint];
43
+	}
44 44
 
45
-    /**
46
-     * @param $endpoint
47
-     * @throws WrongEndpoint
48
-     */
49
-    protected function addProvider($endpoint)
50
-    {
51
-        $className = __NAMESPACE__ . '\\' . ucfirst($endpoint);
45
+	/**
46
+	 * @param $endpoint
47
+	 * @throws WrongEndpoint
48
+	 */
49
+	protected function addProvider($endpoint)
50
+	{
51
+		$className = __NAMESPACE__ . '\\' . ucfirst($endpoint);
52 52
 
53
-        if (!class_exists($className)) {
54
-            throw new WrongEndpoint("Endpoint $className not found.");
55
-        }
53
+		if (!class_exists($className)) {
54
+			throw new WrongEndpoint("Endpoint $className not found.");
55
+		}
56 56
 
57
-        $this->endpoints[$endpoint] = $this->buildEndpoint($className);
58
-    }
57
+		$this->endpoints[$endpoint] = $this->buildEndpoint($className);
58
+	}
59 59
 
60
-    /**
61
-     * @param string $className
62
-     * @return Endpoint|object
63
-     */
64
-    protected function buildEndpoint($className)
65
-    {
66
-        return (new ReflectionClass($className))->newInstanceArgs([$this->httpClient]);
67
-    }
60
+	/**
61
+	 * @param string $className
62
+	 * @return Endpoint|object
63
+	 */
64
+	protected function buildEndpoint($className)
65
+	{
66
+		return (new ReflectionClass($className))->newInstanceArgs([$this->httpClient]);
67
+	}
68 68
 
69
-    /**
70
-     * @return array
71
-     */
72
-    public function getRateInfo()
73
-    {
74
-        $responseHeaders = $this->httpClient->getResponseHeaders();
69
+	/**
70
+	 * @return array
71
+	 */
72
+	public function getRateInfo()
73
+	{
74
+		$responseHeaders = $this->httpClient->getResponseHeaders();
75 75
 
76
-        return [
77
-            'reset'     => $responseHeaders['X-RateLimit-Reset'][0],
78
-            'limit'     => $responseHeaders['X-RateLimit-Limit'][0],
79
-            'remaining' => $responseHeaders['X-RateLimit-Remaining'][0],
80
-        ];
81
-    }
76
+		return [
77
+			'reset'     => $responseHeaders['X-RateLimit-Reset'][0],
78
+			'limit'     => $responseHeaders['X-RateLimit-Limit'][0],
79
+			'remaining' => $responseHeaders['X-RateLimit-Remaining'][0],
80
+		];
81
+	}
82 82
 }
Please login to merge, or discard this patch.
src/Api/Endpoints/Users.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 class Users extends Endpoint
6 6
 {
7 7
 
8
-    /**
9
-     * @var string
10
-     */
11
-    protected $endpoint = 'users';
8
+	/**
9
+	 * @var string
10
+	 */
11
+	protected $endpoint = 'users';
12 12
 }
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/TaskLists.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 class TaskLists extends CrudEndpoint
6 6
 {
7 7
 
8
-    /**
9
-     * @var string
10
-     */
11
-    protected $endpoint = 'tasklists';
8
+	/**
9
+	 * @var string
10
+	 */
11
+	protected $endpoint = 'tasklists';
12 12
 }
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Collections.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 class Collections extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * @var string
9
-     */
10
-    protected $endpoint = 'collections';
7
+	/**
8
+	 * @var string
9
+	 */
10
+	protected $endpoint = 'collections';
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Tags.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 class Tags extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * @var string
9
-     */
10
-    protected $endpoint = 'tags';
7
+	/**
8
+	 * @var string
9
+	 */
10
+	protected $endpoint = 'tags';
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Comments.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 class Comments extends CrudEndpoint
6 6
 {
7 7
 
8
-    /**
9
-     * @var string
10
-     */
11
-    protected $endpoint = 'comments';
8
+	/**
9
+	 * @var string
10
+	 */
11
+	protected $endpoint = 'comments';
12 12
 }
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/CrudEndpoint.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -4,49 +4,49 @@
 block discarded – undo
4 4
 
5 5
 class CrudEndpoint extends Endpoint
6 6
 {
7
-    /**
8
-     * @param array $attributes
9
-     * @return array
10
-     */
11
-    public function create(array $attributes)
12
-    {
13
-        return $this
14
-            ->getHttp()
15
-            ->post(
16
-                $this->makeRequestUrl(),
17
-                $attributes,
18
-                $this->getHeaders()
19
-            );
20
-    }
7
+	/**
8
+	 * @param array $attributes
9
+	 * @return array
10
+	 */
11
+	public function create(array $attributes)
12
+	{
13
+		return $this
14
+			->getHttp()
15
+			->post(
16
+				$this->makeRequestUrl(),
17
+				$attributes,
18
+				$this->getHeaders()
19
+			);
20
+	}
21 21
 
22
-    /**
23
-     * @param string $itemId
24
-     * @param array $attributes
25
-     * @return mixed
26
-     */
27
-    public function update($itemId, array $attributes)
28
-    {
29
-        return $this
30
-            ->getHttp()
31
-            ->put(
32
-                $this->makeRequestUrl($itemId),
33
-                $attributes,
34
-                $this->getHeaders()
35
-            );
36
-    }
22
+	/**
23
+	 * @param string $itemId
24
+	 * @param array $attributes
25
+	 * @return mixed
26
+	 */
27
+	public function update($itemId, array $attributes)
28
+	{
29
+		return $this
30
+			->getHttp()
31
+			->put(
32
+				$this->makeRequestUrl($itemId),
33
+				$attributes,
34
+				$this->getHeaders()
35
+			);
36
+	}
37 37
 
38
-    /**
39
-     * @param string $itemId
40
-     * @return mixed
41
-     */
42
-    public function delete($itemId)
43
-    {
44
-        return $this
45
-            ->getHttp()
46
-            ->delete(
47
-                $this->makeRequestUrl($itemId),
48
-                [],
49
-                $this->getHeaders()
50
-            );
51
-    }
38
+	/**
39
+	 * @param string $itemId
40
+	 * @return mixed
41
+	 */
42
+	public function delete($itemId)
43
+	{
44
+		return $this
45
+			->getHttp()
46
+			->delete(
47
+				$this->makeRequestUrl($itemId),
48
+				[],
49
+				$this->getHeaders()
50
+			);
51
+	}
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Columns.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 class Columns extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * @var string
9
-     */
10
-    protected $endpoint = 'columns';
7
+	/**
8
+	 * @var string
9
+	 */
10
+	protected $endpoint = 'columns';
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Tasks.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 class Tasks extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * @var string
9
-     */
10
-    protected $endpoint = 'tasks';
7
+	/**
8
+	 * @var string
9
+	 */
10
+	protected $endpoint = 'tasks';
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.