Skip to content

Commit

Permalink
Fix short echo CS in bake class templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrowe committed Aug 23, 2014
1 parent 8e28b7c commit 70fbaad
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions src/Template/Bake/default/actions/controller_actions.ctp
Expand Up @@ -59,7 +59,7 @@ $allAssociations = array_merge(
$<?= $singularName?> = $this-><?= $currentModelName ?>->get($id, [
'contain' => [<?= $stringifyList($allAssociations) ?>]
]);
$this->set('<?= $singularName; ?>', $<?= $singularName; ?>);
$this->set('<?= $singularName ?>', $<?= $singularName ?>);
}

<?php $compact = ["'" . $singularName . "'"]; ?>
Expand All @@ -72,10 +72,10 @@ $allAssociations = array_merge(
$<?= $singularName ?> = $this-><?= $currentModelName ?>->newEntity($this->request->data);
if ($this->request->is('post')) {
if ($this-><?= $currentModelName; ?>->save($<?= $singularName ?>)) {
$this->Flash->success('The <?= strtolower($singularHumanName); ?> has been saved.');
$this->Flash->success('The <?= strtolower($singularHumanName) ?> has been saved.');
return $this->redirect(['action' => 'index']);
} else {
$this->Flash->error('The <?= strtolower($singularHumanName); ?> could not be saved. Please, try again.');
$this->Flash->error('The <?= strtolower($singularHumanName) ?> could not be saved. Please, try again.');
}
}
<?php
Expand Down Expand Up @@ -105,10 +105,10 @@ $allAssociations = array_merge(
if ($this->request->is(['patch', 'post', 'put'])) {
$<?= $singularName ?> = $this-><?= $currentModelName ?>->patchEntity($<?= $singularName ?>, $this->request->data);
if ($this-><?= $currentModelName; ?>->save($<?= $singularName ?>)) {
$this->Flash->success('The <?= strtolower($singularHumanName); ?> has been saved.');
$this->Flash->success('The <?= strtolower($singularHumanName) ?> has been saved.');
return $this->redirect(['action' => 'index']);
} else {
$this->Flash->error('The <?= strtolower($singularHumanName); ?> could not be saved. Please, try again.');
$this->Flash->error('The <?= strtolower($singularHumanName) ?> could not be saved. Please, try again.');
}
}
<?php
Expand All @@ -134,9 +134,9 @@ $allAssociations = array_merge(
$<?= $singularName ?> = $this-><?= $currentModelName ?>->get($id);
$this->request->allowMethod('post', 'delete');
if ($this-><?= $currentModelName; ?>->delete($<?= $singularName ?>)) {
$this->Flash->success('The <?= strtolower($singularHumanName); ?> has been deleted.');
$this->Flash->success('The <?= strtolower($singularHumanName) ?> has been deleted.');
} else {
$this->Flash->error('The <?= strtolower($singularHumanName); ?> could not be deleted. Please, try again.');
$this->Flash->error('The <?= strtolower($singularHumanName) ?> could not be deleted. Please, try again.');
}
return $this->redirect(['action' => 'index']);
}
4 changes: 2 additions & 2 deletions src/Template/Bake/default/classes/controller.ctp
Expand Up @@ -24,7 +24,7 @@ namespace <?= $namespace ?>\Controller<?= $prefix ?>;
use <?= $namespace ?>\Controller\AppController;

/**
* <?= $name; ?> Controller
* <?= $name ?> Controller
*
<?php
$defaultModel = $name;
Expand All @@ -36,7 +36,7 @@ if (!empty($components)) {
}
?>
*/
class <?= $name; ?>Controller extends AppController {
class <?= $name ?>Controller extends AppController {

<?php

Expand Down
14 changes: 7 additions & 7 deletions src/Template/Bake/default/classes/fixture.ctp
Expand Up @@ -18,23 +18,23 @@
*/
?>
<?= '<?php' . "\n"; ?>
namespace <?= $namespace; ?>\Test\Fixture;
namespace <?= $namespace ?>\Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;

/**
* <?= $name; ?>Fixture
* <?= $name ?>Fixture
*
*/
class <?= $name; ?>Fixture extends TestFixture {
class <?= $name ?>Fixture extends TestFixture {

<?php if ($table): ?>
/**
* Table name
*
* @var string
*/
public $table = '<?= $table; ?>';
public $table = '<?= $table ?>';

<?php endif; ?>
<?php if ($import): ?>
Expand All @@ -43,7 +43,7 @@ class <?= $name; ?>Fixture extends TestFixture {
*
* @var array
*/
public $import = <?= $import; ?>;
public $import = <?= $import ?>;

<?php endif; ?>
<?php if ($schema): ?>
Expand All @@ -52,7 +52,7 @@ class <?= $name; ?>Fixture extends TestFixture {
*
* @var array
*/
public $fields = <?= $schema; ?>;
public $fields = <?= $schema ?>;

<?php endif; ?>
<?php if ($records): ?>
Expand All @@ -61,7 +61,7 @@ class <?= $name; ?>Fixture extends TestFixture {
*
* @var array
*/
public $records = <?= $records; ?>;
public $records = <?= $records ?>;

<?php endif; ?>
}
20 changes: 10 additions & 10 deletions src/Template/Bake/default/classes/test.ctp
Expand Up @@ -31,12 +31,12 @@ use Cake\TestSuite\TestCase;
<?php endif; ?>

/**
* <?= $fullClassName; ?> Test Case
* <?= $fullClassName ?> Test Case
*/
<?php if ($isController): ?>
class <?= $className; ?>Test extends ControllerTestCase {
class <?= $className ?>Test extends ControllerTestCase {
<?php else: ?>
class <?= $className; ?>Test extends TestCase {
class <?= $className ?>Test extends TestCase {
<?php endif; ?>

<?php if (!empty($fixtures)): ?>
Expand All @@ -58,9 +58,9 @@ class <?= $className; ?>Test extends TestCase {
*/
public function setUp() {
parent::setUp();
<?= $preConstruct ? "\t\t" . $preConstruct : ''; ?>
$this-><?= $subject . ' = ' . $construction; ?>
<?= $postConstruct ? "\t\t" . $postConstruct : ''; ?>
<?= $preConstruct ? "\t\t" . $preConstruct : '' ?>
$this-><?= $subject . ' = ' . $construction ?>
<?= $postConstruct ? "\t\t" . $postConstruct : '' ?>
}

/**
Expand All @@ -69,20 +69,20 @@ class <?= $className; ?>Test extends TestCase {
* @return void
*/
public function tearDown() {
unset($this-><?= $subject; ?>);
unset($this-><?= $subject ?>);

parent::tearDown();
}

<?php endif; ?>
<?php foreach ($methods as $method): ?>
/**
* test<?= Inflector::camelize($method); ?> method
* test<?= Inflector::camelize($method) ?> method
*
* @return void
*/
public function test<?= Inflector::camelize($method); ?>() {
$this->markTestIncomplete('test<?= Inflector::camelize($method); ?> not implemented.');
public function test<?= Inflector::camelize($method) ?>() {
$this->markTestIncomplete('test<?= Inflector::camelize($method) ?> not implemented.');
}

<?php endforeach; ?>
Expand Down

0 comments on commit 70fbaad

Please sign in to comment.