Code Duplication    Length = 13-15 lines in 2 locations

src/Jarboe/Table/Fields/Adapters/RepeaterFile.php 1 location

@@ 25-39 (lines=15) @@
22
        return $this->field->$method(...$parameters);
23
    }
24
25
    public function getPaths($model): array
26
    {
27
        if (is_null($model)) {
28
            return [];
29
        }
30
31
        $filepath = $this->getAttribute($model);
32
        // FIXME: mb change structure for storing files data?
33
        $filepath = $this->sanitizeRepeaterValue($filepath);
34
        if (!$filepath) {
35
            return [];
36
        }
37
38
        return is_array($filepath) ? $filepath : [$filepath];
39
    }
40
41
    private function sanitizeRepeaterValue($filepath)
42
    {

src/Jarboe/Table/Fields/File.php 1 location

@@ 84-96 (lines=13) @@
81
        ]);
82
    }
83
84
    public function getPaths($model): array
85
    {
86
        if (is_null($model)) {
87
            return [];
88
        }
89
90
        $filepath = $this->getAttribute($model);
91
        if (!$filepath) {
92
            return [];
93
        }
94
95
        return is_array($filepath) ? $filepath : [$filepath];
96
    }
97
98
    public function formUrl(string $path)
99
    {