@@ -68,7 +68,7 @@ |
||
| 68 | 68 | private function execute() { |
| 69 | 69 | |
| 70 | 70 | //For debuging |
| 71 | - if ($this->getCurlDebugIsEnable()){ |
|
| 71 | + if ($this->getCurlDebugIsEnable()){ |
|
| 72 | 72 | $parentDir = dirname(dirname(dirname(__FILE__))); |
| 73 | 73 | $fp = fopen($parentDir.'/debug_viva_curl.txt', 'w'); |
| 74 | 74 | curl_setopt($this->ch, CURLOPT_VERBOSE, 1); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | private function execute() { |
| 69 | 69 | |
| 70 | 70 | //For debuging |
| 71 | - if ($this->getCurlDebugIsEnable()){ |
|
| 71 | + if ($this->getCurlDebugIsEnable()) { |
|
| 72 | 72 | $parentDir = dirname(dirname(dirname(__FILE__))); |
| 73 | 73 | $fp = fopen($parentDir.'/debug_viva_curl.txt', 'w'); |
| 74 | 74 | curl_setopt($this->ch, CURLOPT_VERBOSE, 1); |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | $response = curl_exec($this->ch); |
| 81 | 81 | |
| 82 | 82 | //For debuging |
| 83 | - if ($this->getCurlDebugIsEnable()){ |
|
| 83 | + if ($this->getCurlDebugIsEnable()) { |
|
| 84 | 84 | $method = __METHOD__; |
| 85 | 85 | $parentDir = dirname(dirname(dirname(__FILE__))); |
| 86 | - $fp = fopen($parentDir . '/debug_viva_curl_response.txt', 'a+'); |
|
| 87 | - fwrite($fp, '------- '. $method.' -------'.PHP_EOL. $response.PHP_EOL.'------------------------------'.PHP_EOL); |
|
| 86 | + $fp = fopen($parentDir.'/debug_viva_curl_response.txt', 'a+'); |
|
| 87 | + fwrite($fp, '------- '.$method.' -------'.PHP_EOL.$response.PHP_EOL.'------------------------------'.PHP_EOL); |
|
| 88 | 88 | fclose($fp); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | |
| 98 | - throw new \Exception('Curl error: ' . $errorMsg.' '. $errorCode); |
|
| 98 | + throw new \Exception('Curl error: '.$errorMsg.' '.$errorCode); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $data = json_decode($response, true); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | private ?string $fullName; |
| 20 | 20 | private ?string $phone; |
| 21 | 21 | private ?string $countryCode; |
| 22 | - private string|RequestLang $requestLang; |
|
| 22 | + private string | RequestLang $requestLang; |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | public function __construct( |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ?string $fullName = null, |
| 28 | 28 | ?string $phone = null, |
| 29 | 29 | ?string $countryCode = null, |
| 30 | - string|RequestLang $requestLang = null, |
|
| 30 | + string | RequestLang $requestLang = null, |
|
| 31 | 31 | ) { |
| 32 | 32 | $this->setEmail($email) |
| 33 | 33 | ->setFullName($fullName) |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | /** |
| 57 | 57 | * Return value as string |
| 58 | 58 | * Enums\PaymentMethods::fromValue(15); |
| 59 | - */ |
|
| 59 | + */ |
|
| 60 | 60 | |
| 61 | 61 | public static function fromValue(int $value): string |
| 62 | 62 | { |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | public static function fromName(string $name): int |
| 45 | 45 | { |
| 46 | 46 | foreach (self::cases() as $status) { |
| 47 | - if( $name === $status->name ){ |
|
| 47 | + if ($name === $status->name) { |
|
| 48 | 48 | return $status->value; |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | - throw new \ValueError("$name is not a valid backing value for enum " . self::class ); |
|
| 51 | + throw new \ValueError("$name is not a valid backing value for enum ".self::class); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | public static function fromValue(int $value): string |
| 62 | 62 | { |
| 63 | 63 | foreach (self::cases() as $status) { |
| 64 | - if( $value === $status->value ){ |
|
| 64 | + if ($value === $status->value) { |
|
| 65 | 65 | return $status->name; |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | - throw new \ValueError("$value is not a valid backing value for enum " . self::class ); |
|
| 68 | + throw new \ValueError("$value is not a valid backing value for enum ".self::class); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * Return value as string |
| 42 | 42 | * Enums\RequestLang::fromValue('el-GR'); |
| 43 | - */ |
|
| 43 | + */ |
|
| 44 | 44 | |
| 45 | 45 | public static function fromValue(string $value): string |
| 46 | 46 | { |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | case Croatian = 'hr-HR'; |
| 10 | 10 | case Czech = 'cs-CZ'; |
| 11 | 11 | case Danish = 'da-DK'; |
| 12 | - case Dutch_Netherlands = 'nl-NL'; |
|
| 13 | - case Dutch_Belgium = 'nl-BE'; |
|
| 12 | + case Dutch_Netherlands = 'nl-NL'; |
|
| 13 | + case Dutch_Belgium = 'nl-BE'; |
|
| 14 | 14 | case English_UK = 'en-GB'; |
| 15 | 15 | case English_US = 'en-US'; |
| 16 | 16 | case Finnish = 'fi-FI'; |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | public static function fromName(string $name): string |
| 31 | 31 | { |
| 32 | 32 | foreach (self::cases() as $status) { |
| 33 | - if( $name === $status->name ){ |
|
| 33 | + if ($name === $status->name) { |
|
| 34 | 34 | return $status->value; |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | - throw new \ValueError("$name is not a valid backing value for enum " . self::class ); |
|
| 37 | + throw new \ValueError("$name is not a valid backing value for enum ".self::class); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | public static function fromValue(string $value): string |
| 46 | 46 | { |
| 47 | 47 | foreach (self::cases() as $status) { |
| 48 | - if( $value === $status->value ){ |
|
| 48 | + if ($value === $status->value) { |
|
| 49 | 49 | return $status->name; |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | - throw new \ValueError("$value is not a valid backing value for enum " . self::class ); |
|
| 52 | + throw new \ValueError("$value is not a valid backing value for enum ".self::class); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | \ No newline at end of file |
@@ -51,22 +51,22 @@ |
||
| 51 | 51 | public static function fromName(string $name): string |
| 52 | 52 | { |
| 53 | 53 | foreach (self::cases() as $status) { |
| 54 | - if( $name === $status->name ){ |
|
| 54 | + if ($name === $status->name) { |
|
| 55 | 55 | return $status->value; |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | - throw new \ValueError("$name is not a valid backing value for enum " . self::class ); |
|
| 58 | + throw new \ValueError("$name is not a valid backing value for enum ".self::class); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | public static function fromValue(string $value): string |
| 63 | 63 | { |
| 64 | 64 | foreach (self::cases() as $status) { |
| 65 | - if( $value === $status->value ){ |
|
| 65 | + if ($value === $status->value) { |
|
| 66 | 66 | return $status->name; |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | - throw new \ValueError("$value is not a valid backing value for enum " . self::class ); |
|
| 69 | + throw new \ValueError("$value is not a valid backing value for enum ".self::class); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * Return value as string |
| 63 | 63 | * Enums\PaymentMethods::fromName('Dias'); |
| 64 | - */ |
|
| 64 | + */ |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | public static function fromName(string $name): int |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * Return value as string |
| 81 | 81 | * Enums\PaymentMethods::fromValue(15); |
| 82 | - */ |
|
| 82 | + */ |
|
| 83 | 83 | |
| 84 | 84 | public static function fromValue(int $value): string |
| 85 | 85 | { |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | public static function fromName(string $name): int |
| 68 | 68 | { |
| 69 | 69 | foreach (self::cases() as $status) { |
| 70 | - if( $name === $status->name ){ |
|
| 70 | + if ($name === $status->name) { |
|
| 71 | 71 | return $status->value; |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | - throw new \ValueError("$name is not a valid backing value for enum " . self::class ); |
|
| 74 | + throw new \ValueError("$name is not a valid backing value for enum ".self::class); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | public static function fromValue(int $value): string |
| 85 | 85 | { |
| 86 | 86 | foreach (self::cases() as $status) { |
| 87 | - if( $value === $status->value ){ |
|
| 87 | + if ($value === $status->value) { |
|
| 88 | 88 | return $status->name; |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | - throw new \ValueError("$value is not a valid backing value for enum " . self::class ); |
|
| 91 | + throw new \ValueError("$value is not a valid backing value for enum ".self::class); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | public static function fromValue(int $value): string |
| 24 | 24 | { |
| 25 | 25 | foreach (self::cases() as $status) { |
| 26 | - if( $value === $status->value ){ |
|
| 26 | + if ($value === $status->value) { |
|
| 27 | 27 | return $status->name; |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | - throw new \ValueError("$value is not a valid backing value for enum " . self::class ); |
|
| 30 | + throw new \ValueError("$value is not a valid backing value for enum ".self::class); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * Return value as string |
| 63 | 63 | * Enums\PaymentMethods::fromName('Dias'); |
| 64 | - */ |
|
| 64 | + */ |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | public static function fromName(string $name): int |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * Return value as string |
| 81 | 81 | * Enums\PaymentMethods::fromValue(15); |
| 82 | - */ |
|
| 82 | + */ |
|
| 83 | 83 | |
| 84 | 84 | public static function fromValue(int $value): string |
| 85 | 85 | { |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | public static function fromName(string $name): int |
| 68 | 68 | { |
| 69 | 69 | foreach (self::cases() as $status) { |
| 70 | - if( $name === $status->name ){ |
|
| 70 | + if ($name === $status->name) { |
|
| 71 | 71 | return $status->value; |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | - throw new \ValueError("$name is not a valid backing value for enum " . self::class ); |
|
| 74 | + throw new \ValueError("$name is not a valid backing value for enum ".self::class); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | public static function fromValue(int $value): string |
| 85 | 85 | { |
| 86 | 86 | foreach (self::cases() as $status) { |
| 87 | - if( $value === $status->value ){ |
|
| 87 | + if ($value === $status->value) { |
|
| 88 | 88 | return $status->name; |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | - throw new \ValueError("$value is not a valid backing value for enum " . self::class ); |
|
| 91 | + throw new \ValueError("$value is not a valid backing value for enum ".self::class); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | trait getConfigSettings |
| 7 | 7 | { |
| 8 | - public function getConfigSettings() { |
|
| 8 | + public function getConfigSettings() { |
|
| 9 | 9 | if (!property_exists($this, 'accessToken')) { |
| 10 | 10 | throw new \Exception('Property $accessToken does not exist'); |
| 11 | 11 | } |