Code Duplication    Length = 4-4 lines in 2 locations

src/Xtools/EditCounterRepository.php 1 location

@@ 599-602 (lines=4) @@
596
        $userId = $user->getId($project);
597
        $cacheKey = "automatedEdits.".$project->getDatabaseName().'.'.$userId;
598
        $this->stopwatch->start($cacheKey, 'XTools');
599
        if ($this->cache->hasItem($cacheKey)) {
600
            $this->log->debug("Using cache for $cacheKey");
601
            return $this->cache->getItem($cacheKey)->get();
602
        }
603
604
        /** @var AutomatedEditsHelper $automatedEditsHelper */
605
        $automatedEditsHelper = $this->container->get("app.automated_edits_helper");

src/Xtools/ProjectRepository.php 1 location

@@ 204-207 (lines=4) @@
201
202
        // Redis cache
203
        $cacheKey = "projectMetadata." . preg_replace("/[^A-Za-z0-9]/", '', $projectUrl);
204
        if ($this->cache->hasItem($cacheKey)) {
205
            $this->metadata = $this->cache->getItem($cacheKey)->get();
206
            return $this->metadata;
207
        }
208
209
        $api = MediawikiApi::newFromPage($projectUrl);
210