Code Duplication    Length = 10-10 lines in 2 locations

src/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

src/TDBMService.php 1 location

@@ 1398-1407 (lines=10) @@
1395
     *
1396
     * @return mixed
1397
     */
1398
    private function fromCache(string $key, callable $closure)
1399
    {
1400
        $item = $this->cache->fetch($key);
1401
        if ($item === false) {
1402
            $item = $closure();
1403
            $this->cache->save($key, $item);
1404
        }
1405
1406
        return $item;
1407
    }
1408
1409
    /**
1410
     * Returns the foreign key object.