Skip to content

Commit f88cc56

Browse files
author
DarkAngelBGE
committed
Coding standards fixes
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8260 3807eeeb-6ff5-0310-8944-8be069107fe0
1 parent 47cd941 commit f88cc56

32 files changed

+105
-110
lines changed

cake/console/libs/schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function dump() {
199199
}
200200
}
201201
$db =& ConnectionManager::getDataSource($this->Schema->connection);
202-
$contents = "#". $Schema->name ." sql generated on: " . date('Y-m-d H:i:s') . " : ". time()."\n\n";
202+
$contents = "#" . $Schema->name . " sql generated on: " . date('Y-m-d H:i:s') . " : " . time() . "\n\n";
203203
$contents .= $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema);
204204
if ($write) {
205205
if (strpos($write, '.sql') === false) {

cake/console/libs/shell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function loadTasks() {
297297
}
298298

299299
if (!isset($this->{$taskName})) {
300-
$this->err("Task '".$taskName."' could not be loaded");
300+
$this->err("Task '" . $taskName . "' could not be loaded");
301301
$this->_stop();
302302
}
303303
}

cake/console/libs/tasks/controller.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
273273
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n";
274274
}
275275
$actions .= "\t\t}\n";
276-
$actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n";
276+
$actions .= "\t\t\$this->set('" . $singularName . "', \$this->{$currentModelName}->read(null, \$id));\n";
277277
$actions .= "\t}\n";
278278
$actions .= "\n";
279279

@@ -284,7 +284,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
284284
$actions .= "\t\t\t\$this->{$currentModelName}->create();\n";
285285
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
286286
if ($wannaUseSession) {
287-
$actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n";
287+
$actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n";
288288
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n";
289289
} else {
290290
$actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action'=>'index'));\n";
@@ -313,7 +313,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
313313
}
314314
}
315315
if (!empty($compact)) {
316-
$actions .= "\t\t\$this->set(compact(".join(', ', $compact)."));\n";
316+
$actions .= "\t\t\$this->set(compact(" . join(', ', $compact) . "));\n";
317317
}
318318
$actions .= "\t}\n";
319319
$actions .= "\n";
@@ -332,10 +332,10 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
332332
$actions .= "\t\tif (!empty(\$this->data)) {\n";
333333
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
334334
if ($wannaUseSession) {
335-
$actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n";
335+
$actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n";
336336
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n";
337337
} else {
338-
$actions .= "\t\t\t\t\$this->flash(__('The ".$singularHumanName." has been saved.', true), array('action'=>'index'));\n";
338+
$actions .= "\t\t\t\t\$this->flash(__('The " . $singularHumanName . " has been saved.', true), array('action'=>'index'));\n";
339339
}
340340
$actions .= "\t\t\t} else {\n";
341341
if ($wannaUseSession) {
@@ -365,7 +365,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
365365
}
366366
}
367367
if (!empty($compact)) {
368-
$actions .= "\t\t\$this->set(compact(".join(',', $compact)."));\n";
368+
$actions .= "\t\t\$this->set(compact(" . join(',', $compact) . "));\n";
369369
}
370370
$actions .= "\t}\n";
371371
$actions .= "\n";
@@ -484,7 +484,7 @@ function bakeTest($className) {
484484
$this->out("\nBaking unit test for $className...");
485485

486486
$header = '$Id';
487-
$content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ."Controller Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
487+
$content = "<?php \n/* SVN FILE: $header$ */\n/* " . $className . "Controller Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
488488
return $this->createFile($path . $filename, $content);
489489
}
490490
/**

cake/console/libs/tasks/model.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ function bakeTest($className, $useTable = null, $associations = array()) {
733733
$this->out("\nBaking unit test for $className...");
734734

735735
$header = '$Id';
736-
$content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
736+
$content = "<?php \n/* SVN FILE: $header$ */\n/* " . $className . " Test cases generated on: " . date('Y-m-d H:i:s') . " : " . time() . "*/\n{$out}?>";
737737
return $this->createFile($path . $filename, $content);
738738
}
739739
return false;
@@ -905,7 +905,7 @@ function fixture($model, $useTable = null) {
905905
$col = "\t\t'indexes' => array(";
906906
$props = array();
907907
foreach ((array)$value as $key => $index) {
908-
$props[] = "'{$key}' => array(".join(', ', $schema->__values($index)).")";
908+
$props[] = "'{$key}' => array(" . join(', ', $schema->__values($index)) . ")";
909909
}
910910
$col .= join(', ', $props);
911911
}
@@ -925,9 +925,9 @@ function fixture($model, $useTable = null) {
925925
$pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS;
926926
$path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS;
927927
}
928-
$filename = Inflector::underscore($model).'_fixture.php';
928+
$filename = Inflector::underscore($model) . '_fixture.php';
929929
$header = '$Id';
930-
$content = "<?php \n/* SVN FILE: $header$ */\n/* ". $model ." Fixture generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
930+
$content = "<?php \n/* SVN FILE: $header$ */\n/* " . $model . " Fixture generated on: " . date('Y-m-d H:i:s') . " : " . time() . "*/\n{$out}?>";
931931
$this->out("\nBaking test fixture for $model...");
932932
if ($this->createFile($path . $filename, $content)) {
933933
return str_replace("\t\t", "\t\t\t", $records);

cake/console/libs/tasks/project.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function bake($path, $skel = null, $skip = array('empty')) {
153153
$this->out(sprintf(__("Created: %s in %s", true), $app, $path));
154154
$this->hr();
155155
} else {
156-
$this->err(" '".$app."' could not be created properly");
156+
$this->err(" '" . $app . "' could not be created properly");
157157
return false;
158158
}
159159

@@ -219,7 +219,7 @@ function corePath($path) {
219219
$File =& new File($path . 'webroot' . DS . 'index.php');
220220
$contents = $File->read();
221221
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
222-
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents);
222+
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
223223
if (!$File->write($result)) {
224224
return false;
225225
}
@@ -230,7 +230,7 @@ function corePath($path) {
230230
$File =& new File($path . 'webroot' . DS . 'test.php');
231231
$contents = $File->read();
232232
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
233-
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents);
233+
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
234234
if (!$File->write($result)) {
235235
return false;
236236
}

cake/console/libs/tasks/test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function bake($class, $name = null, $cases = array()) {
181181
}
182182

183183
$header = '$Id';
184-
$content = "<?php \n/* SVN FILE: $header$ */\n/* ". $name ." Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
184+
$content = "<?php \n/* SVN FILE: $header$ */\n/* " . $name . " Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
185185
return $this->createFile($this->filePath . Inflector::underscore($name) . '.test.php', $content);
186186
}
187187
/**

cake/console/libs/templates/views/form.ctp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="<?php echo $pluralVar;?> form">
2626
<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?>
2727
<fieldset>
28-
<legend><?php echo "<?php __('".Inflector::humanize($action)." {$singularHumanName}');?>";?></legend>
28+
<legend><?php echo "<?php __('" . Inflector::humanize($action) . " {$singularHumanName}');?>";?></legend>
2929
<?php
3030
echo "\t<?php\n";
3131
foreach ($fields as $field) {
@@ -58,8 +58,8 @@
5858
foreach ($associations as $type => $data) {
5959
foreach ($data as $alias => $details) {
6060
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
61-
echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
62-
echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
61+
echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
62+
echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
6363
$done[] = $details['controller'];
6464
}
6565
}

cake/console/libs/templates/views/home.ctp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$output = "<h2>Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP!</h2>\n";
2+
$output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!</h2>\n";
33
$output .="
44
<?php
55
if (Configure::read() > 0):

cake/console/libs/templates/views/index.ctp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ echo "<?php endforeach; ?>\n";
8888
foreach ($associations as $type => $data) {
8989
foreach ($data as $alias => $details) {
9090
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
91-
echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
92-
echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
91+
echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
92+
echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
9393
$done[] = $details['controller'];
9494
}
9595
}

cake/console/libs/templates/views/view.ctp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ foreach ($fields as $field) {
3232
foreach ($associations['belongsTo'] as $alias => $details) {
3333
if ($field === $details['foreignKey']) {
3434
$isKey = true;
35-
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize(Inflector::underscore($alias))."'); ?></dt>\n";
35+
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize(Inflector::underscore($alias)) . "'); ?></dt>\n";
3636
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t&nbsp;\n\t\t</dd>\n";
3737
break;
3838
}
3939
}
4040
}
4141
if ($isKey !== true) {
42-
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."'); ?></dt>\n";
42+
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize($field) . "'); ?></dt>\n";
4343
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t\t&nbsp;\n\t\t</dd>\n";
4444
}
4545
}
@@ -58,8 +58,8 @@ foreach ($fields as $field) {
5858
foreach ($associations as $type => $data) {
5959
foreach ($data as $alias => $details) {
6060
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
61-
echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
62-
echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
61+
echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
62+
echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
6363
$done[] = $details['controller'];
6464
}
6565
}
@@ -71,20 +71,20 @@ foreach ($fields as $field) {
7171
if (!empty($associations['hasOne'])) :
7272
foreach ($associations['hasOne'] as $alias => $details): ?>
7373
<div class="related">
74-
<h3><?php echo "<?php __('Related ".Inflector::humanize($details['controller'])."');?>";?></h3>
74+
<h3><?php echo "<?php __('Related " . Inflector::humanize($details['controller']) . "');?>";?></h3>
7575
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
7676
<dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?>
7777
<?php
7878
foreach ($details['fields'] as $field) {
79-
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."');?></dt>\n";
79+
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize($field) . "');?></dt>\n";
8080
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t<?php echo \${$singularVar}['{$alias}']['{$field}'];?>\n&nbsp;</dd>\n";
8181
}
8282
?>
8383
</dl>
8484
<?php echo "<?php endif; ?>\n";?>
8585
<div class="actions">
8686
<ul>
87-
<li><?php echo "<?php echo \$html->link(__('Edit ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
87+
<li><?php echo "<?php echo \$html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
8888
</ul>
8989
</div>
9090
</div>
@@ -110,7 +110,7 @@ foreach ($relations as $alias => $details):
110110
<tr>
111111
<?php
112112
foreach ($details['fields'] as $field) {
113-
echo "\t\t<th><?php __('".Inflector::humanize($field)."'); ?></th>\n";
113+
echo "\t\t<th><?php __('" . Inflector::humanize($field) . "'); ?></th>\n";
114114
}
115115
?>
116116
<th class="actions"><?php echo "<?php __('Actions');?>";?></th>
@@ -143,7 +143,7 @@ echo "\t<?php endforeach; ?>\n";
143143
<?php echo "<?php endif; ?>\n\n";?>
144144
<div class="actions">
145145
<ul>
146-
<li><?php echo "<?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
146+
<li><?php echo "<?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
147147
</ul>
148148
</div>
149149
</div>

0 commit comments

Comments
 (0)