diff --git a/app/Config/Schema/i18n.php b/app/Config/Schema/i18n.php index 8de0052ddcd..08aab843b08 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 1a29ffd986a..1b8b08735bf 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 b741ef4d604..eb4847aa4ff 100644 --- a/lib/Cake/I18n/Multibyte.php +++ b/lib/Cake/I18n/Multibyte.php @@ -1008,7 +1008,8 @@ public static function mimeEncode($string, $charset = null, $newline = "\r\n") { 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 @@ public static function mimeEncode($string, $charset = null, $newline = "\r\n") { } $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 9e7cec275da..2104739ac98 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 bfc33f68a71..c0964ccb004 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 @@ public function testRevoke() { /** * 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 @@ protected function __debug($printTreesToo = false) { } 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 @@ protected function __debug($printTreesToo = false) { * @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 380c2909908..7c4be8972a7 100644 --- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php @@ -412,11 +412,11 @@ public function testReadingCookieDataOnStartup() { $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 @@ public function testReadingCookieDataWithoutStartup() { $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 @@ protected function _implode(array $array) { * @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 d9ae235d41e..487f60e8050 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -1710,7 +1710,7 @@ public static function environmentGenerator() { */ 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 @@ public function testIsRequested() { * @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 a0e3df7ba6d..cf0ce8752d5 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -1574,7 +1574,7 @@ public function testFullPageCachingDispatch($url) { $this->assertTextEquals($out, $cached); - $filename = $this->__cachePath($request->here()); + $filename = $this->_cachePath($request->here()); unlink($filename); } @@ -1657,79 +1657,13 @@ public function testHttpMethodOverrides() { 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 df6ec413f81..f41cfa69ddd 100644 --- a/lib/Cake/TestSuite/templates/menu.php +++ b/lib/Cake/TestSuite/templates/menu.php @@ -1,4 +1,5 @@
  • Plugins - +