@@ -9,12 +9,12 @@ discard block |
||
| 9 | 9 | private function xmlToArrayRecursive($xml) { |
| 10 | 10 | $xml = (array) $xml; |
| 11 | 11 | |
| 12 | - if(empty($xml)) { |
|
| 12 | + if (empty($xml)) { |
|
| 13 | 13 | return null; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | foreach ($xml as $key => $val) { |
| 17 | - if (is_array($val)){ |
|
| 17 | + if (is_array($val)) { |
|
| 18 | 18 | $xml[$key] = $this->xmlToArray($val); |
| 19 | 19 | } else { |
| 20 | 20 | if ($val instanceof SimpleXMLElement) { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | private function xmlToArray($xml) { |
| 33 | 33 | $xml = (array) $xml; |
| 34 | 34 | |
| 35 | - if(empty($xml)) { |
|
| 35 | + if (empty($xml)) { |
|
| 36 | 36 | return null; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function checkIntegrity($response) |
| 49 | 49 | { |
| 50 | - return isset( json_decode($response)->{$this->jsonPrefix} ); |
|
| 50 | + return isset(json_decode($response)->{$this->jsonPrefix} ); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function create(array $data) |
| 75 | 75 | { |
| 76 | - if ( empty($data)){ |
|
| 76 | + if (empty($data)) { |
|
| 77 | 77 | return $this->buildJson = '{}'; |
| 78 | 78 | } |
| 79 | 79 | return $this->buildJson = json_encode($data); |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | if (gettype($value) == 'object') |
| 88 | 88 | { |
| 89 | 89 | $result[$key] = $this->objectToArray($value); |
| 90 | - } else{ |
|
| 90 | + } else { |
|
| 91 | 91 | if (gettype($value) != 'object') |
| 92 | 92 | { |
| 93 | 93 | $result[$key] = $value; |
| 94 | - } else{ |
|
| 94 | + } else { |
|
| 95 | 95 | $result[$key] = get_object_vars($value); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public function register() |
| 11 | 11 | { |
| 12 | - if ( app()->resolved('config') === false ) |
|
| 12 | + if (app()->resolved('config') === false) |
|
| 13 | 13 | { |
| 14 | 14 | app()->instance('config', new Repository()); |
| 15 | 15 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function register() |
| 15 | 15 | { |
| 16 | - app()->bind(Read::class, Read::class); |
|
| 16 | + app()->bind(Read::class, Read::class); |
|
| 17 | 17 | app()->bind(Create::class, Create::class); |
| 18 | 18 | app()->bind(Update::class, Update::class); |
| 19 | 19 | app()->bind(Delete::class, Delete::class); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | class CookieAuthentication implements Authentication |
| 11 | 11 | { |
| 12 | 12 | protected $prefixCSRF = 'BPMCSRF'; |
| 13 | - protected $pathToCookieFile = __DIR__ . '/../resource/cookie.txt'; |
|
| 13 | + protected $pathToCookieFile = __DIR__.'/../resource/cookie.txt'; |
|
| 14 | 14 | protected $configuration; |
| 15 | 15 | |
| 16 | 16 | public function setConfig(array $config) |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
| 39 | 39 | curl_setopt($curl, CURLOPT_HEADER, 1); |
| 40 | - curl_setopt($curl, CURLOPT_URL, $this->configuration['UrlLogin']); |
|
| 40 | + curl_setopt($curl, CURLOPT_URL, $this->configuration['UrlLogin']); |
|
| 41 | 41 | curl_setopt($curl, CURLOPT_POST, true); |
| 42 | 42 | curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); |
| 43 | 43 | curl_setopt($curl, CURLOPT_COOKIEJAR, $this->pathToCookieFile); |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function getCsrf() |
| 68 | 68 | { |
| 69 | - if ( file_exists($this->pathToCookieFile) === false ) |
|
| 69 | + if (file_exists($this->pathToCookieFile) === false) |
|
| 70 | 70 | { |
| 71 | 71 | return ''; |
| 72 | 72 | } |
| 73 | 73 | preg_match("/BPMCSRF\\s(.+)/", file_get_contents($this->pathToCookieFile), $matches); |
| 74 | 74 | |
| 75 | - if ( isset($matches[1]) === false ) |
|
| 75 | + if (isset($matches[1]) === false) |
|
| 76 | 76 | { |
| 77 | 77 | return ''; |
| 78 | 78 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function get() |
| 19 | 19 | { |
| 20 | - $configuration = require $this->pathToFile; |
|
| 20 | + $configuration = require $this->pathToFile; |
|
| 21 | 21 | return $configuration; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | if (file_exists($path)) |
| 31 | 31 | { |
| 32 | 32 | $this->pathToFile = $path; |
| 33 | - } else{ |
|
| 33 | + } else { |
|
| 34 | 34 | Assertion::file($path, 'Local file name is not exist.'); |
| 35 | 35 | } |
| 36 | 36 | return true; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | protected function concatenationUrlCurl($newParameters) |
| 18 | 18 | { |
| 19 | - if ($this->url == '?') { |
|
| 19 | + if ($this->url == '?') { |
|
| 20 | 20 | $this->url .= $newParameters; |
| 21 | 21 | } elseif ($this->url == '') { |
| 22 | 22 | $this->url .= $newParameters; |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | $this->checkGuId($guid); |
| 37 | 37 | $this->url = ''; |
| 38 | 38 | $ParameterQuery = '(guid'; |
| 39 | - $ParameterQuery.= "'"; |
|
| 40 | - $ParameterQuery.= $guid; |
|
| 41 | - $ParameterQuery.= "'"; |
|
| 42 | - $ParameterQuery.=')'; |
|
| 39 | + $ParameterQuery .= "'"; |
|
| 40 | + $ParameterQuery .= $guid; |
|
| 41 | + $ParameterQuery .= "'"; |
|
| 42 | + $ParameterQuery .= ')'; |
|
| 43 | 43 | |
| 44 | 44 | return $this->concatenationUrlCurl($ParameterQuery); |
| 45 | 45 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Illuminate\Container\Container; |
| 4 | 4 | |
| 5 | -if (! function_exists('config')) { |
|
| 5 | +if (!function_exists('config')) { |
|
| 6 | 6 | /** |
| 7 | 7 | * Get / set the specified configuration value. |
| 8 | 8 | * |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -if (! function_exists('app')) { |
|
| 29 | +if (!function_exists('app')) { |
|
| 30 | 30 | /** |
| 31 | 31 | * Get the available container instance. |
| 32 | 32 | * |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function filterConstructor($strRequest) |
| 77 | 77 | { |
| 78 | - $ParameterQuery = '$filter='; |
|
| 79 | - $ParameterQuery.= $strRequest; |
|
| 78 | + $ParameterQuery = '$filter='; |
|
| 79 | + $ParameterQuery .= $strRequest; |
|
| 80 | 80 | $this->concatenationUrlCurl($ParameterQuery); |
| 81 | 81 | return $this; |
| 82 | 82 | } |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | public function orderBy($whatSort, $param = 'asc') |
| 94 | 94 | { |
| 95 | 95 | $ParameterQuery = '$orderby='; |
| 96 | - $ParameterQuery.= ucfirst($whatSort); |
|
| 96 | + $ParameterQuery .= ucfirst($whatSort); |
|
| 97 | 97 | |
| 98 | - if ( empty($param) === false ) { |
|
| 98 | + if (empty($param) === false) { |
|
| 99 | 99 | if ($param != 'desc' && $param != 'asc') { |
| 100 | 100 | throw new \Exception('no valid orderby parameters'); |
| 101 | 101 | } |
| 102 | - $ParameterQuery.= " ".$param; |
|
| 102 | + $ParameterQuery .= " ".$param; |
|
| 103 | 103 | } |
| 104 | 104 | $this->concatenationUrlCurl($ParameterQuery); |
| 105 | 105 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function amount($amountMax = null) |
| 132 | 132 | { |
| 133 | - Assert::that($amountMax,'You must specify a numeric parameter for the amount of the method')->integer(); |
|
| 133 | + Assert::that($amountMax, 'You must specify a numeric parameter for the amount of the method')->integer(); |
|
| 134 | 134 | $ParameterQuery = '$top='.$amountMax; |
| 135 | 135 | $this->concatenationUrlCurl($ParameterQuery); |
| 136 | 136 | return $this; |
@@ -143,17 +143,17 @@ discard block |
||
| 143 | 143 | private function query() |
| 144 | 144 | { |
| 145 | 145 | $parameters = str_replace(' ', '%20', $this->url); |
| 146 | - $url = $this->kernel->getCollection() . $parameters; |
|
| 147 | - $urlHome = config($this->kernel->getPrefixConfig() . '.UrlHome'); |
|
| 146 | + $url = $this->kernel->getCollection().$parameters; |
|
| 147 | + $urlHome = config($this->kernel->getPrefixConfig().'.UrlHome'); |
|
| 148 | 148 | |
| 149 | - $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url, |
|
| 149 | + $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url, |
|
| 150 | 150 | $this->debug()->headers()->getCookie()->httpErrorsFalse()->get() |
| 151 | 151 | ); |
| 152 | 152 | $body = $response->getBody(); |
| 153 | 153 | |
| 154 | 154 | $this->kernel->getHandler()->parse($body->getContents()); |
| 155 | 155 | |
| 156 | - if ( $response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized' ) |
|
| 156 | + if ($response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized') |
|
| 157 | 157 | { |
| 158 | 158 | $this->kernel->authentication(); |
| 159 | 159 | $this->query(); |