Completed
Push — app-factory ( 09c0dc...449f0e )
by Akihito
05:15
created
src/Context/Provider/ProdCacheProvider.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
      */
31 31
     public function __construct(AbstractAppMeta $appMeta, string $namespace)
32 32
     {
33
-        $this->cacheDir = $appMeta->tmpDir . '/cache';
33
+        $this->cacheDir = $appMeta->tmpDir.'/cache';
34 34
         $this->namespace = $namespace;
35 35
     }
36 36
 
Please login to merge, or discard this patch.
src/Unlink.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
 
21 21
     public function __invoke(string $path)
22 22
     {
23
-        if ($this->isOptional && file_exists($path . '/.do_not_clear')) {
23
+        if ($this->isOptional && file_exists($path.'/.do_not_clear')) {
24 24
             return;
25 25
         }
26
-        foreach (\glob(\rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*') as $file) {
26
+        foreach (\glob(\rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*') as $file) {
27 27
             \is_dir($file) ? $this->__invoke($file) : \unlink($file);
28 28
             @\rmdir($file);
29 29
         }
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
         return $this->view;
27 27
     }
Please login to merge, or discard this patch.
src/Provide/Representation/HalRenderer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         if ($ro->view) {
44 44
             return $ro->view;
45 45
         }
46
-        $method = 'on' . ucfirst($ro->uri->method);
46
+        $method = 'on'.ucfirst($ro->uri->method);
47 47
         $annotations = $this->reader->getMethodAnnotations(new \ReflectionMethod((object) $ro, $method));
48 48
 
49 49
         return $this->renderHal($ro, $annotations);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         /* @var $annotations Link[] */
56 56
         /* @var $ro ResourceObject */
57 57
         $hal = $this->getHal($ro->uri, $body, $annotations);
58
-        $ro->view = $hal->asJson(true) . PHP_EOL;
58
+        $ro->view = $hal->asJson(true).PHP_EOL;
59 59
         $this->updateHeaders($ro);
60 60
 
61 61
         return $ro->view;
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
      */
84 84
     private function isDifferentSchema(ResourceObject $parentRo, ResourceObject $childRo) : bool
85 85
     {
86
-        return $parentRo->uri->scheme . $parentRo->uri->host !== $childRo->uri->scheme . $childRo->uri->host;
86
+        return $parentRo->uri->scheme.$parentRo->uri->host !== $childRo->uri->scheme.$childRo->uri->host;
87 87
     }
88 88
 
89 89
     private function getHal(AbstractUri $uri, array $body, array $annotations) : Hal
90 90
     {
91
-        $query = $uri->query ? '?' . http_build_query($uri->query) : '';
92
-        $path = $uri->path . $query;
91
+        $query = $uri->query ? '?'.http_build_query($uri->query) : '';
92
+        $path = $uri->path.$query;
93 93
         $selfLink = $this->link->getReverseLink($path);
94 94
 
95 95
         $hal = new Hal($selfLink, $body);
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
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 
31 31
     public function newApp(AbstractAppMeta $appMeta, string $contexts, Cache $cache = null) : AbstractApp
32 32
     {
33
-        $cacheNs = (string) filemtime($appMeta->appDir . '/src');
33
+        $cacheNs = (string) filemtime($appMeta->appDir.'/src');
34 34
         $injector = new AppInjector($appMeta->name, $contexts, $appMeta, $cacheNs);
35 35
         $cache = $cache instanceof Cache ? $cache : $injector->getCachedInstance(Cache::class);
36
-        $appId = $appMeta->name . $contexts . $cacheNs;
36
+        $appId = $appMeta->name.$contexts.$cacheNs;
37 37
         $app = $cache->fetch($appId);
38 38
         if ($app instanceof AbstractApp) {
39 39
             return $app;
Please login to merge, or discard this patch.
src/Module.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,17 +20,17 @@
 block discarded – undo
20 20
         $contextsArray = array_reverse(explode('-', $context));
21 21
         $module = null;
22 22
         foreach ($contextsArray as $context) {
23
-            $class = $appMeta->name . '\Module\\' . ucwords($context) . 'Module';
24
-            if (! class_exists($class)) {
25
-                $class = 'BEAR\Package\Context\\' . ucwords($context) . 'Module';
23
+            $class = $appMeta->name.'\Module\\'.ucwords($context).'Module';
24
+            if (!class_exists($class)) {
25
+                $class = 'BEAR\Package\Context\\'.ucwords($context).'Module';
26 26
             }
27
-            if (! is_a($class, AbstractModule::class, true)) {
27
+            if (!is_a($class, AbstractModule::class, true)) {
28 28
                 throw new InvalidContextException($class);
29 29
             }
30 30
             /* @var $module AbstractModule */
31 31
             $module = new $class($module);
32 32
         }
33
-        if (! $module instanceof AbstractModule) {
33
+        if (!$module instanceof AbstractModule) {
34 34
             throw new \LogicException; // @codeCoverageIgnore
35 35
         }
36 36
         $module->override(new AppMetaModule($appMeta));
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
         return $this->view;
27 27
     }
Please login to merge, or discard this patch.
src/Compiler.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $appMeta = new AppMeta($appName, $context, $appDir);
47 47
         (new Unlink)->force($appMeta->tmpDir);
48
-        $cacheNs = (string) filemtime($appMeta->appDir . '/src');
48
+        $cacheNs = (string) filemtime($appMeta->appDir.'/src');
49 49
         $injector = new AppInjector($appName, $context, $appMeta, $cacheNs);
50 50
         $cache = $injector->getInstance(Cache::class);
51 51
         $reader = $injector->getInstance(AnnotationReader::class);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         foreach ($appMeta->getResourceListGenerator() as list($className)) {
61 61
             $this->scanClass($injector, $reader, $namedParams, $className);
62 62
         }
63
-        $logFile = realpath($appMeta->logDir) . '/compile.log';
63
+        $logFile = realpath($appMeta->logDir).'/compile.log';
64 64
         $this->saveCompileLog($appMeta, $context, $logFile);
65 65
 
66 66
         return $logFile;
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 
69 69
     private function compileLoader(string $appName, string $context, string $appDir) : string
70 70
     {
71
-        $loaderFile = $appDir . '/vendor/autoload.php';
72
-        if (! file_exists($loaderFile)) {
71
+        $loaderFile = $appDir.'/vendor/autoload.php';
72
+        if (!file_exists($loaderFile)) {
73 73
             return '';
74 74
         }
75 75
         $loaderFile = require $loaderFile;
76 76
         spl_autoload_register(
77
-            function ($class) use ($loaderFile) {
77
+            function($class) use ($loaderFile) {
78 78
                 $loaderFile->loadClass($class);
79 79
                 if ($class !== NullPage::class) {
80 80
                     $this->classes[] = $class;
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
         );
86 86
 
87 87
         $this->invokeTypicalReuqest($appName, $context);
88
-        $fies = '<?php' . PHP_EOL;
88
+        $fies = '<?php'.PHP_EOL;
89 89
         foreach ($this->classes as $class) {
90
-            $isAutoloadFailed = ! class_exists($class, false) && ! interface_exists($class, false) && ! trait_exists($class, false); // could be phpdoc tag by anotation loader
90
+            $isAutoloadFailed = !class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false); // could be phpdoc tag by anotation loader
91 91
             if ($isAutoloadFailed) {
92 92
                 continue;
93 93
             }
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
                 $this->getRelativePath($appDir, (new \ReflectionClass($class))->getFileName())
97 97
             );
98 98
         }
99
-        $fies .= "require __DIR__ . '/vendor/autoload.php';" . PHP_EOL;
100
-        $loaderFile = realpath($appDir) . '/autoload.php';
99
+        $fies .= "require __DIR__ . '/vendor/autoload.php';".PHP_EOL;
100
+        $loaderFile = realpath($appDir).'/autoload.php';
101 101
         file_put_contents($loaderFile, $fies);
102 102
 
103 103
         return $loaderFile;
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             return str_replace("{$dir}", "__DIR__ . '", $file);
111 111
         }
112 112
 
113
-        return "'" . $file;
113
+        return "'".$file;
114 114
     }
115 115
 
116 116
     private function invokeTypicalReuqest(string $appName, string $context)
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     private function saveNamedParam(NamedParameterInterface $namedParameter, $instance, string $method)
153 153
     {
154 154
         // named parameter
155
-        if (! \in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
155
+        if (!\in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
156 156
             return;
157 157
         }
158 158
         try {
Please login to merge, or discard this patch.
src/App.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@
 block discarded – undo
26 26
         string $appDir = ''
27 27
     ) : AbstractApp {
28 28
         $appMeta = new Meta($name, $contexts, $appDir);
29
-        $cacheNs = (string) filemtime($appMeta->appDir . '/src');
29
+        $cacheNs = (string) filemtime($appMeta->appDir.'/src');
30 30
         $injector = new AppInjector($appMeta->name, $contexts, $appMeta, $cacheNs, $envFile);
31 31
         $cache = $injector->getCachedInstance(Cache::class);
32
-        $appId = $appMeta->name . $contexts . $cacheNs;
32
+        $appId = $appMeta->name.$contexts.$cacheNs;
33 33
         $app = $cache->fetch($appId);
34 34
         if ($app instanceof AbstractApp) {
35 35
             return $app;
Please login to merge, or discard this patch.