@@ -8,36 +8,36 @@ |
||
8 | 8 | |
9 | 9 | class Favro |
10 | 10 | { |
11 | - /** |
|
12 | - * @param string $login |
|
13 | - * @param string $password |
|
14 | - * @return Api |
|
15 | - */ |
|
16 | - public static function create($login, $password) |
|
17 | - { |
|
18 | - $endpointsContainer = new EndpointsContainer( |
|
19 | - self::getHttpInterfaceAdapter($login, $password) |
|
20 | - ); |
|
21 | - return new Api($endpointsContainer); |
|
22 | - } |
|
11 | + /** |
|
12 | + * @param string $login |
|
13 | + * @param string $password |
|
14 | + * @return Api |
|
15 | + */ |
|
16 | + public static function create($login, $password) |
|
17 | + { |
|
18 | + $endpointsContainer = new EndpointsContainer( |
|
19 | + self::getHttpInterfaceAdapter($login, $password) |
|
20 | + ); |
|
21 | + return new Api($endpointsContainer); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * @param string $login |
|
26 | - * @param string $password |
|
27 | - * @return GuzzleHttpClient |
|
28 | - */ |
|
29 | - protected static function getHttpInterfaceAdapter($login, $password) |
|
30 | - { |
|
31 | - return new GuzzleHttpClient( |
|
32 | - new Client(['auth' => [$login, $password]]) |
|
33 | - ); |
|
34 | - } |
|
24 | + /** |
|
25 | + * @param string $login |
|
26 | + * @param string $password |
|
27 | + * @return GuzzleHttpClient |
|
28 | + */ |
|
29 | + protected static function getHttpInterfaceAdapter($login, $password) |
|
30 | + { |
|
31 | + return new GuzzleHttpClient( |
|
32 | + new Client(['auth' => [$login, $password]]) |
|
33 | + ); |
|
34 | + } |
|
35 | 35 | |
36 | - private function __construct() |
|
37 | - { |
|
38 | - } |
|
36 | + private function __construct() |
|
37 | + { |
|
38 | + } |
|
39 | 39 | |
40 | - private function __clone() |
|
41 | - { |
|
42 | - } |
|
40 | + private function __clone() |
|
41 | + { |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -5,8 +5,8 @@ |
||
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 |
@@ -5,8 +5,8 @@ |
||
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 |
@@ -4,8 +4,8 @@ |
||
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 |
@@ -4,8 +4,8 @@ |
||
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 |
@@ -4,33 +4,33 @@ |
||
4 | 4 | |
5 | 5 | class Cards extends CrudEndpoint |
6 | 6 | { |
7 | - /** |
|
8 | - * @var string |
|
9 | - */ |
|
10 | - protected $endpoint = 'cards'; |
|
7 | + /** |
|
8 | + * @var string |
|
9 | + */ |
|
10 | + protected $endpoint = 'cards'; |
|
11 | 11 | |
12 | - /** |
|
13 | - * @param string $widgetCommonId |
|
14 | - * @return mixed |
|
15 | - */ |
|
16 | - public function getAll($widgetCommonId) |
|
17 | - { |
|
18 | - return parent::getAll(['widgetCommonId'=>$widgetCommonId]); |
|
19 | - } |
|
12 | + /** |
|
13 | + * @param string $widgetCommonId |
|
14 | + * @return mixed |
|
15 | + */ |
|
16 | + public function getAll($widgetCommonId) |
|
17 | + { |
|
18 | + return parent::getAll(['widgetCommonId'=>$widgetCommonId]); |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @param string $cardId |
|
23 | - * @param bool $everywhere |
|
24 | - * @return mixed |
|
25 | - */ |
|
26 | - public function delete($cardId, $everywhere) |
|
27 | - { |
|
28 | - return $this |
|
29 | - ->getHttp() |
|
30 | - ->delete( |
|
31 | - $this->makeRequestUrl($cardId), |
|
32 | - ['everywhere' => $everywhere], |
|
33 | - $this->getHeaders() |
|
34 | - ); |
|
35 | - } |
|
21 | + /** |
|
22 | + * @param string $cardId |
|
23 | + * @param bool $everywhere |
|
24 | + * @return mixed |
|
25 | + */ |
|
26 | + public function delete($cardId, $everywhere) |
|
27 | + { |
|
28 | + return $this |
|
29 | + ->getHttp() |
|
30 | + ->delete( |
|
31 | + $this->makeRequestUrl($cardId), |
|
32 | + ['everywhere' => $everywhere], |
|
33 | + $this->getHeaders() |
|
34 | + ); |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -5,8 +5,8 @@ |
||
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 |
@@ -4,49 +4,49 @@ |
||
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 |
@@ -4,8 +4,8 @@ |
||
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 |