RedirectResponse::getStatusCode()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 2
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Basster\LazyResponseBundle\Response;
5
6
/**
7
 * Class RedirectResponse.
8
 */
9
final class RedirectResponse implements LazyResponseInterface
10
{
11 3
    public function __construct(private string $routeName, private array $routeParams = [], private bool $isPermanent = false, private array $headers = [])
0 ignored issues
show
Unused Code introduced by
The parameter $headers is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

11
    public function __construct(private string $routeName, private array $routeParams = [], private bool $isPermanent = false, /** @scrutinizer ignore-unused */ private array $headers = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $isPermanent is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

11
    public function __construct(private string $routeName, private array $routeParams = [], /** @scrutinizer ignore-unused */ private bool $isPermanent = false, private array $headers = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $routeParams is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

11
    public function __construct(private string $routeName, /** @scrutinizer ignore-unused */ private array $routeParams = [], private bool $isPermanent = false, private array $headers = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $routeName is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

11
    public function __construct(/** @scrutinizer ignore-unused */ private string $routeName, private array $routeParams = [], private bool $isPermanent = false, private array $headers = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
    {
13 3
    }
14
15 3
    public function getRouteName(): string
16
    {
17 3
        return $this->routeName;
18
    }
19
20 3
    public function getRouteParams(): array
21
    {
22 3
        return $this->routeParams;
23
    }
24
25 3
    public function getStatusCode(): int
26
    {
27 3
        return $this->isPermanent ? 301 : 302;
28
    }
29
30 3
    public function getHeaders(): array
31
    {
32 3
        return $this->headers;
33
    }
34
}
35