@@ -77,8 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | if (empty($data)) { |
| 79 | 79 | $this->config = $this->getDefaultConfigData(); |
| 80 | - } |
|
| 81 | - else { |
|
| 80 | + } else { |
|
| 82 | 81 | $this->config = $data; |
| 83 | 82 | } |
| 84 | 83 | } |
@@ -127,8 +126,7 @@ discard block |
||
| 127 | 126 | // Start recursion: |
| 128 | 127 | return $this->set($newKey, $value, $tree[$currentKey]); |
| 129 | 128 | |
| 130 | - } |
|
| 131 | - else { |
|
| 129 | + } else { |
|
| 132 | 130 | // Set value (can overwrite an existing value) |
| 133 | 131 | $tree[$key] = $value; |
| 134 | 132 | // Exit recursion, Success! |
@@ -166,16 +164,13 @@ discard block |
||
| 166 | 164 | // Reassemble key, start recursion: |
| 167 | 165 | $newKey = implode(self::KEY_SEPARATOR, $explodedKey); |
| 168 | 166 | return $this->get($newKey, $newTree); |
| 169 | - } |
|
| 170 | - else { |
|
| 167 | + } else { |
|
| 171 | 168 | return NULL; // Exit recursion, unsuccessful |
| 172 | 169 | } |
| 173 | 170 | |
| 174 | - } |
|
| 175 | - elseif (is_array($tree) and array_key_exists($key, $tree)) { |
|
| 171 | + } elseif (is_array($tree) and array_key_exists($key, $tree)) { |
|
| 176 | 172 | return $tree[$key]; // Exit recursion, Success! |
| 177 | - } |
|
| 178 | - else { |
|
| 173 | + } else { |
|
| 179 | 174 | return NULL; // Exit recursion, unsuccessful |
| 180 | 175 | } |
| 181 | 176 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if ($value instanceof Payone_Settings_Data_ConfigFile_Interface) { |
| 59 | 59 | /** @var Payone_Api_Request_Parameter_Interface $value */ |
| 60 | 60 | $array[$value->getKey()] = $value->toArray(); |
| 61 | - } |
|
| 62 | - else { |
|
| 61 | + } else { |
|
| 63 | 62 | $array[$key] = $value; |
| 64 | 63 | } |
| 65 | 64 | } |
@@ -50,21 +50,18 @@ |
||
| 50 | 50 | if ($data instanceof Payone_Settings_Data_ConfigFile_Interface) { |
| 51 | 51 | /** @var Payone_Api_Request_Parameter_Interface $data */ |
| 52 | 52 | $array[$key] = $data->toArray(); |
| 53 | - } |
|
| 54 | - elseif (is_array($data)) |
|
| 53 | + } elseif (is_array($data)) |
|
| 55 | 54 | { |
| 56 | 55 | foreach ($data as $innerKey => $innerValue) |
| 57 | 56 | { |
| 58 | 57 | if ($innerValue instanceof Payone_Settings_Data_ConfigFile_Interface) { |
| 59 | 58 | /** @var Payone_Api_Request_Parameter_Interface $innerValue */ |
| 60 | 59 | $array[$key][$innerValue->getKey()] = $innerValue->toArray(); |
| 61 | - } |
|
| 62 | - else { |
|
| 60 | + } else { |
|
| 63 | 61 | $array[$key][$innerKey] = $innerValue; |
| 64 | 62 | } |
| 65 | 63 | } |
| 66 | - } |
|
| 67 | - else { |
|
| 64 | + } else { |
|
| 68 | 65 | $array[$key] = $data; |
| 69 | 66 | } |
| 70 | 67 | } |
@@ -109,12 +109,10 @@ discard block |
||
| 109 | 109 | foreach ($value['attribute'] as $attributKey => $attributData) { |
| 110 | 110 | $node->addAttribute($attributKey, $attributData); |
| 111 | 111 | } |
| 112 | - } |
|
| 113 | - else { |
|
| 112 | + } else { |
|
| 114 | 113 | $this->simpleXmlFromNestedArray($key, $value, $parent); |
| 115 | 114 | } |
| 116 | - } |
|
| 117 | - else { |
|
| 115 | + } else { |
|
| 118 | 116 | $parent->addChild($key, $value); |
| 119 | 117 | } |
| 120 | 118 | |
@@ -415,8 +413,7 @@ discard block |
||
| 415 | 413 | foreach ($data as $key => $value) { |
| 416 | 414 | $child = $this->appendElement($parentNode, $key, $value, $withCdata); |
| 417 | 415 | } |
| 418 | - } |
|
| 419 | - else { |
|
| 416 | + } else { |
|
| 420 | 417 | if (isset($data)) { |
| 421 | 418 | $child = $this->appendElement($parent, $property, $data, $withCdata); |
| 422 | 419 | } |
@@ -436,8 +433,7 @@ discard block |
||
| 436 | 433 | foreach ($value as $key => $data) { |
| 437 | 434 | $mapNode->setAttribute($key, $data); |
| 438 | 435 | } |
| 439 | - } |
|
| 440 | - else { |
|
| 436 | + } else { |
|
| 441 | 437 | if (!empty($data)) { |
| 442 | 438 | $mapNode->setAttribute($name, $value); |
| 443 | 439 | } |
@@ -459,8 +455,7 @@ discard block |
||
| 459 | 455 | $cdata = $this->dom->createCDATASection($value); |
| 460 | 456 | $child = $this->dom->createElement($key); |
| 461 | 457 | $child->appendChild($cdata); |
| 462 | - } |
|
| 463 | - else |
|
| 458 | + } else |
|
| 464 | 459 | { |
| 465 | 460 | $child = $this->dom->createElement($key); |
| 466 | 461 | if($value !== null) |
@@ -187,8 +187,7 @@ |
||
| 187 | 187 | |
| 188 | 188 | return $object->get($propertyName); |
| 189 | 189 | } |
| 190 | - } |
|
| 191 | - elseif (property_exists($this, $name)) { |
|
| 190 | + } elseif (property_exists($this, $name)) { |
|
| 192 | 191 | return $this->$name; |
| 193 | 192 | } |
| 194 | 193 | return null; |
@@ -119,8 +119,9 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | // Delete the oldest file, to keep Windows happy. |
| 121 | 121 | $file = $fileName . '.' . $this->maxBackupIndex; |
| 122 | - if(is_writable($file)) |
|
| 123 | - unlink($file); |
|
| 122 | + if(is_writable($file)) { |
|
| 123 | + unlink($file); |
|
| 124 | + } |
|
| 124 | 125 | |
| 125 | 126 | // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2} |
| 126 | 127 | for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) { |
@@ -145,7 +146,9 @@ discard block |
||
| 145 | 146 | // As Payone_Log4php_LoggerAppenderFile does not create the directory, it has to exist. |
| 146 | 147 | // realpath() fails if the argument does not exist so the filename is separated. |
| 147 | 148 | $this->expandedFileName = realpath(dirname($fileName)); |
| 148 | - if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!"); |
|
| 149 | + if ($this->expandedFileName === false) { |
|
| 150 | + throw new Exception("Directory of $fileName does not exist!"); |
|
| 151 | + } |
|
| 149 | 152 | $this->expandedFileName .= DIRECTORY_SEPARATOR . basename($fileName); |
| 150 | 153 | } |
| 151 | 154 | |
@@ -104,14 +104,16 @@ discard block |
||
| 104 | 104 | $this->sessionStatusConfig = new Payone_SessionStatus_Config(); |
| 105 | 105 | } |
| 106 | 106 | $this->config = $this->getDefaultConfigData(); |
| 107 | - } |
|
| 108 | - else { |
|
| 109 | - if(array_key_exists('api', $data)) |
|
| 110 | - $this->setApiConfig($data['api']); |
|
| 111 | - if(array_key_exists('transaction_status',$data)) |
|
| 112 | - $this->setTransactionStatusConfig($data['transaction_status']); |
|
| 113 | - if(array_key_exists('session_status',$data)) |
|
| 114 | - $this->setSessionStatusConfig($data['session_status']); |
|
| 107 | + } else { |
|
| 108 | + if(array_key_exists('api', $data)) { |
|
| 109 | + $this->setApiConfig($data['api']); |
|
| 110 | + } |
|
| 111 | + if(array_key_exists('transaction_status',$data)) { |
|
| 112 | + $this->setTransactionStatusConfig($data['transaction_status']); |
|
| 113 | + } |
|
| 114 | + if(array_key_exists('session_status',$data)) { |
|
| 115 | + $this->setSessionStatusConfig($data['session_status']); |
|
| 116 | + } |
|
| 115 | 117 | $this->config = $data; |
| 116 | 118 | } |
| 117 | 119 | } |
@@ -170,8 +172,7 @@ discard block |
||
| 170 | 172 | $object = $tree[$currentKey]; |
| 171 | 173 | $object->setValue($newKey,$value); |
| 172 | 174 | return TRUE; |
| 173 | - } |
|
| 174 | - else { |
|
| 175 | + } else { |
|
| 175 | 176 | // Set value (can overwrite an existing value) |
| 176 | 177 | $tree[$key] = $value; |
| 177 | 178 | // Exit recursion, Success! |
@@ -205,11 +206,9 @@ discard block |
||
| 205 | 206 | /** @var $object Payone_Config_Abstract */ |
| 206 | 207 | $object = $tree[$currentKey]; |
| 207 | 208 | return $object->getValue($newKey); |
| 208 | - } |
|
| 209 | - elseif (is_array($tree) and array_key_exists($key, $tree)) { |
|
| 209 | + } elseif (is_array($tree) and array_key_exists($key, $tree)) { |
|
| 210 | 210 | return $tree[$key]; // Exit recursion, Success! |
| 211 | - } |
|
| 212 | - else { |
|
| 211 | + } else { |
|
| 213 | 212 | return NULL; // Exit recursion, unsuccessful |
| 214 | 213 | } |
| 215 | 214 | } |
@@ -45,17 +45,13 @@ |
||
| 45 | 45 | |
| 46 | 46 | if ($this->isValid()) { |
| 47 | 47 | $response = new Payone_Api_Response_3dsCheck_Valid($params); |
| 48 | - } |
|
| 49 | - elseif ($this->isEnrolled()) { |
|
| 48 | + } elseif ($this->isEnrolled()) { |
|
| 50 | 49 | $response = new Payone_Api_Response_3dsCheck_Enrolled($params); |
| 51 | - } |
|
| 52 | - elseif ($this->isInvalid()) { |
|
| 50 | + } elseif ($this->isInvalid()) { |
|
| 53 | 51 | $response = new Payone_Api_Response_3dsCheck_Invalid($params); |
| 54 | - } |
|
| 55 | - elseif ($this->isError()) { |
|
| 52 | + } elseif ($this->isError()) { |
|
| 56 | 53 | $response = new Payone_Api_Response_Error($params); |
| 57 | - } |
|
| 58 | - else { |
|
| 54 | + } else { |
|
| 59 | 55 | throw new Payone_Api_Exception_UnknownStatus(); |
| 60 | 56 | } |
| 61 | 57 | |
@@ -46,17 +46,13 @@ |
||
| 46 | 46 | |
| 47 | 47 | if ($this->isValid()) { |
| 48 | 48 | $response = new Payone_Api_Response_BankAccountCheck_Valid($params); |
| 49 | - } |
|
| 50 | - elseif ($this->isInvalid()) { |
|
| 49 | + } elseif ($this->isInvalid()) { |
|
| 51 | 50 | $response = new Payone_Api_Response_BankAccountCheck_Invalid($params); |
| 52 | - } |
|
| 53 | - elseif ($this->isBlocked()) { |
|
| 51 | + } elseif ($this->isBlocked()) { |
|
| 54 | 52 | $response = new Payone_Api_Response_BankAccountCheck_Blocked($params); |
| 55 | - } |
|
| 56 | - elseif ($this->isError()) { |
|
| 53 | + } elseif ($this->isError()) { |
|
| 57 | 54 | $response = new Payone_Api_Response_Error($params); |
| 58 | - } |
|
| 59 | - else { |
|
| 55 | + } else { |
|
| 60 | 56 | throw new Payone_Api_Exception_UnknownStatus(); |
| 61 | 57 | } |
| 62 | 58 | |