mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
coding standards regarding whitespaces
This commit is contained in:
parent
5324a8ca9c
commit
0f978195d6
8 changed files with 29 additions and 29 deletions
|
@ -129,7 +129,7 @@ class TranslateBehavior extends ModelBehavior {
|
|||
'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);
|
||||
|
|
|
@ -418,12 +418,12 @@ class CakeSchema extends Object {
|
|||
}
|
||||
$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') {
|
||||
|
@ -580,7 +580,7 @@ class CakeSchema extends Object {
|
|||
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') {
|
||||
|
|
|
@ -303,7 +303,7 @@ class ClassRegistry {
|
|||
* @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);
|
||||
|
|
|
@ -295,9 +295,9 @@ class Debugger {
|
|||
$back = array();
|
||||
|
||||
$_trace = array(
|
||||
'line' => '??',
|
||||
'file' => '[internal]',
|
||||
'class' => null,
|
||||
'line' => '??',
|
||||
'file' => '[internal]',
|
||||
'class' => null,
|
||||
'function' => '[main]'
|
||||
);
|
||||
|
||||
|
@ -510,7 +510,7 @@ class Debugger {
|
|||
protected static function _array(array $var, $depth, $indent) {
|
||||
$secrets = array(
|
||||
'password' => '*****',
|
||||
'login' => '*****',
|
||||
'login' => '*****',
|
||||
'host' => '*****',
|
||||
'database' => '*****',
|
||||
'port' => '*****',
|
||||
|
|
|
@ -326,13 +326,13 @@ class Validation {
|
|||
* 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
|
||||
|
@ -616,7 +616,7 @@ class Validation {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -642,20 +642,20 @@ class Validation {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -701,13 +701,13 @@ class Validation {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -943,7 +943,7 @@ class Validation {
|
|||
*/
|
||||
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}:)';
|
||||
|
|
|
@ -110,7 +110,7 @@ class Xml {
|
|||
* 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) {
|
||||
|
|
|
@ -558,7 +558,7 @@ class HtmlHelper extends AppHelper {
|
|||
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';
|
||||
|
|
|
@ -134,7 +134,7 @@ require CAKE . 'Core' . DS . 'App.php';
|
|||
require CAKE . 'Error' . DS . 'exceptions.php';
|
||||
|
||||
/**
|
||||
* Full url prefix
|
||||
* Full url prefix
|
||||
*/
|
||||
if (!defined('FULL_BASE_URL')) {
|
||||
$s = null;
|
||||
|
|
Loading…
Reference in a new issue