GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 25-25 lines in 2 locations

src/Application.php 1 location

@@ 194-218 (lines=25) @@
191
     * @param string[] $hooks
192
     * @return void
193
     */
194
    public function loadRoutesFromPath($fromPath, $namespace = '', $hooks=[])
195
    {
196
        $dir = @dir($fromPath) or abort("dir $fromPath not exist");
197
198
        $getEach = function () use ($dir) {
199
            $name = $dir->read();
200
            if (!$name) {
201
                return $name;
202
            }
203
            return $name;
204
        };
205
206
        while (!!($entry = $getEach())) {
207
            if ($entry == '.' || $entry == '..') {
208
                continue;
209
            }
210
            $path = $fromPath . '/' . str_replace('\\', '/', $entry);
211
            if (is_file($path) && substr_compare($entry, '.php', strlen($entry) - 4, 4, true) == 0) {
212
                $class_name = $namespace . '\\' . substr($entry, 0, strlen($entry) - 4);
213
                $this->loadRoutesFromClass($class_name, $hooks);
214
            } else {
215
                //\Log::debug($path.' ignored');
216
            }
217
        }
218
    }
219
220
    /**
221
     * Add route

src/Console.php 1 location

@@ 53-77 (lines=25) @@
50
     * @param string $namespace
51
     * @throws \Exception
52
     */
53
    public function loadRoutesFromPath($fromPath, $namespace = '')
54
    {
55
        $dir = @dir($fromPath) or abort("dir $fromPath not exist");
56
57
        $getEach = function () use ($dir) {
58
            $name = $dir->read();
59
            if (!$name) {
60
                return $name;
61
            }
62
            return $name;
63
        };
64
65
        while (!!($entry = $getEach())) {
66
            if ($entry == '.' || $entry == '..') {
67
                continue;
68
            }
69
            $path = $fromPath . '/' . str_replace('\\', '/', $entry);
70
            if (is_file($path) && substr_compare($entry, '.php', strlen($entry) - 4, 4, true) == 0) {
71
                $class_name = $namespace . '\\' . substr($entry, 0, strlen($entry) - 4);
72
                $this->loadCommandsFromClass($class_name);
73
            } else {
74
                //\Log::debug($path.' ignored');
75
            }
76
        }
77
    }
78
79
}