1 | <?php |
||
23 | class Page extends Item |
||
24 | { |
||
25 | use VariableTrait; |
||
26 | |||
27 | const SLUGIFY_PATTERN = '/(^\/|[^a-z0-9\/]|-)+/'; |
||
28 | |||
29 | /** |
||
30 | * @var SplFileInfo |
||
31 | */ |
||
32 | protected $file; |
||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $fileExtension; |
||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $filePath; |
||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $fileName; |
||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $filePathname; |
||
49 | /** |
||
50 | * @var bool |
||
51 | */ |
||
52 | protected $virtual = false; |
||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $type; |
||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $id; |
||
61 | /** |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $pathname; |
||
65 | /** |
||
66 | * @var string |
||
67 | */ |
||
68 | protected $path; |
||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $name; |
||
73 | /** |
||
74 | * @var string |
||
75 | */ |
||
76 | protected $section; |
||
77 | /** |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $frontmatter; |
||
81 | /** |
||
82 | * @var string |
||
83 | */ |
||
84 | protected $body; |
||
85 | /** |
||
86 | * @var string |
||
87 | */ |
||
88 | protected $html; |
||
89 | |||
90 | /** |
||
91 | * Constructor. |
||
92 | * |
||
93 | * @param SplFileInfo|null $file |
||
94 | */ |
||
95 | public function __construct(SplFileInfo $file = null) |
||
167 | |||
168 | /** |
||
169 | * Turn a path (string) into a slung (URL). |
||
170 | * |
||
171 | * @param string $string |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | public static function slugify(string $string): string |
||
181 | |||
182 | /** |
||
183 | * Is current page is virtual? |
||
184 | * |
||
185 | * @return bool |
||
186 | */ |
||
187 | public function isVirtual(): bool |
||
191 | |||
192 | /** |
||
193 | * Set page type. |
||
194 | * |
||
195 | * @param string $type |
||
196 | * |
||
197 | * @return self |
||
198 | */ |
||
199 | public function setType(string $type): self |
||
205 | |||
206 | /** |
||
207 | * Get page type. |
||
208 | * |
||
209 | * @return string|null |
||
210 | */ |
||
211 | public function getType(): ?string |
||
215 | |||
216 | /** |
||
217 | * Parse file content. |
||
218 | * |
||
219 | * @return self |
||
220 | */ |
||
221 | public function parse(): self |
||
230 | |||
231 | /** |
||
232 | * Set name. |
||
233 | * |
||
234 | * @param string $name |
||
235 | * |
||
236 | * @return self |
||
237 | */ |
||
238 | public function setName(string $name): self |
||
244 | |||
245 | /** |
||
246 | * Get name. |
||
247 | * |
||
248 | * @return string|null |
||
249 | */ |
||
250 | public function getName(): ?string |
||
254 | |||
255 | /** |
||
256 | * Set path. |
||
257 | * |
||
258 | * @param $path |
||
259 | * |
||
260 | * @return self |
||
261 | */ |
||
262 | public function setPath(string $path): self |
||
268 | |||
269 | /** |
||
270 | * Get path. |
||
271 | * |
||
272 | * @return string |
||
273 | */ |
||
274 | public function getPath(): string |
||
278 | |||
279 | /** |
||
280 | * Set path name. |
||
281 | * |
||
282 | * @param string $pathname |
||
283 | * |
||
284 | * @return self |
||
285 | */ |
||
286 | public function setPathname(string $pathname): self |
||
292 | |||
293 | /** |
||
294 | * Get path name. |
||
295 | * |
||
296 | * @return string |
||
297 | */ |
||
298 | public function getPathname(): string |
||
302 | |||
303 | /** |
||
304 | * Set section. |
||
305 | * |
||
306 | * @param string $section |
||
307 | * |
||
308 | * @return self |
||
309 | */ |
||
310 | public function setSection(string $section): self |
||
316 | |||
317 | /** |
||
318 | * Get section. |
||
319 | * |
||
320 | * @return string|false |
||
321 | */ |
||
322 | public function getSection(): ?string |
||
330 | |||
331 | /** |
||
332 | * Get frontmatter. |
||
333 | * |
||
334 | * @return string|null |
||
335 | */ |
||
336 | public function getFrontmatter(): ?string |
||
340 | |||
341 | /** |
||
342 | * Get body as raw. |
||
343 | * |
||
344 | * @return string |
||
345 | */ |
||
346 | public function getBody(): ?string |
||
350 | |||
351 | /** |
||
352 | * Set body as HTML. |
||
353 | * |
||
354 | * @param string $html |
||
355 | * |
||
356 | * @return self |
||
357 | */ |
||
358 | public function setBodyHtml(string $html): self |
||
364 | |||
365 | /** |
||
366 | * Get body as HTML. |
||
367 | * |
||
368 | * @return string|null |
||
369 | */ |
||
370 | public function getBodyHtml(): ?string |
||
374 | |||
375 | /** |
||
376 | * @see getBodyHtml() |
||
377 | * |
||
378 | * @return string|null |
||
379 | */ |
||
380 | public function getContent(): ?string |
||
384 | } |
||
385 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..