@@ -22,7 +22,7 @@ |
||
22 | 22 | $context = new RequestContext(); |
23 | 23 | $context->fromRequest($request); |
24 | 24 | |
25 | - include_once ROOT . 'cache/router_matcher.php'; |
|
25 | + include_once ROOT.'cache/router_matcher.php'; |
|
26 | 26 | |
27 | 27 | $matcher = new ProjectUrlMatcher($context); |
28 | 28 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | putenv(sprintf('LANG=%s.UTF-8', $locale)); |
45 | 45 | setlocale(LC_MESSAGES, sprintf('%s.UTF-8', $locale)); |
46 | 46 | |
47 | - bindtextdomain(self::DOMAIN, ROOT . '/lang/'); |
|
47 | + bindtextdomain(self::DOMAIN, ROOT.'/lang/'); |
|
48 | 48 | bind_textdomain_codeset(self::DOMAIN, 'UTF-8'); |
49 | 49 | textdomain(self::DOMAIN); |
50 | 50 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function read($sessionId) |
37 | 37 | { |
38 | - if ($data = $this->client->get(self::KEY . $sessionId)) { |
|
38 | + if ($data = $this->client->get(self::KEY.$sessionId)) { |
|
39 | 39 | return $data; |
40 | 40 | } |
41 | 41 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function write($sessionId, $sessionData) |
48 | 48 | { |
49 | - $this->client->setex(self::KEY . $sessionId, $this->ttl, $sessionData); |
|
49 | + $this->client->setex(self::KEY.$sessionId, $this->ttl, $sessionData); |
|
50 | 50 | |
51 | 51 | return true; |
52 | 52 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function destroy($sessionId) |
58 | 58 | { |
59 | - $this->client->del(self::KEY . $sessionId); |
|
59 | + $this->client->del(self::KEY.$sessionId); |
|
60 | 60 | |
61 | 61 | return true; |
62 | 62 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $redis = $this->getRedis(); |
26 | 26 | |
27 | - return $redis->set(self::PREFIX . $name, '1', 'EX', $lockTime, 'NX'); |
|
27 | + return $redis->set(self::PREFIX.$name, '1', 'EX', $lockTime, 'NX'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -32,6 +32,6 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function unlock(string $name) |
34 | 34 | { |
35 | - $this->getRedis()->del(self::PREFIX . $name); |
|
35 | + $this->getRedis()->del(self::PREFIX.$name); |
|
36 | 36 | } |
37 | 37 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function generateRandomId($length = self::ID_LENGTH) : string |
35 | 35 | { |
36 | - $randomId = md5(microtime() . mt_rand()) . mt_rand(); |
|
36 | + $randomId = md5(microtime().mt_rand()).mt_rand(); |
|
37 | 37 | |
38 | 38 | return substr(base_convert($randomId, 10, 36), 0, $length); |
39 | 39 | } |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | |
51 | 51 | $appFinder = new Finder(); |
52 | 52 | $appFinder->directories() |
53 | - ->in([ROOT . 'vendor/brainexe/']) |
|
53 | + ->in([ROOT.'vendor/brainexe/']) |
|
54 | 54 | ->depth("<=1") |
55 | 55 | ->name('src'); |
56 | 56 | |
57 | - $annotationLoader->load(ROOT . 'src/'); |
|
57 | + $annotationLoader->load(ROOT.'src/'); |
|
58 | 58 | |
59 | 59 | foreach ($appFinder as $dir) { |
60 | 60 | /** @var SplFileInfo $dir */ |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $debug = $container->getParameter('debug'); |
71 | 71 | $randomId = mt_rand(); |
72 | 72 | $className = sprintf('dic_%d', $randomId); |
73 | - $containerFile = ROOT . 'cache/dic.php'; |
|
73 | + $containerFile = ROOT.'cache/dic.php'; |
|
74 | 74 | |
75 | 75 | $dumper = new PhpDumper($container); |
76 | 76 | $dumper->setProxyDumper(new ProxyDumper()); |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | 'debug' => $debug |
81 | 81 | ]); |
82 | 82 | |
83 | - file_put_contents(ROOT . 'cache/dic.php', $containerContent); |
|
84 | - file_put_contents(ROOT . 'cache/dic.txt', $className); |
|
83 | + file_put_contents(ROOT.'cache/dic.php', $containerContent); |
|
84 | + file_put_contents(ROOT.'cache/dic.txt', $className); |
|
85 | 85 | @chmod($containerFile, 0777); |
86 | 86 | |
87 | 87 | file_put_contents( |
88 | - ROOT . 'cache/config.json', |
|
88 | + ROOT.'cache/config.json', |
|
89 | 89 | json_encode( |
90 | 90 | $container->getParameterBag()->all(), |
91 | 91 | $debug ? JSON_PRETTY_PRINT : null |
@@ -24,10 +24,10 @@ |
||
24 | 24 | $loader = new XmlFileLoader($container, new FileLocator('config')); |
25 | 25 | $filesystem = new Filesystem(); |
26 | 26 | |
27 | - if ($filesystem->exists(ROOT . 'app/container.xml')) { |
|
28 | - $loader->load(ROOT . 'app/container.xml'); |
|
29 | - } elseif ($filesystem->exists(ROOT . '/container.xml')) { |
|
30 | - $loader->load(ROOT . '/container.xml'); |
|
27 | + if ($filesystem->exists(ROOT.'app/container.xml')) { |
|
28 | + $loader->load(ROOT.'app/container.xml'); |
|
29 | + } elseif ($filesystem->exists(ROOT.'/container.xml')) { |
|
30 | + $loader->load(ROOT.'/container.xml'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if (!$container->hasParameter('debug')) { // todo more into expression language in container.xml ? |
@@ -19,10 +19,10 @@ |
||
19 | 19 | chdir(ROOT); |
20 | 20 | umask(0); // todo try to remove |
21 | 21 | |
22 | - $fileName = ROOT . 'cache/dic.php'; |
|
22 | + $fileName = ROOT.'cache/dic.php'; |
|
23 | 23 | /** @var Container $dic */ |
24 | 24 | if (is_file($fileName)) { |
25 | - $className = file_get_contents(ROOT . 'cache/dic.txt'); |
|
25 | + $className = file_get_contents(ROOT.'cache/dic.txt'); |
|
26 | 26 | if (!class_exists($className, false)) { |
27 | 27 | include $fileName; |
28 | 28 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $fileName = $this->getCacheFileName($name); |
32 | 32 | |
33 | - file_put_contents($fileName, '<?php' . PHP_EOL . $content); |
|
33 | + file_put_contents($fileName, '<?php'.PHP_EOL.$content); |
|
34 | 34 | @chmod($fileName, 0777); |
35 | 35 | } |
36 | 36 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function dumpVariableToCache(string $name, $variable) |
42 | 42 | { |
43 | - $this->dumpCacheFile($name, 'return ' . var_export($variable, true) . ';'); |
|
43 | + $this->dumpCacheFile($name, 'return '.var_export($variable, true).';'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -49,6 +49,6 @@ discard block |
||
49 | 49 | */ |
50 | 50 | private function getCacheFileName($name) |
51 | 51 | { |
52 | - return ROOT . 'cache/' . basename($name, '.php') . '.php'; |
|
52 | + return ROOT.'cache/'.basename($name, '.php').'.php'; |
|
53 | 53 | } |
54 | 54 | } |