Code Duplication    Length = 12-12 lines in 2 locations

lib/ComponentManager/PackageRepository/MoodlePackageRepository.php 1 location

@@ 150-161 (lines=12) @@
147
    /**
148
     * @inheritdoc CachingPackageRepository
149
     */
150
    public function metadataCacheLastRefreshed() {
151
        $filename = $this->getMetadataCacheFilename();
152
153
        if (!$this->filesystem->exists($filename)) {
154
            return null;
155
        }
156
157
        $time = new DateTime();
158
        $time->setTimestamp(filemtime($filename));
159
160
        return $time;
161
    }
162
163
    /**
164
     * @inheritdoc CachingPackageRepository

lib/ComponentManager/PackageRepository/StashPackageRepository.php 1 location

@@ 226-237 (lines=12) @@
223
    /**
224
     * @inheritdoc CachingPackageRepository
225
     */
226
    public function metadataCacheLastRefreshed() {
227
        $filename = $this->getMetadataCacheFilename();
228
229
        if (!$this->filesystem->exists($filename)) {
230
            return null;
231
        }
232
233
        $time = new DateTime();
234
        $time->setTimestamp(filemtime($filename));
235
236
        return $time;
237
    }
238
239
    /**
240
     * @inheritdoc CachingPackageRepository