Fixing coding conventions

This commit is contained in:
Jelle Henkens 2012-05-19 15:48:15 +01:00
parent d5b5327f70
commit 97ebbc8e23
30 changed files with 83 additions and 83 deletions

View file

@ -52,7 +52,7 @@ class <?php echo $model; ?>Fixture extends CakeTestFixture {
*/
public $fields = <?php echo $schema; ?>;
<?php endif;?>
<?php endif; ?>
<?php if ($records): ?>
/**
* Records
@ -61,5 +61,5 @@ class <?php echo $model; ?>Fixture extends CakeTestFixture {
*/
public $records = <?php echo $records; ?>;
<?php endif;?>
<?php endif; ?>
}

View file

@ -62,7 +62,7 @@ class <?php echo $fullClassName; ?>Test extends CakeTestCase {
* @return void
*/
public function tearDown() {
unset($this-><?php echo $className;?>);
unset($this-><?php echo $className; ?>);
parent::tearDown();
}
@ -76,5 +76,5 @@ class <?php echo $fullClassName; ?>Test extends CakeTestCase {
public function test<?php echo Inflector::camelize($method); ?>() {
}
<?php endforeach;?>
<?php endforeach; ?>
}

View file

@ -16,8 +16,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> form">
<?php echo "<?php echo \$this->Form->create('{$modelClass}');?>\n";?>
<div class="<?php echo $pluralVar; ?> form">
<?php echo "<?php echo \$this->Form->create('{$modelClass}'); ?>\n"; ?>
<fieldset>
<legend><?php printf("<?php echo __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName); ?></legend>
<?php
@ -38,7 +38,7 @@
?>
</fieldset>
<?php
echo "<?php echo \$this->Form->end(__('Submit'));?>\n";
echo "<?php echo \$this->Form->end(__('Submit')); ?>\n";
?>
</div>
<div class="actions">
@ -46,9 +46,9 @@
<ul>
<?php if (strpos($action, 'add') === false): ?>
<li><?php echo "<?php echo \$this->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}'))); ?>";?></li>
<?php endif;?>
<li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index'));?>";?></li>
<li><?php echo "<?php echo \$this->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}'))); ?>"; ?></li>
<?php endif; ?>
<li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?>"; ?></li>
<?php
$done = array();
foreach ($associations as $type => $data) {

View file

@ -16,14 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> index">
<h2><?php echo "<?php echo __('{$pluralHumanName}');?>";?></h2>
<div class="<?php echo $pluralVar; ?> index">
<h2><?php echo "<?php echo __('{$pluralHumanName}'); ?>"; ?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($fields as $field):?>
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}');?>";?></th>
<?php endforeach;?>
<th class="actions"><?php echo "<?php echo __('Actions');?>";?></th>
<?php foreach ($fields as $field): ?>
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}'); ?>"; ?></th>
<?php endforeach; ?>
<th class="actions"><?php echo "<?php echo __('Actions'); ?>"; ?></th>
</tr>
<?php
echo "<?php
@ -60,7 +60,7 @@
echo \$this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
));
?>";?>
?>"; ?>
</p>
<div class="paging">
@ -76,7 +76,7 @@
<div class="actions">
<h3><?php echo "<?php echo __('Actions'); ?>"; ?></h3>
<ul>
<li><?php echo "<?php echo \$this->Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?>";?></li>
<li><?php echo "<?php echo \$this->Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?>"; ?></li>
<?php
$done = array();
foreach ($associations as $type => $data) {

View file

@ -16,8 +16,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> view">
<h2><?php echo "<?php echo __('{$singularHumanName}');?>";?></h2>
<div class="<?php echo $pluralVar; ?> view">
<h2><?php echo "<?php echo __('{$singularHumanName}'); ?>"; ?></h2>
<dl>
<?php
foreach ($fields as $field) {
@ -66,20 +66,20 @@ foreach ($fields as $field) {
if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $alias => $details): ?>
<div class="related">
<h3><?php echo "<?php echo __('Related " . Inflector::humanize($details['controller']) . "');?>";?></h3>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
<h3><?php echo "<?php echo __('Related " . Inflector::humanize($details['controller']) . "'); ?>"; ?></h3>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])): ?>\n"; ?>
<dl>
<?php
foreach ($details['fields'] as $field) {
echo "\t\t<dt><?php echo __('" . Inflector::humanize($field) . "');?></dt>\n";
echo "\t\t<dd>\n\t<?php echo \${$singularVar}['{$alias}']['{$field}'];?>\n&nbsp;</dd>\n";
echo "\t\t<dt><?php echo __('" . Inflector::humanize($field) . "'); ?></dt>\n";
echo "\t\t<dd>\n\t<?php echo \${$singularVar}['{$alias}']['{$field}']; ?>\n&nbsp;</dd>\n";
}
?>
</dl>
<?php echo "<?php endif; ?>\n";?>
<?php echo "<?php endif; ?>\n"; ?>
<div class="actions">
<ul>
<li><?php echo "<?php echo \$this->Html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
<li><?php echo "<?php echo \$this->Html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n"; ?>
</ul>
</div>
</div>
@ -99,8 +99,8 @@ foreach ($relations as $alias => $details):
$otherPluralHumanName = Inflector::humanize($details['controller']);
?>
<div class="related">
<h3><?php echo "<?php echo __('Related " . $otherPluralHumanName . "');?>";?></h3>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
<h3><?php echo "<?php echo __('Related " . $otherPluralHumanName . "'); ?>"; ?></h3>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])): ?>\n"; ?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<?php
@ -108,7 +108,7 @@ foreach ($relations as $alias => $details):
echo "\t\t<th><?php echo __('" . Inflector::humanize($field) . "'); ?></th>\n";
}
?>
<th class="actions"><?php echo "<?php echo __('Actions');?>";?></th>
<th class="actions"><?php echo "<?php echo __('Actions'); ?>"; ?></th>
</tr>
<?php
echo "\t<?php
@ -116,7 +116,7 @@ echo "\t<?php
foreach (\${$singularVar}['{$alias}'] as \${$otherSingularVar}): ?>\n";
echo "\t\t<tr>\n";
foreach ($details['fields'] as $field) {
echo "\t\t\t<td><?php echo \${$otherSingularVar}['{$field}'];?></td>\n";
echo "\t\t\t<td><?php echo \${$otherSingularVar}['{$field}']; ?></td>\n";
}
echo "\t\t\t<td class=\"actions\">\n";
@ -129,11 +129,11 @@ echo "\t<?php
echo "\t<?php endforeach; ?>\n";
?>
</table>
<?php echo "<?php endif; ?>\n\n";?>
<?php echo "<?php endif; ?>\n\n"; ?>
<div class="actions">
<ul>
<li><?php echo "<?php echo \$this->Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
<li><?php echo "<?php echo \$this->Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>"; ?> </li>
</ul>
</div>
</div>
<?php endforeach;?>
<?php endforeach; ?>

View file

@ -20,11 +20,11 @@
<html>
<head>
<title><?php echo $title_for_layout;?></title>
<title><?php echo $title_for_layout; ?></title>
</head>
<body>
<?php echo $this->fetch('content');?>
<?php echo $this->fetch('content'); ?>
<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>
</body>

View file

@ -17,6 +17,6 @@
*/
?>
<?php echo $this->fetch('content');?>
<?php echo $this->fetch('content'); ?>
This email was sent using the CakePHP Framework, http://cakephp.org.

View file

@ -116,7 +116,7 @@ if (isset($filePresent)):
endif;
?>
</p>
<?php endif;?>
<?php endif; ?>
<?php
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {

View file

@ -2371,10 +2371,10 @@ class MysqlTest extends CakeTestCase {
* @return void
*/
public function testConditionsOptionalArguments() {
$result = $this->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);
}

View file

@ -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',

View file

@ -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);
}
/**

View file

@ -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);
}

View file

@ -1196,7 +1196,7 @@ class HashTest extends CakeTestCase {
$expected = array(
'Some' => array(
'string' => array(
'value' => array( 'values')
'value' => array('values')
)
)
);

View file

@ -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');

View file

@ -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' => '/')
));

View file

@ -20,11 +20,11 @@
<html>
<head>
<title><?php echo $title_for_layout;?></title>
<title><?php echo $title_for_layout; ?></title>
</head>
<body>
<?php echo $content_for_layout;?>
<?php echo $content_for_layout; ?>
<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>
</body>

View file

@ -20,11 +20,11 @@
<html>
<head>
<title><?php echo $title_for_layout;?></title>
<title><?php echo $title_for_layout; ?></title>
</head>
<body>
<?php echo $content_for_layout;?>
<?php echo $content_for_layout; ?>
<p>このメールは <a href="http://cakephp.org">CakePHP Framework</a> を利用して送信しました。</p>
</body>

View file

@ -20,11 +20,11 @@
<html>
<head>
<title><?php echo $title_for_layout;?></title>
<title><?php echo $title_for_layout; ?></title>
</head>
<body>
<?php echo $content_for_layout;?>
<?php echo $content_for_layout; ?>
<p>This email was sent using the CakePHP Framework</p>
</body>

View file

@ -17,6 +17,6 @@
*/
?>
<?php echo $content_for_layout;?>
<?php echo $content_for_layout; ?>
This email was sent using the CakePHP Framework, http://cakephp.org.

View file

@ -17,6 +17,6 @@
*/
?>
<?php echo $content_for_layout;?>
<?php echo $content_for_layout; ?>
CakePHP Framework を使って送信したメールです。 http://cakephp.org.

View file

@ -85,7 +85,7 @@ if (isset($filePresent)):
endif;
?>
</p>
<?php endif;?>
<?php endif; ?>
<?php
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {

View file

@ -1,14 +1,14 @@
<div class="users form">
<!--nocache-->
<?php echo $this->Form->create('User');?>
<?php echo $this->Form->create('User'); ?>
<fieldset>
<legend><?php echo __('Add User');?></legend>
<legend><?php echo __('Add User'); ?></legend>
<?php
echo $this->Form->input('username');
echo $this->Form->input('email');
echo $this->Form->input('password');
?>
</fieldset>
<?php echo $this->Form->end('Submit');?>
<?php echo $this->Form->end('Submit'); ?>
<!--/nocache-->
</div>

View file

@ -22,7 +22,7 @@
<li>
<span style="font-size: 18px">App</span>
<ul>
<li><a href='<?php echo $cases;?>'>Tests</a></li>
<li><a href='<?php echo $cases; ?>'>Tests</a></li>
</ul>
</li>
<?php if (!empty($plugins)): ?>
@ -31,19 +31,19 @@
<?php foreach ($plugins as $plugin): ?>
<ul>
<li style="padding-top: 10px">
<span style="font-size: 18px"><?php echo $plugin;?></span>
<span style="font-size: 18px"><?php echo $plugin; ?></span>
<ul>
<li><a href='<?php echo $cases;?>&amp;plugin=<?php echo $plugin; ?>'>Tests</a></li>
<li><a href='<?php echo $cases; ?>&amp;plugin=<?php echo $plugin; ?>'>Tests</a></li>
</ul>
</li>
</ul>
<?php endforeach; ?>
</li>
<?php endif;?>
<?php endif; ?>
<li style="padding-top: 10px">
<span style="font-size: 18px">Core</span>
<ul>
<li><a href='<?php echo $cases;?>&amp;core=true'>Tests</a></li>
<li><a href='<?php echo $cases; ?>&amp;core=true'>Tests</a></li>
</ul>
</li>
</ul>

View file

@ -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));
}
/**

View file

@ -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)) {

View file

@ -26,10 +26,10 @@
</p>
<pre>
&lt;?php
class <?php echo $controller;?> extends AppController {
class <?php echo $controller; ?> extends AppController {
<strong>
public function <?php echo $action;?>() {
public function <?php echo $action; ?>() {
}
</strong>

View file

@ -313,7 +313,7 @@ class CacheHelper extends AppHelper {
$this->loadHelpers();
extract($this->viewVars, EXTR_SKIP);
?>';
$content = preg_replace("/(<\\?xml)/", "<?php echo '$1';?>", $content);
$content = preg_replace("/(<\\?xml)/", "<?php echo '$1'; ?>", $content);
$file .= $content;
return cache('views' . DS . $cache, $file, $timestamp);
}

View file

@ -16,7 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> form">
<div class="<?php echo $pluralVar; ?> form">
<?php
echo $this->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)));
?></li>
<?php endif;?>
<li><?php echo $this->Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index'));?></li>
<?php endif; ?>
<li><?php echo $this->Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index')); ?></li>
<?php
$done = array();
foreach ($associations as $_type => $_data) {

View file

@ -16,14 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> index">
<h2><?php echo $pluralHumanName;?></h2>
<div class="<?php echo $pluralVar; ?> index">
<h2><?php echo $pluralHumanName; ?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($scaffoldFields as $_field):?>
<th><?php echo $this->Paginator->sort($_field);?></th>
<?php endforeach;?>
<th><?php echo __d('cake', 'Actions');?></th>
<?php foreach ($scaffoldFields as $_field): ?>
<th><?php echo $this->Paginator->sort($_field); ?></th>
<?php endforeach; ?>
<th><?php echo __d('cake', 'Actions'); ?></th>
</tr>
<?php
$i = 0;

View file

@ -16,7 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> view">
<div class="<?php echo $pluralVar; ?> view">
<h2><?php echo __d('cake', 'View %s', $singularHumanName); ?></h2>
<dl>
<?php
@ -68,7 +68,7 @@ if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $_alias => $_details): ?>
<div class="related">
<h3><?php echo __d('cake', "Related %s", Inflector::humanize($_details['controller'])); ?></h3>
<?php if (!empty(${$singularVar}[$_alias])):?>
<?php if (!empty(${$singularVar}[$_alias])): ?>
<dl>
<?php
$i = 0;
@ -82,7 +82,7 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__d('cake', 'Edit %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]))."</li>\n";?>
<li><?php echo $this->Html->link(__d('cake', 'Edit %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]))."</li>\n"; ?>
</ul>
</div>
</div>
@ -103,7 +103,7 @@ $otherSingularVar = Inflector::variable($_alias);
?>
<div class="related">
<h3><?php echo __d('cake', "Related %s", Inflector::humanize($_details['controller'])); ?></h3>
<?php if (!empty(${$singularVar}[$_alias])):?>
<?php if (!empty(${$singularVar}[$_alias])): ?>
<table cellpadding="0" cellspacing="0">
<tr>
<?php
@ -139,8 +139,8 @@ $otherSingularVar = Inflector::variable($_alias);
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__d('cake', "New %s", Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'));?> </li>
<li><?php echo $this->Html->link(__d('cake', "New %s", Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
<?php endforeach;?>
<?php endforeach; ?>