Passed
Pull Request — master (#3)
by
unknown
08:48
created
src/Api/Api.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      */
65 65
     public function setOrganization($organizationName)
66 66
     {
67
-        if($organization = $this->getOrganizationByName($organizationName)) {
67
+        if ($organization = $this->getOrganizationByName($organizationName)) {
68 68
             $this->setOrganizationId($organization['organizationId']);
69 69
         }
70 70
 
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -32,95 +32,95 @@
 block discarded – undo
32 32
  */
33 33
 class Api
34 34
 {
35
-    /**
36
-     * @var EndpointsContainer
37
-     */
38
-    protected $endpointsContainer;
39
-
40
-    /**
41
-     * @var string
42
-     */
43
-    protected $organizationId;
44
-
45
-    public function __construct(EndpointsContainer $endpointsContainer)
46
-    {
47
-        $this->endpointsContainer = $endpointsContainer;
48
-    }
49
-
50
-    /**
51
-     * Magic method to access different endpoints.
52
-     *
53
-     * @param string $endpoint
54
-     *
55
-     * @return Endpoint
56
-     */
57
-    public function __get($endpoint)
58
-    {
59
-        $endpoint = $this->endpointsContainer->resolve($endpoint);
60
-
61
-        if (method_exists($endpoint, 'setOrganizationId')) {
62
-            $endpoint->setOrganizationId($this->organizationId);
63
-        }
64
-
65
-        return $endpoint;
66
-    }
67
-
68
-    /**
69
-     * @param $organizationName
70
-     * @return $this
71
-     */
72
-    public function setOrganization($organizationName)
73
-    {
74
-        if($organization = $this->getOrganizationByName($organizationName)) {
75
-            $this->setOrganizationId($organization['organizationId']);
76
-        }
77
-
78
-        return $this;
79
-    }
80
-
81
-    /**
82
-     * @param int $organizationId
83
-     * @return $this
84
-     */
85
-    public function setOrganizationId($organizationId)
86
-    {
87
-        $this->organizationId = $organizationId;
88
-
89
-        return $this;
90
-    }
91
-
92
-    /**
93
-     * @return string
94
-     */
95
-    public function getOrganizationId()
96
-    {
97
-        return $this->organizationId;
98
-    }
99
-
100
-    /**
101
-     * @param string $name
102
-     * @param array $arguments
103
-     * @return mixed
104
-     */
105
-    public function __call($name, $arguments)
106
-    {
107
-        return call_user_func([$this->endpointsContainer, $name], $arguments);
108
-    }
109
-
110
-    /**
111
-     * @param $organization
112
-     * @return array|bool
113
-     * @throws WrongOrganizationName
114
-     */
115
-    protected function getOrganizationByName($organization)
116
-    {
117
-        $organizations = $this->organizations->getAll();
118
-        foreach ($organizations['entities'] as $entity) {
119
-            if ($entity['name'] == $organization) {
120
-                return $entity;
121
-            }
122
-        }
123
-
124
-        throw new WrongOrganizationName("Organization $organization not found!");
125
-    }
35
+	/**
36
+	 * @var EndpointsContainer
37
+	 */
38
+	protected $endpointsContainer;
39
+
40
+	/**
41
+	 * @var string
42
+	 */
43
+	protected $organizationId;
44
+
45
+	public function __construct(EndpointsContainer $endpointsContainer)
46
+	{
47
+		$this->endpointsContainer = $endpointsContainer;
48
+	}
49
+
50
+	/**
51
+	 * Magic method to access different endpoints.
52
+	 *
53
+	 * @param string $endpoint
54
+	 *
55
+	 * @return Endpoint
56
+	 */
57
+	public function __get($endpoint)
58
+	{
59
+		$endpoint = $this->endpointsContainer->resolve($endpoint);
60
+
61
+		if (method_exists($endpoint, 'setOrganizationId')) {
62
+			$endpoint->setOrganizationId($this->organizationId);
63
+		}
64
+
65
+		return $endpoint;
66
+	}
67
+
68
+	/**
69
+	 * @param $organizationName
70
+	 * @return $this
71
+	 */
72
+	public function setOrganization($organizationName)
73
+	{
74
+		if($organization = $this->getOrganizationByName($organizationName)) {
75
+			$this->setOrganizationId($organization['organizationId']);
76
+		}
77
+
78
+		return $this;
79
+	}
80
+
81
+	/**
82
+	 * @param int $organizationId
83
+	 * @return $this
84
+	 */
85
+	public function setOrganizationId($organizationId)
86
+	{
87
+		$this->organizationId = $organizationId;
88
+
89
+		return $this;
90
+	}
91
+
92
+	/**
93
+	 * @return string
94
+	 */
95
+	public function getOrganizationId()
96
+	{
97
+		return $this->organizationId;
98
+	}
99
+
100
+	/**
101
+	 * @param string $name
102
+	 * @param array $arguments
103
+	 * @return mixed
104
+	 */
105
+	public function __call($name, $arguments)
106
+	{
107
+		return call_user_func([$this->endpointsContainer, $name], $arguments);
108
+	}
109
+
110
+	/**
111
+	 * @param $organization
112
+	 * @return array|bool
113
+	 * @throws WrongOrganizationName
114
+	 */
115
+	protected function getOrganizationByName($organization)
116
+	{
117
+		$organizations = $this->organizations->getAll();
118
+		foreach ($organizations['entities'] as $entity) {
119
+			if ($entity['name'] == $organization) {
120
+				return $entity;
121
+			}
122
+		}
123
+
124
+		throw new WrongOrganizationName("Organization $organization not found!");
125
+	}
126 126
 }
127 127
\ No newline at end of file
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.