@@ -107,9 +107,9 @@ public function clear()
107
107
{
108
108
$ this ->deferred = [];
109
109
if ($ cleared = $ this ->versioningIsEnabled ) {
110
- $ namespaceVersion = substr_replace (base64_encode (pack ('V ' , mt_rand ())), static ::getNsSeparator () , 5 );
110
+ $ namespaceVersion = substr_replace (base64_encode (pack ('V ' , mt_rand ())), static ::NS_SEPARATOR , 5 );
111
111
try {
112
- $ cleared = $ this ->doSave ([static ::getNsSeparator () .$ this ->namespace => $ namespaceVersion ], 0 );
112
+ $ cleared = $ this ->doSave ([static ::NS_SEPARATOR .$ this ->namespace => $ namespaceVersion ], 0 );
113
113
} catch (\Exception $ e ) {
114
114
$ cleared = false ;
115
115
}
@@ -242,14 +242,14 @@ private function getId($key)
242
242
{
243
243
if ($ this ->versioningIsEnabled && '' === $ this ->namespaceVersion ) {
244
244
$ this ->ids = [];
245
- $ this ->namespaceVersion = '1 ' .static ::getNsSeparator () ;
245
+ $ this ->namespaceVersion = '1 ' .static ::NS_SEPARATOR ;
246
246
try {
247
- foreach ($ this ->doFetch ([static ::getNsSeparator () .$ this ->namespace ]) as $ v ) {
247
+ foreach ($ this ->doFetch ([static ::NS_SEPARATOR .$ this ->namespace ]) as $ v ) {
248
248
$ this ->namespaceVersion = $ v ;
249
249
}
250
- if ('1 ' .static ::getNsSeparator () === $ this ->namespaceVersion ) {
251
- $ this ->namespaceVersion = substr_replace (base64_encode (pack ('V ' , time ())), static ::getNsSeparator () , 5 );
252
- $ this ->doSave ([static ::getNsSeparator () .$ this ->namespace => $ this ->namespaceVersion ], 0 );
250
+ if ('1 ' .static ::NS_SEPARATOR === $ this ->namespaceVersion ) {
251
+ $ this ->namespaceVersion = substr_replace (base64_encode (pack ('V ' , time ())), static ::NS_SEPARATOR , 5 );
252
+ $ this ->doSave ([static ::NS_SEPARATOR .$ this ->namespace => $ this ->namespaceVersion ], 0 );
253
253
}
254
254
} catch (\Exception $ e ) {
255
255
}
@@ -266,7 +266,7 @@ private function getId($key)
266
266
}
267
267
if (\strlen ($ id = $ this ->namespace .$ this ->namespaceVersion .$ key ) > $ this ->maxIdLength ) {
268
268
// Use MD5 to favor speed over security, which is not an issue here
269
- $ this ->ids [$ key ] = $ id = substr_replace (base64_encode (hash ('md5 ' , $ key , true )), static ::getNsSeparator () , -(\strlen ($ this ->namespaceVersion ) + 2 ));
269
+ $ this ->ids [$ key ] = $ id = substr_replace (base64_encode (hash ('md5 ' , $ key , true )), static ::NS_SEPARATOR , -(\strlen ($ this ->namespaceVersion ) + 2 ));
270
270
$ id = $ this ->namespace .$ this ->namespaceVersion .$ id ;
271
271
}
272
272
@@ -280,12 +280,4 @@ public static function handleUnserializeCallback($class)
280
280
{
281
281
throw new \DomainException ('Class not found: ' .$ class );
282
282
}
283
-
284
- /**
285
- * @return string the namespace separator for cache keys
286
- */
287
- protected static function getNsSeparator ()
288
- {
289
- return ': ' ;
290
- }
291
283
}
0 commit comments