Code Duplication    Length = 8-11 lines in 2 locations

src/AbstractJsonRepository.php 1 location

@@ 135-145 (lines=11) @@
132
133
        $path = $this->sanitizePath($path);
134
135
        if ($resource instanceof ResourceCollection) {
136
            $this->ensureDirectoryExists($path);
137
138
            foreach ($resource as $child) {
139
                $this->addResource($path.'/'.$child->getName(), $child);
140
            }
141
142
            $this->flush();
143
144
            return;
145
        }
146
147
        $this->ensureDirectoryExists(Path::getDirectory($path));
148

src/FilesystemRepository.php 1 location

@@ 226-233 (lines=8) @@
223
    {
224
        $path = $this->sanitizePath($path);
225
226
        if ($resource instanceof ResourceCollection) {
227
            $this->ensureDirectoryExists($path);
228
            foreach ($resource as $child) {
229
                $this->addResource($path.'/'.$child->getName(), $child);
230
            }
231
232
            return;
233
        }
234
235
        if ($resource instanceof PuliResource) {
236
            $this->ensureDirectoryExists(Path::getDirectory($path));