Code Duplication    Length = 10-14 lines in 2 locations

src/OptimizedJsonRepository.php 1 location

@@ 163-172 (lines=10) @@
160
    /**
161
     * {@inheritdoc}
162
     */
163
    protected function getReferencesInDirectory($path, $stopOnFirst = false)
164
    {
165
        $basePath = rtrim($path, '/');
166
167
        return $this->getReferencesForRegex(
168
            $basePath.'/',
169
            '~^'.preg_quote($basePath, '~').'/[^/]+$~',
170
            $stopOnFirst
171
        );
172
    }
173
174
    /**
175
     * {@inheritdoc}

src/JsonRepository.php 1 location

@@ 315-328 (lines=14) @@
312
    /**
313
     * {@inheritdoc}
314
     */
315
    protected function getReferencesInDirectory($path, $stopOnFirst = false)
316
    {
317
        $basePath = rtrim($path, '/');
318
319
        return $this->getReferencesForRegex(
320
            $basePath.'/',
321
            '~^'.preg_quote($basePath, '~').'/[^/]+$~',
322
            $stopOnFirst,
323
            // Traverse directories and match their contents against the glob
324
            true,
325
            // Limit the directory exploration to the depth of the path + 1
326
            $this->getPathDepth($path) + 1
327
        );
328
    }
329
330
    /**
331
     * Flattens a two-level reference array into a one-level array.