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 $frontmatter; |
||
77 | /** |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $body; |
||
81 | /** |
||
82 | * @var string |
||
83 | */ |
||
84 | protected $html; |
||
85 | |||
86 | /** |
||
87 | * Constructor. |
||
88 | * |
||
89 | * @param SplFileInfo|null $file |
||
90 | */ |
||
91 | public function __construct(SplFileInfo $file = null) |
||
159 | |||
160 | /** |
||
161 | * Turn a path (string) into a slung (URL). |
||
162 | * |
||
163 | * @param string $string |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | public static function slugify(string $string): string |
||
173 | |||
174 | /** |
||
175 | * Is current page is virtual? |
||
176 | * |
||
177 | * @return bool |
||
178 | */ |
||
179 | public function isVirtual(): bool |
||
183 | |||
184 | /** |
||
185 | * Set page type. |
||
186 | * |
||
187 | * @param string $type |
||
188 | * |
||
189 | * @return self |
||
190 | */ |
||
191 | public function setType(string $type): self |
||
197 | |||
198 | /** |
||
199 | * Get page type. |
||
200 | * |
||
201 | * @return string|null |
||
202 | */ |
||
203 | public function getType(): ?string |
||
207 | |||
208 | /** |
||
209 | * Parse file content. |
||
210 | * |
||
211 | * @return self |
||
212 | */ |
||
213 | public function parse(): self |
||
222 | |||
223 | /** |
||
224 | * Set name. |
||
225 | * |
||
226 | * @param string $name |
||
227 | * |
||
228 | * @return self |
||
229 | */ |
||
230 | public function setName(string $name): self |
||
236 | |||
237 | /** |
||
238 | * Get name. |
||
239 | * |
||
240 | * @return string|null |
||
241 | */ |
||
242 | public function getName(): ?string |
||
246 | |||
247 | /** |
||
248 | * Set path. |
||
249 | * |
||
250 | * @param $path |
||
251 | * |
||
252 | * @return self |
||
253 | */ |
||
254 | public function setPath(string $path): self |
||
260 | |||
261 | /** |
||
262 | * Get path. |
||
263 | * |
||
264 | * @return string |
||
265 | */ |
||
266 | public function getPath(): string |
||
270 | |||
271 | /** |
||
272 | * Set path name. |
||
273 | * |
||
274 | * @param string $pathname |
||
275 | * |
||
276 | * @return self |
||
277 | */ |
||
278 | public function setPathname(string $pathname): self |
||
284 | |||
285 | /** |
||
286 | * Get path name. |
||
287 | * |
||
288 | * @return string |
||
289 | */ |
||
290 | public function getPathname(): string |
||
294 | |||
295 | /** |
||
296 | * Set section. |
||
297 | * |
||
298 | * @param string $section |
||
299 | * |
||
300 | * @return self |
||
301 | */ |
||
302 | public function setSection(string $section): self |
||
308 | |||
309 | /** |
||
310 | * Get section. |
||
311 | * |
||
312 | * @return string|false |
||
313 | */ |
||
314 | public function getSection(): ?string |
||
322 | |||
323 | /** |
||
324 | * Set permalink. |
||
325 | * |
||
326 | * @param string $permalink |
||
327 | * |
||
328 | * @return self |
||
329 | */ |
||
330 | public function setPermalink(string $permalink): self |
||
336 | |||
337 | /** |
||
338 | * Get permalink. |
||
339 | * |
||
340 | * @return string|false |
||
341 | */ |
||
342 | public function getPermalink(): ?string |
||
350 | |||
351 | /** |
||
352 | * Get frontmatter. |
||
353 | * |
||
354 | * @return string|null |
||
355 | */ |
||
356 | public function getFrontmatter(): ?string |
||
360 | |||
361 | /** |
||
362 | * Get body as raw. |
||
363 | * |
||
364 | * @return string |
||
365 | */ |
||
366 | public function getBody(): ?string |
||
370 | |||
371 | /** |
||
372 | * Set body as HTML. |
||
373 | * |
||
374 | * @param string $html |
||
375 | * |
||
376 | * @return self |
||
377 | */ |
||
378 | public function setBodyHtml(string $html): self |
||
384 | |||
385 | /** |
||
386 | * Get body as HTML. |
||
387 | * |
||
388 | * @return string|null |
||
389 | */ |
||
390 | public function getBodyHtml(): ?string |
||
394 | |||
395 | /** |
||
396 | * @see getBodyHtml() |
||
397 | * |
||
398 | * @return string|null |
||
399 | */ |
||
400 | public function getContent(): ?string |
||
404 | |||
405 | /** |
||
406 | * Set layout. |
||
407 | * |
||
408 | * @param string $layout |
||
409 | * |
||
410 | * @return self |
||
411 | */ |
||
412 | public function setLayout(string $layout): self |
||
418 | |||
419 | /** |
||
420 | * Get layout. |
||
421 | * |
||
422 | * @return string|false |
||
423 | */ |
||
424 | public function getLayout(): ?string |
||
428 | } |
||
429 |
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..