Code Duplication    Length = 6-6 lines in 2 locations

lib/Service/RedisService.php 2 locations

@@ 108-113 (lines=6) @@
105
	 * @return \Redis
106
	 */
107
	private function setupRedisInstance() {
108
		if (! extension_loaded ( 'redis' )) {
109
			$this->logger->debug ( 'It seems that the message queueing capabilities are not available in your local php installation. Please install php-redis.', [ 
110
					'app' => 'ocr' 
111
			] );
112
			throw new NotFoundException ( $this->l10n->t ( 'Message queueing capabilities are missing on the server.' ) );
113
		}
114
		
115
		$redis = new \Redis ();
116
		// TODO: get from config
@@ 123-128 (lines=6) @@
120
			] );
121
			throw new NotFoundException ( $this->l10n->t ( 'Cannot connect to Redis.' ) );
122
		}
123
		if (! $redis->select ( 0 )) {
124
			$this->logger->debug ( 'Cannot connect to the right Redis database.', [
125
					'app' => 'ocr'
126
			] );
127
			throw new NotFoundException ( $this->l10n->t ( 'Cannot connect to the right Redis database.' ) );
128
		}
129
		$redis->setOption ( \Redis::OPT_PREFIX, 'ocr:' );
130
		
131
		return $redis;