@@ -106,9 +106,9 @@ public function clear()
106
106
{
107
107
$ this ->deferred = [];
108
108
if ($ cleared = $ this ->versioningIsEnabled ) {
109
- $ namespaceVersion = substr_replace (base64_encode (pack ('V ' , mt_rand ())), static ::getNsSeparator () , 5 );
109
+ $ namespaceVersion = substr_replace (base64_encode (pack ('V ' , mt_rand ())), static ::NS_SEPARATOR , 5 );
110
110
try {
111
- $ cleared = $ this ->doSave ([static ::getNsSeparator () .$ this ->namespace => $ namespaceVersion ], 0 );
111
+ $ cleared = $ this ->doSave ([static ::NS_SEPARATOR .$ this ->namespace => $ namespaceVersion ], 0 );
112
112
} catch (\Exception $ e ) {
113
113
$ cleared = false ;
114
114
}
@@ -235,14 +235,14 @@ private function getId($key)
235
235
CacheItem::validateKey ($ key );
236
236
237
237
if ($ this ->versioningIsEnabled && '' === $ this ->namespaceVersion ) {
238
- $ this ->namespaceVersion = '1 ' .static ::getNsSeparator () ;
238
+ $ this ->namespaceVersion = '1 ' .static ::NS_SEPARATOR ;
239
239
try {
240
- foreach ($ this ->doFetch ([static ::getNsSeparator () .$ this ->namespace ]) as $ v ) {
240
+ foreach ($ this ->doFetch ([static ::NS_SEPARATOR .$ this ->namespace ]) as $ v ) {
241
241
$ this ->namespaceVersion = $ v ;
242
242
}
243
- if ('1 ' .static ::getNsSeparator () === $ this ->namespaceVersion ) {
244
- $ this ->namespaceVersion = substr_replace (base64_encode (pack ('V ' , time ())), static ::getNsSeparator () , 5 );
245
- $ this ->doSave ([static ::getNsSeparator () .$ this ->namespace => $ this ->namespaceVersion ], 0 );
243
+ if ('1 ' .static ::NS_SEPARATOR === $ this ->namespaceVersion ) {
244
+ $ this ->namespaceVersion = substr_replace (base64_encode (pack ('V ' , time ())), static ::NS_SEPARATOR , 5 );
245
+ $ this ->doSave ([static ::NS_SEPARATOR .$ this ->namespace => $ this ->namespaceVersion ], 0 );
246
246
}
247
247
} catch (\Exception $ e ) {
248
248
}
@@ -252,7 +252,7 @@ private function getId($key)
252
252
return $ this ->namespace .$ this ->namespaceVersion .$ key ;
253
253
}
254
254
if (\strlen ($ id = $ this ->namespace .$ this ->namespaceVersion .$ key ) > $ this ->maxIdLength ) {
255
- $ id = $ this ->namespace .$ this ->namespaceVersion .substr_replace (base64_encode (hash ('sha256 ' , $ key , true )), static ::getNsSeparator () , -(\strlen ($ this ->namespaceVersion ) + 22 ));
255
+ $ id = $ this ->namespace .$ this ->namespaceVersion .substr_replace (base64_encode (hash ('sha256 ' , $ key , true )), static ::NS_SEPARATOR , -(\strlen ($ this ->namespaceVersion ) + 22 ));
256
256
}
257
257
258
258
return $ id ;
@@ -265,14 +265,4 @@ public static function handleUnserializeCallback($class)
265
265
{
266
266
throw new \DomainException ('Class not found: ' .$ class );
267
267
}
268
-
269
- /**
270
- * @return string the namespace separator for cache keys
271
- *
272
- * @internal
273
- */
274
- protected static function getNsSeparator ()
275
- {
276
- return ': ' ;
277
- }
278
268
}
0 commit comments