@@ -39,7 +39,7 @@ class Post
39
39
*
40
40
* See https://symfony.com/doc/current/best_practices/configuration.html#constants-vs-configuration-options
41
41
*/
42
- const NUM_ITEMS = 10 ;
42
+ public const NUM_ITEMS = 10 ;
43
43
44
44
/**
45
45
* @var int
@@ -138,7 +138,7 @@ public function getTitle(): ?string
138
138
return $ this ->title ;
139
139
}
140
140
141
- public function setTitle (string $ title ): void
141
+ public function setTitle (? string $ title ): void
142
142
{
143
143
$ this ->title = $ title ;
144
144
}
@@ -148,7 +148,7 @@ public function getSlug(): ?string
148
148
return $ this ->slug ;
149
149
}
150
150
151
- public function setSlug (string $ slug ): void
151
+ public function setSlug (? string $ slug ): void
152
152
{
153
153
$ this ->slug = $ slug ;
154
154
}
@@ -158,7 +158,7 @@ public function getContent(): ?string
158
158
return $ this ->content ;
159
159
}
160
160
161
- public function setContent (string $ content ): void
161
+ public function setContent (? string $ content ): void
162
162
{
163
163
$ this ->content = $ content ;
164
164
}
@@ -168,7 +168,7 @@ public function getPublishedAt(): \DateTime
168
168
return $ this ->publishedAt ;
169
169
}
170
170
171
- public function setPublishedAt (\DateTime $ publishedAt ): void
171
+ public function setPublishedAt (? \DateTime $ publishedAt ): void
172
172
{
173
173
$ this ->publishedAt = $ publishedAt ;
174
174
}
@@ -178,7 +178,7 @@ public function getAuthor(): User
178
178
return $ this ->author ;
179
179
}
180
180
181
- public function setAuthor (User $ author ): void
181
+ public function setAuthor (? User $ author ): void
182
182
{
183
183
$ this ->author = $ author ;
184
184
}
@@ -188,7 +188,7 @@ public function getComments(): Collection
188
188
return $ this ->comments ;
189
189
}
190
190
191
- public function addComment (Comment $ comment ): void
191
+ public function addComment (? Comment $ comment ): void
192
192
{
193
193
$ comment ->setPost ($ this );
194
194
if (!$ this ->comments ->contains ($ comment )) {
@@ -207,12 +207,12 @@ public function getSummary(): ?string
207
207
return $ this ->summary ;
208
208
}
209
209
210
- public function setSummary (string $ summary ): void
210
+ public function setSummary (? string $ summary ): void
211
211
{
212
212
$ this ->summary = $ summary ;
213
213
}
214
214
215
- public function addTag (Tag ...$ tags ): void
215
+ public function addTag (? Tag ...$ tags ): void
216
216
{
217
217
foreach ($ tags as $ tag ) {
218
218
if (!$ this ->tags ->contains ($ tag )) {
0 commit comments