From 97ebbc8e2353c9ac35a449087fdb3e7caa0c2c7c Mon Sep 17 00:00:00 2001 From: Jelle Henkens Date: Sat, 19 May 2012 15:48:15 +0100 Subject: [PATCH] Fixing coding conventions --- .../Templates/default/classes/fixture.ctp | 4 +-- .../Templates/default/classes/test.ctp | 4 +-- .../Console/Templates/default/views/form.ctp | 12 ++++---- .../Console/Templates/default/views/index.ctp | 16 +++++----- .../Console/Templates/default/views/view.ctp | 30 +++++++++---------- .../skel/View/Layouts/Emails/html/default.ctp | 4 +-- .../skel/View/Layouts/Emails/text/default.ctp | 2 +- .../Templates/skel/View/Pages/home.ctp | 2 +- .../Model/Datasource/Database/MysqlTest.php | 4 +-- .../Test/Case/Routing/Route/CakeRouteTest.php | 2 +- lib/Cake/Test/Case/Utility/CakeNumberTest.php | 2 +- lib/Cake/Test/Case/Utility/CakeTimeTest.php | 2 +- lib/Cake/Test/Case/Utility/HashTest.php | 2 +- lib/Cake/Test/Case/Utility/SetTest.php | 2 +- .../Case/View/Helper/PaginatorHelperTest.php | 2 +- .../View/Layouts/Emails/html/default.ctp | 4 +-- .../View/Layouts/Emails/html/japanese.ctp | 4 +-- .../View/Layouts/Emails/html/thin.ctp | 4 +-- .../View/Layouts/Emails/text/default.ctp | 2 +- .../View/Layouts/Emails/text/japanese.ctp | 2 +- lib/Cake/Test/test_app/View/Pages/home.ctp | 2 +- .../Test/test_app/View/Posts/cache_form.ctp | 6 ++-- lib/Cake/TestSuite/templates/menu.php | 10 +++---- lib/Cake/Utility/File.php | 2 +- lib/Cake/Utility/Inflector.php | 4 +-- lib/Cake/View/Errors/missing_action.ctp | 4 +-- lib/Cake/View/Helper/CacheHelper.php | 2 +- lib/Cake/View/Scaffolds/form.ctp | 6 ++-- lib/Cake/View/Scaffolds/index.ctp | 12 ++++---- lib/Cake/View/Scaffolds/view.ctp | 12 ++++---- 30 files changed, 83 insertions(+), 83 deletions(-) diff --git a/lib/Cake/Console/Templates/default/classes/fixture.ctp b/lib/Cake/Console/Templates/default/classes/fixture.ctp index 2bec6a549..dda2baf42 100644 --- a/lib/Cake/Console/Templates/default/classes/fixture.ctp +++ b/lib/Cake/Console/Templates/default/classes/fixture.ctp @@ -52,7 +52,7 @@ class Fixture extends CakeTestFixture { */ public $fields = ; - + /** * Records @@ -61,5 +61,5 @@ class Fixture extends CakeTestFixture { */ public $records = ; - + } diff --git a/lib/Cake/Console/Templates/default/classes/test.ctp b/lib/Cake/Console/Templates/default/classes/test.ctp index c412542ef..5bf1fc502 100644 --- a/lib/Cake/Console/Templates/default/classes/test.ctp +++ b/lib/Cake/Console/Templates/default/classes/test.ctp @@ -62,7 +62,7 @@ class Test extends CakeTestCase { * @return void */ public function tearDown() { - unset($this->); + unset($this->); parent::tearDown(); } @@ -76,5 +76,5 @@ class Test extends CakeTestCase { public function test() { } - + } diff --git a/lib/Cake/Console/Templates/default/views/form.ctp b/lib/Cake/Console/Templates/default/views/form.ctp index aaf3c23d7..b6fa78800 100644 --- a/lib/Cake/Console/Templates/default/views/form.ctp +++ b/lib/Cake/Console/Templates/default/views/form.ctp @@ -16,8 +16,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -
-Form->create('{$modelClass}');?>\n";?> +
+Form->create('{$modelClass}'); ?>\n"; ?>
", Inflector::humanize($action), $singularHumanName); ?>
Form->end(__('Submit'));?>\n"; + echo "Form->end(__('Submit')); ?>\n"; ?>
@@ -46,9 +46,9 @@
    -
  • Form->postLink(__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?>
  • - -
  • Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index'));?>";?>
  • +
  • Form->postLink(__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>"; ?>
  • + +
  • Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?>"; ?>
  • $data) { diff --git a/lib/Cake/Console/Templates/default/views/index.ctp b/lib/Cake/Console/Templates/default/views/index.ctp index ded100e8e..451ddfd15 100644 --- a/lib/Cake/Console/Templates/default/views/index.ctp +++ b/lib/Cake/Console/Templates/default/views/index.ctp @@ -16,14 +16,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -
    -

    ";?>

    +
    +

    "; ?>

    - - - - + + + + Paginator->counter(array( 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); - ?>";?> + ?>"; ?>

    @@ -76,7 +76,7 @@

    "; ?>

      -
    • Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?>";?>
    • +
    • Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?>"; ?>
    • $data) { diff --git a/lib/Cake/Console/Templates/default/views/view.ctp b/lib/Cake/Console/Templates/default/views/view.ctp index 5daf35f2d..c3a7087a7 100644 --- a/lib/Cake/Console/Templates/default/views/view.ctp +++ b/lib/Cake/Console/Templates/default/views/view.ctp @@ -16,8 +16,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -
      -

      ";?>

      +
      +

      "; ?>

      $details): ?> @@ -99,8 +99,8 @@ foreach ($relations as $alias => $details): $otherPluralHumanName = Inflector::humanize($details['controller']); ?>
    Paginator->sort('{$field}');?>";?>";?>Paginator->sort('{$field}'); ?>"; ?>"; ?>
    $details): echo "\t\t\n"; } ?> - + \n"; echo "\t\t\n"; foreach ($details['fields'] as $field) { - echo "\t\t\t\n"; + echo "\t\t\t\n"; } echo "\t\t\t
    ";?>"; ?>
    \n"; @@ -129,11 +129,11 @@ echo "\t\n"; ?>
    -\n\n";?> +\n\n"; ?>
      -
    • Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?>
    • +
    • Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>"; ?>
    - + diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp index a1cc8369c..12a9171db 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp @@ -20,11 +20,11 @@ - <?php echo $title_for_layout;?> + <?php echo $title_for_layout; ?> - fetch('content');?> + fetch('content'); ?>

    This email was sent using the CakePHP Framework

    diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp index 0a25fb93d..f914b3d36 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp @@ -17,6 +17,6 @@ */ ?> -fetch('content');?> +fetch('content'); ?> This email was sent using the CakePHP Framework, http://cakephp.org. diff --git a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp index 6661e9a62..82f76fe2a 100644 --- a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp +++ b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp @@ -116,7 +116,7 @@ if (isset($filePresent)): endif; ?>

    - + Dbo->conditions( array('Member.name' => 'Mariano'), true, false); + $result = $this->Dbo->conditions(array('Member.name' => 'Mariano'), true, false); $this->assertRegExp('/^\s*`Member`.`name`\s*=\s*\'Mariano\'\s*$/', $result); - $result = $this->Dbo->conditions( array(), true, false); + $result = $this->Dbo->conditions(array(), true, false); $this->assertRegExp('/^\s*1\s*=\s*1\s*$/', $result); } diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php index a60f04530..01799363f 100644 --- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php @@ -869,7 +869,7 @@ class CakeRouteTest extends CakeTestCase { * @return void */ public function testParseTrailingUTF8() { - $route = new CakeRoute( '/category/**', array('controller' => 'categories','action' => 'index')); + $route = new CakeRoute('/category/**', array('controller' => 'categories','action' => 'index')); $result = $route->parse('/category/%D9%85%D9%88%D8%A8%D8%A7%DB%8C%D9%84'); $expected = array( 'controller' => 'categories', diff --git a/lib/Cake/Test/Case/Utility/CakeNumberTest.php b/lib/Cake/Test/Case/Utility/CakeNumberTest.php index 7fb9d1590..7c2dab19e 100644 --- a/lib/Cake/Test/Case/Utility/CakeNumberTest.php +++ b/lib/Cake/Test/Case/Utility/CakeNumberTest.php @@ -228,7 +228,7 @@ class CakeNumberTest extends CakeTestCase { $this->Number->addFormat('Other2', array('before' => '$ ', 'after' => false)); $result = $this->Number->currency(0.22, 'Other2'); $expected = '$ 0.22'; - $this->assertEquals($expected,$result); + $this->assertEquals($expected, $result); } /** diff --git a/lib/Cake/Test/Case/Utility/CakeTimeTest.php b/lib/Cake/Test/Case/Utility/CakeTimeTest.php index 87d05c33f..fc9fed0fe 100644 --- a/lib/Cake/Test/Case/Utility/CakeTimeTest.php +++ b/lib/Cake/Test/Case/Utility/CakeTimeTest.php @@ -212,7 +212,7 @@ class CakeTimeTest extends CakeTestCase { if ($time == time()) { $expected = 'just now'; $this->assertEquals($expected, $result); - } else if (date("Y-m-d", $time) == date("Y-m-d")) { + } elseif (date("Y-m-d", $time) == date("Y-m-d")) { $expected = 'Today, ' . date("H:i", $time); $this->assertEquals($expected, $result); } diff --git a/lib/Cake/Test/Case/Utility/HashTest.php b/lib/Cake/Test/Case/Utility/HashTest.php index e4647e1bd..d4d3c94d5 100644 --- a/lib/Cake/Test/Case/Utility/HashTest.php +++ b/lib/Cake/Test/Case/Utility/HashTest.php @@ -1196,7 +1196,7 @@ class HashTest extends CakeTestCase { $expected = array( 'Some' => array( 'string' => array( - 'value' => array( 'values') + 'value' => array('values') ) ) ); diff --git a/lib/Cake/Test/Case/Utility/SetTest.php b/lib/Cake/Test/Case/Utility/SetTest.php index 51778582f..4960a139d 100644 --- a/lib/Cake/Test/Case/Utility/SetTest.php +++ b/lib/Cake/Test/Case/Utility/SetTest.php @@ -1445,7 +1445,7 @@ class SetTest extends CakeTestCase { ); $result = Set::extract($a, '{n}.Article.id'); - $expected = array( 1, 2, 3 ); + $expected = array(1, 2, 3); $this->assertEquals($expected, $result); $result = Set::extract($a, '{n}.Article.title'); diff --git a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php index 6d06541b0..fb8289f0c 100644 --- a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php @@ -581,7 +581,7 @@ class PaginatorHelperTest extends CakeTestCase { Router::parse('/'); - Router::setRequestInfo( array( + Router::setRequestInfo(array( array('controller' => 'posts', 'action' => 'index', 'form' => array(), 'url' => array(), 'plugin' => null), array('base' => '', 'here' => 'posts/index', 'webroot' => '/') )); diff --git a/lib/Cake/Test/test_app/View/Layouts/Emails/html/default.ctp b/lib/Cake/Test/test_app/View/Layouts/Emails/html/default.ctp index 414da23a7..31a92817d 100644 --- a/lib/Cake/Test/test_app/View/Layouts/Emails/html/default.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/Emails/html/default.ctp @@ -20,11 +20,11 @@ - <?php echo $title_for_layout;?> + <?php echo $title_for_layout; ?> - +

    This email was sent using the CakePHP Framework

    diff --git a/lib/Cake/Test/test_app/View/Layouts/Emails/html/japanese.ctp b/lib/Cake/Test/test_app/View/Layouts/Emails/html/japanese.ctp index 3a607dd6f..caca09b5d 100644 --- a/lib/Cake/Test/test_app/View/Layouts/Emails/html/japanese.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/Emails/html/japanese.ctp @@ -20,11 +20,11 @@ - <?php echo $title_for_layout;?> + <?php echo $title_for_layout; ?> - +

    このメールは CakePHP Framework を利用して送信しました。

    diff --git a/lib/Cake/Test/test_app/View/Layouts/Emails/html/thin.ctp b/lib/Cake/Test/test_app/View/Layouts/Emails/html/thin.ctp index 9db3996fb..09d0e3212 100644 --- a/lib/Cake/Test/test_app/View/Layouts/Emails/html/thin.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/Emails/html/thin.ctp @@ -20,11 +20,11 @@ - <?php echo $title_for_layout;?> + <?php echo $title_for_layout; ?> - +

    This email was sent using the CakePHP Framework

    diff --git a/lib/Cake/Test/test_app/View/Layouts/Emails/text/default.ctp b/lib/Cake/Test/test_app/View/Layouts/Emails/text/default.ctp index 0c1547642..21fd9e2e9 100644 --- a/lib/Cake/Test/test_app/View/Layouts/Emails/text/default.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/Emails/text/default.ctp @@ -17,6 +17,6 @@ */ ?> - + This email was sent using the CakePHP Framework, http://cakephp.org. \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Layouts/Emails/text/japanese.ctp b/lib/Cake/Test/test_app/View/Layouts/Emails/text/japanese.ctp index 607cbbbcb..53a0d225b 100644 --- a/lib/Cake/Test/test_app/View/Layouts/Emails/text/japanese.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/Emails/text/japanese.ctp @@ -17,6 +17,6 @@ */ ?> - + CakePHP Framework を使って送信したメールです。 http://cakephp.org. \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Pages/home.ctp b/lib/Cake/Test/test_app/View/Pages/home.ctp index 4001038c8..bc7145982 100644 --- a/lib/Cake/Test/test_app/View/Pages/home.ctp +++ b/lib/Cake/Test/test_app/View/Pages/home.ctp @@ -85,7 +85,7 @@ if (isset($filePresent)): endif; ?>

    - + - Form->create('User');?> + Form->create('User'); ?>
    - + Form->input('username'); echo $this->Form->input('email'); echo $this->Form->input('password'); ?>
    - Form->end('Submit');?> + Form->end('Submit'); ?>
    \ No newline at end of file diff --git a/lib/Cake/TestSuite/templates/menu.php b/lib/Cake/TestSuite/templates/menu.php index a775a8ce9..e23b8a181 100644 --- a/lib/Cake/TestSuite/templates/menu.php +++ b/lib/Cake/TestSuite/templates/menu.php @@ -22,7 +22,7 @@
  • App
  • @@ -31,19 +31,19 @@ - +
  • Core
diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php index a7914f837..0a503830d 100644 --- a/lib/Cake/Utility/File.php +++ b/lib/Cake/Utility/File.php @@ -366,7 +366,7 @@ class File { if (!$ext) { $ext = $this->ext(); } - return preg_replace( "/(?:[^\w\.-]+)/", "_", basename($name, $ext)); + return preg_replace("/(?:[^\w\.-]+)/", "_", basename($name, $ext)); } /** diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 7cfc04aa2..31829d621 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -406,8 +406,8 @@ class Inflector { } if (!isset(self::$_singular['cacheUninflected']) || !isset(self::$_singular['cacheIrregular'])) { - self::$_singular['cacheUninflected'] = '(?:' . join( '|', self::$_singular['merged']['uninflected']) . ')'; - self::$_singular['cacheIrregular'] = '(?:' . join( '|', array_keys(self::$_singular['merged']['irregular'])) . ')'; + self::$_singular['cacheUninflected'] = '(?:' . join('|', self::$_singular['merged']['uninflected']) . ')'; + self::$_singular['cacheIrregular'] = '(?:' . join('|', array_keys(self::$_singular['merged']['irregular'])) . ')'; } if (preg_match('/(.*)\\b(' . self::$_singular['cacheIrregular'] . ')$/i', $word, $regs)) { diff --git a/lib/Cake/View/Errors/missing_action.ctp b/lib/Cake/View/Errors/missing_action.ctp index d2017abd4..614933ecc 100644 --- a/lib/Cake/View/Errors/missing_action.ctp +++ b/lib/Cake/View/Errors/missing_action.ctp @@ -26,10 +26,10 @@

 <?php
-class  extends AppController {
+class  extends AppController {
 
 
-	public function () {
+	public function () {
 
 	}
 
diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php
index d66f24d34..a48088650 100644
--- a/lib/Cake/View/Helper/CacheHelper.php
+++ b/lib/Cake/View/Helper/CacheHelper.php
@@ -313,7 +313,7 @@ class CacheHelper extends AppHelper {
 				$this->loadHelpers();
 				extract($this->viewVars, EXTR_SKIP);
 		?>';
-		$content = preg_replace("/(<\\?xml)/", "", $content);
+		$content = preg_replace("/(<\\?xml)/", "", $content);
 		$file .= $content;
 		return cache('views' . DS . $cache, $file, $timestamp);
 	}
diff --git a/lib/Cake/View/Scaffolds/form.ctp b/lib/Cake/View/Scaffolds/form.ctp
index eedaeff41..b6725953a 100644
--- a/lib/Cake/View/Scaffolds/form.ctp
+++ b/lib/Cake/View/Scaffolds/form.ctp
@@ -16,7 +16,7 @@
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
 ?>
-
+
Form->create(); echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated')); @@ -33,8 +33,8 @@ null, __d('cake', 'Are you sure you want to delete # %s?', $this->Form->value($modelClass . '.' . $primaryKey))); ?> - -
  • Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index'));?>
  • + +
  • Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index')); ?>
  • $_data) { diff --git a/lib/Cake/View/Scaffolds/index.ctp b/lib/Cake/View/Scaffolds/index.ctp index a00c12c2a..fffec7fa7 100644 --- a/lib/Cake/View/Scaffolds/index.ctp +++ b/lib/Cake/View/Scaffolds/index.ctp @@ -16,14 +16,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -
    -

    +
    +

    - - - - + + + + -
    +

    $_details): ?> @@ -103,7 +103,7 @@ $otherSingularVar = Inflector::variable($_alias); ?>
    Paginator->sort($_field);?>Paginator->sort($_field); ?>
      -
    • Html->link(__d('cake', "New %s", Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'));?>
    • +
    • Html->link(__d('cake', "New %s", Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')); ?>
    - +