Completed
Push — 1.x ( 071ffc...c21892 )
by Akihito
04:09
created
src/Provide/Representation/HalRenderer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
     /**
132 132
      * @param string $uri
133 133
      *
134
-     * @return mixed
134
+     * @return string
135 135
      */
136 136
     private function getReverseMatchedLink($uri)
137 137
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function render(ResourceObject $ro)
64 64
     {
65
-        $method = 'on' . ucfirst($ro->uri->method);
65
+        $method = 'on'.ucfirst($ro->uri->method);
66 66
         $hasMethod = method_exists($ro, $method);
67
-        if (! $hasMethod) {
67
+        if (!$hasMethod) {
68 68
             $ro->view = ''; // OPTIONS request no view
69 69
 
70 70
             return '';
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         /* @var $annotations Link[] */
82 82
         /* @var $ro ResourceObject */
83 83
         $hal = $this->getHal($ro->uri, $body, $annotations);
84
-        $ro->view = $hal->asJson(true) . PHP_EOL;
84
+        $ro->view = $hal->asJson(true).PHP_EOL;
85 85
         $this->updateHeaders($ro);
86 86
 
87 87
         return $ro->view;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     /**
105 105
      * @param \BEAR\Resource\ResourceObject $ro
106 106
      */
107
-    private function valuateElements(ResourceObject &$ro)
107
+    private function valuateElements(ResourceObject & $ro)
108 108
     {
109 109
         foreach ($ro->body as $key => &$embeded) {
110 110
             if ($embeded instanceof AbstractRequest) {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     private function isDifferentSchema(ResourceObject $parentRo, ResourceObject $childRo)
133 133
     {
134
-        return $parentRo->uri->host . $parentRo->uri->host !== $childRo->uri->scheme . $childRo->uri->host;
134
+        return $parentRo->uri->host.$parentRo->uri->host !== $childRo->uri->scheme.$childRo->uri->host;
135 135
     }
136 136
 
137 137
     /**
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
      */
144 144
     private function getHal(AbstractUri $uri, array $body, array $annotations)
145 145
     {
146
-        $query = $uri->query ? '?' . http_build_query($uri->query) : '';
147
-        $path = $uri->path . $query;
146
+        $query = $uri->query ? '?'.http_build_query($uri->query) : '';
147
+        $path = $uri->path.$query;
148 148
         $selfLink = $this->getReverseMatchedLink($path);
149 149
 
150 150
         $hal = new Hal($selfLink, $body);
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $hal->addCurie($this->curies->name, $this->curies->href);
210 210
         }
211 211
         foreach ($methodAnnotations as $annotation) {
212
-            if (! $annotation instanceof Link) {
212
+            if (!$annotation instanceof Link) {
213 213
                 continue;
214 214
             }
215 215
             $uri = uri_template($annotation->href, $body);
Please login to merge, or discard this patch.