@@ -20,7 +20,8 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public static function array_safe_get(array $array, $key, $default = null) |
| 22 | 22 | { |
| 23 | - if (isset($array[$key])) { |
|
| 23 | + if (isset($array[$key])) |
|
| 24 | + { |
|
| 24 | 25 | return $array[$key]; |
| 25 | 26 | } |
| 26 | 27 | |
@@ -26,6 +26,9 @@ |
||
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $extension |
|
| 31 | + */ |
|
| 29 | 32 | public function getTransformer($extension) |
| 30 | 33 | { |
| 31 | 34 | if (isset($this->transformers[$extension])) |
@@ -12,6 +12,9 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | interface CollectableItem |
| 14 | 14 | { |
| 15 | + /** |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 15 | 18 | public function getRelativeFilePath(); |
| 16 | 19 | |
| 17 | 20 | /** |
@@ -58,6 +61,7 @@ discard block |
||
| 58 | 61 | * Evaluate the FrontMatter in this object by merging a custom array of data. |
| 59 | 62 | * |
| 60 | 63 | * @param array|null $variables An array of YAML variables to use in evaluating the `$permalink` value |
| 64 | + * @return void |
|
| 61 | 65 | */ |
| 62 | 66 | public function evaluateFrontMatter(array $variables = null); |
| 63 | 67 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | * |
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | - public function setParentPageView(DynamicPageView &$pageView); |
|
| 55 | + public function setParentPageView(DynamicPageView & $pageView); |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Evaluate the FrontMatter in this object by merging a custom array of data. |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * Get all of the ContentItems grouped by Collection name. |
| 51 | 51 | * |
| 52 | - * @return ContentItem[][] |
|
| 52 | + * @return \allejo\stakx\Document\ReadableDocument[] |
|
| 53 | 53 | */ |
| 54 | 54 | public function &getCollections() |
| 55 | 55 | { |
@@ -135,6 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | 137 | * {@inheritdoc} |
| 138 | + * @param string $filePath |
|
| 138 | 139 | */ |
| 139 | 140 | public function createNewItem($filePath) |
| 140 | 141 | { |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | * |
| 102 | 102 | * @since 0.1.1 |
| 103 | 103 | * |
| 104 | - * @return BasePageView[][] |
|
| 104 | + * @return \allejo\stakx\Document\ReadableDocument[] |
|
| 105 | 105 | */ |
| 106 | 106 | public function &getPageViews() |
| 107 | 107 | { |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | - * @param File|string $filePath |
|
| 91 | + * @param string $filePath |
|
| 92 | 92 | * |
| 93 | - * @return mixed|null |
|
| 93 | + * @return \allejo\stakx\Document\BasePageView |
|
| 94 | 94 | */ |
| 95 | 95 | public function createNewItem($filePath) |
| 96 | 96 | { |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | /** |
| 136 | 136 | * Update the contents of a specified file. |
| 137 | 137 | * |
| 138 | - * @param File|string $filePath The relative path of the file |
|
| 138 | + * @param string $filePath The relative path of the file |
|
| 139 | 139 | * |
| 140 | - * @return mixed|null |
|
| 140 | + * @return \allejo\stakx\Document\BasePageView |
|
| 141 | 141 | */ |
| 142 | 142 | public function refreshItem($filePath) |
| 143 | 143 | { |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | /** |
| 287 | 287 | * Return an array of JailedDocuments created from the tracked items |
| 288 | 288 | * |
| 289 | - * @param array $elements |
|
| 289 | + * @param ReadableDocument[] $elements |
|
| 290 | 290 | * @param \Closure $name |
| 291 | 291 | * |
| 292 | 292 | * @return JailedDocument[]|JailedDocument[][] |
@@ -148,12 +148,12 @@ discard block |
||
| 148 | 148 | // Internal object handling |
| 149 | 149 | /// |
| 150 | 150 | |
| 151 | - protected function addFileToTracker(File &$file) |
|
| 151 | + protected function addFileToTracker(File & $file) |
|
| 152 | 152 | { |
| 153 | 153 | $this->trackedItemsFlattened[$file->getRelativeFilePath()] = &$file; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - protected function delFileFromTracker(File &$file) |
|
| 156 | + protected function delFileFromTracker(File & $file) |
|
| 157 | 157 | { |
| 158 | 158 | unset($this->trackedItemsFlattened[$file->getRelativeFilePath()]); |
| 159 | 159 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * @param ReadableDocument $trackedItem |
| 165 | 165 | * @param string|null $namespace |
| 166 | 166 | */ |
| 167 | - protected function addObjectToTracker(ReadableDocument &$trackedItem, $namespace = null) |
|
| 167 | + protected function addObjectToTracker(ReadableDocument & $trackedItem, $namespace = null) |
|
| 168 | 168 | { |
| 169 | 169 | if ($namespace == null) |
| 170 | 170 | { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @param ReadableDocument $trackedItem |
| 185 | 185 | * @param string|null $namespace |
| 186 | 186 | */ |
| 187 | - protected function delObjectFromTracker(ReadableDocument &$trackedItem, $namespace = null) |
|
| 187 | + protected function delObjectFromTracker(ReadableDocument & $trackedItem, $namespace = null) |
|
| 188 | 188 | { |
| 189 | 189 | if ($namespace == null) |
| 190 | 190 | { |
@@ -41,13 +41,15 @@ |
||
| 41 | 41 | $twig->setGlobalVariable('site', $this->container->get(Configuration::class)->getconfiguration()); |
| 42 | 42 | |
| 43 | 43 | $dataItems = []; |
| 44 | - if ($this->container->has(DataManager::class)) { |
|
| 44 | + if ($this->container->has(DataManager::class)) |
|
| 45 | + { |
|
| 45 | 46 | $dataItems = $this->container->get(DataManager::class)->getJailedDataItems(); |
| 46 | 47 | } |
| 47 | 48 | $twig->setGlobalVariable('data', $dataItems); |
| 48 | 49 | |
| 49 | 50 | $collectionItems = []; |
| 50 | - if ($this->container->has(CollectionManager::class)) { |
|
| 51 | + if ($this->container->has(CollectionManager::class)) |
|
| 52 | + { |
|
| 51 | 53 | $collectionItems = $this->container->get(CollectionManager::class)->getJailedCollections(); |
| 52 | 54 | } |
| 53 | 55 | $twig->setGlobalVariable('collections', $collectionItems); |
@@ -16,7 +16,8 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $data = json_decode($content, true); |
| 18 | 18 | |
| 19 | - if ($data === null) { |
|
| 19 | + if ($data === null) |
|
| 20 | + { |
|
| 20 | 21 | return []; |
| 21 | 22 | } |
| 22 | 23 | |
@@ -31,7 +31,8 @@ |
||
| 31 | 31 | { |
| 32 | 32 | $parent = $this->template->getParent([]); |
| 33 | 33 | |
| 34 | - if ($parent === false) { |
|
| 34 | + if ($parent === false) |
|
| 35 | + { |
|
| 35 | 36 | return false; |
| 36 | 37 | } |
| 37 | 38 | |