Skip to content

Commit

Permalink
fix remaining cs errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Nov 4, 2012
1 parent fa5ccf4 commit aaf2d2e
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 88 deletions.
5 changes: 4 additions & 1 deletion app/Config/Schema/i18n.php
Expand Up @@ -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()) {
Expand Down
5 changes: 4 additions & 1 deletion lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
Expand Up @@ -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()) {
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/I18n/Multibyte.php
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/Model/Model.php
Expand Up @@ -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.
*
Expand Down Expand Up @@ -586,6 +588,8 @@ class Model extends Object implements CakeEventListener {
*/
public $__backContainableAssociation = array();

// @codingStandardsIgnoreEnd

/**
* The ID of the model record that was last inserted.
*
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
Expand Up @@ -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'));
Expand Down Expand Up @@ -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()));
Expand All @@ -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);
}
}
18 changes: 9 additions & 9 deletions lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Network/CakeRequestTest.php
Expand Up @@ -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");
Expand Down Expand Up @@ -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']);
}
Expand Down
70 changes: 2 additions & 68 deletions lib/Cake/Test/Case/Routing/DispatcherTest.php
Expand Up @@ -1574,7 +1574,7 @@ public function testFullPageCachingDispatch($url) {

$this->assertTextEquals($out, $cached);

$filename = $this->__cachePath($request->here());
$filename = $this->_cachePath($request->here());
unlink($filename);
}

Expand Down Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/TestSuite/templates/menu.php
@@ -1,4 +1,5 @@
<?php
// @codingStandardsIgnoreFile
/**
* Short description for file.
*
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit aaf2d2e

Please sign in to comment.