Completed
Push — master ( 6cc2de...ecdd96 )
by Adrien
02:40
created

DefaultValue::setNameWithoutDefault()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
eloc 0
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLTests\Doctrine\Blog\Model\Special;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
9
use GraphQLTests\Doctrine\Blog\Model\Post;
10
11
/**
12
 * @ORM\Entity
13
 */
14
class DefaultValue extends AbstractModel
15
{
16
    /**
17
     * @ORM\Column(type="string")
18
     */
19
    private $nameWithDefaultValueOnField = 'jane';
0 ignored issues
show
introduced by
The private property $nameWithDefaultValueOnField is not used, and could be removed.
Loading history...
20
21
    /**
22
     * @ORM\Column(type="string")
23
     */
24
    private $nameWithDefaultValueOnArgumentOverrideField = 'field';
0 ignored issues
show
introduced by
The private property $nameWithDefaultValueOnArgumentOverrideField is not used, and could be removed.
Loading history...
25
26
    /**
27
     * @var string
28
     *
29
     * @ORM\Column(type="string", options={"default" = Post::STATUS_PRIVATE})
30
     */
31
    private $type = Post::STATUS_PRIVATE;
0 ignored issues
show
introduced by
The private property $type is not used, and could be removed.
Loading history...
32
33
    public function setNameWithoutDefault(string $name): void
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

33
    public function setNameWithoutDefault(/** @scrutinizer ignore-unused */ string $name): void

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...
34
    {
35
    }
36
37
    public function setNameWithDefaultValueOnField(string $name): void
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

37
    public function setNameWithDefaultValueOnField(/** @scrutinizer ignore-unused */ string $name): void

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...
38
    {
39
    }
40
41
    public function setNameWithDefaultValueOnArgument(string $name = 'john'): void
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

41
    public function setNameWithDefaultValueOnArgument(/** @scrutinizer ignore-unused */ string $name = 'john'): void

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...
42
    {
43
    }
44
45
    public function setNameWithDefaultValueOnArgumentOverrideField(string $name = 'argument'): void
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

45
    public function setNameWithDefaultValueOnArgumentOverrideField(/** @scrutinizer ignore-unused */ string $name = 'argument'): void

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...
46
    {
47
    }
48
49
    public function setNameWithDefaultValueOnArgumentNullable(string $name = null): void
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

49
    public function setNameWithDefaultValueOnArgumentNullable(/** @scrutinizer ignore-unused */ string $name = null): void

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...
50
    {
51
    }
52
53
    public function getNameWithoutDefault(string $name): string
54
    {
55
        return $name;
56
    }
57
58
    public function getNameWithDefaultValueOnArgument(string $name = 'john'): string
59
    {
60
        return $name;
61
    }
62
63
    public function getNameWithDefaultValueOnArgumentNullable(string $name = null): string
64
    {
65
        return $name ?? 'foo';
66
    }
67
}
68