diff --git a/app/Config/Schema/i18n.php b/app/Config/Schema/i18n.php index 8de0052dd..08aab843b 100644 --- a/app/Config/Schema/i18n.php +++ b/app/Config/Schema/i18n.php @@ -19,14 +19,17 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +// @codingStandardsIgnoreStart + /* * * Using the Schema command line utility * cake schema run create i18n - * */ class i18nSchema extends CakeSchema { +// @codingStandardsIgnoreEnd + public $name = 'i18n'; public function before($event = array()) { diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php index 1a29ffd98..1b8b08735 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php @@ -21,14 +21,17 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +// @codingStandardsIgnoreStart + /* * * Using the Schema command line utility * cake schema run create i18n - * */ class i18nSchema extends CakeSchema { +// @codingStandardsIgnoreEnd + public $name = 'i18n'; public function before($event = array()) { diff --git a/lib/Cake/I18n/Multibyte.php b/lib/Cake/I18n/Multibyte.php index b741ef4d6..eb4847aa4 100644 --- a/lib/Cake/I18n/Multibyte.php +++ b/lib/Cake/I18n/Multibyte.php @@ -1008,7 +1008,8 @@ class Multibyte { if ($charset == 'UTF-8') { $parts = array(); $maxchars = floor(($length * 3) / 4); - while (strlen($string) > $maxchars) { + $stringLength = strlen($string); + while ($stringLength > $maxchars) { $i = (int)$maxchars; $test = ord($string[$i]); while ($test >= 128 && $test <= 191) { @@ -1017,6 +1018,7 @@ class Multibyte { } $parts[] = base64_encode(substr($string, 0, $i)); $string = substr($string, $i); + $stringLength = strlen($string); } $parts[] = base64_encode($string); $string = implode($spacer, $parts); diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 9e7cec275..2104739ac 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -558,6 +558,8 @@ class Model extends Object implements CakeEventListener { */ protected $_associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); +// @codingStandardsIgnoreStart + /** * Holds model associations temporarily to allow for dynamic (un)binding. * @@ -586,6 +588,8 @@ class Model extends Object implements CakeEventListener { */ public $__backContainableAssociation = array(); +// @codingStandardsIgnoreEnd + /** * The ID of the model record that was last inserted. * diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index bfc33f68a..c0964ccb0 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -483,14 +483,14 @@ class DbAclTest extends CakeTestCase { /** * debug function - to help editing/creating test cases for the ACL component * - * To check the overall ACL status at any time call $this->__debug(); + * To check the overall ACL status at any time call $this->_debug(); * Generates a list of the current aro and aco structures and a grid dump of the permissions that are defined * Only designed to work with the db based ACL * * @param bool $treesToo * @return void */ - protected function __debug($printTreesToo = false) { + protected function _debug($printTreesToo = false) { $this->Acl->Aro->displayField = 'alias'; $this->Acl->Aco->displayField = 'alias'; $aros = $this->Acl->Aro->find('list', array('order' => 'lft')); @@ -518,10 +518,10 @@ class DbAclTest extends CakeTestCase { } foreach ($permissions as $key => $values) { array_unshift($values, $key); - $values = array_map(array(&$this, '__pad'), $values); + $values = array_map(array(&$this, '_pad'), $values); $permissions[$key] = implode (' ', $values); } - $permisssions = array_map(array(&$this, '__pad'), $permissions); + $permisssions = array_map(array(&$this, '_pad'), $permissions); array_unshift($permissions, 'Current Permissions :'); if ($printTreesToo) { debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList())); @@ -537,7 +537,7 @@ class DbAclTest extends CakeTestCase { * @param integer $len * @return void */ - protected function __pad($string = '', $len = 14) { + protected function _pad($string = '', $len = 14) { return str_pad($string, $len); } } diff --git a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php index 380c29099..7c4be8972 100644 --- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php @@ -412,11 +412,11 @@ class CookieComponentTest extends CakeTestCase { $this->assertNull($data); $_COOKIE['CakeTestCookie'] = array( - 'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), + 'Encrytped_array' => $this->_encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), 'Encrytped_multi_cookies' => array( - 'name' => $this->__encrypt('CakePHP'), - 'version' => $this->__encrypt('1.2.0.x'), - 'tag' => $this->__encrypt('CakePHP Rocks!')), + 'name' => $this->_encrypt('CakePHP'), + 'version' => $this->_encrypt('1.2.0.x'), + 'tag' => $this->_encrypt('CakePHP Rocks!')), 'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}', 'Plain_multi_cookies' => array( 'name' => 'CakePHP', @@ -467,11 +467,11 @@ class CookieComponentTest extends CakeTestCase { $this->assertEquals($expected, $data); $_COOKIE['CakeTestCookie'] = array( - 'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), + 'Encrytped_array' => $this->_encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), 'Encrytped_multi_cookies' => array( - 'name' => $this->__encrypt('CakePHP'), - 'version' => $this->__encrypt('1.2.0.x'), - 'tag' => $this->__encrypt('CakePHP Rocks!')), + 'name' => $this->_encrypt('CakePHP'), + 'version' => $this->_encrypt('1.2.0.x'), + 'tag' => $this->_encrypt('CakePHP Rocks!')), 'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}', 'Plain_multi_cookies' => array( 'name' => 'CakePHP', @@ -594,7 +594,7 @@ class CookieComponentTest extends CakeTestCase { * @param array|string $value * @return string */ - protected function __encrypt($value) { + protected function _encrypt($value) { if (is_array($value)) { $value = $this->_implode($value); } diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index d9ae235d4..487f60e80 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -1710,7 +1710,7 @@ class CakeRequestTest extends CakeTestCase { */ public function testEnvironmentDetection($name, $env, $expected) { $_GET = array(); - $this->__loadEnvironment($env); + $this->_loadEnvironment($env); $request = new CakeRequest(); $this->assertEquals($expected['url'], $request->url, "url error"); @@ -1913,7 +1913,7 @@ XML; * @param array $env * @return void */ - protected function __loadEnvironment($env) { + protected function _loadEnvironment($env) { if (isset($env['App'])) { Configure::write('App', $env['App']); } diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index a0e3df7ba..cf0ce8752 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -1574,7 +1574,7 @@ class DispatcherTest extends CakeTestCase { $this->assertTextEquals($out, $cached); - $filename = $this->__cachePath($request->here()); + $filename = $this->_cachePath($request->here()); unlink($filename); } @@ -1657,79 +1657,13 @@ class DispatcherTest extends CakeTestCase { unset($_POST['_method']); } -/** - * backupEnvironment method - * - * @return void - */ - protected function __backupEnvironment() { - return array( - 'App' => Configure::read('App'), - 'GET' => $_GET, - 'POST' => $_POST, - 'SERVER' => $_SERVER - ); - } - -/** - * reloadEnvironment method - * - * @return void - */ - protected function __reloadEnvironment() { - foreach ($_GET as $key => $val) { - unset($_GET[$key]); - } - foreach ($_POST as $key => $val) { - unset($_POST[$key]); - } - foreach ($_SERVER as $key => $val) { - unset($_SERVER[$key]); - } - Configure::write('App', array()); - } - -/** - * loadEnvironment method - * - * @param array $env - * @return void - */ - protected function __loadEnvironment($env) { - if ($env['reload']) { - $this->__reloadEnvironment(); - } - - if (isset($env['App'])) { - Configure::write('App', $env['App']); - } - - if (isset($env['GET'])) { - foreach ($env['GET'] as $key => $val) { - $_GET[$key] = $val; - } - } - - if (isset($env['POST'])) { - foreach ($env['POST'] as $key => $val) { - $_POST[$key] = $val; - } - } - - if (isset($env['SERVER'])) { - foreach ($env['SERVER'] as $key => $val) { - $_SERVER[$key] = $val; - } - } - } - /** * cachePath method * * @param string $here * @return string */ - protected function __cachePath($here) { + protected function _cachePath($here) { $path = $here; if ($here == '/') { $path = 'home'; diff --git a/lib/Cake/TestSuite/templates/menu.php b/lib/Cake/TestSuite/templates/menu.php index df6ec413f..f41cfa69d 100644 --- a/lib/Cake/TestSuite/templates/menu.php +++ b/lib/Cake/TestSuite/templates/menu.php @@ -1,4 +1,5 @@