@@ -39,7 +39,7 @@ class Post
3939 *
4040 * See https://symfony.com/doc/current/best_practices/configuration.html#constants-vs-configuration-options
4141 */
42- const NUM_ITEMS = 10 ;
42+ public const NUM_ITEMS = 10 ;
4343
4444 /**
4545 * @var int
@@ -138,7 +138,7 @@ public function getTitle(): ?string
138138 return $ this ->title ;
139139 }
140140
141- public function setTitle (string $ title ): void
141+ public function setTitle (? string $ title ): void
142142 {
143143 $ this ->title = $ title ;
144144 }
@@ -148,7 +148,7 @@ public function getSlug(): ?string
148148 return $ this ->slug ;
149149 }
150150
151- public function setSlug (string $ slug ): void
151+ public function setSlug (? string $ slug ): void
152152 {
153153 $ this ->slug = $ slug ;
154154 }
@@ -158,7 +158,7 @@ public function getContent(): ?string
158158 return $ this ->content ;
159159 }
160160
161- public function setContent (string $ content ): void
161+ public function setContent (? string $ content ): void
162162 {
163163 $ this ->content = $ content ;
164164 }
@@ -168,7 +168,7 @@ public function getPublishedAt(): \DateTime
168168 return $ this ->publishedAt ;
169169 }
170170
171- public function setPublishedAt (\DateTime $ publishedAt ): void
171+ public function setPublishedAt (? \DateTime $ publishedAt ): void
172172 {
173173 $ this ->publishedAt = $ publishedAt ;
174174 }
@@ -178,7 +178,7 @@ public function getAuthor(): User
178178 return $ this ->author ;
179179 }
180180
181- public function setAuthor (User $ author ): void
181+ public function setAuthor (? User $ author ): void
182182 {
183183 $ this ->author = $ author ;
184184 }
@@ -188,7 +188,7 @@ public function getComments(): Collection
188188 return $ this ->comments ;
189189 }
190190
191- public function addComment (Comment $ comment ): void
191+ public function addComment (? Comment $ comment ): void
192192 {
193193 $ comment ->setPost ($ this );
194194 if (!$ this ->comments ->contains ($ comment )) {
@@ -207,12 +207,12 @@ public function getSummary(): ?string
207207 return $ this ->summary ;
208208 }
209209
210- public function setSummary (string $ summary ): void
210+ public function setSummary (? string $ summary ): void
211211 {
212212 $ this ->summary = $ summary ;
213213 }
214214
215- public function addTag (Tag ...$ tags ): void
215+ public function addTag (? Tag ...$ tags ): void
216216 {
217217 foreach ($ tags as $ tag ) {
218218 if (!$ this ->tags ->contains ($ tag )) {
0 commit comments