Code Duplication    Length = 4-4 lines in 2 locations

lib/Service/RedisService.php 2 locations

@@ 164-167 (lines=4) @@
161
     * @return \Redis
162
     */
163
    private function setupRedisInstance() {
164
        if (!extension_loaded('redis')) {
165
            $this->logger->debug(
166
                    'It seems that the message queueing capabilities are not available in your local php installation. Please install php-redis.');
167
            throw new NotFoundException($this->l10n->t('Message queueing capabilities are missing on the server.'));
168
        }
169
        $redis = new \Redis();
170
        if (!$redis->connect($this->redisHost, $this->redisPort, 2.5, NULL, 100)) {
@@ 174-177 (lines=4) @@
171
            $this->logger->debug('Cannot connect to Redis.');
172
            throw new NotFoundException($this->l10n->t('Cannot connect to Redis.'));
173
        }
174
        if (!$redis->select($this->redisDb)) {
175
            $this->logger->debug('Cannot connect to the right Redis database.');
176
            throw new NotFoundException($this->l10n->t('Cannot connect to the right Redis database.'));
177
        }
178
        $redis->setOption(\Redis::OPT_PREFIX, OcrConstants::REDIS_KEY_PREFIX);
179
        return $redis;
180
    }