From f88cc56cfe01b9441845d8121828d9815fa6e67e Mon Sep 17 00:00:00 2001 From: DarkAngelBGE Date: Tue, 28 Jul 2009 20:01:42 +0000 Subject: [PATCH] Coding standards fixes git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8260 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/libs/schema.php | 2 +- cake/console/libs/shell.php | 2 +- cake/console/libs/tasks/controller.php | 14 +++---- cake/console/libs/tasks/model.php | 8 ++-- cake/console/libs/tasks/project.php | 6 +-- cake/console/libs/tasks/test.php | 2 +- cake/console/libs/templates/views/form.ctp | 6 +-- cake/console/libs/templates/views/home.ctp | 2 +- cake/console/libs/templates/views/index.ctp | 4 +- cake/console/libs/templates/views/view.ctp | 18 ++++----- cake/libs/controller/components/cookie.php | 14 +++---- cake/libs/http_socket.php | 6 +-- .../libs/model/datasources/dbo/dbo_mysqli.php | 37 ++++++++----------- cake/libs/model/schema.php | 4 +- cake/libs/view/errors/missing_action.ctp | 6 +-- .../view/errors/missing_component_class.ctp | 6 +-- .../view/errors/missing_component_file.ctp | 4 +- cake/libs/view/errors/missing_controller.ctp | 6 +-- .../libs/view/errors/missing_helper_class.ctp | 4 +- cake/libs/view/errors/missing_helper_file.ctp | 6 +-- cake/libs/view/errors/missing_layout.ctp | 6 +-- cake/libs/view/errors/missing_model.ctp | 4 +- cake/libs/view/errors/missing_scaffolddb.ctp | 4 +- cake/libs/view/errors/missing_table.ctp | 4 +- cake/libs/view/errors/missing_view.ctp | 4 +- cake/libs/view/errors/private_action.ctp | 4 +- cake/libs/view/errors/scaffold_error.ctp | 2 +- cake/libs/view/scaffolds/edit.ctp | 4 +- cake/libs/view/scaffolds/index.ctp | 4 +- cake/libs/view/scaffolds/view.ctp | 16 ++++---- cake/tests/cases/libs/http_socket.test.php | 4 +- cake/tests/cases/libs/sanitize.test.php | 4 +- 32 files changed, 106 insertions(+), 111 deletions(-) diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 698164d05..c04a399cb 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -199,7 +199,7 @@ class SchemaShell extends Shell { } } $db =& ConnectionManager::getDataSource($this->Schema->connection); - $contents = "#". $Schema->name ." sql generated on: " . date('Y-m-d H:i:s') . " : ". time()."\n\n"; + $contents = "#" . $Schema->name . " sql generated on: " . date('Y-m-d H:i:s') . " : " . time() . "\n\n"; $contents .= $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema); if ($write) { if (strpos($write, '.sql') === false) { diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 47bbfac1f..eed6bff8e 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -297,7 +297,7 @@ class Shell extends Object { } if (!isset($this->{$taskName})) { - $this->err("Task '".$taskName."' could not be loaded"); + $this->err("Task '" . $taskName . "' could not be loaded"); $this->_stop(); } } diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 2531dacca..736522a84 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -273,7 +273,7 @@ class ControllerTask extends Shell { $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; } $actions .= "\t\t}\n"; - $actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n"; + $actions .= "\t\t\$this->set('" . $singularName . "', \$this->{$currentModelName}->read(null, \$id));\n"; $actions .= "\t}\n"; $actions .= "\n"; @@ -284,7 +284,7 @@ class ControllerTask extends Shell { $actions .= "\t\t\t\$this->{$currentModelName}->create();\n"; $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n"; if ($wannaUseSession) { - $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n"; + $actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n"; $actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n"; } else { $actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action'=>'index'));\n"; @@ -313,7 +313,7 @@ class ControllerTask extends Shell { } } if (!empty($compact)) { - $actions .= "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; + $actions .= "\t\t\$this->set(compact(" . join(', ', $compact) . "));\n"; } $actions .= "\t}\n"; $actions .= "\n"; @@ -332,10 +332,10 @@ class ControllerTask extends Shell { $actions .= "\t\tif (!empty(\$this->data)) {\n"; $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n"; if ($wannaUseSession) { - $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n"; + $actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n"; $actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n"; } else { - $actions .= "\t\t\t\t\$this->flash(__('The ".$singularHumanName." has been saved.', true), array('action'=>'index'));\n"; + $actions .= "\t\t\t\t\$this->flash(__('The " . $singularHumanName . " has been saved.', true), array('action'=>'index'));\n"; } $actions .= "\t\t\t} else {\n"; if ($wannaUseSession) { @@ -365,7 +365,7 @@ class ControllerTask extends Shell { } } if (!empty($compact)) { - $actions .= "\t\t\$this->set(compact(".join(',', $compact)."));\n"; + $actions .= "\t\t\$this->set(compact(" . join(',', $compact) . "));\n"; } $actions .= "\t}\n"; $actions .= "\n"; @@ -484,7 +484,7 @@ class ControllerTask extends Shell { $this->out("\nBaking unit test for $className..."); $header = '$Id'; - $content = ""; + $content = ""; return $this->createFile($path . $filename, $content); } /** diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 2c98659da..779d088f8 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -733,7 +733,7 @@ class ModelTask extends Shell { $this->out("\nBaking unit test for $className..."); $header = '$Id'; - $content = ""; + $content = ""; return $this->createFile($path . $filename, $content); } return false; @@ -905,7 +905,7 @@ class ModelTask extends Shell { $col = "\t\t'indexes' => array("; $props = array(); foreach ((array)$value as $key => $index) { - $props[] = "'{$key}' => array(".join(', ', $schema->__values($index)).")"; + $props[] = "'{$key}' => array(" . join(', ', $schema->__values($index)) . ")"; } $col .= join(', ', $props); } @@ -925,9 +925,9 @@ class ModelTask extends Shell { $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; } - $filename = Inflector::underscore($model).'_fixture.php'; + $filename = Inflector::underscore($model) . '_fixture.php'; $header = '$Id'; - $content = ""; + $content = ""; $this->out("\nBaking test fixture for $model..."); if ($this->createFile($path . $filename, $content)) { return str_replace("\t\t", "\t\t\t", $records); diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 1d73e515f..f7a0c3021 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -153,7 +153,7 @@ class ProjectTask extends Shell { $this->out(sprintf(__("Created: %s in %s", true), $app, $path)); $this->hr(); } else { - $this->err(" '".$app."' could not be created properly"); + $this->err(" '" . $app . "' could not be created properly"); return false; } @@ -219,7 +219,7 @@ class ProjectTask extends Shell { $File =& new File($path . 'webroot' . DS . 'index.php'); $contents = $File->read(); if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { - $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents); + $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents); if (!$File->write($result)) { return false; } @@ -230,7 +230,7 @@ class ProjectTask extends Shell { $File =& new File($path . 'webroot' . DS . 'test.php'); $contents = $File->read(); if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { - $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents); + $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents); if (!$File->write($result)) { return false; } diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index f959d21da..416d3bd22 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -181,7 +181,7 @@ class TestTask extends Shell { } $header = '$Id'; - $content = ""; + $content = ""; return $this->createFile($this->filePath . Inflector::underscore($name) . '.test.php', $content); } /** diff --git a/cake/console/libs/templates/views/form.ctp b/cake/console/libs/templates/views/form.ctp index 78ebdda7b..fda3eddc9 100644 --- a/cake/console/libs/templates/views/form.ctp +++ b/cake/console/libs/templates/views/form.ctp @@ -25,7 +25,7 @@
create('{$modelClass}');?>\n";?>
- ";?> + ";?> $data) { foreach ($data as $alias => $details) { if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { - echo "\t\t
  • link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?>
  • \n"; - echo "\t\t
  • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>
  • \n"; + echo "\t\t
  • link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?>
  • \n"; + echo "\t\t
  • link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>
  • \n"; $done[] = $details['controller']; } } diff --git a/cake/console/libs/templates/views/home.ctp b/cake/console/libs/templates/views/home.ctp index 39020d488..5b3dc316f 100644 --- a/cake/console/libs/templates/views/home.ctp +++ b/cake/console/libs/templates/views/home.ctp @@ -1,5 +1,5 @@ Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP!\n"; +$output = "

    Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!

    \n"; $output .=" 0): diff --git a/cake/console/libs/templates/views/index.ctp b/cake/console/libs/templates/views/index.ctp index af2c5acb5..49c69dbab 100644 --- a/cake/console/libs/templates/views/index.ctp +++ b/cake/console/libs/templates/views/index.ctp @@ -88,8 +88,8 @@ echo "\n"; foreach ($associations as $type => $data) { foreach ($data as $alias => $details) { if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { - echo "\t\t
  • link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?>
  • \n"; - echo "\t\t
  • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>
  • \n"; + echo "\t\t
  • link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?>
  • \n"; + echo "\t\t
  • link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>
  • \n"; $done[] = $details['controller']; } } diff --git a/cake/console/libs/templates/views/view.ctp b/cake/console/libs/templates/views/view.ctp index a25b7574c..e390bb02e 100644 --- a/cake/console/libs/templates/views/view.ctp +++ b/cake/console/libs/templates/views/view.ctp @@ -32,14 +32,14 @@ foreach ($fields as $field) { foreach ($associations['belongsTo'] as $alias => $details) { if ($field === $details['foreignKey']) { $isKey = true; - echo "\t\t>\n"; + echo "\t\t>\n"; echo "\t\t>\n\t\t\tlink(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t \n\t\t\n"; break; } } } if ($isKey !== true) { - echo "\t\t>\n"; + echo "\t\t>\n"; echo "\t\t>\n\t\t\t\n\t\t\t \n\t\t\n"; } } @@ -58,8 +58,8 @@ foreach ($fields as $field) { foreach ($associations as $type => $data) { foreach ($data as $alias => $details) { if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { - echo "\t\t
  • link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?>
  • \n"; - echo "\t\t
  • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>
  • \n"; + echo "\t\t
  • link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?>
  • \n"; + echo "\t\t
  • link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?>
  • \n"; $done[] = $details['controller']; } } @@ -71,12 +71,12 @@ foreach ($fields as $field) { if (!empty($associations['hasOne'])) : foreach ($associations['hasOne'] as $alias => $details): ?> @@ -110,7 +110,7 @@ foreach ($relations as $alias => $details): \n"; + echo "\t\t\n"; } ?> ";?> @@ -143,7 +143,7 @@ echo "\t\n"; \n\n";?>
      -
    • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?>
    • +
    • link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?>
    diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 524453c96..56713f5c4 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -203,10 +203,10 @@ class CookieComponent extends Object { if (count($name) > 1) { $this->__values[$name[0]][$name[1]] = $value; - $this->__write("[".$name[0]."][".$name[1]."]", $value); + $this->__write("[" . $name[0] . "][" . $name[1] . "]", $value); } else { $this->__values[$name[0]] = $value; - $this->__write("[".$name[0]."]", $value); + $this->__write("[" . $name[0] . "]", $value); } } else { foreach ($key as $names => $value) { @@ -214,10 +214,10 @@ class CookieComponent extends Object { if (count($name) > 1) { $this->__values[$name[0]][$name[1]] = $value; - $this->__write("[".$name[0]."][".$name[1]."]", $value); + $this->__write("[" . $name[0] . "][" . $name[1] . "]", $value); } else { $this->__values[$name[0]] = $value; - $this->__write("[".$name[0]."]", $value); + $this->__write("[" . $name[0] . "]", $value); } } } @@ -278,17 +278,17 @@ class CookieComponent extends Object { $name = $this->__cookieVarNames($key); if (count($name) > 1) { if (isset($this->__values[$name[0]])) { - $this->__delete("[".$name[0]."][".$name[1]."]"); + $this->__delete("[" . $name[0] . "][" . $name[1] . "]"); unset($this->__values[$name[0]][$name[1]]); } } else { if (isset($this->__values[$name[0]])) { if (is_array($this->__values[$name[0]])) { foreach ($this->__values[$name[0]] as $key => $value) { - $this->__delete("[".$name[0]."][".$key."]"); + $this->__delete("[" . $name[0] . "][" . $key . "]"); } } - $this->__delete("[".$name[0]."]"); + $this->__delete("[" . $name[0] . "]"); unset($this->__values[$name[0]]); } } diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 79a96cd32..544de704f 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -202,10 +202,10 @@ class HttpSocket extends CakeSocket { } if (isset($this->request['auth']['user']) && isset($this->request['auth']['pass'])) { - $this->request['header']['Authorization'] = $this->request['auth']['method'] ." ". base64_encode($this->request['auth']['user'] .":".$this->request['auth']['pass']); + $this->request['header']['Authorization'] = $this->request['auth']['method'] . " " . base64_encode($this->request['auth']['user'] . ":" . $this->request['auth']['pass']); } if (isset($this->request['uri']['user']) && isset($this->request['uri']['pass'])) { - $this->request['header']['Authorization'] = $this->request['auth']['method'] ." ". base64_encode($this->request['uri']['user'] .":".$this->request['uri']['pass']); + $this->request['header']['Authorization'] = $this->request['auth']['method'] . " " . base64_encode($this->request['uri']['user'] . ":" . $this->request['uri']['pass']); } if (is_array($this->request['body'])) { @@ -812,7 +812,7 @@ class HttpSocket extends CakeSocket { return false; } - preg_match_all("/(.+):(.+)(?:(?lineBreak."|\$)/Uis", $header, $matches, PREG_SET_ORDER); + preg_match_all("/(.+):(.+)(?:(?lineBreak . "|\$)/Uis", $header, $matches, PREG_SET_ORDER); $header = array(); foreach ($matches as $match) { diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index c0d238079..4663567ca 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -105,9 +105,8 @@ class DboMysqli extends DboMysqlBase { function _execute($sql) { if (preg_match('/^\s*call/i', $sql)) { return $this->_executeProcedure($sql); - } else { - return mysqli_query($this->connection, $sql); } + return mysqli_query($this->connection, $sql); } /** * Executes given SQL statement (procedure call). @@ -140,15 +139,15 @@ class DboMysqli extends DboMysqlBase { if (!$result) { return array(); - } else { - $tables = array(); - - while ($line = mysqli_fetch_array($result)) { - $tables[] = $line[0]; - } - parent::listSources($tables); - return $tables; } + + $tables = array(); + + while ($line = mysqli_fetch_array($result)) { + $tables[] = $line[0]; + } + parent::listSources($tables); + return $tables; } /** * Returns an array of the fields in given table name. @@ -201,14 +200,15 @@ class DboMysqli extends DboMysqlBase { if ($parent != null) { return $parent; } - - if ($data === null) { + if ($data === null || (is_array($data) && empty($data))) { return 'NULL'; } - if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') { return "''"; } + if (empty($column)) { + $column = $this->introspectType($data); + } switch ($column) { case 'boolean': @@ -217,9 +217,6 @@ class DboMysqli extends DboMysqlBase { case 'integer' : case 'float' : case null : - if ($data === '') { - return 'NULL'; - } if ((is_int($data) || is_float($data) || $data === '0') || ( is_numeric($data) && strpos($data, ',') === false && $data[0] != '0' && strpos($data, 'e') === false)) { @@ -278,7 +275,6 @@ class DboMysqli extends DboMysqlBase { if ($id !== false && !empty($id) && !empty($id[0]) && isset($id[0]['insertID'])) { return $id[0]['insertID']; } - return null; } /** @@ -337,11 +333,11 @@ class DboMysqli extends DboMysqlBase { function length($real) { $col = str_replace(array(')', 'unsigned'), '', $real); $limit = null; - + if (strpos($col, '(') !== false) { list($col, $limit) = explode('(', $col); } - + if ($limit != null) { return intval($limit); } @@ -389,9 +385,8 @@ class DboMysqli extends DboMysqlBase { $i++; } return $resultRow; - } else { - return false; } + return false; } /** * Gets the database encoding diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index d3e2811ab..23c2f4816 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -338,7 +338,7 @@ class CakeSchema extends Object { $col = "\t\t'indexes' => array("; $props = array(); foreach ((array)$value as $key => $index) { - $props[] = "'{$key}' => array(".join(', ', $this->__values($index)).")"; + $props[] = "'{$key}' => array(" . join(', ', $this->__values($index)) . ")"; } $col .= join(', ', $props); } @@ -446,7 +446,7 @@ class CakeSchema extends Object { if (is_array($values)) { foreach ($values as $key => $val) { if (is_array($val)) { - $vals[] = "'{$key}' => array('".join("', '", $val)."')"; + $vals[] = "'{$key}' => array('" . join("', '", $val) . "')"; } else if (!is_numeric($key)) { $val = var_export($val, true); $vals[] = "'{$key}' => {$val}"; diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 857ac206c..0de1c6cc3 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -25,11 +25,11 @@

    : - ".$action."", "".$controller."");?> + " . $action . "", "" . $controller . "");?>

    : - ".$controller."::", "".$action."()", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?> + " . $controller . "::", "" . $action . "()", APP_DIR . DS . "controllers" . DS . Inflector::underscore($controller) . ".php");?>

     <?php
    @@ -47,5 +47,5 @@ class  extends AppController {
     

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp index 49af6e3a3..ec154de02 100644 --- a/cake/libs/view/errors/missing_component_class.ctp +++ b/cake/libs/view/errors/missing_component_class.ctp @@ -25,11 +25,11 @@

    : - ". $component ."Component", "". $controller ."Controller");?> + " . $component . "Component", "" . $controller . "Controller");?>

    : - ". $component ."Component", APP_DIR.DS."controllers".DS."components".DS.$file);?> + " . $component . "Component", APP_DIR . DS . "controllers" . DS . "components" . DS . $file);?>

     <?php
    @@ -40,5 +40,5 @@ class Component extends Object {

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp index e4eb675b9..3b8b874fb 100644 --- a/cake/libs/view/errors/missing_component_file.ctp +++ b/cake/libs/view/errors/missing_component_file.ctp @@ -29,7 +29,7 @@

    : - ". $component ."Component", APP_DIR.DS."controllers".DS."components".DS.$file);?> + " . $component . "Component", APP_DIR . DS . "controllers" . DS . "components" . DS . $file);?>

     <?php
    @@ -40,5 +40,5 @@ class Component extends Object {

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index 829cc53ca..676747284 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -25,11 +25,11 @@

    : - ".$controller."");?> + " . $controller . "");?>

    : - ".$controller."", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?> + " . $controller . "", APP_DIR . DS . "controllers" . DS . Inflector::underscore($controller) . ".php");?>

     <?php
    @@ -41,5 +41,5 @@ class  extends AppController {
     

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp index d94d1ab1d..e1f464cdd 100644 --- a/cake/libs/view/errors/missing_helper_class.ctp +++ b/cake/libs/view/errors/missing_helper_class.ctp @@ -29,7 +29,7 @@

    : - +

     <?php
    @@ -40,5 +40,5 @@ class  extends AppHelper {
     

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp index 7affb0fd4..34d6d5dc7 100644 --- a/cake/libs/view/errors/missing_helper_file.ctp +++ b/cake/libs/view/errors/missing_helper_file.ctp @@ -25,11 +25,11 @@

    : - +

    : - +

     <?php
    @@ -40,5 +40,5 @@ class  extends AppHelper {
     

    : - +

    diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp index c41c59d45..cb8445a44 100644 --- a/cake/libs/view/errors/missing_layout.ctp +++ b/cake/libs/view/errors/missing_layout.ctp @@ -25,13 +25,13 @@

    : - ". $file ."");?> + " . $file . "");?>

    : - ". $file ."");?> + " . $file . "");?>

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp index 49cf8f7a4..c2d64e95f 100644 --- a/cake/libs/view/errors/missing_model.ctp +++ b/cake/libs/view/errors/missing_model.ctp @@ -29,7 +29,7 @@

    : - ". $model . "", APP_DIR.DS."models".DS.Inflector::underscore($model).".php");?> + " . $model . "", APP_DIR . DS . "models" . DS . Inflector::underscore($model) . ".php");?>

     <?php
    @@ -42,5 +42,5 @@ class  extends AppModel {
     

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_scaffolddb.ctp b/cake/libs/view/errors/missing_scaffolddb.ctp index 2477d3207..443199224 100644 --- a/cake/libs/view/errors/missing_scaffolddb.ctp +++ b/cake/libs/view/errors/missing_scaffolddb.ctp @@ -29,9 +29,9 @@

    : - +

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp index 341897680..1bdc59f69 100644 --- a/cake/libs/view/errors/missing_table.ctp +++ b/cake/libs/view/errors/missing_table.ctp @@ -25,9 +25,9 @@

    : - ". $table ."", "". $model ."");?> + " . $table . "", "" . $model . "");?>

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp index 184573751..737da88c0 100644 --- a/cake/libs/view/errors/missing_view.ctp +++ b/cake/libs/view/errors/missing_view.ctp @@ -25,7 +25,7 @@

    : - ". $controller."Controller::", "". $action ."()");?> + " . $controller . "Controller::", "". $action . "()");?>

    : @@ -33,5 +33,5 @@

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp index f172c50aa..6d9e92c70 100644 --- a/cake/libs/view/errors/private_action.ctp +++ b/cake/libs/view/errors/private_action.ctp @@ -25,9 +25,9 @@

    : - ". $controller ."::", "". $action ."()");?> + " . $controller . "::", "" . $action . "()");?>

    : - +

    \ No newline at end of file diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp index d20843cbd..9ce156af7 100644 --- a/cake/libs/view/errors/scaffold_error.ctp +++ b/cake/libs/view/errors/scaffold_error.ctp @@ -29,7 +29,7 @@

    : - +

     <?php
    diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp
    index fd537d239..6705b4bf4 100644
    --- a/cake/libs/view/scaffolds/edit.ctp
    +++ b/cake/libs/view/scaffolds/edit.ctp
    @@ -40,8 +40,8 @@
     		foreach ($associations as $_type => $_data) {
     			foreach ($_data as $_alias => $_details) {
     				if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
    -					echo "\t\t
  • ".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index'))."
  • \n"; - echo "\t\t
  • ".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add'))."
  • \n"; + echo "\t\t
  • " . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "
  • \n"; + echo "\t\t
  • " . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "
  • \n"; $done[] = $_details['controller']; } } diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp index 5d18fef54..c5b9e0e7f 100644 --- a/cake/libs/view/scaffolds/index.ctp +++ b/cake/libs/view/scaffolds/index.ctp @@ -86,8 +86,8 @@ echo "\n"; foreach ($associations as $_type => $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "\t\t
  • ".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index'))."
  • \n"; - echo "\t\t
  • ".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'))."
  • \n"; + echo "\t\t
  • " . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
  • \n"; + echo "\t\t
  • " . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
  • \n"; $done[] = $_details['controller']; } } diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index 0c5ef7420..a497ca673 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -37,14 +37,14 @@ foreach ($scaffoldFields as $_field) { foreach ($associations['belongsTo'] as $_alias => $_details) { if ($_field === $_details['foreignKey']) { $isKey = true; - echo "\t\t".Inflector::humanize($_alias)."\n"; + echo "\t\t" . Inflector::humanize($_alias) . "\n"; echo "\t\t\n\t\t\t" . $html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . "\n\t\t \n"; break; } } } if ($isKey !== true) { - echo "\t\t".Inflector::humanize($_field)."\n"; + echo "\t\t" . Inflector::humanize($_field) . "\n"; echo "\t\t\n\t\t\t{${$singularVar}[$modelClass][$_field]}\n \t\t\n"; } } @@ -63,8 +63,8 @@ foreach ($scaffoldFields as $_field) { foreach ($associations as $_type => $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "\t\t
  • ".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index'))."
  • \n"; - echo "\t\t
  • ".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'))."
  • \n"; + echo "\t\t
  • " . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
  • \n"; + echo "\t\t
  • " . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
  • \n"; $done[] = $_details['controller']; } } @@ -87,8 +87,8 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?> if ($i++ % 2 == 0) { $class = ' class="altrow"'; } - echo "\t\t".Inflector::humanize($_field)."\n"; - echo "\t\t\n\t" .${$singularVar}[$_alias][$_field] ."\n \n"; + echo "\t\t" . Inflector::humanize($_field) . "\n"; + echo "\t\t\n\t" . ${$singularVar}[$_alias][$_field] . "\n \n"; } ?> @@ -122,7 +122,7 @@ $otherSingularVar = Inflector::variable($_alias); ".Inflector::humanize($_field)."\n"; + echo "\t\t" . Inflector::humanize($_field) . "\n"; } ?> Actions @@ -137,7 +137,7 @@ $otherSingularVar = Inflector::variable($_alias); echo "\t\t\n"; foreach ($otherFields as $_field) { - echo "\t\t\t".${$otherSingularVar}[$_field]."\n"; + echo "\t\t\t" . ${$otherSingularVar}[$_field] . "\n"; } echo "\t\t\t\n"; diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index cb6a79891..b3fa948b1 100644 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -399,12 +399,12 @@ class HttpSocketTest extends CakeTestCase { $this->Socket->setReturnValue('read', false); $this->Socket->_mock->_call_counts['read'] = 0; $number = mt_rand(0, 9999999); - $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

    Hello, your lucky number is ".$number."

    "; + $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

    Hello, your lucky number is " . $number . "

    "; $this->Socket->setReturnValueAt(0, 'read', $serverResponse); $this->Socket->expect('write', array("GET / HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n")); $this->Socket->expectCallCount('read', 2); $response = $this->Socket->request($request); - $this->assertIdentical($response, "

    Hello, your lucky number is ".$number."

    "); + $this->assertIdentical($response, "

    Hello, your lucky number is " . $number . "

    "); $this->Socket->reset(); $serverResponse = "HTTP/1.x 200 OK\r\nSet-Cookie: foo=bar\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

    This is a cookie test!

    "; diff --git a/cake/tests/cases/libs/sanitize.test.php b/cake/tests/cases/libs/sanitize.test.php index e564f9a92..1899f16c7 100644 --- a/cake/tests/cases/libs/sanitize.test.php +++ b/cake/tests/cases/libs/sanitize.test.php @@ -298,8 +298,8 @@ class SanitizeTest extends CakeTestCase { $result = Sanitize::stripScripts($string); $this->assertEqual($result, $expected); - $string = ''."\n".''."\n".''."\n".''; - $expected = "\n".''."\n".''."\n".''; + $string = '' . "\n" . '' . "\n" . '' . "\n" . ''; + $expected = "\n" . '' . "\n" . ''."\n".''; $result = Sanitize::stripScripts($string); $this->assertEqual($result, $expected);