Code Duplication    Length = 35-35 lines in 2 locations

src/Exercise/FilteredLs.php 1 location

@@ 52-86 (lines=35) @@
49
    /**
50
     * @return array
51
     */
52
    public function getArgs()
53
    {
54
        $folder = $this->getTemporaryPath();
55
56
        $files = [
57
            "learnyouphp.dat",
58
            "learnyouphp.txt",
59
            "learnyouphp.sql",
60
            "api.html",
61
            "README.md",
62
            "CHANGELOG.md",
63
            "LICENCE.md",
64
            "md",
65
            "data.json",
66
            "data.dat",
67
            "words.dat",
68
            "w00t.dat",
69
            "w00t.txt",
70
            "wrrrrongdat",
71
            "dat",
72
        ];
73
74
        $this->filesystem->mkdir($folder);
75
        array_walk($files, function ($file) use ($folder) {
76
            $this->filesystem->dumpFile(sprintf('%s/%s', $folder, $file), '');
77
        });
78
79
        $ext = '';
80
        while ($ext === '') {
81
            $index = array_rand($files);
82
            $ext = pathinfo($files[$index], PATHINFO_EXTENSION);
83
        }
84
85
        return [$folder, $ext];
86
    }
87
88
    /**
89
     * @return null

src/Exercise/ConcernedAboutSeparation.php 1 location

@@ 78-112 (lines=35) @@
75
    /**
76
     * @return array
77
     */
78
    public function getArgs()
79
    {
80
        $folder = $this->getTemporaryPath();
81
82
        $files = [
83
            "learnyouphp.dat",
84
            "learnyouphp.txt",
85
            "learnyouphp.sql",
86
            "api.html",
87
            "README.md",
88
            "CHANGELOG.md",
89
            "LICENCE.md",
90
            "md",
91
            "data.json",
92
            "data.dat",
93
            "words.dat",
94
            "w00t.dat",
95
            "w00t.txt",
96
            "wrrrrongdat",
97
            "dat",
98
        ];
99
100
        $this->filesystem->mkdir($folder);
101
        array_walk($files, function ($file) use ($folder) {
102
            $this->filesystem->dumpFile(sprintf('%s/%s', $folder, $file), '');
103
        });
104
105
        $ext = '';
106
        while ($ext === '') {
107
            $index = array_rand($files);
108
            $ext = pathinfo($files[$index], PATHINFO_EXTENSION);
109
        }
110
111
        return [$folder, $ext];
112
    }
113
114
    /**
115
     * @return SolutionInterface