Passed
Pull Request — main (#25)
by Sílvio
02:46
created
src/CacheStore/ArrayCacheStore.php 1 patch
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 class ArrayCacheStore implements CacheerInterface
14 14
 {
15 15
 
16
-  /**
17
-  * @param array $arrayStore
18
-  */
19
-  private array $arrayStore = [];
16
+    /**
17
+     * @param array $arrayStore
18
+     */
19
+    private array $arrayStore = [];
20 20
 
21 21
     /**
22 22
      * @param boolean
@@ -33,26 +33,26 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private $logger = null;
35 35
 
36
-  public function __construct(string $logPath)
37
-  {
36
+    public function __construct(string $logPath)
37
+    {
38 38
     $this->logger = new CacheLogger($logPath);
39
-  }
39
+    }
40 40
 
41
-  /**
42
-  * @param string $cacheKey
43
-  * @param string $namespace
44
-  * @param int|string $ttl
45
-  * @return mixed
46
-  */
47
-  public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600)
48
-  {
41
+    /**
42
+     * @param string $cacheKey
43
+     * @param string $namespace
44
+     * @param int|string $ttl
45
+     * @return mixed
46
+     */
47
+    public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600)
48
+    {
49 49
 
50 50
     $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
51 51
 
52 52
     if (!$this->has($cacheKey, $namespace)) {
53
-      $this->setMessage("cacheData not found, does not exists or expired", false);
54
-      $this->logger->debug("{$this->getMessage()} from array driver.");
55
-      return false;
53
+        $this->setMessage("cacheData not found, does not exists or expired", false);
54
+        $this->logger->debug("{$this->getMessage()} from array driver.");
55
+        return false;
56 56
     }
57 57
 
58 58
     $cacheData = $this->arrayStore[$arrayStoreKey];
@@ -60,102 +60,102 @@  discard block
 block discarded – undo
60 60
     $now = time();
61 61
 
62 62
     if($expirationTime !== 0 && $now >= $expirationTime) {
63
-      list($np, $key) = explode(':', $arrayStoreKey);
64
-      $this->clearCache($key, $np);
65
-      $this->setMessage("cacheKey: {$key} has expired.", false);
66
-      $this->logger->debug("{$this->getMessage()} from array driver.");
67
-      return false;
63
+        list($np, $key) = explode(':', $arrayStoreKey);
64
+        $this->clearCache($key, $np);
65
+        $this->setMessage("cacheKey: {$key} has expired.", false);
66
+        $this->logger->debug("{$this->getMessage()} from array driver.");
67
+        return false;
68 68
     }
69 69
 
70 70
     $this->setMessage("Cache retrieved successfully", true);
71 71
     $this->logger->debug("{$this->getMessage()} from array driver.");
72 72
     return $this->serialize($cacheData['cacheData'], false);
73
-  }
74
-
75
-  /**
76
-  * @param string $cacheKey
77
-  * @param mixed $cacheData
78
-  * @param string $namespace
79
-  * @param int|string $ttl
80
-  * @return bool
81
-  */
82
-  public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600)
83
-  {
73
+    }
74
+
75
+    /**
76
+     * @param string $cacheKey
77
+     * @param mixed $cacheData
78
+     * @param string $namespace
79
+     * @param int|string $ttl
80
+     * @return bool
81
+     */
82
+    public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600)
83
+    {
84 84
 
85 85
     $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
86 86
 
87 87
     $this->arrayStore[$arrayStoreKey] = [
88
-      'cacheData' => serialize($cacheData),
89
-      'expirationTime' => time() + $ttl
88
+        'cacheData' => serialize($cacheData),
89
+        'expirationTime' => time() + $ttl
90 90
     ];
91 91
 
92 92
     $this->setMessage("Cache stored successfully", true);
93 93
     $this->logger->debug("{$this->getMessage()} from Array driver.");
94 94
     return true;
95
-  }
95
+    }
96 96
 
97
-  /**
98
-  * @param array $items
99
-  * @param string $namespace
100
-  * @param int $batchSize
101
-  * @return void
102
-  */
103
-  public function putMany(array $items, string $namespace = '', int $batchSize = 100)
104
-  {
97
+    /**
98
+     * @param array $items
99
+     * @param string $namespace
100
+     * @param int $batchSize
101
+     * @return void
102
+     */
103
+    public function putMany(array $items, string $namespace = '', int $batchSize = 100)
104
+    {
105 105
 
106 106
     $chunks = array_chunk($items, $batchSize, true);
107 107
 
108 108
     foreach ($chunks as $chunk) {
109
-      foreach ($chunk as $key => $data) {
110
-          $this->putCache($data['cacheKey'], $data['cacheData'], $namespace);
109
+        foreach ($chunk as $key => $data) {
110
+            $this->putCache($data['cacheKey'], $data['cacheData'], $namespace);
111
+        }
111 112
         }
112
-      }
113 113
     $this->setMessage("{$this->getMessage()}", $this->isSuccess());
114 114
     $this->logger->debug("{$this->getMessage()} from Array driver.");
115
-  }
116
-
117
-  /**
118
-  * @param string $cacheKey
119
-  * @param mixed  $cacheData
120
-  * @param string $namespace
121
-  * @return bool
122
-  */
123
-  public function appendCache(string $cacheKey, mixed $cacheData, string $namespace = '')
124
-  {
125
-      $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
126
-
127
-      if (!$this->has($cacheKey, $namespace)) {
128
-          $this->setMessage("cacheData can't be appended, because doesn't exist or expired", false);
129
-          $this->logger->debug("{$this->getMessage()} from array driver.");
130
-          return false;
131
-      }
132
-
133
-      $this->arrayStore[$arrayStoreKey]['cacheData'] = serialize($cacheData);
134
-      $this->setMessage("Cache appended successfully", true);
135
-      return true;
136
-  }
137
-
138
-
139
-
140
-  /**
141
-  * @param string $cacheKey
142
-  * @param string $namespace
143
-  * @return bool
144
-  */
145
-  public function has(string $cacheKey, string $namespace = '')
146
-  {
115
+    }
116
+
117
+    /**
118
+     * @param string $cacheKey
119
+     * @param mixed  $cacheData
120
+     * @param string $namespace
121
+     * @return bool
122
+     */
123
+    public function appendCache(string $cacheKey, mixed $cacheData, string $namespace = '')
124
+    {
125
+        $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
126
+
127
+        if (!$this->has($cacheKey, $namespace)) {
128
+            $this->setMessage("cacheData can't be appended, because doesn't exist or expired", false);
129
+            $this->logger->debug("{$this->getMessage()} from array driver.");
130
+            return false;
131
+        }
132
+
133
+        $this->arrayStore[$arrayStoreKey]['cacheData'] = serialize($cacheData);
134
+        $this->setMessage("Cache appended successfully", true);
135
+        return true;
136
+    }
137
+
138
+
139
+
140
+    /**
141
+     * @param string $cacheKey
142
+     * @param string $namespace
143
+     * @return bool
144
+     */
145
+    public function has(string $cacheKey, string $namespace = '')
146
+    {
147 147
     $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
148 148
     return isset($this->arrayStore[$arrayStoreKey]) && time() < $this->arrayStore[$arrayStoreKey]['expirationTime'];
149
-  }
150
-
151
-  /**
152
-  * @param string $cacheKey
153
-  * @param int|string $ttl
154
-  * @param string $namespace
155
-  * @return void
156
-  */
157
-  public function renewCache(string $cacheKey, int|string $ttl = 3600, string $namespace = '')
158
-  {
149
+    }
150
+
151
+    /**
152
+     * @param string $cacheKey
153
+     * @param int|string $ttl
154
+     * @param string $namespace
155
+     * @return void
156
+     */
157
+    public function renewCache(string $cacheKey, int|string $ttl = 3600, string $namespace = '')
158
+    {
159 159
     $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
160 160
 
161 161
     if (isset($this->arrayStore[$arrayStoreKey])) {
@@ -163,33 +163,33 @@  discard block
 block discarded – undo
163 163
         $this->arrayStore[$arrayStoreKey]['expirationTime'] = time() + $ttlSeconds;
164 164
         $this->setMessage("cacheKey: {$cacheKey} renewed successfully", true);
165 165
         $this->logger->debug("{$this->getMessage()} from array driver.");
166
-      }
167
-  }
166
+        }
167
+    }
168 168
   
169
-  /**
170
-  * @param string $cacheKey
171
-  * @param string $namespace
172
-  * @return void
173
-  */
174
-  public function clearCache(string $cacheKey, string $namespace = '')
175
-  {
169
+    /**
170
+     * @param string $cacheKey
171
+     * @param string $namespace
172
+     * @return void
173
+     */
174
+    public function clearCache(string $cacheKey, string $namespace = '')
175
+    {
176 176
     $arrayStoreKey = $this->buildArrayKey($cacheKey, $namespace);
177 177
     unset($this->arrayStore[$arrayStoreKey]);
178 178
     $this->setMessage("Cache cleared successfully", true);
179 179
     $this->logger->debug("{$this->getMessage()} from array driver.");
180 180
 
181
-  }
181
+    }
182 182
 
183
-  /**
184
-  * @return void
185
-  */
186
-  public function flushCache()
187
-  {
183
+    /**
184
+     * @return void
185
+     */
186
+    public function flushCache()
187
+    {
188 188
     unset($this->arrayStore);
189 189
     $this->arrayStore = [];
190 190
     $this->setMessage("Cache flushed successfully", true);
191 191
     $this->logger->debug("{$this->getMessage()} from array driver.");
192
-  }
192
+    }
193 193
     
194 194
     /**
195 195
      * @param string  $message
@@ -219,24 +219,24 @@  discard block
 block discarded – undo
219 219
         return $this->success;
220 220
     }
221 221
 
222
-  /**
223
-  * @param string $cacheKey
224
-  * @param string $namespace
225
-  * @return string
226
-  */
227
-  private function buildArrayKey(string $cacheKey, string $namespace = '')
228
-  {
222
+    /**
223
+     * @param string $cacheKey
224
+     * @param string $namespace
225
+     * @return string
226
+     */
227
+    private function buildArrayKey(string $cacheKey, string $namespace = '')
228
+    {
229 229
     return !empty($namespace) ? ($namespace . ':' . $cacheKey) : $cacheKey;
230
-  }
231
-
232
-  /**
233
-  * @param mixed $data
234
-  * @param bool $serialize
235
-  * @return mixed
236
-  */
237
-  private function serialize(mixed $data, bool $serialize = true)
238
-  {
230
+    }
231
+
232
+    /**
233
+     * @param mixed $data
234
+     * @param bool $serialize
235
+     * @return mixed
236
+     */
237
+    private function serialize(mixed $data, bool $serialize = true)
238
+    {
239 239
     return $serialize ? serialize($data) : unserialize($data);
240
-  }
240
+    }
241 241
 
242 242
 }
Please login to merge, or discard this patch.
src/Cacheer.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
     /**
134
-    * @param string $cacheKey
135
-    * @param int $amount
136
-    * @param string $namespace
137
-    * @return bool
138
-    */
134
+     * @param string $cacheKey
135
+     * @param int $amount
136
+     * @param string $namespace
137
+     * @return bool
138
+     */
139 139
     public function increment(string $cacheKey, int $amount = 1, string $namespace = '')
140 140
     {
141 141
         $cacheData = $this->getCache($cacheKey, $namespace);
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
     }
151 151
 
152 152
     /**
153
-    * @param string $cacheKey
154
-    * @param int $amount
155
-    * @param string $namespace
156
-    * @return bool
157
-    */
153
+     * @param string $cacheKey
154
+     * @param int $amount
155
+     * @param string $namespace
156
+     * @return bool
157
+     */
158 158
     public function decrement(string $cacheKey, int $amount = 1, string $namespace = '')
159 159
     {
160
-      return $this->increment($cacheKey, ($amount * -1), $namespace);
160
+        return $this->increment($cacheKey, ($amount * -1), $namespace);
161 161
     }
162 162
     /**
163
-    * @param string $cacheKey
164
-    * @param mixed $cacheData
165
-    * @return void
166
-    */
163
+     * @param string $cacheKey
164
+     * @param mixed $cacheData
165
+     * @return void
166
+     */
167 167
     public function forever(string $cacheKey, mixed $cacheData)
168 168
     {
169 169
         $this->putCache($cacheKey, $cacheData, ttl: 31536000 * 1000);
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
     }
172 172
 
173 173
     /**
174
-    * @param string $cacheKey
175
-    * @param int|string $ttl
176
-    * @param Closure $callback
177
-    * @return mixed
178
-    */
174
+     * @param string $cacheKey
175
+     * @param int|string $ttl
176
+     * @param Closure $callback
177
+     * @return mixed
178
+     */
179 179
     public function remember(string $cacheKey, int|string $ttl, Closure $callback)
180 180
     {
181 181
         $cachedData = $this->getCache($cacheKey, ttl: $ttl);
@@ -192,20 +192,20 @@  discard block
 block discarded – undo
192 192
     }
193 193
 
194 194
     /**
195
-    * @param string $cacheKey
196
-    * @param Closure $callback
197
-    * @return mixed
198
-    */
195
+     * @param string $cacheKey
196
+     * @param Closure $callback
197
+     * @return mixed
198
+     */
199 199
     public function rememberForever(string $cacheKey, Closure $callback)
200 200
     {
201 201
         return $this->remember($cacheKey, 31536000 * 1000, $callback);
202 202
     }
203 203
 
204 204
     /**
205
-    * @param string $cacheKey
206
-    * @param string $namespace
207
-    * @return mixed
208
-    */
205
+     * @param string $cacheKey
206
+     * @param string $namespace
207
+     * @return mixed
208
+     */
209 209
     public function getAndForget(string $cacheKey, string $namespace = '')
210 210
     {
211 211
         $cachedData = $this->getCache($cacheKey, $namespace);
@@ -219,12 +219,12 @@  discard block
 block discarded – undo
219 219
     }
220 220
 
221 221
     /**
222
-    * @param string $cacheKey
223
-    * @param mixed  $cacheData
224
-    * @param string $namespace
225
-    * @param int|string $ttl
226
-    * @return bool
227
-    */
222
+     * @param string $cacheKey
223
+     * @param mixed  $cacheData
224
+     * @param string $namespace
225
+     * @param int|string $ttl
226
+     * @return bool
227
+     */
228 228
     public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600)
229 229
     {
230 230
         if (!empty($this->getCache($cacheKey, $namespace))) {
Please login to merge, or discard this patch.
src/Core/ConnectionFactory.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
     /**
18
-      * @param array|null $database
19
-      * @return PDO|null
20
-    */
18
+     * @param array|null $database
19
+     * @return PDO|null
20
+     */
21 21
     public static function createConnection(?array $database = null)
22 22
     {
23 23
         $dbConf = $database ?? CACHEER_DATABASE_CONFIG[Connect::getConnection()];
Please login to merge, or discard this patch.
src/Core/Connect.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
     /**
21
-    * @param array|null $database
22
-    * @return PDO|null
23
-    */
21
+     * @param array|null $database
22
+     * @return PDO|null
23
+     */
24 24
     public static function getInstance(?array $database = null)
25 25
     {
26 26
         $pdo = ConnectionFactory::createConnection($database);
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
     }
32 32
 
33 33
     /**
34
-    * @param string $connection
35
-    * @return void
36
-    */
34
+     * @param string $connection
35
+     * @return void
36
+     */
37 37
     public static function setConnection(string $connection)
38 38
     {
39 39
         $drivers = ['mysql', 'sqlite', 'pgsql'];
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
     }
45 45
 
46 46
     /**
47
-    * @return string
48
-    */
47
+     * @return string
48
+     */
49 49
     public static function getConnection()
50 50
     {
51 51
         return self::$connection;
52 52
     }
53 53
 
54 54
     /**
55
-    * @return PDOException|null
56
-    */
55
+     * @return PDOException|null
56
+     */
57 57
     public static function getError()
58 58
     {
59 59
         return self::$error;
Please login to merge, or discard this patch.
src/Config/Option/Builder/OptionBuilder.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
11 11
  */
12 12
 class OptionBuilder
13 13
 {
14
-  /**
15
-  * @return FileOptionBuilder
16
-  */
17
-  public static function forFile() 
18
-  {
14
+    /**
15
+     * @return FileOptionBuilder
16
+     */
17
+    public static function forFile() 
18
+    {
19 19
     return new FileOptionBuilder();
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
src/Utils/CacheDriver.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     }
66 66
 
67 67
     /**
68
-    * @return Cacheer
69
-    */
68
+     * @return Cacheer
69
+     */
70 70
     public function useArrayDriver()
71 71
     {
72 72
         $this->cacheer->cacheStore = new ArrayCacheStore($this->logPath);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
     /**
77 77
      * @return Cacheer
78
-    */
78
+     */
79 79
     public function useDefaultDriver()
80 80
     {
81 81
         if (!isset($this->cacheer->options['cacheDir'])) {
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
     }
93 93
 
94 94
     /**
95
-    * @param mixed $dirName
96
-    * @return bool
97
-    */
95
+     * @param mixed $dirName
96
+     * @return bool
97
+     */
98 98
     private function isDir(mixed $dirName)
99 99
     {
100
-      if (is_dir($dirName)) {
101
-          return true;
102
-      }
103
-      return mkdir($dirName, 0755, true);
100
+        if (is_dir($dirName)) {
101
+            return true;
102
+        }
103
+        return mkdir($dirName, 0755, true);
104 104
     }
105 105
 }
Please login to merge, or discard this patch.
src/Helpers/CacheFileHelper.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
 {
15 15
 
16 16
     /**
17
-    * @param string $expiration
18
-    * @return int
19
-    */
17
+     * @param string $expiration
18
+     * @return int
19
+     */
20 20
     public static function convertExpirationToSeconds(string $expiration)
21 21
     {
22 22
         $units = [
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
     }
59 59
 
60 60
     /**
61
-    * @param string|int $ttl
62
-    * @param int $defaultTTL
63
-    * @return mixed
64
-    */
61
+     * @param string|int $ttl
62
+     * @param int $defaultTTL
63
+     * @return mixed
64
+     */
65 65
     public static function ttl($ttl = null, ?int $defaultTTL = null) {
66 66
         if ($ttl) {
67 67
             $ttl = is_string($ttl) ? self::convertExpirationToSeconds($ttl) : $ttl;
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
         return $ttl;
72 72
     }
73 73
 
74
-  /**
75
-  * @param mixed $currentCacheData
76
-  * @param mixed $cacheData
77
-  * @return array
78
-  */
79
-  public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData)
80
-  {
74
+    /**
75
+     * @param mixed $currentCacheData
76
+     * @param mixed $cacheData
77
+     * @return array
78
+     */
79
+    public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData)
80
+    {
81 81
     return CacheerHelper::arrayIdentifier($currentCacheData, $cacheData);
82
-  }
82
+    }
83 83
 }
Please login to merge, or discard this patch.
src/Helpers/CacheRedisHelper.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,20 +13,20 @@  discard block
 block discarded – undo
13 13
 class CacheRedisHelper
14 14
 {
15 15
 
16
-  /**
17
-  * @param mixed $data
18
-  * @param bool  $serialize
19
-  * @return mixed
20
-  */
21
-  public static function serialize(mixed $data, bool $serialize = true)
22
-  {
16
+    /**
17
+     * @param mixed $data
18
+     * @param bool  $serialize
19
+     * @return mixed
20
+     */
21
+    public static function serialize(mixed $data, bool $serialize = true)
22
+    {
23 23
     if($serialize) {
24
-      return serialize($data);
24
+        return serialize($data);
25 25
     }
26 26
 
27 27
     return unserialize($data);
28 28
 
29
-  }
29
+    }
30 30
 
31 31
     /**
32 32
      * @param array $item
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
         return CacheerHelper::mergeCacheData($cacheData);
50 50
     }
51 51
 
52
-  /**
53
-    * @param mixed $currentCacheData
54
-    * @param mixed $cacheData
55
-    * @return array
56
-    */
57
-  public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData)
58
-  {
59
-      return CacheerHelper::arrayIdentifier($currentCacheData, $cacheData);
60
-  }
52
+    /**
53
+     * @param mixed $currentCacheData
54
+     * @param mixed $cacheData
55
+     * @return array
56
+     */
57
+    public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData)
58
+    {
59
+        return CacheerHelper::arrayIdentifier($currentCacheData, $cacheData);
60
+    }
61 61
 
62 62
 }
63 63
 
Please login to merge, or discard this patch.
src/CacheStore/CacheManager/FileCacheManager.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 {
16 16
 
17 17
     /**
18
-    * @param string $dir
19
-    * @return void
20
-    */
18
+     * @param string $dir
19
+     * @return void
20
+     */
21 21
     public function createDirectory(string $dir)
22 22
     {
23 23
         if ((!file_exists($dir) || !is_dir($dir)) && !mkdir($dir, 0755, true)) {
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
     }
27 27
 
28 28
     /**
29
-    * @param string $filename
30
-    * @param string $data
31
-    * @return void
32
-    */
29
+     * @param string $filename
30
+     * @param string $data
31
+     * @return void
32
+     */
33 33
     public function writeFile(string $filename, string $data)
34 34
     {
35 35
         if (!@file_put_contents($filename, $data, LOCK_EX)) {
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-    * @param string $filename
42
-    * @return string
43
-    */
41
+     * @param string $filename
42
+     * @return string
43
+     */
44 44
     public function readFile(string $filename)
45 45
     {
46 46
         if (!$this->fileExists($filename)) {
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
     }
51 51
 
52 52
     /**
53
-    * @param string $filename
54
-    * @return bool
55
-    */
53
+     * @param string $filename
54
+     * @return bool
55
+     */
56 56
     public function fileExists(string $filename)
57 57
     {
58 58
         return file_exists($filename);
59 59
     }
60 60
 
61 61
     /**
62
-    * @param string $filename
63
-    * @return void
64
-    */
62
+     * @param string $filename
63
+     * @return void
64
+     */
65 65
     public function removeFile(string $filename)
66 66
     {
67 67
         if (file_exists($filename)) {
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
     }
71 71
 
72 72
     /**
73
-    * @param string $dir
74
-    * @return void
75
-    */
73
+     * @param string $dir
74
+     * @return void
75
+     */
76 76
     public function clearDirectory(string $dir)
77 77
     {
78 78
         $iterator = new RecursiveIteratorIterator(
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
     }
87 87
 
88 88
     /**
89
-    * @param mixed $data
90
-    * @param bool $serialize
91
-    */
89
+     * @param mixed $data
90
+     * @param bool $serialize
91
+     */
92 92
     public function serialize(mixed $data, bool $serialize = true)
93 93
     {
94 94
         if($serialize) {
Please login to merge, or discard this patch.