Code Duplication    Length = 10-12 lines in 2 locations

src/JsonRepository.php 1 location

@@ 336-347 (lines=12) @@
333
    /**
334
     * {@inheritdoc}
335
     */
336
    protected function getReferencesInDirectory($path, $flags = 0)
337
    {
338
        $basePath = rtrim($path, '/');
339
340
        return $this->getReferencesForRegex(
341
            $basePath.'/',
342
            '~^'.preg_quote($basePath, '~').'/[^/]+$~',
343
            $flags,
344
            // Limit the directory exploration to the depth of the path + 1
345
            $this->getPathDepth($path) + 1
346
        );
347
    }
348
349
    /**
350
     * Flattens a two-level reference array into a one-level array.

src/OptimizedJsonRepository.php 1 location

@@ 223-232 (lines=10) @@
220
    /**
221
     * {@inheritdoc}
222
     */
223
    protected function getReferencesInDirectory($path, $flags = 0)
224
    {
225
        $basePath = rtrim($path, '/');
226
227
        return $this->getReferencesForRegex(
228
            $basePath.'/',
229
            '~^'.preg_quote($basePath, '~').'/[^/]+$~',
230
            $flags
231
        );
232
    }
233
234
    /**
235
     * {@inheritdoc}