Completed
Branch 1.x (f12d5a)
by Akihito
01:34
created
src/Provide/Representation/HalRenderer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function render(ResourceObject $ro)
63 63
     {
64
-        $method = 'on' . ucfirst($ro->uri->method);
65
-        if (! method_exists($ro, $method)) {
64
+        $method = 'on'.ucfirst($ro->uri->method);
65
+        if (!method_exists($ro, $method)) {
66 66
             $ro->view = ''; // no view for OPTIONS request
67 67
 
68 68
             return '';
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         /* @var $annotations Link[] */
83 83
         /* @var $ro ResourceObject */
84 84
         $hal = $this->getHal($ro->uri, $body, $annotations);
85
-        $ro->view = $hal->asJson(true) . PHP_EOL;
85
+        $ro->view = $hal->asJson(true).PHP_EOL;
86 86
         $this->updateHeaders($ro);
87 87
 
88 88
         return $ro->view;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         return $ro->view;
113 113
     }
114 114
 
115
-    private function valuateElements(ResourceObject &$ro)
115
+    private function valuateElements(ResourceObject & $ro)
116 116
     {
117 117
         foreach ($ro->body as $key => &$embeded) {
118 118
             if ($embeded instanceof AbstractRequest) {
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
      */
135 135
     private function isDifferentSchema(ResourceObject $parentRo, ResourceObject $childRo) : bool
136 136
     {
137
-        return $parentRo->uri->scheme . $parentRo->uri->host !== $childRo->uri->scheme . $childRo->uri->host;
137
+        return $parentRo->uri->scheme.$parentRo->uri->host !== $childRo->uri->scheme.$childRo->uri->host;
138 138
     }
139 139
 
140 140
     private function getHal(AbstractUri $uri, array $body, array $annotations) : Hal
141 141
     {
142
-        $query = $uri->query ? '?' . http_build_query($uri->query) : '';
143
-        $path = $uri->path . $query;
142
+        $query = $uri->query ? '?'.http_build_query($uri->query) : '';
143
+        $path = $uri->path.$query;
144 144
         $selfLink = $this->getReverseMatchedLink($path);
145 145
 
146 146
         $hal = new Hal($selfLink, $body);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         if ($this->curies instanceof Curies) {
194 194
             $hal->addCurie($this->curies->name, $this->curies->href);
195 195
         }
196
-        if (! empty($methodAnnotations)) {
196
+        if (!empty($methodAnnotations)) {
197 197
             $hal = $this->linkAnnotation($body, $methodAnnotations, $hal);
198 198
         }
199 199
         if (isset($body['_links'])) {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     private function linkAnnotation(array $body, array $methodAnnotations, Hal $hal) : Hal
231 231
     {
232 232
         foreach ($methodAnnotations as $annotation) {
233
-            if (! $annotation instanceof Link) {
233
+            if (!$annotation instanceof Link) {
234 234
                 continue;
235 235
             }
236 236
             $uri = uri_template($annotation->href, $body);
Please login to merge, or discard this patch.