Code Duplication    Length = 9-9 lines in 2 locations

src/CacheManager.php 1 location

@@ 211-219 (lines=9) @@
208
     */
209
    final public function setNamespace($namespace) {
210
211
        if ( preg_match('/^[0-9a-zA-Z]+$/', $namespace) && strlen($namespace) <= 64 ) {
212
            
213
            $this->namespace = strtoupper($namespace);
214
            
215
        } else {
216
            
217
            throw new CacheException("Invalid namespace");
218
            
219
        }
220
221
        foreach ( $this->caches as $cache ) $cache->setNamespace($namespace);
222

src/CacheObject/CacheObject.php 1 location

@@ 281-289 (lines=9) @@
278
     */
279
    final public function setNamespace($namespace) {
280
281
        if ( preg_match('/^[0-9a-zA-Z]+$/', $namespace) && strlen($namespace) <= 64 ) {
282
            
283
            $this->namespace = strtoupper($namespace);
284
            
285
        } else {
286
            
287
            throw new CacheException("Invalid namespace");
288
            
289
        }
290
291
        return $this;
292