Code Duplication    Length = 10-10 lines in 2 locations

src/Mouf/Database/TDBM/TDBMService.php 1 location

@@ 1365-1374 (lines=10) @@
1362
     *
1363
     * @return mixed
1364
     */
1365
    private function fromCache(string $key, callable $closure)
1366
    {
1367
        $item = $this->cache->fetch($key);
1368
        if ($item === false) {
1369
            $item = $closure();
1370
            $this->cache->save($key, $item);
1371
        }
1372
1373
        return $item;
1374
    }
1375
1376
    /**
1377
     * Returns the foreign key object.

src/Mouf/Database/TDBM/QueryFactory/FindObjectsFromSqlQueryFactory.php 1 location

@@ 172-181 (lines=10) @@
169
     *
170
     * @return mixed
171
     */
172
    protected function fromCache(string $key, callable $closure)
173
    {
174
        $item = $this->cache->fetch($key);
175
        if ($item === false) {
176
            $item = $closure();
177
            $this->cache->save($key, $item);
178
        }
179
180
        return $item;
181
    }
182
}
183