| @@ -47,9 +47,9 @@ discard block | ||
| 47 | 47 | public function render(ResourceObject $ro) | 
| 48 | 48 |      { | 
| 49 | 49 | list($ro, $body) = $this->valuate($ro); | 
| 50 | - $method = 'on' . ucfirst($ro->uri->method); | |
| 50 | + $method = 'on'.ucfirst($ro->uri->method); | |
| 51 | 51 | $hasMethod = method_exists($ro, $method); | 
| 52 | -        if (! $hasMethod) { | |
| 52 | +        if (!$hasMethod) { | |
| 53 | 53 | $ro->view = ''; // OPTIONS request no view | 
| 54 | 54 | |
| 55 | 55 | return ''; | 
| @@ -58,7 +58,7 @@ discard block | ||
| 58 | 58 | /* @var $annotations Link[] */ | 
| 59 | 59 | /* @var $ro ResourceObject */ | 
| 60 | 60 | $hal = $this->getHal($ro->uri, $body, $annotations); | 
| 61 | - $ro->view = $hal->asJson(true) . PHP_EOL; | |
| 61 | + $ro->view = $hal->asJson(true).PHP_EOL; | |
| 62 | 62 | $this->updateHeaders($ro); | 
| 63 | 63 | |
| 64 | 64 | return $ro->view; | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | /** | 
| 68 | 68 | * @param \BEAR\Resource\ResourceObject $ro | 
| 69 | 69 | */ | 
| 70 | - private function valuateElements(ResourceObject &$ro) | |
| 70 | + private function valuateElements(ResourceObject & $ro) | |
| 71 | 71 |      { | 
| 72 | 72 |          foreach ($ro->body as $key => &$element) { | 
| 73 | 73 |              if ($element instanceof RequestInterface) { | 
| @@ -87,8 +87,8 @@ discard block | ||
| 87 | 87 | */ | 
| 88 | 88 | private function getHal(AbstractUri $uri, array $body, array $annotations) | 
| 89 | 89 |      { | 
| 90 | - $query = $uri->query ? '?' . http_build_query($uri->query) : ''; | |
| 91 | - $path = $uri->path . $query; | |
| 90 | + $query = $uri->query ? '?'.http_build_query($uri->query) : ''; | |
| 91 | + $path = $uri->path.$query; | |
| 92 | 92 | $selfLink = $this->getReverseMatchedLink($path); | 
| 93 | 93 | $hal = new Hal($selfLink, $body); | 
| 94 | 94 | $this->getHalLink($body, $annotations, $hal); | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | private function getHalLink(array $body, array $links, Hal $hal) | 
| 150 | 150 |      { | 
| 151 | 151 |          foreach ($links as $link) { | 
| 152 | -            if (! $link instanceof Link) { | |
| 152 | +            if (!$link instanceof Link) { | |
| 153 | 153 | continue; | 
| 154 | 154 | } | 
| 155 | 155 | $uri = uri_template($link->href, $body); | 
| @@ -41,7 +41,7 @@ | ||
| 41 | 41 |      { | 
| 42 | 42 | $request = new RouterMatch; | 
| 43 | 43 | list($request->method, $request->query) = $this->httpMethodParams->get($server, $globals['_GET'], $globals['_POST']); | 
| 44 | - $request->path = $this->schemeHost . parse_url($server['REQUEST_URI'], PHP_URL_PATH); | |
| 44 | + $request->path = $this->schemeHost.parse_url($server['REQUEST_URI'], PHP_URL_PATH); | |
| 45 | 45 | |
| 46 | 46 | return $request; | 
| 47 | 47 | } | 
| @@ -24,6 +24,6 @@ | ||
| 24 | 24 |      { | 
| 25 | 25 | $string = parent::__toString(); | 
| 26 | 26 | |
| 27 | - return $string . $this->postBody; | |
| 27 | + return $string.$this->postBody; | |
| 28 | 28 | } | 
| 29 | 29 | } | 
| @@ -29,7 +29,7 @@ | ||
| 29 | 29 | protected function configure() | 
| 30 | 30 |      { | 
| 31 | 31 | $this->bind(AbstractAppMeta::class)->toInstance($this->appMeta); | 
| 32 | - $this->bind(AppInterface::class)->to($this->appMeta->name . '\Module\App'); | |
| 32 | + $this->bind(AppInterface::class)->to($this->appMeta->name.'\Module\App'); | |
| 33 | 33 |          $this->bind('')->annotatedWith(AppName::class)->toInstance($this->appMeta->name); | 
| 34 | 34 | } | 
| 35 | 35 | } | 
| @@ -27,6 +27,6 @@ | ||
| 27 | 27 | */ | 
| 28 | 28 | public function get() | 
| 29 | 29 |      { | 
| 30 | - return new FilesystemCache($this->app->tmpDir . '/cache'); | |
| 30 | + return new FilesystemCache($this->app->tmpDir.'/cache'); | |
| 31 | 31 | } | 
| 32 | 32 | } | 
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | $this->rename(RouterInterface::class, 'original'); | 
| 24 | 24 | $this->bind(RouterInterface::class)->to(CliRouter::class); | 
| 25 | 25 | $this->bind(TransferInterface::class)->to(CliResponder::class); | 
| 26 | - $stdIn = tempnam(sys_get_temp_dir(), 'stdin-' . crc32(__FILE__)); | |
| 26 | + $stdIn = tempnam(sys_get_temp_dir(), 'stdin-'.crc32(__FILE__)); | |
| 27 | 27 | $this->bind()->annotatedWith(StdIn::class)->toInstance($stdIn); | 
| 28 | 28 | } | 
| 29 | 29 | } | 
| @@ -21,16 +21,16 @@ | ||
| 21 | 21 | $body = $resourceObject->toString(); | 
| 22 | 22 | // code | 
| 23 | 23 | $statusText = (new Code)->statusText[$resourceObject->code]; | 
| 24 | - $ob = $resourceObject->code . ' ' . $statusText . PHP_EOL; | |
| 24 | + $ob = $resourceObject->code.' '.$statusText.PHP_EOL; | |
| 25 | 25 | // header | 
| 26 | 26 |          foreach ($resourceObject->headers as $label => $value) { | 
| 27 | -            $ob .= "{$label}: {$value}" . PHP_EOL; | |
| 27 | +            $ob .= "{$label}: {$value}".PHP_EOL; | |
| 28 | 28 | } | 
| 29 | 29 | // empty line | 
| 30 | 30 | $ob .= PHP_EOL; | 
| 31 | 31 | // body | 
| 32 | 32 | $ob .= $body; | 
| 33 | 33 | |
| 34 | - echo $ob . PHP_EOL; | |
| 34 | + echo $ob.PHP_EOL; | |
| 35 | 35 | } | 
| 36 | 36 | } | 
| @@ -62,7 +62,7 @@ discard block | ||
| 62 | 62 | public function __construct(AbstractAppMeta $appMeta, TransferInterface $responder) | 
| 63 | 63 |      { | 
| 64 | 64 | $this->logDir = $appMeta->logDir; | 
| 65 | - $this->lastErrorFile = $this->logDir . '/last_error.log'; | |
| 65 | + $this->lastErrorFile = $this->logDir.'/last_error.log'; | |
| 66 | 66 | $this->responder = $responder; | 
| 67 | 67 | $this->exceptionString = new ExceptionAsString; | 
| 68 | 68 | } | 
| @@ -122,7 +122,7 @@ discard block | ||
| 122 | 122 | private function codeError(\Exception $e) | 
| 123 | 123 |      { | 
| 124 | 124 | $code = $e->getCode(); | 
| 125 | - $message = $code . ' ' . (new Code)->statusText[$code]; | |
| 125 | + $message = $code.' '.(new Code)->statusText[$code]; | |
| 126 | 126 | $body = ['message' => $message]; | 
| 127 | 127 | |
| 128 | 128 | return [$code, $body]; | 
| @@ -154,6 +154,6 @@ discard block | ||
| 154 | 154 | */ | 
| 155 | 155 | private function getLogRefId(\Exception $e) | 
| 156 | 156 |      { | 
| 157 | - return (string) crc32(get_class($e) . $e->getMessage() . $e->getFile() . $e->getLine()); | |
| 157 | + return (string) crc32(get_class($e).$e->getMessage().$e->getFile().$e->getLine()); | |
| 158 | 158 | } | 
| 159 | 159 | } | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | private function getParams($method, array $server, array $post) | 
| 111 | 111 |      { | 
| 112 | 112 | // post data exists | 
| 113 | -        if ($method === 'post' && ! empty($post)) { | |
| 113 | +        if ($method === 'post' && !empty($post)) { | |
| 114 | 114 | return $post; | 
| 115 | 115 | } | 
| 116 | 116 | |
| @@ -131,7 +131,7 @@ discard block | ||
| 131 | 131 | private function phpInput(array $server) | 
| 132 | 132 |      { | 
| 133 | 133 | $contentType = $this->getContentType($server); | 
| 134 | -        if (! $contentType) { | |
| 134 | +        if (!$contentType) { | |
| 135 | 135 | return []; | 
| 136 | 136 | } | 
| 137 | 137 | $isFormUrlEncoded = strpos($contentType, self::FORM_URL_ENCODE) !== false; |