Completed
Push — 1.x ( 071ffc...c21892 )
by Akihito
04:09
created
src/Provide/Router/WebRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/AppMetaModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Context/Provider/FilesystemCacheProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,6 +27,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Context/CliModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Provide/Router/HttpMethodParams.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/AppInjector.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     private function compile(AbstractModule $module, AbstractAppMeta $appMeta, $scriptDir)
81 81
     {
82
-        $hashFile = $appMeta->tmpDir . '/compile_hash';
82
+        $hashFile = $appMeta->tmpDir.'/compile_hash';
83 83
         $moduleHash = md5(serialize($module));
84 84
         $isUnchanged = file_exists($hashFile) && (file_get_contents($hashFile) === $moduleHash);
85 85
         if ($isUnchanged) {
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
         $contextsArray = array_reverse(explode('-', $contexts));
105 105
         $module = null;
106 106
         foreach ($contextsArray as $context) {
107
-            $class = $appMeta->name . '\Module\\' . ucwords($context) . 'Module';
108
-            if (! class_exists($class)) {
109
-                $class = 'BEAR\Package\Context\\' . ucwords($context) . 'Module';
107
+            $class = $appMeta->name.'\Module\\'.ucwords($context).'Module';
108
+            if (!class_exists($class)) {
109
+                $class = 'BEAR\Package\Context\\'.ucwords($context).'Module';
110 110
             }
111
-            if (! is_a($class, AbstractModule::class, true)) {
111
+            if (!is_a($class, AbstractModule::class, true)) {
112 112
                 throw new InvalidContextException($class);
113 113
             }
114 114
             /* @var $module AbstractModule */
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
      */
124 124
     private function cleanupDir($tmpDir)
125 125
     {
126
-        $unlink = function ($path) use (&$unlink) {
127
-            foreach (glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*') as $file) {
126
+        $unlink = function($path) use (&$unlink) {
127
+            foreach (glob(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*') as $file) {
128 128
                 is_dir($file) ? $unlink($file) : unlink($file);
129 129
                 @rmdir($file);
130 130
             }
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -29,6 +29,10 @@
 block discarded – undo
29 29
      */
30 30
     private $appMeta;
31 31
 
32
+    /**
33
+     * @param string $name
34
+     * @param string $contexts
35
+     */
32 36
     public function __construct($name, $contexts)
33 37
     {
34 38
         $this->appMeta = new AppMeta($name, $contexts);
Please login to merge, or discard this patch.
src/Bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function newApp(AbstractAppMeta $appMeta, $contexts, Cache $cache = null)
60 60
     {
61 61
         $cache = $cache ?: $this->getCache($appMeta, $contexts);
62
-        $appId = $appMeta->name . $contexts;
62
+        $appId = $appMeta->name.$contexts;
63 63
         list($app, $scriptInjector) = $cache->fetch($appId); // $scriptInjector set cached single instance in wakeup
64 64
         if ($app && $app instanceof AbstractApp) {
65 65
             return $app;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     private function getCache(AbstractAppMeta $appMeta, $contexts)
87 87
     {
88
-        $isDeveop = ! is_int(strpos($contexts, 'prod'));
88
+        $isDeveop = !is_int(strpos($contexts, 'prod'));
89 89
         if ($isDeveop) {
90 90
             return new VoidCache;
91 91
         }
Please login to merge, or discard this patch.
src/Provide/Transfer/CliResponder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,21 +18,21 @@
 block discarded – undo
18 18
     public function __invoke(ResourceObject $resourceObject, array $server)
19 19
     {
20 20
         unset($server);
21
-        if (! $resourceObject->view) {
21
+        if (!$resourceObject->view) {
22 22
             $resourceObject->toString();
23 23
         }
24 24
         // code
25 25
         $statusText = (new Code)->statusText[$resourceObject->code];
26
-        $ob = $resourceObject->code . ' ' . $statusText . PHP_EOL;
26
+        $ob = $resourceObject->code.' '.$statusText.PHP_EOL;
27 27
         // header
28 28
         foreach ($resourceObject->headers as $label => $value) {
29
-            $ob .= "{$label}: {$value}" . PHP_EOL;
29
+            $ob .= "{$label}: {$value}".PHP_EOL;
30 30
         }
31 31
         // empty line
32 32
         $ob .= PHP_EOL;
33 33
         // body
34 34
         $ob .= $resourceObject->view;
35 35
 
36
-        echo $ob . PHP_EOL;
36
+        echo $ob.PHP_EOL;
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
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.