Completed
Push — master ( 672616...b2af45 )
by Sergey
03:20
created
src/Contracts/HttpInterface.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -4,40 +4,40 @@
 block discarded – undo
4 4
 
5 5
 interface HttpInterface
6 6
 {
7
-    /**
8
-     * @param $uri
9
-     * @param array $params
10
-     * @param array $headers
11
-     * @return array
12
-     */
13
-    public function get($uri, $params = [], $headers = []);
7
+	/**
8
+	 * @param $uri
9
+	 * @param array $params
10
+	 * @param array $headers
11
+	 * @return array
12
+	 */
13
+	public function get($uri, $params = [], $headers = []);
14 14
 
15
-    /**
16
-     * @param string $uri
17
-     * @param array $body
18
-     * @param array $headers
19
-     * @return array
20
-     */
21
-    public function post($uri, $body = [], $headers = []);
15
+	/**
16
+	 * @param string $uri
17
+	 * @param array $body
18
+	 * @param array $headers
19
+	 * @return array
20
+	 */
21
+	public function post($uri, $body = [], $headers = []);
22 22
 
23
-    /**
24
-     * @param string $uri
25
-     * @param array $body
26
-     * @param array $headers
27
-     * @return mixed
28
-     */
29
-    public function put($uri, $body = [], $headers = []);
23
+	/**
24
+	 * @param string $uri
25
+	 * @param array $body
26
+	 * @param array $headers
27
+	 * @return mixed
28
+	 */
29
+	public function put($uri, $body = [], $headers = []);
30 30
 
31
-    /**
32
-     * @param string $uri
33
-     * @param array $headers
34
-     * @return mixed
35
-     */
36
-    public function delete($uri, $headers = []);
31
+	/**
32
+	 * @param string $uri
33
+	 * @param array $headers
34
+	 * @return mixed
35
+	 */
36
+	public function delete($uri, $headers = []);
37 37
 
38
-    /**
39
-     * @param string $url
40
-     * @return $this
41
-     */
42
-    public function setBaseUrl($url);
38
+	/**
39
+	 * @param string $url
40
+	 * @return $this
41
+	 */
42
+	public function setBaseUrl($url);
43 43
 }
44 44
\ No newline at end of file
Please login to merge, or discard this patch.
src/Favro.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -9,36 +9,36 @@
 block discarded – undo
9 9
 
10 10
 class Favro
11 11
 {
12
-    /**
13
-     * @param string $login
14
-     * @param string $password
15
-     * @return Api
16
-     */
17
-    public static function create($login, $password)
18
-    {
19
-        $endpointsContainer = new EndpointsContainer(
20
-            self::getHttpInterfaceAdapter($login, $password)
21
-        );
22
-        return new Api($endpointsContainer);
23
-    }
12
+	/**
13
+	 * @param string $login
14
+	 * @param string $password
15
+	 * @return Api
16
+	 */
17
+	public static function create($login, $password)
18
+	{
19
+		$endpointsContainer = new EndpointsContainer(
20
+			self::getHttpInterfaceAdapter($login, $password)
21
+		);
22
+		return new Api($endpointsContainer);
23
+	}
24 24
 
25
-    /**
26
-     * @param string $login
27
-     * @param string $password
28
-     * @return GuzzleHttpAdapter
29
-     */
30
-    protected static function getHttpInterfaceAdapter($login, $password)
31
-    {
32
-        return new GuzzleHttpAdapter(
33
-            new Client(['auth' => [$login, $password]])
34
-        );
35
-    }
25
+	/**
26
+	 * @param string $login
27
+	 * @param string $password
28
+	 * @return GuzzleHttpAdapter
29
+	 */
30
+	protected static function getHttpInterfaceAdapter($login, $password)
31
+	{
32
+		return new GuzzleHttpAdapter(
33
+			new Client(['auth' => [$login, $password]])
34
+		);
35
+	}
36 36
 
37
-    private function __construct()
38
-    {
39
-    }
37
+	private function __construct()
38
+	{
39
+	}
40 40
 
41
-    private function __clone()
42
-    {
43
-    }
41
+	private function __clone()
42
+	{
43
+	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Users.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@
 block discarded – undo
6 6
 
7 7
 class Users extends Endpoint
8 8
 {
9
-    use BelongsToOrganization;
9
+	use BelongsToOrganization;
10 10
 
11
-    /**
12
-     * @var string
13
-     */
14
-    protected $endpoint = 'users';
11
+	/**
12
+	 * @var string
13
+	 */
14
+	protected $endpoint = 'users';
15 15
 }
16 16
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Columns.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 class Columns extends Endpoint
10 10
 {
11 11
 
12
-    use BelongsToOrganization, BelongsToWidget, CrudEndpoint;
12
+	use BelongsToOrganization, BelongsToWidget, CrudEndpoint;
13 13
 
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $endpoint = 'columns';
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $endpoint = 'columns';
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/TaskLists.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 class TaskLists extends Endpoint
10 10
 {
11 11
 
12
-    use CrudEndpoint, BelongsToOrganization, BelongsToCard;
12
+	use CrudEndpoint, BelongsToOrganization, BelongsToCard;
13 13
 
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $endpoint = 'tasklists';
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $endpoint = 'tasklists';
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/EndpointsContainer.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -8,63 +8,63 @@
 block discarded – undo
8 8
 
9 9
 class EndpointsContainer
10 10
 {
11
-    const ENDPOINTS_NAMESPACE = 'seregazhuk\\Favro\\Api\\Endpoints\\';
11
+	const ENDPOINTS_NAMESPACE = 'seregazhuk\\Favro\\Api\\Endpoints\\';
12 12
 
13
-    /*
13
+	/*
14 14
     * @var HttpInterface
15 15
     */
16
-    protected $http;
16
+	protected $http;
17 17
 
18
-    /*
18
+	/*
19 19
      * @var array
20 20
      */
21
-    protected $endpoints = [];
21
+	protected $endpoints = [];
22 22
 
23
-    /**
24
-     * @param HttpInterface $http
25
-     */
26
-    public function __construct(HttpInterface $http)
27
-    {
28
-        $this->http = $http;
29
-    }
23
+	/**
24
+	 * @param HttpInterface $http
25
+	 */
26
+	public function __construct(HttpInterface $http)
27
+	{
28
+		$this->http = $http;
29
+	}
30 30
 
31
-    /**
32
-     * @param string $endpoint
33
-     * @return Endpoint
34
-     */
35
-    public function resolveEndpoint($endpoint)
36
-    {
37
-        $endpoint = strtolower($endpoint);
31
+	/**
32
+	 * @param string $endpoint
33
+	 * @return Endpoint
34
+	 */
35
+	public function resolveEndpoint($endpoint)
36
+	{
37
+		$endpoint = strtolower($endpoint);
38 38
 
39
-        // Check if an instance has already been initiated
40
-        if (!isset($this->endpoints[$endpoint])) {
41
-            $this->addProvider($endpoint);
42
-        }
39
+		// Check if an instance has already been initiated
40
+		if (!isset($this->endpoints[$endpoint])) {
41
+			$this->addProvider($endpoint);
42
+		}
43 43
 
44
-        return $this->endpoints[$endpoint];
45
-    }
44
+		return $this->endpoints[$endpoint];
45
+	}
46 46
 
47
-    /**
48
-     * @param $endpoint
49
-     * @throws BadEndpointException
50
-     */
51
-    protected function addProvider($endpoint)
52
-    {
53
-        $className = self::ENDPOINTS_NAMESPACE . ucfirst($endpoint);
47
+	/**
48
+	 * @param $endpoint
49
+	 * @throws BadEndpointException
50
+	 */
51
+	protected function addProvider($endpoint)
52
+	{
53
+		$className = self::ENDPOINTS_NAMESPACE . ucfirst($endpoint);
54 54
 
55
-        if (!class_exists($className)) {
56
-            throw new BadEndpointException("Endpoint $className not found.");
57
-        }
55
+		if (!class_exists($className)) {
56
+			throw new BadEndpointException("Endpoint $className not found.");
57
+		}
58 58
 
59
-        $this->endpoints[$endpoint] = $this->buildEndpoint($className);
60
-    }
59
+		$this->endpoints[$endpoint] = $this->buildEndpoint($className);
60
+	}
61 61
 
62
-    /**
63
-     * @param string $className
64
-     * @return Endpoint|object
65
-     */
66
-    protected function buildEndpoint($className)
67
-    {
68
-        return (new ReflectionClass($className))->newInstanceArgs([$this->http]);
69
-    }
62
+	/**
63
+	 * @param string $className
64
+	 * @return Endpoint|object
65
+	 */
66
+	protected function buildEndpoint($className)
67
+	{
68
+		return (new ReflectionClass($className))->newInstanceArgs([$this->http]);
69
+	}
70 70
 }
71 71
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Cards.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 class Cards extends Endpoint
10 10
 {
11 11
 
12
-    use BelongsToOrganization, BelongsToWidget, CrudEndpoint;
12
+	use BelongsToOrganization, BelongsToWidget, CrudEndpoint;
13 13
 
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $endpoint = 'cards';
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $endpoint = 'cards';
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Tags.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 class Tags extends Endpoint
9 9
 {
10 10
 
11
-    use CrudEndpoint, BelongsToOrganization;
11
+	use CrudEndpoint, BelongsToOrganization;
12 12
 
13
-    /**
14
-     * @var string
15
-     */
16
-    protected $endpoint = 'tags';
13
+	/**
14
+	 * @var string
15
+	 */
16
+	protected $endpoint = 'tags';
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Comments.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 class Comments extends Endpoint
10 10
 {
11 11
 
12
-    use CrudEndpoint, BelongsToOrganization, BelongsToCard;
12
+	use CrudEndpoint, BelongsToOrganization, BelongsToCard;
13 13
 
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $endpoint = 'comments';
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $endpoint = 'comments';
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.