tuupola / cors-middleware
Showing 1 of 4 files from the diff.

@@ -223,9 +223,9 @@
Loading
223 223
        $serverOrigin = $this->determineServerOrigin();
224 224
225 225
        $settings->init(
226 -
            $serverOrigin['scheme'],
227 -
            $serverOrigin['host'],
228 -
            $serverOrigin['port']
226 +
            $serverOrigin["scheme"],
227 +
            $serverOrigin["host"],
228 +
            $serverOrigin["port"]
229 229
        );
230 230
231 231
        $settings->setAllowedOrigins($this->options["origin"]);
@@ -261,14 +261,14 @@
Loading
261 261
     */
262 262
    private function determineServerOrigin(): array
263 263
    {
264 -
        // set some default
264 +
        /* Set defaults */
265 265
        $url = [
266 -
            'scheme' => 'https',
267 -
            'host' => '',
268 -
            'port' => self::PORT_HTTPS,
266 +
            "scheme" => "https",
267 +
            "host" => "",
268 +
            "port" => self::PORT_HTTPS,
269 269
        ];
270 270
271 -
        // load details from server origin
271 +
        /* Load details from server origin */
272 272
        if (is_string($this->options["origin.server"])) {
273 273
            /** @var false|array{scheme: string, host: string, port?: int} $url_chunks */
274 274
            $url_chunks = parse_url($this->options["origin.server"]);
@@ -276,8 +276,8 @@
Loading
276 276
                $url = $url_chunks;
277 277
            }
278 278
279 -
            if (!array_key_exists('port', $url)) {
280 -
                $url['port'] = $url['scheme'] === 'https' ? self::PORT_HTTPS : self::PORT_HTTP;
279 +
            if (!array_key_exists("port", $url)) {
280 +
                $url["port"] = $url["scheme"] === "https" ? self::PORT_HTTPS : self::PORT_HTTP;
281 281
            }
282 282
        }
283 283
@@ -292,11 +292,12 @@
Loading
292 292
    private function fixHeaders(array $headers): array
293 293
    {
294 294
        if (isset($headers[CorsResponseHeaders::EXPOSE_HEADERS])) {
295 -
            $headers[CorsResponseHeaders::EXPOSE_HEADERS] = str_replace(
296 -
                ' ',
297 -
                '',
298 -
                $headers[CorsResponseHeaders::EXPOSE_HEADERS]
299 -
            );
295 +
            $headers[CorsResponseHeaders::EXPOSE_HEADERS] =
296 +
                str_replace(
297 +
                    " ",
298 +
                    "",
299 +
                    $headers[CorsResponseHeaders::EXPOSE_HEADERS]
300 +
                );
300 301
        }
301 302
302 303
        return $headers;
Files Complexity Coverage
src 49 99.24%
Project Totals (2 files) 49 99.24%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading