Skip to content

Commit

Permalink
Fix newlines
Browse files Browse the repository at this point in the history
Remove editorconfig that was doing the wrong thing and removing trailing
newlines.
  • Loading branch information
markstory committed Jun 19, 2024
1 parent 3d7e7eb commit 0e66b0e
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ indent_size = 2

[phars.xml]
indent_size = 2

[*.twig]
insert_final_newline = false
2 changes: 1 addition & 1 deletion templates/bake/Controller/controller.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ class {{ name }}Controller extends AppController
{% endif %}
{%- for action in actions %}
{% if loop.index > 1 %}{{ "\n" }}{% endif %}
{{- element('Bake.Controller/' ~ action) }}
{{- element('Bake.Controller/' ~ action) -}}
{% endfor %}
}
2 changes: 1 addition & 1 deletion templates/bake/element/Controller/add.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
{%- set compact = compact|merge(["'#{otherPlural}'"]) %}
{% endfor %}
$this->set(compact({{ compact|join(', ')|raw }}));
}
}
2 changes: 1 addition & 1 deletion templates/bake/element/Controller/delete.twig
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
}

return $this->redirect(['action' => 'index']);
}
}
2 changes: 1 addition & 1 deletion templates/bake/element/Controller/edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
{%- set compact = compact|merge(["'#{otherPlural}'"]) %}
{% endfor %}
$this->set(compact({{ compact|join(', ')|raw }}));
}
}
2 changes: 1 addition & 1 deletion templates/bake/element/Controller/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
${{ pluralName }} = $this->paginate($query);

$this->set(compact('{{ pluralName }}'));
}
}
2 changes: 1 addition & 1 deletion templates/bake/element/Controller/view.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
$this->Authorization->authorize(${{ singularName }});
{% endif %}
$this->set(compact('{{ singularName }}'));
}
}
6 changes: 3 additions & 3 deletions tests/TestCase/Command/ControllerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,16 @@ public function testBakeActions()
}

/**
* Test the integration with Authorization plugin
*/
* Test the integration with Authorization plugin
*/
public function testBakeActionsAuthorizationPlugin()
{
$this->_loadTestPlugin('Authorization');

$this->generatedFile = APP . 'Controller/BakeArticlesController.php';
$this->exec('bake controller --connection test --no-test BakeArticles');

$this->assertExitCode(CommandInterface::CODE_SUCCESS);
$this->assertExitSuccess();
$result = file_get_contents($this->generatedFile);
$this->assertSameAsFile(__FUNCTION__ . '.php', $result);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/comparisons/Controller/testBakeWithPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ public function delete($id = null)

return $this->redirect(['action' => 'index']);
}
}
}

0 comments on commit 0e66b0e

Please sign in to comment.