@@ -52,7 +52,7 @@ |
||
52 | 52 | public function newApp(AbstractAppMeta $appMeta, string $contexts, Cache $cache = null) : AbstractApp |
53 | 53 | { |
54 | 54 | $cache = $this->getCache($appMeta, $contexts, $cache); |
55 | - $appId = $appMeta->name . $contexts . filemtime($appMeta->appDir . '/src'); |
|
55 | + $appId = $appMeta->name.$contexts.filemtime($appMeta->appDir.'/src'); |
|
56 | 56 | list($app) = $cache->fetch($appId); // $scriptInjector set cached single instance in wakeup |
57 | 57 | if ($app && $app instanceof AbstractApp) { |
58 | 58 | return $app; |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | if ($ro->view) { |
51 | 51 | return $ro->view; |
52 | 52 | } |
53 | - $method = 'on' . ucfirst($ro->uri->method); |
|
54 | - if (! method_exists($ro, $method)) { |
|
53 | + $method = 'on'.ucfirst($ro->uri->method); |
|
54 | + if (!method_exists($ro, $method)) { |
|
55 | 55 | $ro->view = ''; // no view for OPTIONS request |
56 | 56 | |
57 | 57 | return ''; |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | /* @var $annotations Link[] */ |
68 | 68 | /* @var $ro ResourceObject */ |
69 | 69 | $hal = $this->getHal($ro->uri, $body, $annotations); |
70 | - $ro->view = $hal->asJson(true) . PHP_EOL; |
|
70 | + $ro->view = $hal->asJson(true).PHP_EOL; |
|
71 | 71 | $this->updateHeaders($ro); |
72 | 72 | |
73 | 73 | return $ro->view; |
74 | 74 | } |
75 | 75 | |
76 | - private function valuateElements(ResourceObject &$ro) |
|
76 | + private function valuateElements(ResourceObject & $ro) |
|
77 | 77 | { |
78 | 78 | foreach ($ro->body as $key => &$embeded) { |
79 | 79 | if ($embeded instanceof AbstractRequest) { |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function isDifferentSchema(ResourceObject $parentRo, ResourceObject $childRo) : bool |
97 | 97 | { |
98 | - return $parentRo->uri->scheme . $parentRo->uri->host !== $childRo->uri->scheme . $childRo->uri->host; |
|
98 | + return $parentRo->uri->scheme.$parentRo->uri->host !== $childRo->uri->scheme.$childRo->uri->host; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | private function getHal(AbstractUri $uri, array $body, array $annotations) : Hal |
102 | 102 | { |
103 | - $query = $uri->query ? '?' . http_build_query($uri->query) : ''; |
|
104 | - $path = $uri->path . $query; |
|
103 | + $query = $uri->query ? '?'.http_build_query($uri->query) : ''; |
|
104 | + $path = $uri->path.$query; |
|
105 | 105 | $selfLink = $this->link->getReverseLink($path); |
106 | 106 | |
107 | 107 | $hal = new Hal($selfLink, $body); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function addHalLink(array $body, array $methodAnnotations, Hal $hal) : Hal |
42 | 42 | { |
43 | - if (! empty($methodAnnotations)) { |
|
43 | + if (!empty($methodAnnotations)) { |
|
44 | 44 | $hal = $this->linkAnnotation($body, $methodAnnotations, $hal); |
45 | 45 | } |
46 | 46 | if (isset($body['_links'])) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | private function linkAnnotation(array $body, array $methodAnnotations, Hal $hal) : Hal |
54 | 54 | { |
55 | 55 | foreach ($methodAnnotations as $annotation) { |
56 | - if (! $annotation instanceof Link) { |
|
56 | + if (!$annotation instanceof Link) { |
|
57 | 57 | continue; |
58 | 58 | } |
59 | 59 | $uri = uri_template($annotation->href, $body); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $ro = $invocation->proceed(); |
30 | 30 | $isCreated = $ro->code === 201 && isset($ro->headers['Location']); |
31 | - if (! $isCreated) { |
|
31 | + if (!$isCreated) { |
|
32 | 32 | return $ro; |
33 | 33 | } |
34 | 34 | $ro->setRenderer($this->renderer); |