1 | <?php |
||
16 | abstract class PermalinkDocument extends ReadableFile |
||
17 | { |
||
18 | /** @var array */ |
||
19 | protected $permalink; |
||
20 | |||
21 | /** @var array */ |
||
22 | protected $redirects; |
||
23 | |||
24 | /** |
||
25 | * Get the destination of where this Content Item would be written to when the website is compiled. |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | 20 | final public function getTargetFile() |
|
42 | |||
43 | /** |
||
44 | * Get the permalink of this Content Item. |
||
45 | * |
||
46 | * @throws \Exception |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | 39 | final public function getPermalink() |
|
60 | |||
61 | /** |
||
62 | * Get an array of URLs that will redirect to. |
||
63 | * |
||
64 | * @return string[] |
||
65 | */ |
||
66 | 14 | final public function getRedirects() |
|
77 | |||
78 | /** |
||
79 | * Get the permalink based off the location of where the file is relative to the website. This permalink is to be |
||
80 | * used as a fallback in the case that a permalink is not explicitly specified in the Front Matter. |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | 3 | protected function getPathPermalink() |
|
108 | |||
109 | /** |
||
110 | * Sanitize a permalink to remove unsupported characters or multiple '/' and replace spaces with hyphens. |
||
111 | * |
||
112 | * @param string $permalink A permalink |
||
113 | * |
||
114 | * @return string $permalink The sanitized permalink |
||
115 | */ |
||
116 | 39 | protected function sanitizePermalink($permalink) |
|
146 | |||
147 | /** |
||
148 | * Evaluate the FrontMatter for the document. |
||
149 | * |
||
150 | * This FrontMatter can be the user-defined FrontMatter in a FrontMatterDocument but it can also be used as internal |
||
151 | * settings used for objects that do not have user-defined FrontMatter such as DataItems. |
||
152 | * |
||
153 | * @param array $variables |
||
154 | * |
||
155 | * @return void |
||
156 | */ |
||
157 | abstract public function evaluateFrontMatter($variables = array()); |
||
158 | |||
159 | /** |
||
160 | * @return void |
||
161 | */ |
||
162 | abstract public function buildPermalink($force = false); |
||
163 | |||
164 | /** |
||
165 | * If a document has extra redirects defined in a special manner, overload this function. |
||
166 | */ |
||
167 | 13 | public function handleSpecialRedirects() |
|
170 | } |
||
171 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: