Browse Source

fix remaining cs errors

Ceeram 13 years ago
parent
commit
aaf2d2ef71

+ 4 - 1
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()) {

+ 4 - 1
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()) {

+ 3 - 1
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);

+ 4 - 0
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.
  *

+ 5 - 5
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);
 	}
 }

+ 9 - 9
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);
 		}

+ 2 - 2
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']);
 		}

+ 2 - 68
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);
 	}
 
@@ -1658,78 +1658,12 @@ class DispatcherTest extends CakeTestCase {
 	}
 
 /**
- * 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';

+ 2 - 1
lib/Cake/TestSuite/templates/menu.php

@@ -1,4 +1,5 @@
 <?php
+// @codingStandardsIgnoreFile
 /**
  * Short description for file.
  *
@@ -28,7 +29,7 @@
 <?php if (!empty($plugins)): ?>
 	<li style="padding-top: 10px">
 		<span style="font-size: 18px">Plugins</span>
-	<?php foreach ($plugins as $plugin): ?>
+	<?php foreach ($plugins as $plugin) : ?>
 			<ul>
 				<li style="padding-top: 10px">
 					<span  style="font-size: 18px"><?php echo $plugin; ?></span>