@@ -19,7 +19,7 @@ |
||
19 | 19 | if (count($pathParts) > 1) { |
20 | 20 | unset($pathParts[count($pathParts) - 1]); |
21 | 21 | $this->logFileDir = implode('/', $pathParts); |
22 | - if (! file_exists($this->logFileDir)) { |
|
22 | + if (!file_exists($this->logFileDir)) { |
|
23 | 23 | mkdir($this->logFileDir); |
24 | 24 | } |
25 | 25 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $socket = socket_create($socketType, SOCK_STREAM, 0); |
44 | 44 | socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1); |
45 | 45 | $bindResult = socket_bind($socket, $this->location, $this->serverPort); |
46 | - if (! $bindResult) { |
|
46 | + if (!$bindResult) { |
|
47 | 47 | $errorCode = socket_last_error($socket); |
48 | 48 | $errorMsg = socket_strerror($errorCode); |
49 | 49 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $this->location, |
74 | 74 | $this->serverPort |
75 | 75 | ); |
76 | - if (! $connectionResult) { |
|
76 | + if (!$connectionResult) { |
|
77 | 77 | $errorCode = socket_last_error($socket); |
78 | 78 | $errorMsg = socket_strerror($errorCode); |
79 | 79 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | /* @var $client CacheClient */ |
44 | 44 | $client = $this->serviceManager->get(CacheClient::class); |
45 | 45 | $table = (new Table($output))->setHeaders(['KEY', 'VALUE']); |
46 | - if (! is_null($key)) { |
|
46 | + if (!is_null($key)) { |
|
47 | 47 | $value = $client->get($key); |
48 | 48 | if ($value === false) { |
49 | 49 | $output->writeln('<comment>No entry found for key: '.$key.'</comment>'); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | public function get(string $key): ?string |
22 | 22 | { |
23 | - if (! array_key_exists($key, $this->entries) && ! $this->existsInBackup($key)) { |
|
23 | + if (!array_key_exists($key, $this->entries) && !$this->existsInBackup($key)) { |
|
24 | 24 | return null; |
25 | 25 | } |
26 | 26 | if ($this->existsInBackup($key)) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $contents = ''; |
47 | 47 | $handle = fopen($this->backupDir.'/'.$key.'.dat', 'r+'); |
48 | 48 | if (is_resource($handle)) { |
49 | - while (! feof($handle)) { |
|
49 | + while (!feof($handle)) { |
|
50 | 50 | $contents .= fread($handle, 32); |
51 | 51 | } |
52 | 52 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $compressed = gzcompress($entry, 9); |
60 | 60 | $this->entries[$key]['content'] = $compressed; |
61 | 61 | $this->entries[$key]['created_time'] = is_null($time) ? time() : $time; |
62 | - if (! $compressed) { |
|
62 | + if (!$compressed) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 |
@@ -78,7 +78,7 @@ |
||
78 | 78 | |
79 | 79 | private function createBackupDir(): void |
80 | 80 | { |
81 | - if (! file_exists($this->backupDir)) { |
|
81 | + if (!file_exists($this->backupDir)) { |
|
82 | 82 | mkdir($this->backupDir); |
83 | 83 | } |
84 | 84 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $config = $container->getConfig(); |
15 | 15 | $backupDir = $config['backupDir']; |
16 | 16 | $bucket = new Bucket($backupDir); |
17 | - if (! file_exists($backupDir)) { |
|
17 | + if (!file_exists($backupDir)) { |
|
18 | 18 | return $bucket; |
19 | 19 | } |
20 | 20 | |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | private function restoreFromBackup($bucket, $backupDir) |
25 | 25 | { |
26 | 26 | foreach (new \DirectoryIterator($backupDir) as $file) { |
27 | - if (! $file->isDot() && $file->isFile()) { |
|
27 | + if (!$file->isDot() && $file->isFile()) { |
|
28 | 28 | $keyParts = explode('.', $file->getFilename()); |
29 | 29 | $key = $keyParts[0]; |
30 | 30 | $handle = $file->openFile('r'); |
31 | 31 | $contents = ''; |
32 | - while (! $handle->eof()) { |
|
32 | + while (!$handle->eof()) { |
|
33 | 33 | $contents .= $handle->fread(128); |
34 | 34 | } |
35 | 35 | if ($contents != '') { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | ): ?bool { |
17 | 17 | $action = $data['action']; |
18 | 18 | $functionName = 'handle'.ucfirst($action); |
19 | - if (! method_exists($this, $functionName)) { |
|
19 | + if (!method_exists($this, $functionName)) { |
|
20 | 20 | return false; |
21 | 21 | } |
22 | 22 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ): bool { |
49 | 49 | $key = $data['key']; |
50 | 50 | $package = $server->getBucket()->get($key); |
51 | - if (! $package) { |
|
51 | + if (!$package) { |
|
52 | 52 | return false; |
53 | 53 | } |
54 | 54 | if ($server->getEventListener()) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ): bool { |
68 | 68 | $key = $data['key']; |
69 | 69 | $package = $server->getBucket()->get($key); |
70 | - if (! $package) { |
|
70 | + if (!$package) { |
|
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | if ($server->getEventListener()) { |