Completed
Branch master (cc75d4)
by Mathieu
02:56
created
src/Charcoal/View/Mustache/TranslatorHelpers.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
                     $this->number = $helper->render('{{ '.$this->number.' }}');
112 112
                 }
113 113
 
114
-                $text = $this->translator->transChoice($text, (int)$this->number, [], $this->domain, $this->locale);
114
+                $text = $this->translator->transChoice($text, (int) $this->number, [], $this->domain, $this->locale);
115 115
             }
116 116
 
117 117
             $this->reset();
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
      *
150 150
      * @param  string $macro A domain, locale, or number.
151 151
      * @throws LogicException If the macro is unresolved.
152
-     * @return mixed
152
+     * @return TranslatorHelpers
153 153
      */
154 154
     public function __get(string $macro)
155 155
     {
Please login to merge, or discard this patch.
src/Charcoal/View/ViewableTrait.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
     /**
80 80
      * Set the renderable view.
81 81
      *
82
-     * @param ViewInterface|array $view The view instance to use to render.
82
+     * @param ViewInterface $view The view instance to use to render.
83 83
      * @throws InvalidArgumentException If the view parameter is not an array or a View object.
84 84
      * @return self
85 85
      */
Please login to merge, or discard this patch.
src/Charcoal/View/ViewServiceProvider.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 namespace Charcoal\View;
6 6
 
7 7
 // From Pimple
8
-use Charcoal\View\Mustache\HelpersInterface;
9 8
 use Pimple\ServiceProviderInterface;
10 9
 use Pimple\Container;
11 10
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
          * @param  Container $container A container instance.
80 80
          * @return ViewConfig
81 81
          */
82
-        $container['view/config'] = function (Container $container): ViewConfig {
82
+        $container['view/config'] = function(Container $container): ViewConfig {
83 83
             $appConfig  = isset($container['config']) ? $container['config'] : [];
84 84
             $viewConfig = isset($appConfig['view']) ? $appConfig['view'] : null;
85 85
             $viewConfig = new ViewConfig($viewConfig);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
          * @param Container $container A container instance.
121 121
          * @return array The view loader dependencies array.
122 122
          */
123
-        $container['view/loader/dependencies'] = function (Container $container): array {
123
+        $container['view/loader/dependencies'] = function(Container $container): array {
124 124
             return [
125 125
                 'base_path' => $container['config']['base_path'],
126 126
                 'paths'     => $container['view/config']['paths']
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
          * @param Container $container A container instance.
132 132
          * @return MustacheLoader
133 133
          */
134
-        $container['view/loader/mustache'] = function (Container $container): MustacheLoader {
134
+        $container['view/loader/mustache'] = function(Container $container): MustacheLoader {
135 135
             return new MustacheLoader($container['view/loader/dependencies']);
136 136
         };
137 137
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
          * @param Container $container A container instance.
140 140
          * @return PhpLoader
141 141
          */
142
-        $container['view/loader/php'] = function (Container $container): PhpLoader {
142
+        $container['view/loader/php'] = function(Container $container): PhpLoader {
143 143
             return new PhpLoader($container['view/loader/dependencies']);
144 144
         };
145 145
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
          * @param Container $container A container instance.
148 148
          * @return TwigLoader
149 149
          */
150
-        $container['view/loader/twig'] = function (Container $container): TwigLoader {
150
+        $container['view/loader/twig'] = function(Container $container): TwigLoader {
151 151
             return new TwigLoader($container['view/loader/dependencies']);
152 152
         };
153 153
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
          * @param Container $container A container instance.
163 163
          * @return MustacheEngine
164 164
          */
165
-        $container['view/engine/mustache'] = function (Container $container) {
165
+        $container['view/engine/mustache'] = function(Container $container) {
166 166
             return new MustacheEngine([
167 167
                 'loader'    => $container['view/loader/mustache'],
168 168
                 'helpers'   => $container['view/mustache/helpers'],
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
          * @param Container $container A container instance.
175 175
          * @return PhpEngine
176 176
          */
177
-        $container['view/engine/php'] = function (Container $container): PhpEngine {
177
+        $container['view/engine/php'] = function(Container $container): PhpEngine {
178 178
             return new PhpEngine([
179 179
                 'loader'    => $container['view/loader/php']
180 180
             ]);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
          * @param Container $container A container instance.
185 185
          * @return TwigEngine
186 186
          */
187
-        $container['view/engine/twig'] = function (Container $container): TwigEngine {
187
+        $container['view/engine/twig'] = function(Container $container): TwigEngine {
188 188
             return new TwigEngine([
189 189
                 'loader'    => $container['view/loader/twig'],
190 190
                 'cache'     => $container['view/twig/cache']
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
          * @param Container $container A container instance.
198 198
          * @return EngineInterface
199 199
          */
200
-        $container['view/engine'] = function (Container $container): EngineInterface {
200
+        $container['view/engine'] = function(Container $container): EngineInterface {
201 201
             $viewConfig = $container['view/config'];
202 202
             $type = $viewConfig['default_engine'];
203 203
             return $container['view/engine/'.$type];
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
          * @param Container $container A container instance.
217 217
          * @return string|null
218 218
          */
219
-        $container['view/mustache/cache'] = function (Container $container): ?string {
219
+        $container['view/mustache/cache'] = function(Container $container): ?string {
220 220
             $viewConfig = $container['view/config'];
221 221
             return $viewConfig['engines.mustache.cache'];
222 222
         };
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     protected function registerMustacheHelpersServices(Container $container): void
230 230
     {
231 231
         if (!isset($container['view/mustache/helpers'])) {
232
-            $container['view/mustache/helpers'] = function (): array {
232
+            $container['view/mustache/helpers'] = function(): array {
233 233
                 return [];
234 234
             };
235 235
         }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
          *
240 240
          * @return AssetsHelpers
241 241
          */
242
-        $container['view/mustache/helpers/assets'] = function (): AssetsHelpers {
242
+        $container['view/mustache/helpers/assets'] = function(): AssetsHelpers {
243 243
             return new AssetsHelpers();
244 244
         };
245 245
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
          *
249 249
          * @return TranslatorHelpers
250 250
          */
251
-        $container['view/mustache/helpers/translator'] = function (Container $container): TranslatorHelpers {
251
+        $container['view/mustache/helpers/translator'] = function(Container $container): TranslatorHelpers {
252 252
             return new TranslatorHelpers([
253 253
                 'translator' => (isset($container['translater']) ? $container['translator'] : null)
254 254
             ]);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
          *
260 260
          * @return MarkdownHelpers
261 261
          */
262
-        $container['view/mustache/helpers/markdown'] = function (Container $container): MarkdownHelpers {
262
+        $container['view/mustache/helpers/markdown'] = function(Container $container): MarkdownHelpers {
263 263
             return new MarkdownHelpers([
264 264
                 'parsedown' => $container['view/parsedown']
265 265
             ]);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
          * @param  Container $container A container instance.
273 273
          * @return array
274 274
          */
275
-        $container->extend('view/mustache/helpers', function (array $helpers, Container $container): array {
275
+        $container->extend('view/mustache/helpers', function(array $helpers, Container $container): array {
276 276
             return array_merge(
277 277
                 $helpers,
278 278
                 $container['view/mustache/helpers/assets']->toArray(),
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
          * @param  Container $container A container instance.
293 293
          * @return string|null
294 294
          */
295
-        $container['view/twig/cache'] = function (Container $container) {
295
+        $container['view/twig/cache'] = function(Container $container) {
296 296
             $viewConfig = $container['view/config'];
297 297
             return $viewConfig['engines.twig.cache'];
298 298
         };
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
          * @param Container $container A container instance.
311 311
          * @return ViewInterface
312 312
          */
313
-        $container['view'] = function (Container $container) {
313
+        $container['view'] = function(Container $container) {
314 314
             return new GenericView([
315 315
                 'engine' => $container['view/engine']
316 316
             ]);
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
          * @param Container $container A container instance.
323 323
          * @return Renderer
324 324
          */
325
-        $container['view/renderer'] = function (Container $container) {
325
+        $container['view/renderer'] = function(Container $container) {
326 326
             return new Renderer([
327 327
                 'view' => $container['view']
328 328
             ]);
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
          *
334 334
          * @return Parsedown
335 335
          */
336
-        $container['view/parsedown'] = function () {
336
+        $container['view/parsedown'] = function() {
337 337
             $parsedown = new Parsedown();
338 338
             $parsedown->setSafeMode(true);
339 339
             return $parsedown;
Please login to merge, or discard this patch.
src/Charcoal/View/Mustache/MustacheLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      */
44 44
     protected function filenameFromIdent(string $ident): string
45 45
     {
46
-        $filename  = str_replace([ '\\' ], '.', $ident);
46
+        $filename  = str_replace(['\\'], '.', $ident);
47 47
         $filename .= '.mustache';
48 48
 
49 49
         return $filename;
Please login to merge, or discard this patch.
src/Charcoal/View/Php/PhpLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      */
39 39
     protected function filenameFromIdent(string $ident): string
40 40
     {
41
-        $filename = str_replace([ '\\' ], '.', $ident);
41
+        $filename = str_replace(['\\'], '.', $ident);
42 42
         $filename .= '.php';
43 43
 
44 44
         return $filename;
Please login to merge, or discard this patch.
src/Charcoal/View/Twig/TwigLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     protected function filenameFromIdent(string $ident): string
48 48
     {
49
-        $filename = str_replace([ '\\' ], '.', $ident);
49
+        $filename = str_replace(['\\'], '.', $ident);
50 50
         $filename .= '.twig';
51 51
 
52 52
         return $filename;
Please login to merge, or discard this patch.