Replace demo page by twig file

by @nicolas-grekas

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

$ curl https://fabbot.io/patch/symfony/maker-bundle/64/daa56eef3bea75e706afbb17ffa9cda942515e44/cs.diff | patch -p0
diff -ru src/Maker/MakeController.php src/Maker/MakeController.php
--- src/Maker/MakeController.php	2017-12-06 08:46:51.813370229 +0000
+++ src/Maker/MakeController.php	2017-12-06 08:46:52.894346676 +0000
@@ -69,13 +69,13 @@
             $twigFirstLine = "<!DOCTYPE html>\n<title>{$title}</title>";
         }
 
-        return [
+        return array(
             'controller_class_name' => $controllerClassName,
             'route_path' => Str::asRoutePath(str_replace('Controller', '', $controllerClassName)),
             'route_name' => Str::asRouteName(str_replace('Controller', '', $controllerClassName)),
             'twig_file' => Str::asFilePath(str_replace('Controller', '', $controllerClassName)).'.html.twig',
             'twig_first_line' => $twigFirstLine,
-        ];
+        );
     }
 
     public function getFiles(array $params): array
@@ -84,13 +84,13 @@
         $classFile = 'src/Controller/'.$params['controller_class_name'].'.php';
 
         if (!$this->isTwigInstalled()) {
-            return [$dir.'Controller.tpl.php' => $classFile];
+            return array($dir.'Controller.tpl.php' => $classFile);
         }
 
-        return [
+        return array(
             $dir.'ControllerWithTwig.tpl.php' => $classFile,
             $dir.'ControllerWithTwig.twig.php' => 'templates/'.$params['twig_file'],
-        ];
+        );
     }
 
     public function writeNextStepsMessage(array $params, ConsoleStyle $io)
diff -ru src/Resources/skeleton/controller/ControllerWithTwig.tpl.php src/Resources/skeleton/controller/ControllerWithTwig.tpl.php
--- src/Resources/skeleton/controller/ControllerWithTwig.tpl.php	2017-12-06 08:46:52.080364412 +0000
+++ src/Resources/skeleton/controller/ControllerWithTwig.tpl.php	2017-12-06 08:46:52.900346545 +0000
@@ -1,4 +1,4 @@
-<?= "<?php\n" ?>
+<?= "<?php\n"; ?>
 
 namespace App\Controller;
 
@@ -6,13 +6,13 @@
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Response;
 
-class <?= $controller_class_name ?> extends Controller
+class <?= $controller_class_name; ?> extends Controller
 {
     /**
-     * @Route("<?= $route_path ?>", name="<?= $route_name ?>")
+     * @Route("<?= $route_path; ?>", name="<?= $route_name; ?>")
      */
     public function index()
     {
-        return $this->render('<?= $twig_file ?>');
+        return $this->render('<?= $twig_file; ?>');
     }
 }
diff -ru src/Resources/skeleton/controller/ControllerWithTwig.twig.php src/Resources/skeleton/controller/ControllerWithTwig.twig.php
--- src/Resources/skeleton/controller/ControllerWithTwig.twig.php	2017-12-06 08:46:52.207361645 +0000
+++ src/Resources/skeleton/controller/ControllerWithTwig.twig.php	2017-12-06 08:46:52.897346611 +0000
@@ -1,6 +1,6 @@
-<?= $twig_first_line ?>
+<?= $twig_first_line; ?>
 
 {% block body %}
-<h1>Hello <?= $controller_class_name ?>!</h1>
-<p>From <code>templates/<?= $twig_file ?></code></p>
+<h1>Hello <?= $controller_class_name; ?>!</h1>
+<p>From <code>templates/<?= $twig_file; ?></code></p>
 {% endblock %}
diff -ru src/Str.php src/Str.php
--- src/Str.php	2017-12-06 08:46:52.334358878 +0000
+++ src/Str.php	2017-12-06 08:46:52.759349618 +0000
@@ -55,7 +55,7 @@
     public static function asClassName(string $value, string $suffix = ''): string
     {
         $value = trim($value);
-        $value = str_replace(['-', '_', '.', ':'], ' ', $value);
+        $value = str_replace(array('-', '_', '.', ':'), ' ', $value);
         $value = ucwords($value);
         $value = str_replace(' ', '', $value);
         $value = ucfirst($value);
@@ -109,7 +109,7 @@
 
     public static function getRandomTerm(): string
     {
-        $adjectives = [
+        $adjectives = array(
             'tiny',
             'delicious',
             'gentle',
@@ -119,8 +119,8 @@
             'grumpy',
             'fierce',
             'victorious',
-        ];
-        $nouns = [
+        );
+        $nouns = array(
             'elephant',
             'pizza',
             'jellybean',
@@ -128,7 +128,7 @@
             'puppy',
             'gnome',
             'kangaroo',
-        ];
+        );
 
         return sprintf('%s %s', $adjectives[array_rand($adjectives)], $nouns[array_rand($nouns)]);
     }

0
Common Typos

0
File Permissions