@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | const DOMAIN = 'messages'; |
16 | - const LANG_DIR = ROOT . '/cache/lang/'; |
|
16 | + const LANG_DIR = ROOT.'/cache/lang/'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @var string[] |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function getTokens() |
63 | 63 | { |
64 | - return array_map(function (string $locale) { |
|
65 | - return 'locale.' . $locale; |
|
64 | + return array_map(function(string $locale) { |
|
65 | + return 'locale.'.$locale; |
|
66 | 66 | }, $this->locales); |
67 | 67 | } |
68 | 68 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $host = parse_url($url, PHP_URL_HOST) ?: $request->getHost(); |
66 | 66 | |
67 | 67 | if ($port) { |
68 | - $host .= ':' . $port; |
|
68 | + $host .= ':'.$port; |
|
69 | 69 | } |
70 | 70 | $allowed[] = $host; |
71 | 71 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | foreach ($logLevels as $file => $level) { |
36 | 36 | $definition->addMethodCall('pushHandler', [ |
37 | 37 | new Definition(StreamHandler::class, [ |
38 | - $baseDir . $file, |
|
38 | + $baseDir.$file, |
|
39 | 39 | $level |
40 | 40 | ]) |
41 | 41 | ]); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $fileName = $this->getCacheFileName($name); |
32 | 32 | |
33 | - file_put_contents($fileName, "<?php \n//@codingStandardsIgnoreFile" . PHP_EOL . $content); |
|
33 | + file_put_contents($fileName, "<?php \n//@codingStandardsIgnoreFile".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 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | class CompilerPass implements CompilerPassInterface |
18 | 18 | { |
19 | 19 | |
20 | - const CACHE_FILE = ROOT . 'cache/translation_token'; |
|
20 | + const CACHE_FILE = ROOT.'cache/translation_token'; |
|
21 | 21 | const TAG = 'middleware'; |
22 | 22 | |
23 | 23 | use FileCacheTrait; |
@@ -93,16 +93,16 @@ discard block |
||
93 | 93 | { |
94 | 94 | ksort($tokens); |
95 | 95 | |
96 | - $contentPhp = sprintf("return [\n %s\n];\n", implode(",\n ", array_map(function (Token $token) { |
|
96 | + $contentPhp = sprintf("return [\n %s\n];\n", implode(",\n ", array_map(function(Token $token) { |
|
97 | 97 | return sprintf('_("%s")', addslashes($token->token)); |
98 | 98 | }, $tokens))); |
99 | 99 | |
100 | - $contentHtml = sprintf("%s", implode("\n", array_map(function (Token $token) { |
|
100 | + $contentHtml = sprintf("%s", implode("\n", array_map(function(Token $token) { |
|
101 | 101 | return sprintf('<span translate>%s</span>', addslashes($token->token)); |
102 | 102 | }, $tokens))); |
103 | 103 | |
104 | 104 | $this->dumpCacheFile(self::CACHE_FILE, $contentPhp); |
105 | - file_put_contents(self::CACHE_FILE . '.html', $contentHtml); |
|
106 | - chmod(self::CACHE_FILE . '.html', 0777); |
|
105 | + file_put_contents(self::CACHE_FILE.'.html', $contentHtml); |
|
106 | + chmod(self::CACHE_FILE.'.html', 0777); |
|
107 | 107 | } |
108 | 108 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @param int $userId |
57 | - * @return array[]|Generator |
|
57 | + * @return Generator |
|
58 | 58 | */ |
59 | 59 | public function getTokensForUser(int $userId) |
60 | 60 | { |
@@ -105,7 +105,7 @@ |
||
105 | 105 | /** |
106 | 106 | * @param string $eventType |
107 | 107 | * @param int $since |
108 | - * @return Generator|Job[] |
|
108 | + * @return Generator |
|
109 | 109 | */ |
110 | 110 | public function getEventsByTypeGenerator(string $eventType = null, int $since = 0) : Generator |
111 | 111 | { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function addEvent(AbstractEvent $event, int $timestamp = 0) : Job |
61 | 61 | { |
62 | - $jobId = $this->generateUniqueId('jobid:' . $event->getEventName()); |
|
62 | + $jobId = $this->generateUniqueId('jobid:'.$event->getEventName()); |
|
63 | 63 | $jobId = sprintf('%s:%s', $event->getEventName(), $jobId); |
64 | 64 | |
65 | 65 | $job = new Job($event, $jobId, $timestamp); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $pipeline = $this->getRedis()->pipeline(['fire-and-forget' => true]); |
81 | 81 | if (empty($job->timestamp)) { |
82 | 82 | // immediate execution in background |
83 | - $pipeline->lpush(self::QUEUE_IMMEDIATE, $job->jobId . '#' . $serialized); |
|
83 | + $pipeline->lpush(self::QUEUE_IMMEDIATE, $job->jobId.'#'.$serialized); |
|
84 | 84 | } else { |
85 | 85 | // delayed execution |
86 | 86 | $pipeline->hset(self::META_DATA, $job->jobId, $serialized); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | $keys = []; |
122 | 122 | foreach ($resultRaw as $jobId => $timestamp) { |
123 | - if (empty($eventType) || strpos($jobId, $eventType . ":") === 0) { |
|
123 | + if (empty($eventType) || strpos($jobId, $eventType.":") === 0) { |
|
124 | 124 | $keys[$jobId] = $timestamp; |
125 | 125 | } |
126 | 126 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $immediate = $this->getRedis()->lrange(self::QUEUE_IMMEDIATE, 0, 100); |
178 | 178 | foreach ($immediate as $rawJob) { |
179 | 179 | list($jobId, $rawJob) = explode('#', $rawJob, 2); |
180 | - if (empty($eventType) || strpos($jobId, $eventType . ":") === 0) { |
|
180 | + if (empty($eventType) || strpos($jobId, $eventType.":") === 0) { |
|
181 | 181 | /** @var Job $job */ |
182 | 182 | $job = unserialize(base64_decode($rawJob)); |
183 | 183 | yield $job->jobId => $job; |
@@ -16,14 +16,14 @@ |
||
16 | 16 | */ |
17 | 17 | public function boot() : Container |
18 | 18 | { |
19 | - $fileName = ROOT . 'cache/dic.php'; |
|
19 | + $fileName = ROOT.'cache/dic.php'; |
|
20 | 20 | /** @var Container $dic */ |
21 | 21 | if (!is_file($fileName)) { |
22 | 22 | $rebuild = new Rebuild(); |
23 | 23 | $rebuild->buildContainer(); |
24 | 24 | } |
25 | 25 | |
26 | - $className = file_get_contents(ROOT . 'cache/dic.txt'); |
|
26 | + $className = file_get_contents(ROOT.'cache/dic.txt'); |
|
27 | 27 | if (!class_exists($className, false)) { |
28 | 28 | include $fileName; |
29 | 29 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function __construct(string $type, Job $job) |
28 | 28 | { |
29 | 29 | parent::__construct($type); |
30 | - $this->job = $job; |
|
30 | + $this->job = $job; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |