| @@ -53,6 +53,7 @@ | ||
| 53 | 53 | |
| 54 | 54 | /** | 
| 55 | 55 |       * {@inheritdoc} | 
| 56 | + * @param string $name | |
| 56 | 57 | */ | 
| 57 | 58 | public function addGlobal($name, $value) | 
| 58 | 59 |      { | 
| @@ -93,7 +93,7 @@ | ||
| 93 | 93 | // https://regex101.com/r/dZ02zO/5 | 
| 94 | 94 | $this->rendered = preg_replace_callback( | 
| 95 | 95 | '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is', | 
| 96 | -            function ($matches) { | |
| 96 | +            function($matches) { | |
| 97 | 97 |                  return \sprintf('href="../%s%s"', Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? ''); | 
| 98 | 98 | }, | 
| 99 | 99 | $this->rendered | 
| @@ -229,7 +229,7 @@ discard block | ||
| 229 | 229 | public function setMessageCallback($messageCallback = null) | 
| 230 | 230 |      { | 
| 231 | 231 |          if ($messageCallback === null) { | 
| 232 | -            $messageCallback = function ($code, $message = '', $itemsCount = 0, $itemsMax = 0) { | |
| 232 | +            $messageCallback = function($code, $message = '', $itemsCount = 0, $itemsMax = 0) { | |
| 233 | 233 |                  switch ($code) { | 
| 234 | 234 | case 'CONFIG': | 
| 235 | 235 | case 'LOCATE': | 
| @@ -326,7 +326,7 @@ discard block | ||
| 326 | 326 | public function getLog($type = 0) | 
| 327 | 327 |      { | 
| 328 | 328 |          if (is_array($this->log)) { | 
| 329 | -            return array_filter($this->log, function ($key) use ($type) { | |
| 329 | +            return array_filter($this->log, function($key) use ($type) { | |
| 330 | 330 | return $key['type'] <= $type; | 
| 331 | 331 | }); | 
| 332 | 332 | } | 
| @@ -16,6 +16,7 @@ | ||
| 16 | 16 | * StepInterface constructor. | 
| 17 | 17 | * | 
| 18 | 18 | * @param Builder $builder | 
| 19 | + * @return void | |
| 19 | 20 | */ | 
| 20 | 21 | public function __construct(Builder $builder); | 
| 21 | 22 | |
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | */ | 
| 24 | 24 | public function sortByDate(): self | 
| 25 | 25 |      { | 
| 26 | -        return $this->usort(function ($a, $b) { | |
| 26 | +        return $this->usort(function($a, $b) { | |
| 27 | 27 |              if (!isset($a['date'])) { | 
| 28 | 28 | return -1; | 
| 29 | 29 | } | 
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | call_user_func_array($this->builder->getMessageCb(), ['SAVE', 'Saving pages']); | 
| 47 | 47 | |
| 48 | 48 | /* @var $page Page */ | 
| 49 | -        $filteredPages = $this->builder->getPages()->filter(function (Page $page) { | |
| 49 | +        $filteredPages = $this->builder->getPages()->filter(function(Page $page) { | |
| 50 | 50 |              return !empty($page->getVariable('rendered')); | 
| 51 | 51 | }); | 
| 52 | 52 | $max = count($filteredPages); | 
| @@ -20,6 +20,7 @@ | ||
| 20 | 20 | * | 
| 21 | 21 | * @param string|array $templatesPath | 
| 22 | 22 | * @param Builder $buider | 
| 23 | + * @return void | |
| 23 | 24 | */ | 
| 24 | 25 | public function __construct($templatesPath, Builder $buider); | 
| 25 | 26 | |
| @@ -20,7 +20,7 @@ discard block | ||
| 20 | 20 | */ | 
| 21 | 21 | public function all(): self | 
| 22 | 22 |      { | 
| 23 | -        $filteredPages = $this->filter(function (Page $page) { | |
| 23 | +        $filteredPages = $this->filter(function(Page $page) { | |
| 24 | 24 |              if ($page->isVirtual() === false) { | 
| 25 | 25 | return true; | 
| 26 | 26 | } | 
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 | */ | 
| 37 | 37 | public function sortByDate(): self | 
| 38 | 38 |      { | 
| 39 | -        return $this->usort(function ($a, $b) { | |
| 39 | +        return $this->usort(function($a, $b) { | |
| 40 | 40 |              if (!isset($a['date'])) { | 
| 41 | 41 | return -1; | 
| 42 | 42 | } | 
| @@ -58,7 +58,7 @@ discard block | ||
| 58 | 58 | */ | 
| 59 | 59 | public function sortByTitle(): self | 
| 60 | 60 |      { | 
| 61 | -        return $this->usort(function ($a, $b) { | |
| 61 | +        return $this->usort(function($a, $b) { | |
| 62 | 62 | return strnatcmp($a['title'], $b['title']); | 
| 63 | 63 | }); | 
| 64 | 64 | } | 
| @@ -70,7 +70,7 @@ discard block | ||
| 70 | 70 | */ | 
| 71 | 71 | public function sortByWeight(): self | 
| 72 | 72 |      { | 
| 73 | -        return $this->usort(function ($a, $b) { | |
| 73 | +        return $this->usort(function($a, $b) { | |
| 74 | 74 |              if (!isset($a['weight'])) { | 
| 75 | 75 | return -1; | 
| 76 | 76 | } | 
| @@ -36,7 +36,7 @@ | ||
| 36 | 36 | call_user_func_array($this->builder->getMessageCb(), ['GENERATE', 'Generating pages']); | 
| 37 | 37 | |
| 38 | 38 |              $generators = $this->builder->getConfig()->get('generators'); | 
| 39 | -            array_walk($generators, function ($generator, $priority) use ($generatorManager) { | |
| 39 | +            array_walk($generators, function($generator, $priority) use ($generatorManager) { | |
| 40 | 40 |                  if (!class_exists($generator)) { | 
| 41 | 41 |                      $message = sprintf('Unable to load generator "%s"', $generator); | 
| 42 | 42 | call_user_func_array($this->builder->getMessageCb(), ['GENERATE_ERROR', $message]); | 
| @@ -127,7 +127,7 @@ | ||
| 127 | 127 | /** | 
| 128 | 128 | * Format class name. | 
| 129 | 129 | * | 
| 130 | - * @param \object $class | |
| 130 | + * @param Generator\GeneratorInterface $class | |
| 131 | 131 | * @param array $options | 
| 132 | 132 | * | 
| 133 | 133 | * @return string |