@@ -63,18 +63,18 @@ |
||
| 63 | 63 | { |
| 64 | 64 | $parameters = str_replace(' ', '%20', $this->url); |
| 65 | 65 | |
| 66 | - $url = $this->kernel->getCollection() . $parameters; |
|
| 67 | - $urlHome = config($this->kernel->getPrefixConfig() . '.UrlHome'); |
|
| 66 | + $url = $this->kernel->getCollection().$parameters; |
|
| 67 | + $urlHome = config($this->kernel->getPrefixConfig().'.UrlHome'); |
|
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url, |
|
| 70 | + $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url, |
|
| 71 | 71 | $this->headers()->getCookie()->httpErrorsFalse()->get() |
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | 74 | $body = $response->getBody(); |
| 75 | 75 | $this->kernel->getHandler()->parse($body->getContents()); |
| 76 | 76 | |
| 77 | - if ( $response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized' ) |
|
| 77 | + if ($response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized') |
|
| 78 | 78 | { |
| 79 | 79 | $this->kernel->authentication(); |
| 80 | 80 | $this->query(); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | public function getCookie() |
| 13 | 13 | { |
| 14 | - $curl = ['curl' => [ CURLOPT_COOKIEFILE => app(Authentication::class)->getPathCookieFile()]]; |
|
| 14 | + $curl = ['curl' => [CURLOPT_COOKIEFILE => app(Authentication::class)->getPathCookieFile()]]; |
|
| 15 | 15 | $this->merge($curl); |
| 16 | 16 | return $this; |
| 17 | 17 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function debug() |
| 41 | 41 | { |
| 42 | - $debug = ['on_stats' => function (TransferStats $stats) { |
|
| 42 | + $debug = ['on_stats' => function(TransferStats $stats) { |
|
| 43 | 43 | app(Logger::class)->debug('api', |
| 44 | 44 | [ |
| 45 | 45 | 'time' => $stats->getTransferTime(), |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function register() |
| 14 | 14 | { |
| 15 | - app()->bind(Logger::class, function(){ |
|
| 15 | + app()->bind(Logger::class, function() { |
|
| 16 | 16 | $log = new Logger(KernelBpm::class); |
| 17 | - return $log->pushHandler(new StreamHandler(KernelBpm::PATH_LOG . date('Y-m-d'). '.txt', Logger::DEBUG)); |
|
| 17 | + return $log->pushHandler(new StreamHandler(KernelBpm::PATH_LOG.date('Y-m-d').'.txt', Logger::DEBUG)); |
|
| 18 | 18 | }); |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | class KernelBpm |
| 38 | 38 | { |
| 39 | - const PATH_LOG = __DIR__ . '/resource/logs/'; |
|
| 39 | + const PATH_LOG = __DIR__.'/resource/logs/'; |
|
| 40 | 40 | |
| 41 | 41 | protected $action = [ |
| 42 | 42 | 'create' => Create::class, |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function loadConfiguration(SourceConfiguration $configuration) |
| 111 | 111 | { |
| 112 | - config()->set( $this->prefixConfiguration = $configuration->getName(), $configuration->get()); |
|
| 112 | + config()->set($this->prefixConfiguration = $configuration->getName(), $configuration->get()); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | Assertion::keyIsset($this->action, $typeAction); |
| 161 | 161 | |
| 162 | - $this->currentAction = app()->make( $this->action[$typeAction] ); |
|
| 162 | + $this->currentAction = app()->make($this->action[$typeAction]); |
|
| 163 | 163 | |
| 164 | 164 | return $this->currentAction; |
| 165 | 165 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | extract($this->splitAction($action)); |
| 177 | 177 | |
| 178 | - $action = $this->setAction($action); |
|
| 178 | + $action = $this->setAction($action); |
|
| 179 | 179 | $this->setHandler($handler); |
| 180 | 180 | |
| 181 | 181 | $action->injectionKernel($this); |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | { |
| 206 | 206 | try { |
| 207 | 207 | Assertion::regex($collection, '/[A-z]+Collection$/'); |
| 208 | - } catch(AssertionFailedException $e) { |
|
| 209 | - throw new \Exception("Expected word 'Collection' in parameter method setCollection received : " . $e->getValue()); |
|
| 208 | + } catch (AssertionFailedException $e) { |
|
| 209 | + throw new \Exception("Expected word 'Collection' in parameter method setCollection received : ".$e->getValue()); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | return $this->collection = $collection; |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | // verification values |
| 239 | 239 | Assertion::between(count($split), 2, 2); |
| 240 | - Assertion::keyExists( $this->action, $split[0]); |
|
| 241 | - Assertion::keyExists( $this->handlers, $split[1]); |
|
| 240 | + Assertion::keyExists($this->action, $split[0]); |
|
| 241 | + Assertion::keyExists($this->handlers, $split[1]); |
|
| 242 | 242 | |
| 243 | 243 | return ['action' => $split[0], 'handler' => $split[1]]; |
| 244 | 244 | } |
@@ -54,17 +54,17 @@ |
||
| 54 | 54 | { |
| 55 | 55 | $parameters = str_replace(' ', '%20', $this->url); |
| 56 | 56 | |
| 57 | - $url = $this->kernel->getCollection() . $parameters; |
|
| 58 | - $urlHome = config($this->kernel->getPrefixConfig() . '.UrlHome'); |
|
| 57 | + $url = $this->kernel->getCollection().$parameters; |
|
| 58 | + $urlHome = config($this->kernel->getPrefixConfig().'.UrlHome'); |
|
| 59 | 59 | |
| 60 | 60 | $this->headers()->getCookie()->body()->httpErrorsFalse()->get(); |
| 61 | - $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url, |
|
| 61 | + $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url, |
|
| 62 | 62 | $this->headers()->getCookie()->body()->httpErrorsFalse()->get() |
| 63 | 63 | ); |
| 64 | 64 | $body = $response->getBody(); |
| 65 | 65 | $this->kernel->getHandler()->parse($body->getContents()); |
| 66 | 66 | |
| 67 | - if ( $response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized' ) |
|
| 67 | + if ($response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized') |
|
| 68 | 68 | { |
| 69 | 69 | $this->kernel->authentication(); |
| 70 | 70 | $this->query(); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | //$test->authentication(); |
| 32 | 32 | |
| 33 | 33 | // 5. Example Reading from API |
| 34 | -$test = $test->action('read:json', function ($read){ |
|
| 34 | +$test = $test->action('read:json', function($read) { |
|
| 35 | 35 | $read->amount(1)->skip(100); |
| 36 | 36 | |
| 37 | 37 | })->get(); |
@@ -84,12 +84,12 @@ discard block |
||
| 84 | 84 | $this->response = simplexml_load_string($response); |
| 85 | 85 | $copyXml = $this->response; |
| 86 | 86 | |
| 87 | - if ( $this->response === false || $this->checkIntegrity($this->response) === false ) |
|
| 87 | + if ($this->response === false || $this->checkIntegrity($this->response) === false) |
|
| 88 | 88 | { |
| 89 | 89 | return []; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $array_vars_list = get_object_vars($copyXml); |
|
| 92 | + $array_vars_list = get_object_vars($copyXml); |
|
| 93 | 93 | |
| 94 | 94 | if (key_exists('content', $array_vars_list)) { |
| 95 | 95 | return $this->arrayOne(); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function checkIntegrity($response) |
| 109 | 109 | { |
| 110 | - if ( empty($response->message) ) |
|
| 110 | + if (empty($response->message)) |
|
| 111 | 111 | { |
| 112 | 112 | return true; |
| 113 | 113 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | private function workspace() |
| 156 | 156 | { |
| 157 | 157 | foreach ($this->response->workspace->collection as $item) { |
| 158 | - $this->validText[] = get_object_vars($item->children( $this->namespaces['NamespaceAtom'] ))['title']; |
|
| 158 | + $this->validText[] = get_object_vars($item->children($this->namespaces['NamespaceAtom']))['title']; |
|
| 159 | 159 | } |
| 160 | 160 | return $this; |
| 161 | 161 | } |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | private function arrayMany() |
| 169 | 169 | { |
| 170 | - foreach ($this->response->children( $this->namespaces['NamespaceAtom'] )->entry as $item ) { |
|
| 171 | - $this->validText[] = $item->content->children( $this->namespaces['NamespaceMetadata'] ) |
|
| 170 | + foreach ($this->response->children($this->namespaces['NamespaceAtom'])->entry as $item) { |
|
| 171 | + $this->validText[] = $item->content->children($this->namespaces['NamespaceMetadata']) |
|
| 172 | 172 | ->children($this->namespaces['NamespaceDataServices']); |
| 173 | 173 | } |
| 174 | 174 | return $this; |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | private function arrayOne() |
| 181 | 181 | { |
| 182 | - $this->validText = $this->response->children( $this->namespaces['NamespaceAtom'] )->content |
|
| 183 | - ->children( $this->namespaces['NamespaceMetadata'] ) |
|
| 184 | - ->children( $this->namespaces['NamespaceDataServices'] ); |
|
| 182 | + $this->validText = $this->response->children($this->namespaces['NamespaceAtom'])->content |
|
| 183 | + ->children($this->namespaces['NamespaceMetadata']) |
|
| 184 | + ->children($this->namespaces['NamespaceDataServices']); |
|
| 185 | 185 | return $this; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | $xmlns_dcd->appendChild($valued); |
| 219 | 219 | |
| 220 | 220 | //---------- properties ----------// |
| 221 | - $properties = $dom->createElement('m:properties'); |
|
| 221 | + $properties = $dom->createElement('m:properties'); |
|
| 222 | 222 | $content->appendChild($properties); |
| 223 | 223 | |
| 224 | 224 | foreach ($data as $nameField => $valueField) { |