Code Duplication    Length = 11-11 lines in 2 locations

Tests/MemcachedTest.php 1 location

@@ 65-75 (lines=11) @@
62
				$server = new \stdClass;
63
64
				// Parse each part and populate the options array.
65
				foreach ($parts as $part)
66
				{
67
					list ($k, $v) = explode('=', $part, 2);
68
					switch ($k)
69
					{
70
						case 'host':
71
						case 'port':
72
							$server->$k = $v;
73
							break;
74
					}
75
				}
76
				$options['memcache.servers'] = array($server);
77
			}
78

Tests/RedisTest.php 1 location

@@ 297-307 (lines=11) @@
294
			$parts = explode(';', $dsn);
295
296
			// Parse each part and populate the options array.
297
			foreach ($parts as $part)
298
			{
299
				list ($k, $v) = explode('=', $part, 2);
300
				switch ($k)
301
				{
302
					case 'host':
303
					case 'port':
304
						$options['redis.' . $k] = $v;
305
						break;
306
				}
307
			}
308
309
			$this->cacheOptions = $options;
310
		}