@@ -29,7 +29,7 @@ class DebugEngine extends CacheEngine
2929 /**
3030 * Proxied engine
3131 */
32- protected CacheEngine $ _engine ;
32+ protected CacheEngine $ engine ;
3333
3434 protected LoggerInterface $ logger ;
3535
@@ -57,9 +57,9 @@ class DebugEngine extends CacheEngine
5757 public function __construct (CacheEngine |array $ config , string $ name , LoggerInterface $ logger )
5858 {
5959 if ($ config instanceof CacheEngine) {
60- $ this ->_engine = $ config ;
60+ $ this ->engine = $ config ;
6161 } else {
62- $ this ->_config = $ config ;
62+ $ this ->config = $ config ;
6363 }
6464
6565 $ this ->logger = $ logger ;
@@ -74,9 +74,9 @@ public function __construct(CacheEngine|array $config, string $name, LoggerInter
7474 */
7575 public function init (array $ config = []): bool
7676 {
77- if (!isset ($ this ->_engine )) {
77+ if (!isset ($ this ->engine )) {
7878 $ registry = new CacheRegistry ();
79- $ this ->_engine = $ registry ->load ('spies ' , $ this ->_config );
79+ $ this ->engine = $ registry ->load ('spies ' , $ this ->config );
8080 unset($ registry );
8181 }
8282
@@ -90,7 +90,7 @@ public function init(array $config = []): bool
9090 */
9191 public function engine (): CacheEngine
9292 {
93- return $ this ->_engine ;
93+ return $ this ->engine ;
9494 }
9595
9696 /**
@@ -135,7 +135,7 @@ protected function log(string $operation, float $duration, ?string $key = null):
135135 public function set ($ key , $ value , $ ttl = null ): bool
136136 {
137137 $ start = microtime (true );
138- $ result = $ this ->_engine ->set ($ key , $ value , $ ttl );
138+ $ result = $ this ->engine ->set ($ key , $ value , $ ttl );
139139 $ duration = microtime (true ) - $ start ;
140140
141141 $ this ->track ('set ' );
@@ -150,7 +150,7 @@ public function set($key, $value, $ttl = null): bool
150150 public function setMultiple ($ values , $ ttl = null ): bool
151151 {
152152 $ start = microtime (true );
153- $ result = $ this ->_engine ->setMultiple ($ values );
153+ $ result = $ this ->engine ->setMultiple ($ values );
154154 $ duration = microtime (true ) - $ start ;
155155
156156 $ this ->track ('set ' );
@@ -165,7 +165,7 @@ public function setMultiple($values, $ttl = null): bool
165165 public function get (string $ key , mixed $ default = null ): mixed
166166 {
167167 $ start = microtime (true );
168- $ result = $ this ->_engine ->get ($ key , $ default );
168+ $ result = $ this ->engine ->get ($ key , $ default );
169169 $ duration = microtime (true ) - $ start ;
170170 $ metric = 'hit ' ;
171171 if ($ result === null ) {
@@ -184,7 +184,7 @@ public function get(string $key, mixed $default = null): mixed
184184 public function getMultiple ($ keys , $ default = null ): iterable
185185 {
186186 $ start = microtime (true );
187- $ result = $ this ->_engine ->getMultiple ($ keys , $ default );
187+ $ result = $ this ->engine ->getMultiple ($ keys , $ default );
188188 $ duration = microtime (true ) - $ start ;
189189
190190 $ this ->track ('get hit ' );
@@ -199,7 +199,7 @@ public function getMultiple($keys, $default = null): iterable
199199 public function increment (string $ key , int $ offset = 1 ): int |false
200200 {
201201 $ start = microtime (true );
202- $ result = $ this ->_engine ->increment ($ key , $ offset );
202+ $ result = $ this ->engine ->increment ($ key , $ offset );
203203 $ duration = microtime (true ) - $ start ;
204204
205205 $ this ->track ('set ' );
@@ -214,7 +214,7 @@ public function increment(string $key, int $offset = 1): int|false
214214 public function decrement (string $ key , int $ offset = 1 ): int |false
215215 {
216216 $ start = microtime (true );
217- $ result = $ this ->_engine ->decrement ($ key , $ offset );
217+ $ result = $ this ->engine ->decrement ($ key , $ offset );
218218 $ duration = microtime (true ) - $ start ;
219219
220220 $ this ->track ('set ' );
@@ -229,7 +229,7 @@ public function decrement(string $key, int $offset = 1): int|false
229229 public function delete ($ key ): bool
230230 {
231231 $ start = microtime (true );
232- $ result = $ this ->_engine ->delete ($ key );
232+ $ result = $ this ->engine ->delete ($ key );
233233 $ duration = microtime (true ) - $ start ;
234234
235235 $ this ->track ('delete ' );
@@ -244,7 +244,7 @@ public function delete($key): bool
244244 public function deleteMultiple ($ keys ): bool
245245 {
246246 $ start = microtime (true );
247- $ result = $ this ->_engine ->deleteMultiple ($ keys );
247+ $ result = $ this ->engine ->deleteMultiple ($ keys );
248248 $ duration = microtime (true ) - $ start ;
249249
250250 $ this ->track ('delete ' );
@@ -259,7 +259,7 @@ public function deleteMultiple($keys): bool
259259 public function clear (): bool
260260 {
261261 $ start = microtime (true );
262- $ result = $ this ->_engine ->clear ();
262+ $ result = $ this ->engine ->clear ();
263263 $ duration = microtime (true ) - $ start ;
264264
265265 $ this ->track ('delete ' );
@@ -273,7 +273,7 @@ public function clear(): bool
273273 */
274274 public function groups (): array
275275 {
276- return $ this ->_engine ->groups ();
276+ return $ this ->engine ->groups ();
277277 }
278278
279279 /**
@@ -285,7 +285,7 @@ public function groups(): array
285285 */
286286 public function getConfig (?string $ key = null , mixed $ default = null ): mixed
287287 {
288- return $ this ->_engine ->getConfig ($ key , $ default );
288+ return $ this ->engine ->getConfig ($ key , $ default );
289289 }
290290
291291 /**
@@ -297,9 +297,9 @@ public function getConfig(?string $key = null, mixed $default = null): mixed
297297 * @return $this
298298 * @throws \Cake\Core\Exception\CakeException When trying to set a key that is invalid.
299299 */
300- public function setConfig (array |string $ key , mixed $ value = null , bool $ merge = true )
300+ public function setConfig (array |string $ key , mixed $ value = null , bool $ merge = true ): static
301301 {
302- $ this ->_engine ->setConfig ($ key , $ value , $ merge );
302+ $ this ->engine ->setConfig ($ key , $ value , $ merge );
303303
304304 return $ this ;
305305 }
@@ -310,7 +310,7 @@ public function setConfig(array|string $key, mixed $value = null, bool $merge =
310310 public function clearGroup (string $ group ): bool
311311 {
312312 $ start = microtime (true );
313- $ result = $ this ->_engine ->clearGroup ($ group );
313+ $ result = $ this ->engine ->clearGroup ($ group );
314314 $ duration = microtime (true ) - $ start ;
315315
316316 $ this ->track ('delete ' );
@@ -326,13 +326,13 @@ public function clearGroup(string $group): bool
326326 */
327327 public function __toString (): string
328328 {
329- if (isset ($ this ->_engine )) {
329+ if (isset ($ this ->engine )) {
330330 // phpcs:ignore SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable
331- [$ ns , $ class ] = namespaceSplit ($ this ->_engine ::class);
331+ [$ ns , $ class ] = namespaceSplit ($ this ->engine ::class);
332332
333333 return str_replace ('Engine ' , '' , $ class );
334334 }
335335
336- return $ this ->_config ['className ' ];
336+ return $ this ->config ['className ' ];
337337 }
338338}
0 commit comments