Skip to content

Commit

Permalink
coding standards regarding whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Oct 26, 2012
1 parent 5324a8c commit 0f97819
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Behavior/TranslateBehavior.php
Expand Up @@ -129,7 +129,7 @@ public function beforeFind(Model $Model, $query) {
'conditions' => array(
$Model->escapeField() => $db->identifier($RuntimeModel->escapeField('foreign_key')),
$RuntimeModel->escapeField('model') => $Model->name,
$RuntimeModel->escapeField('locale') => $locale
$RuntimeModel->escapeField('locale') => $locale
)
);
$conditionFields = $this->_checkConditions($Model, $query);
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Model/CakeSchema.php
Expand Up @@ -418,12 +418,12 @@ public function generateTable($table, $fields) {
}
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
unset($value['type']);
$col .= implode(', ', $this->_values($value));
$col .= implode(', ', $this->_values($value));
} elseif ($field == 'indexes') {
$col = "\t\t'indexes' => array(\n\t\t\t";
$props = array();
foreach ((array)$value as $key => $index) {
$props[] = "'{$key}' => array(" . implode(', ', $this->_values($index)) . ")";
$props[] = "'{$key}' => array(" . implode(', ', $this->_values($index)) . ")";
}
$col .= implode(",\n\t\t\t", $props) . "\n\t\t";
} elseif ($field == 'tableParameters') {
Expand Down Expand Up @@ -580,7 +580,7 @@ protected function _values($values) {
if (is_array($values)) {
foreach ($values as $key => $val) {
if (is_array($val)) {
$vals[] = "'{$key}' => array('" . implode("', '", $val) . "')";
$vals[] = "'{$key}' => array('" . implode("', '", $val) . "')";
} elseif (!is_numeric($key)) {
$val = var_export($val, true);
if ($val === 'NULL') {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/ClassRegistry.php
Expand Up @@ -303,7 +303,7 @@ public static function config($type, $param = array()) {
* @param string $class
* @return boolean
*/
protected function &_duplicate($alias, $class) {
protected function &_duplicate($alias, $class) {
$duplicate = false;
if ($this->isKeySet($alias)) {
$model = $this->getObject($alias);
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Utility/Debugger.php
Expand Up @@ -295,9 +295,9 @@ public static function trace($options = array()) {
$back = array();

$_trace = array(
'line' => '??',
'file' => '[internal]',
'class' => null,
'line' => '??',
'file' => '[internal]',
'class' => null,
'function' => '[main]'
);

Expand Down Expand Up @@ -510,7 +510,7 @@ protected static function _export($var, $depth, $indent) {
protected static function _array(array $var, $depth, $indent) {
$secrets = array(
'password' => '*****',
'login' => '*****',
'login' => '*****',
'host' => '*****',
'database' => '*****',
'port' => '*****',
Expand Down
34 changes: 17 additions & 17 deletions lib/Cake/Utility/Validation.php
Expand Up @@ -326,13 +326,13 @@ public static function date($check, $format = 'ymd', $regex = null) {
* Use a string or an array of the keys below. Arrays should be passed as array('dmy', 'mdy', etc)
* ## Keys:
*
* - dmy 27-12-2006 or 27-12-06 separators can be a space, period, dash, forward slash
* - mdy 12-27-2006 or 12-27-06 separators can be a space, period, dash, forward slash
* - ymd 2006-12-27 or 06-12-27 separators can be a space, period, dash, forward slash
* - dMy 27 December 2006 or 27 Dec 2006
* - Mdy December 27, 2006 or Dec 27, 2006 comma is optional
* - My December 2006 or Dec 2006
* - my 12/2006 separators can be a space, period, dash, forward slash
* - dmy 27-12-2006 or 27-12-06 separators can be a space, period, dash, forward slash
* - mdy 12-27-2006 or 12-27-06 separators can be a space, period, dash, forward slash
* - ymd 2006-12-27 or 06-12-27 separators can be a space, period, dash, forward slash
* - dMy 27 December 2006 or 27 Dec 2006
* - Mdy December 27, 2006 or Dec 27, 2006 comma is optional
* - My December 2006 or Dec 2006
* - my 12/2006 separators can be a space, period, dash, forward slash
* @param string $regex Regex for the date part. If a custom regular expression is used this is the only validation that will occur.
* @return boolean True if the value is valid, false otherwise
* @see Validation::date
Expand Down Expand Up @@ -616,7 +616,7 @@ public static function phone($check, $regex = null, $country = 'all') {
case 'can':
// includes all NANPA members.
// see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories
$regex = '/^(?:\+?1)?[-. ]?\\(?[2-9][0-8][0-9]\\)?[-. ]?[2-9][0-9]{2}[-. ]?[0-9]{4}$/';
$regex = '/^(?:\+?1)?[-. ]?\\(?[2-9][0-8][0-9]\\)?[-. ]?[2-9][0-9]{2}[-. ]?[0-9]{4}$/';
break;
}
}
Expand All @@ -642,20 +642,20 @@ public static function postal($check, $regex = null, $country = 'us') {
if (is_null($regex)) {
switch ($country) {
case 'uk':
$regex = '/\\A\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\\z/i';
$regex = '/\\A\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\\z/i';
break;
case 'ca':
$regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9]\\b\\z/i';
$regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9]\\b\\z/i';
break;
case 'it':
case 'de':
$regex = '/^[0-9]{5}$/i';
$regex = '/^[0-9]{5}$/i';
break;
case 'be':
$regex = '/^[1-9]{1}[0-9]{3}$/i';
$regex = '/^[1-9]{1}[0-9]{3}$/i';
break;
case 'us':
$regex = '/\\A\\b[0-9]{5}(?:-[0-9]{4})?\\b\\z/i';
$regex = '/\\A\\b[0-9]{5}(?:-[0-9]{4})?\\b\\z/i';
break;
}
}
Expand Down Expand Up @@ -701,13 +701,13 @@ public static function ssn($check, $regex = null, $country = null) {
if (is_null($regex)) {
switch ($country) {
case 'dk':
$regex = '/\\A\\b[0-9]{6}-[0-9]{4}\\b\\z/i';
$regex = '/\\A\\b[0-9]{6}-[0-9]{4}\\b\\z/i';
break;
case 'nl':
$regex = '/\\A\\b[0-9]{9}\\b\\z/i';
$regex = '/\\A\\b[0-9]{9}\\b\\z/i';
break;
case 'us':
$regex = '/\\A\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b\\z/i';
$regex = '/\\A\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b\\z/i';
break;
}
}
Expand Down Expand Up @@ -943,7 +943,7 @@ public static function uploadError($check) {
*/
protected static function _populateIp() {
if (!isset(self::$_pattern['IPv6'])) {
$pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}';
$pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}';
$pattern .= '(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})';
$pattern .= '|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})';
$pattern .= '(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)';
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Xml.php
Expand Up @@ -110,7 +110,7 @@ public static function build($input, $options = array()) {
* Parse the input data and create either a SimpleXmlElement object or a DOMDocument.
*
* @param string $input The input to load.
* @param array $options The options to use. See Xml::build()
* @param array $options The options to use. See Xml::build()
* @return SimpleXmlElement|DOMDocument.
*/
protected static function _loadXml($input, $options) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -558,7 +558,7 @@ public function script($url, $options = array()) {
public function scriptBlock($script, $options = array()) {
$options += array('safe' => true, 'inline' => true);
if ($options['safe']) {
$script = "\n" . '//<![CDATA[' . "\n" . $script . "\n" . '//]]>' . "\n";
$script = "\n" . '//<![CDATA[' . "\n" . $script . "\n" . '//]]>' . "\n";
}
if (!$options['inline'] && empty($options['block'])) {
$options['block'] = 'script';
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/bootstrap.php
Expand Up @@ -134,7 +134,7 @@
require CAKE . 'Error' . DS . 'exceptions.php';

/**
* Full url prefix
* Full url prefix
*/
if (!defined('FULL_BASE_URL')) {
$s = null;
Expand Down

0 comments on commit 0f97819

Please sign in to comment.