1 | <?php |
||
10 | abstract class PermalinkDocument extends ReadableDocument |
||
|
|||
11 | { |
||
12 | protected $permalink; |
||
13 | protected $redirects; |
||
14 | |||
15 | /** |
||
16 | * Get the destination of where this Content Item would be written to when the website is compiled. |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | 20 | final public function getTargetFile() |
|
33 | |||
34 | /** |
||
35 | * Get the permalink of this Content Item. |
||
36 | * |
||
37 | * @throws \Exception |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | 39 | final public function getPermalink() |
|
51 | |||
52 | /** |
||
53 | * Get an array of URLs that will redirect to. |
||
54 | * |
||
55 | * @return string[] |
||
56 | */ |
||
57 | 14 | final public function getRedirects() |
|
66 | |||
67 | /** |
||
68 | * Get the permalink based off the location of where the file is relative to the website. This permalink is to be |
||
69 | * used as a fallback in the case that a permalink is not explicitly specified in the Front Matter. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | 3 | protected function getPathPermalink() |
|
97 | |||
98 | /** |
||
99 | * Sanitize a permalink to remove unsupported characters or multiple '/' and replace spaces with hyphens. |
||
100 | * |
||
101 | * @param string $permalink A permalink |
||
102 | * |
||
103 | * @return string $permalink The sanitized permalink |
||
104 | */ |
||
105 | 39 | protected function sanitizePermalink($permalink) |
|
132 | |||
133 | /** |
||
134 | * @return void |
||
135 | */ |
||
136 | abstract protected function buildPermalink(); |
||
137 | } |
||
138 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.