Code Duplication    Length = 13-13 lines in 2 locations

php/class-except.php 2 locations

@@ 30-42 (lines=13) @@
27
     * @param array $pluginsDirectories Names of plugin folders to watch for
28
     *                                  Notices & Warnings.
29
     */
30
    public static function pluginsDirectories($plugins) {
31
        $plugins = func_get_args();
32
        
33
        if(empty($plugins)) {
34
            throw new InvalidArgumentException('Pass plugins folder names to watch for Notices & Warnings');
35
        }
36
37
        $plugins = array_map(function($plugin){
38
            return '@plugins/' . preg_quote($plugin, '@') . '@';
39
        }, $plugins);
40
41
        return new self($plugins);
42
    }
43
44
    /**
45
     * Constructor
@@ 50-62 (lines=13) @@
47
     * @param array $themesDirectories Names of theme folders to watch for
48
     *                                 Notices and Warnings.
49
     */
50
    public static function themesDirectories() {
51
        $themes = func_get_args();
52
        
53
        if(empty($themes)) {
54
            throw new InvalidArgumentException('Pass themes folder names to watch for Notices & Warnings');
55
        }
56
57
        $themes = array_map(function($theme){
58
            return '@themes/' . preg_quote($theme, '@') . '@';
59
        }, $themes);
60
61
        return new self($themes);
62
    }
63
64
    /**
65
     * Constructor