Skip to content

Commit 4c0b639

Browse files
committed
fix fabpot.ci CS
1 parent bf9a5c1 commit 4c0b639

File tree

7 files changed

+61
-61
lines changed

7 files changed

+61
-61
lines changed

src/Maker/MakeCrud.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getParameters(InputInterface $input): array
9090

9191
$metadata = $this->entityManager->getClassMetadata('App\\Entity\\'.$entityClassName);
9292

93-
return [
93+
return array(
9494
'controller_class_name' => $controllerClassName,
9595
'entity_var_plural' => lcfirst(Inflector::pluralize($entityClassName)),
9696
'entity_var_singular' => lcfirst(Inflector::singularize($entityClassName)),
@@ -100,22 +100,22 @@ public function getParameters(InputInterface $input): array
100100
'form_class_name' => $formClassName,
101101
'route_path' => Str::asRoutePath(str_replace('Controller', '', $controllerClassName)),
102102
'route_name' => Str::asRouteName(str_replace('Controller', '', $controllerClassName)),
103-
];
103+
);
104104
}
105105

106106
/**
107107
* {@inheritdoc}
108108
*/
109109
public function getFiles(array $params): array
110110
{
111-
return [
111+
return array(
112112
__DIR__.'/../Resources/skeleton/crud/controller/ControllerWithTwig.tpl.php' => 'src/Controller/'.$params['controller_class_name'].'.php',
113113
__DIR__.'/../Resources/skeleton/crud/form/Type.tpl.php' => 'src/Form/'.$params['form_class_name'].'.php',
114114
__DIR__.'/../Resources/skeleton/crud/templates/index.tpl.php' => 'templates/'.$params['route_name'].'/index.html.twig',
115115
__DIR__.'/../Resources/skeleton/crud/templates/show.tpl.php' => 'templates/'.$params['route_name'].'/show.html.twig',
116116
__DIR__.'/../Resources/skeleton/crud/templates/new.tpl.php' => 'templates/'.$params['route_name'].'/new.html.twig',
117117
__DIR__.'/../Resources/skeleton/crud/templates/edit.tpl.php' => 'templates/'.$params['route_name'].'/edit.html.twig',
118-
];
118+
);
119119
}
120120

121121
/**

src/Resources/skeleton/crud/controller/ControllerWithTwig.tpl.php

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<?= "<?php\n" ?>
1+
<?= "<?php\n"; ?>
22

33
namespace App\Controller;
44

5-
use App\Entity\<?= $entity_class_name ?>;
6-
use App\Form\<?= $form_class_name ?>;
5+
use App\Entity\<?= $entity_class_name; ?>;
6+
use App\Form\<?= $form_class_name; ?>;
77
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
88
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
99
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
1010
use Symfony\Component\HttpFoundation\Request;
1111
use Symfony\Component\HttpFoundation\Response;
1212

1313
/**
14-
* @Route("<?= $route_path ?>", name="<?= $route_name ?>_")
14+
* @Route("<?= $route_path; ?>", name="<?= $route_name; ?>_")
1515
*/
1616
class <?= $controller_class_name ?> extends Controller
1717
{
@@ -22,27 +22,27 @@ class <?= $controller_class_name ?> extends Controller
2222
*/
2323
public function index()
2424
{
25-
$<?= $entity_var_plural ?> = $this->getDoctrine()
26-
->getRepository(<?= $entity_class_name ?>::class)
25+
$<?= $entity_var_plural; ?> = $this->getDoctrine()
26+
->getRepository(<?= $entity_class_name; ?>::class)
2727
->findAll();
2828

29-
return $this->render('<?= $route_name ?>/index.html.twig', ['<?= $entity_var_plural ?>' => $<?= $entity_var_plural ?>]);
29+
return $this->render('<?= $route_name; ?>/index.html.twig', ['<?= $entity_var_plural; ?>' => $<?= $entity_var_plural; ?>]);
3030
}
3131

3232
/**
33-
* @Route("/{<?= $entity_identifier ?>}", name="show")
33+
* @Route("/{<?= $entity_identifier; ?>}", name="show")
3434
* @Method("GET")
3535
*
36-
* @param <?= $entity_class_name ?> $<?= $entity_var_singular ?> The <?= $entity_class_name ?> entity
36+
* @param <?= $entity_class_name; ?> $<?= $entity_var_singular; ?> The <?= $entity_class_name; ?> entity
3737
*
3838
* @return Response
3939
*/
40-
public function show(<?= $entity_class_name ?> $<?= $entity_var_singular ?>)
40+
public function show(<?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
4141
{
42-
$deleteForm = $this->createDeleteForm($<?= $entity_var_singular ?>);
42+
$deleteForm = $this->createDeleteForm($<?= $entity_var_singular; ?>);
4343

44-
return $this->render('<?= $route_name ?>/show.html.twig', [
45-
'<?= $entity_var_singular ?>' => $<?= $entity_var_singular ?>,
44+
return $this->render('<?= $route_name; ?>/show.html.twig', [
45+
'<?= $entity_var_singular; ?>' => $<?= $entity_var_singular; ?>,
4646
'delete_form' => $deleteForm->createView(),
4747
]);
4848
}
@@ -57,87 +57,87 @@ public function show(<?= $entity_class_name ?> $<?= $entity_var_singular ?>)
5757
*/
5858
public function new(Request $request)
5959
{
60-
$<?= $entity_var_singular ?> = new <?= $entity_class_name ?>();
61-
$form = $this->createForm(<?= $form_class_name?>::class, $<?= $entity_var_singular ?>);
60+
$<?= $entity_var_singular; ?> = new <?= $entity_class_name; ?>();
61+
$form = $this->createForm(<?= $form_class_name; ?>::class, $<?= $entity_var_singular; ?>);
6262
$form->handleRequest($request);
6363

6464
if ($form->isSubmitted() && $form->isValid()) {
6565
$em = $this->getDoctrine()->getManager();
66-
$em->persist($<?= $entity_var_singular ?>);
66+
$em->persist($<?= $entity_var_singular; ?>);
6767
$em->flush();
6868

69-
return $this->redirectToRoute('<?= $route_name ?>_edit', ['<?= $entity_identifier ?>' => $<?= $entity_var_singular ?>->get<?= ucfirst($entity_identifier) ?>()]);
69+
return $this->redirectToRoute('<?= $route_name; ?>_edit', ['<?= $entity_identifier; ?>' => $<?= $entity_var_singular; ?>->get<?= ucfirst($entity_identifier); ?>()]);
7070
}
7171

72-
return $this->render('<?= $route_name ?>/new.html.twig', [
73-
'<?= $entity_var_singular ?>' => $<?= $entity_var_singular ?>,
72+
return $this->render('<?= $route_name; ?>/new.html.twig', [
73+
'<?= $entity_var_singular; ?>' => $<?= $entity_var_singular; ?>,
7474
'form' => $form->createView(),
7575
]);
7676
}
7777

7878
/**
79-
* @Route("/{<?= $entity_identifier ?>}/edit", name="edit")
79+
* @Route("/{<?= $entity_identifier; ?>}/edit", name="edit")
8080
* @Method({"GET", "POST"})
8181
*
8282
* @param Request $request
83-
* @param <?= $entity_class_name ?> $<?= $entity_var_singular ?> The <?= $entity_class_name ?> entity
83+
* @param <?= $entity_class_name; ?> $<?= $entity_var_singular; ?> The <?= $entity_class_name; ?> entity
8484
*
8585
* @return Response
8686
*/
87-
public function edit(Request $request, <?= $entity_class_name ?> $<?= $entity_var_singular ?>)
87+
public function edit(Request $request, <?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
8888
{
89-
$form = $this->createForm(<?= $form_class_name?>::class, $<?= $entity_var_singular ?>);
89+
$form = $this->createForm(<?= $form_class_name; ?>::class, $<?= $entity_var_singular; ?>);
9090
$form->handleRequest($request);
9191

92-
$deleteForm = $this->createDeleteForm($<?= $entity_var_singular ?>);
92+
$deleteForm = $this->createDeleteForm($<?= $entity_var_singular; ?>);
9393

9494
if ($form->isSubmitted() && $form->isValid()) {
9595
$this->getDoctrine()->getManager()->flush();
9696

97-
return $this->redirectToRoute('<?= $route_name ?>_edit', ['<?= $entity_identifier ?>' => $<?= $entity_var_singular ?>->get<?= ucfirst($entity_identifier) ?>()]);
97+
return $this->redirectToRoute('<?= $route_name; ?>_edit', ['<?= $entity_identifier; ?>' => $<?= $entity_var_singular; ?>->get<?= ucfirst($entity_identifier); ?>()]);
9898
}
9999

100-
return $this->render('<?= $route_name ?>/edit.html.twig', [
101-
'<?= $entity_var_singular ?>' => $<?= $entity_var_singular ?>,
100+
return $this->render('<?= $route_name; ?>/edit.html.twig', [
101+
'<?= $entity_var_singular; ?>' => $<?= $entity_var_singular; ?>,
102102
'form' => $form->createView(),
103103
'delete_form' => $deleteForm->createView(),
104104
]);
105105
}
106106

107107
/**
108-
* @Route("/{<?= $entity_identifier ?>}", name="delete")
108+
* @Route("/{<?= $entity_identifier; ?>}", name="delete")
109109
* @Method("DELETE")
110110
*
111111
* @param Request $request
112-
* @param <?= $entity_class_name ?> $<?= $entity_var_singular ?> The <?= $entity_class_name ?> entity
112+
* @param <?= $entity_class_name; ?> $<?= $entity_var_singular; ?> The <?= $entity_class_name; ?> entity
113113
*
114114
* @return Response
115115
*/
116-
public function delete(Request $request, <?= $entity_class_name ?> $<?= $entity_var_singular ?>)
116+
public function delete(Request $request, <?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
117117
{
118-
$form = $this->createDeleteForm($<?= $entity_var_singular ?>);
118+
$form = $this->createDeleteForm($<?= $entity_var_singular; ?>);
119119
$form->handleRequest($request);
120120

121121
if ($form->isSubmitted() && $form->isValid()) {
122122
$em = $this->getDoctrine()->getManager();
123-
$em->remove($<?= $entity_var_singular ?>);
123+
$em->remove($<?= $entity_var_singular; ?>);
124124
$em->flush();
125125
}
126126

127-
return $this->redirectToRoute('<?= $route_name ?>_index');
127+
return $this->redirectToRoute('<?= $route_name; ?>_index');
128128
}
129129

130130
/**
131-
* Creates a form to delete a <?= $entity_class_name ?> entity.
131+
* Creates a form to delete a <?= $entity_class_name; ?> entity.
132132
*
133-
* @param <?= $entity_class_name ?> $<?= $entity_var_singular ?> The <?= $entity_class_name ?> entity
133+
* @param <?= $entity_class_name; ?> $<?= $entity_var_singular; ?> The <?= $entity_class_name; ?> entity
134134
*
135135
* @return \Symfony\Component\Form\FormInterface The form
136136
*/
137-
private function createDeleteForm(<?= $entity_class_name ?> $<?= $entity_var_singular ?>)
137+
private function createDeleteForm(<?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
138138
{
139139
return $this->createFormBuilder()
140-
->setAction($this->generateUrl('<?= $route_name ?>_delete', ['<?= $entity_identifier ?>' => $<?= $entity_var_singular ?>->get<?= ucfirst($entity_identifier) ?>()]))
140+
->setAction($this->generateUrl('<?= $route_name; ?>_delete', ['<?= $entity_identifier; ?>' => $<?= $entity_var_singular; ?>->get<?= ucfirst($entity_identifier); ?>()]))
141141
->setMethod('DELETE')
142142
->getForm()
143143
;
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
<?= "<?php\n" ?>
1+
<?= "<?php\n"; ?>
22

33
namespace App\Form;
44

5-
use App\Entity\<?= $entity_class_name ?>;
5+
use App\Entity\<?= $entity_class_name; ?>;
66
use Symfony\Component\Form\AbstractType;
77
use Symfony\Component\Form\FormBuilderInterface;
88
use Symfony\Component\OptionsResolver\OptionsResolver;
99

10-
class <?= $form_class_name ?> extends AbstractType
10+
class <?= $form_class_name; ?> extends AbstractType
1111
{
1212
public function buildForm(FormBuilderInterface $builder, array $options)
1313
{
1414
$builder
15-
<?php foreach ($entity_fields as $field): ?><?php if ($field['fieldName'] !== $entity_identifier): ?>->add('<?= $field['fieldName'] ?>')
15+
<?php foreach ($entity_fields as $field): ?><?php if ($field['fieldName'] !== $entity_identifier): ?>->add('<?= $field['fieldName']; ?>')
1616
<?php endif; ?><?php endforeach; ?>;
1717
}
1818

1919
public function configureOptions(OptionsResolver $resolver)
2020
{
2121
$resolver->setDefaults([
22-
'data_class' => <?= $entity_class_name ?>::class,
22+
'data_class' => <?= $entity_class_name; ?>::class,
2323
]);
2424
}
2525
}

src/Resources/skeleton/crud/templates/edit.tpl.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends 'base.html.twig' %}
22

33
{% block body %}
4-
<h1>Edit <?= $entity_class_name ?></h1>
4+
<h1>Edit <?= $entity_class_name; ?></h1>
55

66
{{ form_start(form) }}
77
{{ form_widget(form) }}
@@ -10,7 +10,7 @@
1010

1111
<ul>
1212
<li>
13-
<a href="{{ path('<?= $route_name ?>_index') }}">back to list</a>
13+
<a href="{{ path('<?= $route_name; ?>_index') }}">back to list</a>
1414
</li>
1515
<li>
1616
{{ form_start(delete_form) }}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{% extends 'base.html.twig' %}
22

33
{% block body %}
4-
<h1><?= $entity_class_name ?> index</h1>
4+
<h1><?= $entity_class_name; ?> index</h1>
55
<table>
66
<tr>
7-
<?php foreach ($entity_fields as $field): ?><th><?= ucfirst($field['fieldName']) ?></th>
7+
<?php foreach ($entity_fields as $field): ?><th><?= ucfirst($field['fieldName']); ?></th>
88
<?php endforeach; ?>
99
<th>actions</th>
1010
</tr>
1111
{% for <?= $entity_var_singular ?> in <?= $entity_var_plural ?> %}
1212
<tr>
13-
<?php foreach ($entity_fields as $field): ?><td>{{ <?= $entity_var_singular ?>.<?= $field['fieldName'] ?> }}</td>
13+
<?php foreach ($entity_fields as $field): ?><td>{{ <?= $entity_var_singular ?>.<?= $field['fieldName']; ?> }}</td>
1414
<?php endforeach; ?>
1515
<td>
16-
<a href="{{ path('<?= $route_name ?>_show', {'<?= $entity_identifier ?>':<?= $entity_var_singular ?>.<?= $entity_identifier ?>}) }}">show</a>
17-
<a href="{{ path('<?= $route_name ?>_edit', {'<?= $entity_identifier ?>':<?= $entity_var_singular ?>.<?= $entity_identifier ?>}) }}">edit</a>
16+
<a href="{{ path('<?= $route_name; ?>_show', {'<?= $entity_identifier; ?>':<?= $entity_var_singular; ?>.<?= $entity_identifier; ?>}) }}">show</a>
17+
<a href="{{ path('<?= $route_name; ?>_edit', {'<?= $entity_identifier; ?>':<?= $entity_var_singular; ?>.<?= $entity_identifier; ?>}) }}">edit</a>
1818
</td>
1919
</tr>
2020
{% else %}
2121
<tr>
22-
<td colspan="<?= (count($entity_fields) + 1) ?>">no records found</td>
22+
<td colspan="<?= (count($entity_fields) + 1); ?>">no records found</td>
2323
</tr>
2424
{% endfor %}
2525
</table>
26-
<a href="{{ path('<?= $route_name ?>_new') }}">Create new</a>
26+
<a href="{{ path('<?= $route_name; ?>_new') }}">Create new</a>
2727
{% endblock %}

src/Resources/skeleton/crud/templates/new.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends 'base.html.twig' %}
22

33
{% block body %}
4-
<h1>Create new <?= $entity_class_name ?></h1>
4+
<h1>Create new <?= $entity_class_name; ?></h1>
55
{{ form_start(form) }}
66
{{ form_widget(form) }}
77
<input type="submit" value="Save">

src/Resources/skeleton/crud/templates/show.tpl.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{% extends 'base.html.twig' %}
22

33
{% block body %}
4-
<h1><?= $entity_class_name ?></h1>
4+
<h1><?= $entity_class_name; ?></h1>
55

66
<table>
77
<?php foreach ($entity_fields as $field): ?>
88
<tr>
9-
<th><?= ucfirst($field['fieldName']) ?></th>
10-
<td>{{ <?= $entity_var_singular ?>.<?= $field['fieldName'] ?> }}</td>
9+
<th><?= ucfirst($field['fieldName']); ?></th>
10+
<td>{{ <?= $entity_var_singular; ?>.<?= $field['fieldName']; ?> }}</td>
1111
</tr>
1212
<?php endforeach; ?>
1313
</table>
1414

1515
<ul>
1616
<li>
17-
<a href="{{ path('<?= $route_name ?>_index') }}">back to list</a>
17+
<a href="{{ path('<?= $route_name; ?>_index') }}">back to list</a>
1818
</li>
1919
<li>
20-
<a href="{{ path('<?= $route_name ?>_edit', {'<?= $entity_identifier ?>':<?= $entity_var_singular ?>.<?= $entity_identifier ?>}) }}">edit</a>
20+
<a href="{{ path('<?= $route_name; ?>_edit', {'<?= $entity_identifier; ?>':<?= $entity_var_singular; ?>.<?= $entity_identifier; ?>}) }}">edit</a>
2121
</li>
2222
<li>
2323
{{ form_start(delete_form) }}

0 commit comments

Comments
 (0)