@@ -26,10 +26,10 @@ |
||
| 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; |
@@ -66,21 +66,21 @@ discard block |
||
| 66 | 66 | $this->context = $context; |
| 67 | 67 | $this->appMeta = $appMeta instanceof AbstractAppMeta ? $appMeta : new Meta($name, $context); |
| 68 | 68 | $this->cacheSpace = $cacheSpace; |
| 69 | - $scriptDir = $this->appMeta->tmpDir . '/di'; |
|
| 70 | - ! \file_exists($scriptDir) && \mkdir($scriptDir); |
|
| 69 | + $scriptDir = $this->appMeta->tmpDir.'/di'; |
|
| 70 | + !\file_exists($scriptDir) && \mkdir($scriptDir); |
|
| 71 | 71 | $this->scriptDir = $scriptDir; |
| 72 | - $appDir = $this->appMeta->tmpDir . '/app'; |
|
| 73 | - ! \file_exists($appDir) && \mkdir($appDir); |
|
| 74 | - touch($appDir . '/.do_not_clear'); |
|
| 72 | + $appDir = $this->appMeta->tmpDir.'/app'; |
|
| 73 | + !\file_exists($appDir) && \mkdir($appDir); |
|
| 74 | + touch($appDir.'/.do_not_clear'); |
|
| 75 | 75 | $this->appDir = $appDir; |
| 76 | - $this->injector = new ScriptInjector($this->scriptDir, function () use ($envFile) { |
|
| 76 | + $this->injector = new ScriptInjector($this->scriptDir, function() use ($envFile) { |
|
| 77 | 77 | if (file_exists($envFile)) { |
| 78 | 78 | (new Loader($envFile))->parse()->toEnv(true); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $this->getModule(); |
| 82 | 82 | }); |
| 83 | - if (! $cacheSpace) { |
|
| 83 | + if (!$cacheSpace) { |
|
| 84 | 84 | $this->clear(); |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -106,16 +106,16 @@ discard block |
||
| 106 | 106 | if ((new Unlink)->once($this->appMeta->tmpDir)) { |
| 107 | 107 | return; |
| 108 | 108 | } |
| 109 | - ! is_dir($this->appMeta->tmpDir . '/di') && \mkdir($this->appMeta->tmpDir . '/di'); |
|
| 110 | - file_put_contents($this->scriptDir . ScriptInjector::MODULE, serialize($this->getModule())); |
|
| 109 | + !is_dir($this->appMeta->tmpDir.'/di') && \mkdir($this->appMeta->tmpDir.'/di'); |
|
| 110 | + file_put_contents($this->scriptDir.ScriptInjector::MODULE, serialize($this->getModule())); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | public function getCachedInstance($interface, $name = Name::ANY) |
| 114 | 114 | { |
| 115 | - $lockFile = $this->appMeta->appDir . '/composer.lock'; |
|
| 115 | + $lockFile = $this->appMeta->appDir.'/composer.lock'; |
|
| 116 | 116 | $this->cacheSpace .= file_exists($lockFile) ? (string) filemtime($lockFile) : ''; |
| 117 | 117 | $cache = new FilesystemCache($this->appDir); |
| 118 | - $id = $interface . $name . $this->context . $this->cacheSpace; |
|
| 118 | + $id = $interface.$name.$this->context.$this->cacheSpace; |
|
| 119 | 119 | $instance = $cache->fetch($id); |
| 120 | 120 | if ($instance) { |
| 121 | 121 | return $instance; |