Passed
Push — master ( 122983...91227d )
by William
02:34 queued 26s
created
src/MoParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             return;
62 62
         }
63 63
 
64
-        if (! is_readable($this->filename)) {
64
+        if (!is_readable($this->filename)) {
65 65
             $this->error = self::ERROR_DOES_NOT_EXIST;
66 66
 
67 67
             return;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             $translations = $stream->readint($unpack, 16);
88 88
 
89 89
             /* get original and translations tables */
90
-            $totalTimesTwo = (int) ($total * 2);// Fix for issue #36 on ARM
90
+            $totalTimesTwo = (int) ($total * 2); // Fix for issue #36 on ARM
91 91
             $tableOriginals = $stream->readintarray($unpack, $originals, $totalTimesTwo);
92 92
             $tableTranslations = $stream->readintarray($unpack, $translations, $totalTimesTwo);
93 93
 
Please login to merge, or discard this patch.
tests/Cache/ApcuCacheTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $msgid = 'Column';
128 128
 
129 129
         $lock = 'mo_' . $locale . '.' . $domain . '.' . ApcuCache::LOADED_KEY;
130
-        apcu_entry($lock, static function () {
130
+        apcu_entry($lock, static function() {
131 131
             sleep(1);
132 132
 
133 133
             return 1;
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $method->setAccessible(true);
203 203
 
204 204
         $key = 'mo_' . $locale . '.' . $domain . '.' . $msgid;
205
-        apcu_entry($key, static function () use ($expected): string {
205
+        apcu_entry($key, static function() use ($expected): string {
206 206
             sleep(1);
207 207
 
208 208
             return $expected;
Please login to merge, or discard this patch.
src/Cache/ApcuCache.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         bool $reloadOnMiss = true,
46 46
         string $prefix = 'mo_'
47 47
     ) {
48
-        if (! (function_exists('apcu_enabled') && apcu_enabled())) {
48
+        if (!(function_exists('apcu_enabled') && apcu_enabled())) {
49 49
             throw new CacheException('ACPu extension must be installed and enabled');
50 50
         }
51 51
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             return $msgstr;
67 67
         }
68 68
 
69
-        if (! $this->reloadOnMiss) {
69
+        if (!$this->reloadOnMiss) {
70 70
             return $msgid;
71 71
         }
72 72
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     private function reloadOnMiss(string $msgid): string
77 77
     {
78 78
         // store original if translation is not present
79
-        $cached = apcu_entry($this->getKey($msgid), static function () use ($msgid) {
79
+        $cached = apcu_entry($this->getKey($msgid), static function() use ($msgid) {
80 80
             return $msgid;
81 81
         }, $this->ttl);
82 82
         // if another process has updated cache, return early
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     public function setAll(array $translations): void
106 106
     {
107
-        $keys = array_map(function (string $msgid): string {
107
+        $keys = array_map(function(string $msgid): string {
108 108
             return $this->getKey($msgid);
109 109
         }, array_keys($translations));
110 110
         $translations = array_combine($keys, $translations);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         // Try to prevent cache slam if multiple processes are trying to load translations. There is still a race
124 124
         // between the exists check and creating the entry, but at least it's small
125 125
         $key = $this->getKey(self::LOADED_KEY);
126
-        $loaded = apcu_exists($key) || apcu_entry($key, static function (): int {
126
+        $loaded = apcu_exists($key) || apcu_entry($key, static function(): int {
127 127
             return 0;
128 128
         }, $this->ttl);
129 129
         if ($loaded) {
Please login to merge, or discard this patch.
src/Translator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function __construct($cache)
113 113
     {
114
-        if (! $cache instanceof CacheInterface) {
114
+        if (!$cache instanceof CacheInterface) {
115 115
             $cache = new InMemoryCache(new MoParser($cache));
116 116
         }
117 117
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     {
283 283
         // this should contains all strings separated by NULLs
284 284
         $key = implode(chr(0), [$msgid, $msgidPlural]);
285
-        if (! $this->cache->has($key)) {
285
+        if (!$this->cache->has($key)) {
286 286
             return $number !== 1 ? $msgidPlural : $msgid;
287 287
         }
288 288
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         // @codeCoverageIgnoreEnd
303 303
 
304
-        if (! isset($list[$select])) {
304
+        if (!isset($list[$select])) {
305 305
             return $list[0];
306 306
         }
307 307
 
Please login to merge, or discard this patch.