Code Duplication    Length = 11-11 lines in 2 locations

src/Http/Traits/BrowsableTrait.php 1 location

@@ 26-36 (lines=11) @@
23
     *
24
     * @return array
25
     */
26
    public function getFileDirectories()
27
    {
28
        $mediaFiles['/'] = '/';
29
        $path            = storage_path($this->mediaPath);
30
        foreach ($this->getFiles($path)->directories() as $file) {
31
            $strFile              = str_replace($path, '', $file->getRealPath());
32
            $mediaFiles[$strFile] = $strFile;
33
        }
34
35
        return $mediaFiles;
36
    }
37
38
    /**
39
     * Show all files on selected path.

src/Providers/ViewComposerServiceProvider.php 1 location

@@ 77-87 (lines=11) @@
74
     *
75
     * @return array
76
     */
77
    protected function getFileDirectories()
78
    {
79
        $mediaFiles['/'] = '/';
80
        $path            = storage_path($this->mediaPath);
81
        foreach ($this->getFiles($path)->directories() as $file) {
82
            $strFile              = str_replace($path, '', $file->getRealPath());
83
            $mediaFiles[$strFile] = $strFile;
84
        }
85
86
        return $mediaFiles;
87
    }
88
89
    /**
90
     * Symfony file finder.