Code Duplication    Length = 10-14 lines in 2 locations

src/JsonRepository.php 1 location

@@ 283-296 (lines=14) @@
280
    /**
281
     * {@inheritdoc}
282
     */
283
    protected function getReferencesInDirectory($path, $stopOnFirst = false)
284
    {
285
        $basePath = rtrim($path, '/');
286
287
        return $this->getReferencesForRegex(
288
            $basePath.'/',
289
            '~^'.preg_quote($basePath, '~').'/[^/]+$~',
290
            $stopOnFirst,
291
            // Traverse directories and match their contents against the glob
292
            true,
293
            // Limit the directory exploration to the depth of the path + 1
294
            $this->getPathDepth($path) + 1
295
        );
296
    }
297
298
    /**
299
     * Flattens a two-level reference array into a one-level array.

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}