Passed
Push — master ( 259020...d68831 )
by Bruce Pinheiro de
02:13
created
src/Utils/Currency.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     const SEK = 'SEK';
13 13
     const USD = 'USD';
14 14
  
15
-    static function isValid(string $currency){
15
+    static function isValid(string $currency) {
16 16
         $currencies = self::getCurrencies();
17 17
         return in_array($currency, $currencies);
18 18
     }
Please login to merge, or discard this patch.
src/Exception/FileNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace BPCI\SumUp\Exception;
4 4
 
5
-class FileNotFoundException extends \RuntimeException{
5
+class FileNotFoundException extends \RuntimeException {
6 6
     private $path;
7 7
     public function __construct(string $message, int $code = 0, \Exception $previous = null, string $path = null)
8 8
     {
Please login to merge, or discard this patch.
src/Customer/Card/CardClientInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 use BPCI\SumUp\OAuth\AccessToken;
7 7
 use BPCI\SumUp\Customer\CustomerInterface;
8 8
 
9
-interface CardClientInterface extends SumUpClientInterface{
9
+interface CardClientInterface extends SumUpClientInterface {
10 10
 
11 11
     /**
12 12
      * Create a new card resource and fill the $card Object with response.
Please login to merge, or discard this patch.
src/OAuth/AccessToken.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
      * @param string $type
20 20
      * @param integer $expiresIn
21 21
      */
22
-    function __construct(string $token, string $type, int $expiresIn, string $scope = null){
22
+    function __construct(string $token, string $type, int $expiresIn, string $scope = null) {
23 23
         $this->token = $token;
24 24
         $this->type = $type;
25 25
         $this->expiration = time() + $expiresIn;
26 26
 
27
-        if($scope !== null) {
27
+        if ($scope !== null) {
28 28
             $this->scope = $scope;
29 29
         }
30 30
     }
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
      * @param string $scope[,$scope[,$scope[,...]]]
86 86
      * @return boolean
87 87
      */
88
-    function canAccess(string $scope){
88
+    function canAccess(string $scope) {
89 89
         $scopes = func_get_args();
90 90
         $diff = array_diff($scopes, $this->scope);
91
-        return count($diff)>0;
91
+        return count($diff) > 0;
92 92
     }
93 93
 }
Please login to merge, or discard this patch.
src/Context.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,14 +81,14 @@
 block discarded – undo
81 81
      */
82 82
     public static function loadContextFromFile(string $filePath): ContextInterface
83 83
     {
84
-        if(!file_exists($filePath)){
85
-            throw new Exception\FileNotFoundException('Context file not found: '.$filePath, 404, null, $filePath);
84
+        if (!file_exists($filePath)) {
85
+            throw new Exception\FileNotFoundException('Context file not found: ' . $filePath, 404, null, $filePath);
86 86
         }
87 87
 
88 88
         $contents = file_get_contents($filePath);
89 89
         $context_array = json_decode($contents, true);
90 90
 
91
-        if($context_array === null){
91
+        if ($context_array === null) {
92 92
             throw new Exception\MalformedJsonException('JSON sintax error.');
93 93
         }
94 94
 
Please login to merge, or discard this patch.
src/Traits/PropertyHandler.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,48 +11,48 @@
 block discarded – undo
11 11
 
12 12
 trait PropertyHandler
13 13
 {
14
-	/**
15
-	 * @param array $data
16
-	 */
17
-	function fillProperties(array $data)
18
-	{
19
-		foreach ($data as $p => $v)
20
-		{
21
-			$this->fillProperty($p, $v);
22
-		}
23
-	}
14
+    /**
15
+     * @param array $data
16
+     */
17
+    function fillProperties(array $data)
18
+    {
19
+        foreach ($data as $p => $v)
20
+        {
21
+            $this->fillProperty($p, $v);
22
+        }
23
+    }
24 24
 
25
-	/**
26
-	 * @param string $property
27
-	 * @param mixed $value
28
-	 */
29
-	function fillProperty(string $property, $value)
30
-	{
31
-		$property = lcfirst(str_replace('_', '', ucwords($property, '_')));
32
-		if(property_exists(__CLASS__, $property))
33
-		{
34
-			$method = sprintf('set%s', ucfirst($property));
35
-			$this->{$method}($value);
36
-		}
37
-	}
25
+    /**
26
+     * @param string $property
27
+     * @param mixed $value
28
+     */
29
+    function fillProperty(string $property, $value)
30
+    {
31
+        $property = lcfirst(str_replace('_', '', ucwords($property, '_')));
32
+        if(property_exists(__CLASS__, $property))
33
+        {
34
+            $method = sprintf('set%s', ucfirst($property));
35
+            $this->{$method}($value);
36
+        }
37
+    }
38 38
 
39
-	/**
40
-	 * @return array
41
-	 */
42
-	function getPropertyArray(): array
43
-	{
44
-		$reflection = new \ReflectionClass(__CLASS__);
45
-		$properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED);
46
-		$data = [];
47
-		foreach($properties as $property){
48
-			$prop_name = $property->getName();
49
-			$method = sprintf('get%s', ucfirst($prop_name));
50
-			$form_name = strtolower(preg_replace('/[A-Z]/', '_$0', $prop_name));
51
-			if($reflection->hasMethod($method)){
52
-				$data[$form_name] = $this->{$method}();
53
-			}
54
-		}
55
-		return $data;
56
-	}
39
+    /**
40
+     * @return array
41
+     */
42
+    function getPropertyArray(): array
43
+    {
44
+        $reflection = new \ReflectionClass(__CLASS__);
45
+        $properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED);
46
+        $data = [];
47
+        foreach($properties as $property){
48
+            $prop_name = $property->getName();
49
+            $method = sprintf('get%s', ucfirst($prop_name));
50
+            $form_name = strtolower(preg_replace('/[A-Z]/', '_$0', $prop_name));
51
+            if($reflection->hasMethod($method)){
52
+                $data[$form_name] = $this->{$method}();
53
+            }
54
+        }
55
+        return $data;
56
+    }
57 57
 
58 58
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	function fillProperty(string $property, $value)
30 30
 	{
31 31
 		$property = lcfirst(str_replace('_', '', ucwords($property, '_')));
32
-		if(property_exists(__CLASS__, $property))
32
+		if (property_exists(__CLASS__, $property))
33 33
 		{
34 34
 			$method = sprintf('set%s', ucfirst($property));
35 35
 			$this->{$method}($value);
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 		$reflection = new \ReflectionClass(__CLASS__);
45 45
 		$properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED);
46 46
 		$data = [];
47
-		foreach($properties as $property){
47
+		foreach ($properties as $property) {
48 48
 			$prop_name = $property->getName();
49 49
 			$method = sprintf('get%s', ucfirst($prop_name));
50 50
 			$form_name = strtolower(preg_replace('/[A-Z]/', '_$0', $prop_name));
51
-			if($reflection->hasMethod($method)){
51
+			if ($reflection->hasMethod($method)) {
52 52
 				$data[$form_name] = $this->{$method}();
53 53
 			}
54 54
 		}
Please login to merge, or discard this patch.
src/SumUpClientInterface.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
 
6 6
 interface SumUpClientInterface
7 7
 {
8
-	/**
9
-	 * CheckoutClientInterface constructor.
10
-	 * @param ContextInterface $context
11
-	 */
12
-	function __construct(ContextInterface $context);
8
+    /**
9
+     * CheckoutClientInterface constructor.
10
+     * @param ContextInterface $context
11
+     */
12
+    function __construct(ContextInterface $context);
13 13
 
14 14
     /**
15 15
      * Shows in an array all scopes required by the client
@@ -18,15 +18,15 @@  discard block
 block discarded – undo
18 18
      */
19 19
     static function getScopes(): array;
20 20
 
21
-	/**
22
-	 * Return last response of client
23
-	 * @return ResponseInterface
24
-	 */
25
-	function getLastResponse(): ResponseInterface;
21
+    /**
22
+     * Return last response of client
23
+     * @return ResponseInterface
24
+     */
25
+    function getLastResponse(): ResponseInterface;
26 26
 
27
-	/**
28
-	 * return the context used to created the client.
29
-	 * @return ContextInterface
30
-	 */
31
-	function getContext(): ContextInterface;
27
+    /**
28
+     * return the context used to created the client.
29
+     * @return ContextInterface
30
+     */
31
+    function getContext(): ContextInterface;
32 32
 }
Please login to merge, or discard this patch.
src/SumUp.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@
 block discarded – undo
7 7
 
8 8
 class SumUp
9 9
 {
10
-	const VERSION = 'v0.1';
11
-	const ENTRYPOINT = 'https://api.sumup.com/';
10
+    const VERSION = 'v0.1';
11
+    const ENTRYPOINT = 'https://api.sumup.com/';
12 12
 
13
-	/**
14
-	 * @return ClientInterface
15
-	 */
16
-	static function getClient(): ClientInterface
17
-	{
18
-		return new Client(
19
-			[
20
-				'base_uri' => self::getEntrypoint(),
21
-				'timeout' => 2
22
-			]
23
-		);
24
-	}
13
+    /**
14
+     * @return ClientInterface
15
+     */
16
+    static function getClient(): ClientInterface
17
+    {
18
+        return new Client(
19
+            [
20
+                'base_uri' => self::getEntrypoint(),
21
+                'timeout' => 2
22
+            ]
23
+        );
24
+    }
25 25
 
26
-	static function getEntrypoint(): string
27
-	{
28
-		return self::ENTRYPOINT.self::VERSION.'/';
29
-	}
26
+    static function getEntrypoint(): string
27
+    {
28
+        return self::ENTRYPOINT.self::VERSION.'/';
29
+    }
30 30
 }
31 31
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
 	static function getEntrypoint(): string
27 27
 	{
28
-		return self::ENTRYPOINT.self::VERSION.'/';
28
+		return self::ENTRYPOINT . self::VERSION . '/';
29 29
 	}
30 30
 }
31 31
 
Please login to merge, or discard this patch.
src/Checkout/CheckoutClientInterface.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 interface CheckoutClientInterface extends SumUpClientInterface
10 10
 {
11 11
 
12
-	/**
12
+    /**
13 13
      * Create a checkout
14 14
      *
15 15
      * @param CheckoutInterface $checkout
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
      */
45 45
     static function getCheckoutBody(CheckoutInterface $checkout): array;
46 46
 
47
-	/**
48
-	 * Generate a body to a complete checkout request.
49
-	 *
50
-	 * @param CheckoutInterface $checkout
51
-	 * @return array
52
-	 */
47
+    /**
48
+     * Generate a body to a complete checkout request.
49
+     *
50
+     * @param CheckoutInterface $checkout
51
+     * @return array
52
+     */
53 53
     static function getCompleteCheckoutBody(CheckoutInterface $checkout): array;
54 54
 
55 55
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      * @param AccessToken $accessToken
17 17
      * @return CheckoutInterface
18 18
      */
19
-    public function create(CheckoutInterface $checkout, AccessToken $accessToken = null):? CheckoutInterface;
19
+    public function create(CheckoutInterface $checkout, AccessToken $accessToken = null): ? CheckoutInterface;
20 20
 
21 21
     /**
22 22
      * Retrieve a checkout from sumup.com server
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @param AccessToken $accessToken
26 26
      * @return CheckoutInterface
27 27
      */
28
-    public function get(CheckoutInterface $checkout, AccessToken $accessToken = null):? CheckoutInterface;
28
+    public function get(CheckoutInterface $checkout, AccessToken $accessToken = null): ? CheckoutInterface;
29 29
 
30 30
     /**
31 31
      * Complete a checkout
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param AccessToken $accessToken
35 35
      * @return CheckoutInterface
36 36
      */
37
-    public function complete(CheckoutInterface $checkout, AccessToken $accessToken = null):? CheckoutInterface;
37
+    public function complete(CheckoutInterface $checkout, AccessToken $accessToken = null): ? CheckoutInterface;
38 38
 
39 39
     /**
40 40
      * Generate body to request a new checkout.
Please login to merge, or discard this patch.