@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->type = $type; |
27 | 27 | $this->expiration = time() + $expiresIn; |
28 | 28 | |
29 | - if($scope !== null) { |
|
29 | + if ($scope !== null) { |
|
30 | 30 | $this->scope = $scope; |
31 | 31 | } |
32 | 32 | } |
@@ -91,6 +91,6 @@ discard block |
||
91 | 91 | { |
92 | 92 | $scopes = func_get_args(); |
93 | 93 | $diff = array_diff($scopes, $this->scope); |
94 | - return count($diff)>0; |
|
94 | + return count($diff) > 0; |
|
95 | 95 | } |
96 | 96 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @throws BadResponseException |
30 | 30 | * @throws ConnectException |
31 | 31 | */ |
32 | - public function request(string $action, $object = null, string $endpoint = null):? bool |
|
32 | + public function request(string $action, $object = null, string $endpoint = null): ? bool |
|
33 | 33 | { |
34 | 34 | /** @var SumUpClientInterface $this */ |
35 | 35 |
@@ -17,5 +17,5 @@ |
||
17 | 17 | * @param string|null $endpoint |
18 | 18 | * @return bool|null |
19 | 19 | */ |
20 | - public function request(string $action, $object, string $endpoint = null):? bool; |
|
20 | + public function request(string $action, $object, string $endpoint = null): ? bool; |
|
21 | 21 | } |
@@ -11,48 +11,48 @@ |
||
11 | 11 | |
12 | 12 | trait PropertyHandler |
13 | 13 | { |
14 | - /** |
|
15 | - * @param array $data |
|
16 | - */ |
|
14 | + /** |
|
15 | + * @param array $data |
|
16 | + */ |
|
17 | 17 | public function fillProperties(array $data): void |
18 | - { |
|
19 | - foreach ($data as $p => $v) |
|
20 | - { |
|
21 | - $this->fillProperty($p, $v); |
|
22 | - } |
|
23 | - } |
|
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 | - */ |
|
25 | + /** |
|
26 | + * @param string $property |
|
27 | + * @param mixed $value |
|
28 | + */ |
|
29 | 29 | public function fillProperty(string $property, $value): void |
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 | - } |
|
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 | - */ |
|
39 | + /** |
|
40 | + * @return array |
|
41 | + */ |
|
42 | 42 | public 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 | - } |
|
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 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function fillProperty(string $property, $value): void |
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 |
||
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 | } |