Passed
Push — master ( a30b85...c1874d )
by Arnaud
05:16
created
config/default.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
     'title'        => 'Site title',
17 17
     //'baseline'     => 'Site baseline',
18 18
     'baseurl'      => 'http://localhost:8000/',
19
-    'canonicalurl' => false,   // if true 'url()' function preprends URL wirh 'baseurl'
19
+    'canonicalurl' => false, // if true 'url()' function preprends URL wirh 'baseurl'
20 20
     'description'  => 'Site description',
21
-    'taxonomies'   => [        // default taxonomies
21
+    'taxonomies'   => [// default taxonomies
22 22
         'tags'       => 'tag', // can be disabled with 'disabled' value
23 23
         'categories' => 'category',
24 24
     ],
25 25
     'pagination' => [
26
-        'max'  => 5,      // number of pages on each paginated pages
26
+        'max'  => 5, // number of pages on each paginated pages
27 27
         'path' => 'page', // path to paginated pages. ie: '/blog/page/2/'
28 28
     ],
29 29
     'date' => [
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
         'format' => 'yaml', // front matter format `yaml`, `ini`, `toml` or `json` (`yaml` by default)
182 182
     ],
183 183
     'body' => [
184
-        'format'    => 'md',         // page body format (only Markdown is supported)
184
+        'format'    => 'md', // page body format (only Markdown is supported)
185 185
         'toc'       => ['h2', 'h3'], // headers used to build the table of contents
186 186
         'highlight' => [
187
-            'enabled' => false,  // enables code syntax highlighting (`false` by default)
187
+            'enabled' => false, // enables code syntax highlighting (`false` by default)
188 188
         ],
189 189
         'images' => [
190 190
             'lazy' => [
191
-                'enabled' => true,  // adds `loading="lazy"` attribute (`true` by default)
191
+                'enabled' => true, // adds `loading="lazy"` attribute (`true` by default)
192 192
             ],
193 193
             'resize' => [
194 194
                 'enabled' => false, // enables image resizing by using the `width` extra attribute (`false` by default)
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
                 'enabled' => false, // puts the image in a <figure> element and adds a <figcaption> containing the title (`false` by default)
204 204
             ],
205 205
             'remote' => [
206
-                'enabled'  => true,  // turns remote images to Asset to handling them (`true` by default)
206
+                'enabled'  => true, // turns remote images to Asset to handling them (`true` by default)
207 207
                 'fallback' => [
208 208
                     'enabled' => false, // enables a fallback if image is not found (`false` by default)
209
-                    'path'    => '',     // path to the fallback image, stored in assets dir (`` by default)
209
+                    'path'    => '', // path to the fallback image, stored in assets dir (`` by default)
210 210
                 ],
211 211
             ],
212 212
             'class' => '', // put default class to each image (`` by default)
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         ],
219 219
         'excerpt' => [
220 220
             'separator' => 'excerpt|break', // string to use as separator (`excerpt|break` by default)
221
-            'capture'   => 'before',        // part to capture, `before` or `after` the separator (`before` by default)
221
+            'capture'   => 'before', // part to capture, `before` or `after` the separator (`before` by default)
222 222
         ],
223 223
     ],
224 224
     // data files
@@ -254,17 +254,17 @@  discard block
 block discarded – undo
254 254
     ],
255 255
     'assets' => [
256 256
         'dir'     => 'assets',
257
-        'compile' => [ // Compile Saas
257
+        'compile' => [// Compile Saas
258 258
             'enabled'   => true,
259 259
             'style'     => 'expanded', // 'expanded' or 'compressed',
260 260
             'import'    => ['sass', 'scss', 'node_modules'],
261 261
             'sourcemap' => false, // works in debug mode only
262 262
             //'variables' => ['var' => 'value']
263 263
         ],
264
-        'minify' => [ // Minify CSS and JS
264
+        'minify' => [// Minify CSS and JS
265 265
             'enabled' => true,
266 266
         ],
267
-        'fingerprint' => [ // Add fingerprint
267
+        'fingerprint' => [// Add fingerprint
268 268
             'enabled' => true,
269 269
         ],
270 270
         'target' => 'assets', // target directory of remote and resized assets
Please login to merge, or discard this patch.
src/Renderer/RendererInterface.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,30 +23,30 @@
 block discarded – undo
23 23
     /**
24 24
      * @param string|array $templatesPath
25 25
      */
26
-    public function __construct(Builder $buider, $templatesPath);
26
+    public function __construct (Builder $buider, $templatesPath);
27 27
 
28 28
     /**
29 29
      * Adds a global variable.
30 30
      */
31
-    public function addGlobal(string $name, $value): void;
31
+    public function addGlobal (string $name, $value): void;
32 32
 
33 33
     /**
34 34
      * Rendering.
35 35
      */
36
-    public function render(string $template, array $variables): string;
36
+    public function render (string $template, array $variables): string;
37 37
 
38 38
     /**
39 39
      * Set locale (e.g.: 'fr_FR').
40 40
      */
41
-    public function setLocale(string $locale): void;
41
+    public function setLocale (string $locale): void;
42 42
 
43 43
     /**
44 44
      * Adds a translation file.
45 45
      */
46
-    public function addTransResource(string $translationsDir, string $locale): void;
46
+    public function addTransResource (string $translationsDir, string $locale): void;
47 47
 
48 48
     /**
49 49
      * Returns debug profile.
50 50
      */
51
-    public function getDebugProfile(): ?\Twig\Profiler\Profile;
51
+    public function getDebugProfile (): ?\Twig\Profiler\Profile;
52 52
 }
Please login to merge, or discard this patch.
src/Renderer/Twig.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     /**
43 43
      * {@inheritdoc}
44 44
      */
45
-    public function __construct(Builder $builder, $templatesPath)
45
+    public function __construct (Builder $builder, $templatesPath)
46 46
     {
47 47
         $this->builder = $builder;
48 48
         // load layouts
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     /**
143 143
      * {@inheritdoc}
144 144
      */
145
-    public function addGlobal(string $name, $value): void
145
+    public function addGlobal (string $name, $value): void
146 146
     {
147 147
         $this->twig->addGlobal($name, $value);
148 148
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     /**
151 151
      * {@inheritdoc}
152 152
      */
153
-    public function render(string $template, array $variables): string
153
+    public function render (string $template, array $variables): string
154 154
     {
155 155
         return $this->twig->render($template, $variables);
156 156
     }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     /**
159 159
      * {@inheritdoc}
160 160
      */
161
-    public function setLocale(string $locale): void
161
+    public function setLocale (string $locale): void
162 162
     {
163 163
         if (extension_loaded('intl')) {
164 164
             \Locale::setDefault($locale);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     /**
170 170
      * {@inheritdoc}
171 171
      */
172
-    public function addTransResource(string $translationsDir, string $locale): void
172
+    public function addTransResource (string $translationsDir, string $locale): void
173 173
     {
174 174
         $locales[] = $locale;
175 175
         // if locale is 'fr_FR', trying to load ['fr', 'fr_FR']
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     /**
191 191
      * {@inheritdoc}
192 192
      */
193
-    public function getDebugProfile(): ?\Twig\Profiler\Profile
193
+    public function getDebugProfile (): ?\Twig\Profiler\Profile
194 194
     {
195 195
         return $this->profile;
196 196
     }
Please login to merge, or discard this patch.
src/Renderer/Page.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     /** @var Config */
25 25
     protected $config;
26 26
 
27
-    public function __construct(Config $config)
27
+    public function __construct (Config $config)
28 28
     {
29 29
         $this->config = $config;
30 30
     }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @param PageItem $page
43 43
      * @param string   $format Output format (ie: 'html', 'amp', 'json', etc.)
44 44
      */
45
-    public function getOutputFile(PageItem $page, string $format): string
45
+    public function getOutputFile (PageItem $page, string $format): string
46 46
     {
47 47
         $path = $page->getPath();
48 48
         $subpath = (string) $this->config->getOutputFormatProperty($format, 'subpath');
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @param PageItem $page
77 77
      * @param string   $format Output format (ie: 'html', 'amp', 'json', etc.), 'html' by default
78 78
      */
79
-    public function getUrl(PageItem $page, string $format = 'html'): string
79
+    public function getUrl (PageItem $page, string $format = 'html'): string
80 80
     {
81 81
         $output = $this->getOutputFile($page, $format);
82 82
         if (!($page->getVariable('uglyurl') ?? false)) {
Please login to merge, or discard this patch.
src/Renderer/Site.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     /** @var string Current language. */
31 31
     protected $language;
32 32
 
33
-    public function __construct(Builder $builder, string $language)
33
+    public function __construct (Builder $builder, string $language)
34 34
     {
35 35
         $this->builder = $builder;
36 36
         $this->config = $this->builder->getConfig();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @return bool
46 46
      */
47 47
     #[\ReturnTypeWillChange]
48
-    public function offsetExists($offset): bool
48
+    public function offsetExists ($offset): bool
49 49
     {
50 50
         // special cases
51 51
         switch ($offset) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @return mixed|null
66 66
      */
67 67
     #[\ReturnTypeWillChange]
68
-    public function offsetGet($offset)
68
+    public function offsetGet ($offset)
69 69
     {
70 70
         // Fetchs data from builder instead of config raw data
71 71
         switch ($offset) {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
98 98
      */
99 99
     #[\ReturnTypeWillChange]
100
-    public function offsetSet($offset, $value): void
100
+    public function offsetSet ($offset, $value): void
101 101
     {
102 102
     }
103 103
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
110 110
      */
111 111
     #[\ReturnTypeWillChange]
112
-    public function offsetUnset($offset): void
112
+    public function offsetUnset ($offset): void
113 113
     {
114 114
     }
115 115
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      *
119 119
      * @throws \DomainException
120 120
      */
121
-    public function getPage(string $id, string $language = null): ?CollectionPage
121
+    public function getPage (string $id, string $language = null): ?CollectionPage
122 122
     {
123 123
         $pageId = $id;
124 124
         if ($language === null && $this->language != $this->config->getLanguageDefault()) {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     /**
135 135
      * Returns all pages, in the current language.
136 136
      */
137
-    public function getPages(): \Cecil\Collection\Page\Collection
137
+    public function getPages (): \Cecil\Collection\Page\Collection
138 138
     {
139 139
         return $this->builder->getPages()->filter(function (CollectionPage $page) {
140 140
             // We should fix case of virtual pages without language
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     /**
150 150
      * Returns all pages, regardless of their translation.
151 151
      */
152
-    public function getAllPages(): \Cecil\Collection\Page\Collection
152
+    public function getAllPages (): \Cecil\Collection\Page\Collection
153 153
     {
154 154
         return $this->builder->getPages();
155 155
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     /**
158 158
      * Alias of getAllPages().
159 159
      */
160
-    public function getPagesIntl(): \Cecil\Collection\Page\Collection
160
+    public function getPagesIntl (): \Cecil\Collection\Page\Collection
161 161
     {
162 162
         return $this->getAllPages();
163 163
     }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     /**
166 166
      * Return current time.
167 167
      */
168
-    public function getTime(): int
168
+    public function getTime (): int
169 169
     {
170 170
         return time();
171 171
     }
Please login to merge, or discard this patch.
src/Renderer/Layout.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @throws RuntimeException
33 33
      */
34
-    public static function finder(CollectionPage $page, string $format, Config $config): array
34
+    public static function finder (CollectionPage $page, string $format, Config $config): array
35 35
     {
36 36
         $layout = 'unknown';
37 37
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      *
78 78
      * @see finder()
79 79
      */
80
-    protected static function fallback(CollectionPage $page, string $format): array
80
+    protected static function fallback (CollectionPage $page, string $format): array
81 81
     {
82 82
         $ext = self::EXT;
83 83
 
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
             case PageType::TERM:
143 143
                 $layouts = [
144 144
                     // "taxonomy/$term.$format.$ext", // ie: taxonomy/velo.html.twig
145
-                    "_default/term.$format.$ext",     // ie: _default/term.html.twig
146
-                    "_default/list.$format.$ext",     // ie: _default/list.html.twig
145
+                    "_default/term.$format.$ext", // ie: _default/term.html.twig
146
+                    "_default/list.$format.$ext", // ie: _default/list.html.twig
147 147
                 ];
148 148
                 if ($page->hasVariable('term')) {
149 149
                     $layouts = array_merge(
Please login to merge, or discard this patch.
src/Renderer/Extension/Core.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     /** @var Slugify */
47 47
     private static $slugifier;
48 48
 
49
-    public function __construct(Builder $builder)
49
+    public function __construct (Builder $builder)
50 50
     {
51 51
         if (!self::$slugifier instanceof Slugify) {
52 52
             self::$slugifier = Slugify::create(['regexp' => Page::SLUGIFY_PATTERN]);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     /**
62 62
      * {@inheritdoc}
63 63
      */
64
-    public function getName()
64
+    public function getName ()
65 65
     {
66 66
         return 'CoreExtension';
67 67
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     /**
70 70
      * {@inheritdoc}
71 71
      */
72
-    public function getFunctions()
72
+    public function getFunctions ()
73 73
     {
74 74
         return [
75 75
             new \Twig\TwigFunction('url', [$this, 'url']),
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     /**
103 103
      * {@inheritdoc}
104 104
      */
105
-    public function getFilters()
105
+    public function getFilters ()
106 106
     {
107 107
         return [
108 108
             new \Twig\TwigFilter('url', [$this, 'url']),
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     /**
193 193
      * {@inheritdoc}
194 194
      */
195
-    public function getTests()
195
+    public function getTests ()
196 196
     {
197 197
         return [
198 198
             new \Twig\TwigTest('asset', [$this, 'isAsset']),
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     /**
203 203
      * Filters by Section.
204 204
      */
205
-    public function filterBySection(PagesCollection $pages, string $section): CollectionInterface
205
+    public function filterBySection (PagesCollection $pages, string $section): CollectionInterface
206 206
     {
207 207
         return $this->filterBy($pages, 'section', $section);
208 208
     }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     /**
211 211
      * Filters a pages collection by variable's name/value.
212 212
      */
213
-    public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface
213
+    public function filterBy (PagesCollection $pages, string $variable, string $value): CollectionInterface
214 214
     {
215 215
         $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) {
216 216
             // is a dedicated getter exists?
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     /**
231 231
      * Sorts a collection by title.
232 232
      */
233
-    public function sortByTitle(\Traversable $collection): array
233
+    public function sortByTitle (\Traversable $collection): array
234 234
     {
235 235
         $sort = \SORT_ASC;
236 236
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     /**
244 244
      * Sorts a collection by weight.
245 245
      */
246
-    public function sortByWeight(\Traversable $collection): array
246
+    public function sortByWeight (\Traversable $collection): array
247 247
     {
248 248
         $callback = function ($a, $b) {
249 249
             if (!isset($a['weight'])) {
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     /**
269 269
      * Sorts by creation date (or 'updated' date): the most recent first.
270 270
      */
271
-    public function sortByDate(\Traversable $collection, string $variable = 'date', bool $descTitle = false): array
271
+    public function sortByDate (\Traversable $collection, string $variable = 'date', bool $descTitle = false): array
272 272
     {
273 273
         $callback = function ($a, $b) use ($variable, $descTitle) {
274 274
             if ($a[$variable] == $b[$variable]) {
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
      * @param Page|Asset|string|null $value
302 302
      * @param array|null             $options
303 303
      */
304
-    public function url($value = null, array $options = null): string
304
+    public function url ($value = null, array $options = null): string
305 305
     {
306 306
         return (new Url($this->builder, $value, $options))->getUrl();
307 307
     }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      *
315 315
      * @return Asset
316 316
      */
317
-    public function asset($path, array $options = null): Asset
317
+    public function asset ($path, array $options = null): Asset
318 318
     {
319 319
         return new Asset($this->builder, $path, $options);
320 320
     }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
      *
327 327
      * @return Asset
328 328
      */
329
-    public function toCss($asset): Asset
329
+    public function toCss ($asset): Asset
330 330
     {
331 331
         if (!$asset instanceof Asset) {
332 332
             $asset = new Asset($this->builder, $asset);
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      *
343 343
      * @return Asset
344 344
      */
345
-    public function minify($asset): Asset
345
+    public function minify ($asset): Asset
346 346
     {
347 347
         if (!$asset instanceof Asset) {
348 348
             $asset = new Asset($this->builder, $asset);
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      *
359 359
      * @return Asset
360 360
      */
361
-    public function fingerprint($asset): Asset
361
+    public function fingerprint ($asset): Asset
362 362
     {
363 363
         if (!$asset instanceof Asset) {
364 364
             $asset = new Asset($this->builder, $asset);
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
      *
375 375
      * @return Asset
376 376
      */
377
-    public function resize($asset, int $size): Asset
377
+    public function resize ($asset, int $size): Asset
378 378
     {
379 379
         if (!$asset instanceof Asset) {
380 380
             $asset = new Asset($this->builder, $asset);
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
      *
391 391
      * @return string
392 392
      */
393
-    public function dataurl($asset): string
393
+    public function dataurl ($asset): string
394 394
     {
395 395
         if (!$asset instanceof Asset) {
396 396
             $asset = new Asset($this->builder, $asset);
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
      *
408 408
      * @return string
409 409
      */
410
-    public function integrity($asset, string $algo = 'sha384'): string
410
+    public function integrity ($asset, string $algo = 'sha384'): string
411 411
     {
412 412
         if (!$asset instanceof Asset) {
413 413
             $asset = new Asset($this->builder, $asset);
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
     /**
420 420
      * Minifying a CSS string.
421 421
      */
422
-    public function minifyCss(?string $value): string
422
+    public function minifyCss (?string $value): string
423 423
     {
424 424
         $value = $value ?? '';
425 425
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     /**
442 442
      * Minifying a JavaScript string.
443 443
      */
444
-    public function minifyJs(?string $value): string
444
+    public function minifyJs (?string $value): string
445 445
     {
446 446
         $value = $value ?? '';
447 447
 
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
      *
466 466
      * @throws RuntimeException
467 467
      */
468
-    public function scssToCss(?string $value): string
468
+    public function scssToCss (?string $value): string
469 469
     {
470 470
         $value = $value ?? '';
471 471
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      *
503 503
      * @throws RuntimeException
504 504
      */
505
-    public function html(Asset $asset, array $attributes = [], array $options = []): string
505
+    public function html (Asset $asset, array $attributes = [], array $options = []): string
506 506
     {
507 507
         $htmlAttributes = '';
508 508
         $preload = false;
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
     /**
598 598
      * Returns the content of an asset.
599 599
      */
600
-    public function inline(Asset $asset): string
600
+    public function inline (Asset $asset): string
601 601
     {
602 602
         return $asset['content'];
603 603
     }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     /**
606 606
      * Reads $length first characters of a string and adds a suffix.
607 607
      */
608
-    public function excerpt(?string $string, int $length = 450, string $suffix = ' …'): string
608
+    public function excerpt (?string $string, int $length = 450, string $suffix = ' …'): string
609 609
     {
610 610
         $string = $string ?? '';
611 611
 
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
      *  - separator: string to use as separator (`excerpt|break` by default)
626 626
      *  - capture: part to capture, `before` or `after` the separator (`before` by default).
627 627
      */
628
-    public function excerptHtml(?string $string, array $options = []): string
628
+    public function excerptHtml (?string $string, array $options = []): string
629 629
     {
630 630
         $string = $string ?? '';
631 631
 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
      *
654 654
      * @throws RuntimeException
655 655
      */
656
-    public function markdownToHtml(?string $markdown): ?string
656
+    public function markdownToHtml (?string $markdown): ?string
657 657
     {
658 658
         $markdown = $markdown ?? '';
659 659
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
      *
674 674
      * @throws RuntimeException
675 675
      */
676
-    public function markdownToToc(?string $markdown, $format = 'html', $url = ''): ?string
676
+    public function markdownToToc (?string $markdown, $format = 'html', $url = ''): ?string
677 677
     {
678 678
         $markdown = $markdown ?? '';
679 679
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
      *
694 694
      * @throws RuntimeException
695 695
      */
696
-    public function jsonDecode(?string $json): ?array
696
+    public function jsonDecode (?string $json): ?array
697 697
     {
698 698
         $json = $json ?? '';
699 699
 
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
      *
715 715
      * @throws RuntimeException
716 716
      */
717
-    public function yamlParse(?string $yaml): ?array
717
+    public function yamlParse (?string $yaml): ?array
718 718
     {
719 719
         $yaml = $yaml ?? '';
720 720
 
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
      *
736 736
      * @throws RuntimeException
737 737
      */
738
-    public function pregSplit(?string $value, string $pattern, int $limit = 0): ?array
738
+    public function pregSplit (?string $value, string $pattern, int $limit = 0): ?array
739 739
     {
740 740
         $value = $value ?? '';
741 741
 
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
      *
757 757
      * @throws RuntimeException
758 758
      */
759
-    public function pregMatchAll(?string $value, string $pattern, int $group = 0): ?array
759
+    public function pregMatchAll (?string $value, string $pattern, int $group = 0): ?array
760 760
     {
761 761
         $value = $value ?? '';
762 762
 
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
     /**
776 776
      * Calculates estimated time to read a text.
777 777
      */
778
-    public function readtime(?string $text): string
778
+    public function readtime (?string $text): string
779 779
     {
780 780
         $text = $text ?? '';
781 781
 
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
     /**
792 792
      * Gets the value of an environment variable.
793 793
      */
794
-    public function getEnv(?string $var): ?string
794
+    public function getEnv (?string $var): ?string
795 795
     {
796 796
         $var = $var ?? '';
797 797
 
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
     /**
802 802
      * Tests if a variable is an Asset.
803 803
      */
804
-    public function isAsset($variable): bool
804
+    public function isAsset ($variable): bool
805 805
     {
806 806
         return $variable instanceof Asset;
807 807
     }
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
      *
814 814
      * @return string
815 815
      */
816
-    public function dominantColor($asset): string
816
+    public function dominantColor ($asset): string
817 817
     {
818 818
         if (!$asset instanceof Asset) {
819 819
             $asset = new Asset($this->builder, $asset);
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
      *
828 828
      * @throws RuntimeException
829 829
      */
830
-    public function hexToRgb(?string $variable): array
830
+    public function hexToRgb (?string $variable): array
831 831
     {
832 832
         $variable = $variable ?? '';
833 833
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
     /**
851 851
      * Is a hexadecimal color is valid?
852 852
      */
853
-    private static function isHex(string $hex): bool
853
+    private static function isHex (string $hex): bool
854 854
     {
855 855
         $valid = is_string($hex);
856 856
         $hex = ltrim($hex, '#');
Please login to merge, or discard this patch.
src/Renderer/Language.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     /** @var string Current language. */
28 28
     protected $language;
29 29
 
30
-    public function __construct(Config $config, string $language = null)
30
+    public function __construct (Config $config, string $language = null)
31 31
     {
32 32
         $this->config = $config;
33 33
         $this->language = $language;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return string
43 43
      */
44
-    public function __toString()
44
+    public function __toString ()
45 45
     {
46 46
         return $this->language;
47 47
     }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * Returns the name of the current or of the given language code.
51 51
      */
52
-    public function getName(?string $language = null): ?string
52
+    public function getName (?string $language = null): ?string
53 53
     {
54 54
         if ($language !== null) {
55 55
             $this->language = $language;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     /**
65 65
      * Returns the locale of the current or of the given language code.
66 66
      */
67
-    public function getLocale(?string $language = null): ?string
67
+    public function getLocale (?string $language = null): ?string
68 68
     {
69 69
         if ($language !== null) {
70 70
             $this->language = $language;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     /**
80 80
      * Returns the weight of the current or of the given language code.
81 81
      */
82
-    public function getWeight(?string $language = null): int
82
+    public function getWeight (?string $language = null): int
83 83
     {
84 84
         if ($language !== null) {
85 85
             $this->language = $language;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     /**
92 92
      * Checks if the given property exists for the current language.
93 93
      */
94
-    private function hasProperty(string $property): bool
94
+    private function hasProperty (string $property): bool
95 95
     {
96 96
         $value = $this->config->getLanguageProperty($property, $this->language);
97 97
 
Please login to merge, or discard this patch.
src/Generator/Homepage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     /**
26 26
      * {@inheritdoc}
27 27
      */
28
-    public function generate(): void
28
+    public function generate (): void
29 29
     {
30 30
         foreach ($this->config->getLanguages() as $lang) {
31 31
             $language = $lang['code'];
Please login to merge, or discard this patch.