Code Duplication    Length = 10-10 lines in 2 locations

src/Filesystem/src/Filesystem.php 2 locations

@@ 101-110 (lines=10) @@
98
    /**
99
     * @inheritDoc
100
     */
101
    public function listDirectories(string $path = '.', bool $recursive = false): array
102
    {
103
        return array_map(
104
            function ($item) {
105
                return new Metadata($item);
106
            },
107
            array_filter(
108
                $this->flysystem->listContents($path, $recursive),
109
                function ($item) {
110
                    return $item['type'] === MetadataContract::TYPE_DIR;
111
                }
112
            )
113
        );
@@ 119-128 (lines=10) @@
116
    /**
117
     * @inheritDoc
118
     */
119
    public function listFiles(string $path = '.', bool $recursive = false): array
120
    {
121
        return array_map(
122
            function ($item) {
123
                return new Metadata($item);
124
            },
125
            array_filter(
126
                $this->flysystem->listContents($path, $recursive),
127
                function ($item) {
128
                    return $item['type'] === MetadataContract::TYPE_FILE;
129
                }
130
            )
131
        );