Completed
Push — fix-compile ( d74749 )
by Akihito
04:38
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/Provide/Error/ErrorPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,6 +24,6 @@
 block discarded – undo
24 24
     {
25 25
         $string = parent::__toString();
26 26
 
27
-        return $string . $this->postBody;
27
+        return $string.$this->postBody;
28 28
     }
29 29
 }
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/Transfer/CliResponder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,15 +18,15 @@
 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;
Please login to merge, or discard this patch.
src/Provide/Error/DevVndErrorPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
     public function toString()
23 23
     {
24
-        $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;
24
+        $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL;
25 25
     }
26 26
 
27 27
     private function getHeader() : array
Please login to merge, or discard this patch.
src/Provide/Error/ProdVndErrorPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
     public function toString()
23 23
     {
24
-        $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;
24
+        $this->view = json_encode($this->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL;
25 25
     }
26 26
 
27 27
     private function getHeader($code) : array
Please login to merge, or discard this patch.
src/Provide/Representation/HalLink.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -22,6 +22,9 @@
 block discarded – undo
22 22
         $this->router = $router;
23 23
     }
24 24
 
25
+    /**
26
+     * @param string $uri
27
+     */
25 28
     public function getReverseLink($uri) : string
26 29
     {
27 30
         $urlParts = parse_url($uri);
Please login to merge, or discard this patch.
src/Provide/Representation/CreatedResourceInterceptor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         /** @var ResourceObject $ro */
31 31
         $ro = $invocation->proceed();
32 32
         $isCreated = $ro->code === 201 && isset($ro->headers['Location']);
33
-        if (! $isCreated) {
33
+        if (!$isCreated) {
34 34
             return $ro;
35 35
         }
36 36
         $ro->setRenderer($this->renderer);
Please login to merge, or discard this patch.
src/Compiler.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -59,6 +59,9 @@
 block discarded – undo
59 59
         }
60 60
     }
61 61
 
62
+    /**
63
+     * @param string $method
64
+     */
62 65
     private function isMagicMethod($method) : bool
63 66
     {
64 67
         return \in_array($method, ['__sleep', '__wakeup', 'offsetGet', 'offsetSet', 'offsetExists', 'offsetUnset', 'count', 'ksort', 'asort', 'jsonSerialize'], true);
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         foreach ($appMeta->getResourceListGenerator() as list($className)) {
60 60
             $this->scanClass($injector, $reader, $namedParams, $className);
61 61
         }
62
-        $logFile = realpath($appMeta->logDir) . '/compile.log';
62
+        $logFile = realpath($appMeta->logDir).'/compile.log';
63 63
         $this->saveCompileLog($appMeta, $context, $logFile);
64 64
 
65 65
         return $logFile;
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 
68 68
     private function compileLoader(string $appName, string $context, string $appDir) : string
69 69
     {
70
-        $loaderFile = $appDir . '/vendor/autoload.php';
71
-        if (! file_exists($loaderFile)) {
70
+        $loaderFile = $appDir.'/vendor/autoload.php';
71
+        if (!file_exists($loaderFile)) {
72 72
             return '';
73 73
         }
74 74
         $loaderFile = require $loaderFile;
75 75
         spl_autoload_register(
76
-            function ($class) use ($loaderFile) {
76
+            function($class) use ($loaderFile) {
77 77
                 $loaderFile->loadClass($class);
78 78
                 if ($class !== NullPage::class) {
79 79
                     $this->classes[] = $class;
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
         );
85 85
 
86 86
         $this->invokeTypicalReuqest($appName, $context);
87
-        $fies = '<?php' . PHP_EOL;
87
+        $fies = '<?php'.PHP_EOL;
88 88
         foreach ($this->classes as $class) {
89
-            $isAutoloadFailed = ! class_exists($class, false) && ! interface_exists($class, false) && ! trait_exists($class, false); // could be phpdoc tag by anotation loader
89
+            $isAutoloadFailed = !class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false); // could be phpdoc tag by anotation loader
90 90
             if ($isAutoloadFailed) {
91 91
                 continue;
92 92
             }
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
                 $this->getRelativePath($appDir, (new \ReflectionClass($class))->getFileName())
96 96
             );
97 97
         }
98
-        $fies .= "require __DIR__ . '/vendor/autoload.php';" . PHP_EOL;
99
-        $loaderFile = realpath($appDir . '/autoload.php');
98
+        $fies .= "require __DIR__ . '/vendor/autoload.php';".PHP_EOL;
99
+        $loaderFile = realpath($appDir.'/autoload.php');
100 100
         file_put_contents($loaderFile, $fies);
101 101
 
102 102
         return $loaderFile;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             return str_replace("{$dir}", "__DIR__ . '", $file);
110 110
         }
111 111
 
112
-        return "'" . $file;
112
+        return "'".$file;
113 113
     }
114 114
 
115 115
     private function invokeTypicalReuqest(string $appName, string $context)
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     private function saveNamedParam(NamedParameterInterface $namedParameter, $instance, string $method)
152 152
     {
153 153
         // named parameter
154
-        if (! \in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
154
+        if (!\in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
155 155
             return;
156 156
         }
157 157
         try {
Please login to merge, or discard this patch.