Skip to content

Commit fd73939

Browse files
94nonijaviereguiluz
authored andcommitted
Update serializer.rst
1 parent bb06b33 commit fd73939

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

components/serializer.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,20 @@ exists in your project::
7474

7575
class Person
7676
{
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;
8181

8282
// Getters
83-
public function getName()
83+
public function getAge(): int
8484
{
85-
return $this->name;
85+
return $this->age;
8686
}
8787

88-
public function getAge()
88+
public function getName(): string
8989
{
90-
return $this->age;
90+
return $this->name;
9191
}
9292

9393
public function getCreatedAt()
@@ -96,28 +96,28 @@ exists in your project::
9696
}
9797

9898
// Issers
99-
public function isSportsperson()
99+
public function isSportsperson(): bool
100100
{
101101
return $this->sportsperson;
102102
}
103103

104104
// Setters
105-
public function setName($name)
105+
public function setName(string $name): void
106106
{
107107
$this->name = $name;
108108
}
109109

110-
public function setAge($age)
110+
public function setAge(int $age): void
111111
{
112112
$this->age = $age;
113113
}
114114

115-
public function setSportsperson($sportsperson)
115+
public function setSportsperson(bool $sportsperson): void
116116
{
117117
$this->sportsperson = $sportsperson;
118118
}
119119

120-
public function setCreatedAt($createdAt)
120+
public function setCreatedAt(\DateTime $createdAt = null): void
121121
{
122122
$this->createdAt = $createdAt;
123123
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy