Code Duplication    Length = 9-9 lines in 2 locations

module/Core/src/Application.php 1 location

@@ 182-190 (lines=9) @@
179
    {
180
        $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1));
181
        $route = isset($parseUrl['path']) ? $parseUrl['path']:null;
182
        if (is_file(__DIR__ . '/' . $route)) {
183
            if (substr($route, -4) == ".php") {
184
                require __DIR__ . '/' . $route;     // Include requested script files
185
                exit;
186
            }
187
            return false;           // Serve file as is
188
        } else {                    // Fallback to index.php
189
            $_GET["q"] = $route;    // Try to emulate the behaviour of a .htaccess here.
190
        }
191
        return true;
192
    }
193

module/Core/src/Yawik.php 1 location

@@ 147-155 (lines=9) @@
144
        if (php_sapi_name() == 'cli-server') {
145
            $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1));
146
            $route = isset($parseUrl['path']) ? $parseUrl['path']:null;
147
            if (is_file(__DIR__ . '/' . $route)) {
148
                if (substr($route, -4) == ".php") {
149
                    require __DIR__ . '/' . $route;     // Include requested script files
150
                    exit;
151
                }
152
                return false;           // Serve file as is
153
            } else {                    // Fallback to index.php
154
                $_GET["q"] = $route;    // Try to emulate the behaviour of a .htaccess here.
155
            }
156
        }
157
158
        return static::initApplication($appConfig)->run();