File tree 1 file changed +13
-13
lines changed
1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -74,20 +74,20 @@ exists in your project::
74
74
75
75
class Person
76
76
{
77
- private $age;
78
- private $name;
79
- private $sportsperson;
80
- private $createdAt;
77
+ private int $age;
78
+ private string $name;
79
+ private bool $sportsperson;
80
+ private ?\DateTime $createdAt;
81
81
82
82
// Getters
83
- public function getName()
83
+ public function getAge(): int
84
84
{
85
- return $this->name ;
85
+ return $this->age ;
86
86
}
87
87
88
- public function getAge()
88
+ public function getName(): string
89
89
{
90
- return $this->age ;
90
+ return $this->name ;
91
91
}
92
92
93
93
public function getCreatedAt()
@@ -96,28 +96,28 @@ exists in your project::
96
96
}
97
97
98
98
// Issers
99
- public function isSportsperson()
99
+ public function isSportsperson(): bool
100
100
{
101
101
return $this->sportsperson;
102
102
}
103
103
104
104
// Setters
105
- public function setName($name)
105
+ public function setName(string $name): void
106
106
{
107
107
$this->name = $name;
108
108
}
109
109
110
- public function setAge($age)
110
+ public function setAge(int $age): void
111
111
{
112
112
$this->age = $age;
113
113
}
114
114
115
- public function setSportsperson($sportsperson)
115
+ public function setSportsperson(bool $sportsperson): void
116
116
{
117
117
$this->sportsperson = $sportsperson;
118
118
}
119
119
120
- public function setCreatedAt($createdAt)
120
+ public function setCreatedAt(\DateTime $createdAt = null): void
121
121
{
122
122
$this->createdAt = $createdAt;
123
123
}
You can’t perform that action at this time.
0 commit comments