Browse Source

Fix CS errors that fixers missed

Bryan Crowe 11 years ago
parent
commit
81c025bd21

+ 0 - 1
src/Database/Driver/Sqlite.php

@@ -72,7 +72,6 @@ class Sqlite extends \Cake\Database\Driver
      *
      * @return bool true if it is valid to use this driver
      */
-
     public function enabled()
     {
         return in_array('sqlite', PDO::getAvailableDrivers());

+ 4 - 4
src/Model/Behavior/TranslateBehavior.php

@@ -188,10 +188,10 @@ class TranslateBehavior extends Behavior
             $select
             );
 
-        if ($changeFilter) {
-            $filter = $options['filterByCurrentLocale'] ? 'INNER' : 'LEFT';
-            $contain[$alias . '_' . $field . '_translation']['joinType'] = $filter;
-        }
+            if ($changeFilter) {
+                $filter = $options['filterByCurrentLocale'] ? 'INNER' : 'LEFT';
+                $contain[$alias . '_' . $field . '_translation']['joinType'] = $filter;
+            }
         }
 
         $query->contain($contain);

+ 1 - 1
src/Network/Request.php

@@ -1014,7 +1014,7 @@ class Request implements \ArrayAccess
      * Generally you want to use Cake\Network\Request::accept() to get a simple list
      * of the accepted content types.
      *
-     * @return array An array of prefValue => array(content/types)
+     * @return array An array of prefValue => [content/types]
      */
     public function parseAccept()
     {

+ 2 - 1
src/Utility/Hash.php

@@ -160,11 +160,12 @@ class Hash
         }
         return $context[$_key];
     }
+
     /**
      * Split token conditions
      *
      * @param string $token the token being splitted.
-     * @return array array(token, conditions) with token splitted
+     * @return array [token, conditions] with token splitted
      */
     protected static function _splitConditions($token)
     {

+ 14 - 16
src/Validation/Validation.php

@@ -155,23 +155,21 @@ class Validation
         }
         $cards = array(
             'all' => array(
-                'amex'      => '/^3[4|7]\\d{13}$/',
-                'bankcard'  => '/^56(10\\d\\d|022[1-5])\\d{10}$/',
-                'diners'    => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/',
-                'disc'      => '/^(?:6011|650\\d)\\d{12}$/',
-                'electron'  => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/',
-                'enroute'   => '/^2(?:014|149)\\d{11}$/',
-                'jcb'       => '/^(3\\d{4}|2100|1800)\\d{11}$/',
-                'maestro'   => '/^(?:5020|6\\d{3})\\d{12}$/',
-                'mc'        => '/^5[1-5]\\d{14}$/',
-                'solo'      => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
-                'switch'    =>
-                '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
-                'visa'      => '/^4\\d{12}(\\d{3})?$/',
-                'voyager'   => '/^8699[0-9]{11}$/'
+                'amex' => '/^3[4|7]\\d{13}$/',
+                'bankcard' => '/^56(10\\d\\d|022[1-5])\\d{10}$/',
+                'diners' => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/',
+                'disc' => '/^(?:6011|650\\d)\\d{12}$/',
+                'electron' => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/',
+                'enroute' => '/^2(?:014|149)\\d{11}$/',
+                'jcb' => '/^(3\\d{4}|2100|1800)\\d{11}$/',
+                'maestro' => '/^(?:5020|6\\d{3})\\d{12}$/',
+                'mc' => '/^5[1-5]\\d{14}$/',
+                'solo' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
+                'switch' => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
+                'visa' => '/^4\\d{12}(\\d{3})?$/',
+                'voyager' => '/^8699[0-9]{11}$/'
             ),
-            'fast' =>
-            '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/'
+            'fast' => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/'
         );
 
         if (is_array($type)) {

+ 6 - 0
src/View/Helper/FormHelper.php

@@ -363,18 +363,24 @@ class FormHelper extends Helper
             case 'get':
                 $htmlAttributes['method'] = 'get';
                 break;
+            // Set enctype for form
             case 'file':
                 $htmlAttributes['enctype'] = 'multipart/form-data';
                 $options['type'] = ($isCreate) ? 'post' : 'put';
+            // Move on
             case 'post':
+            // Move on
             case 'put':
+            // Move on
             case 'delete':
+            // Set patch method
             case 'patch':
                 $append .= $this->hidden('_method', array(
                     'name' => '_method',
                     'value' => strtoupper($options['type']),
                     'secure' => static::SECURE_SKIP
                 ));
+            // Default to post method
             default:
                 $htmlAttributes['method'] = 'post';
         }

+ 5 - 5
tests/TestCase/Network/SocketTest.php

@@ -57,11 +57,11 @@ class SocketTest extends TestCase
         $this->Socket = new Socket();
         $config = $this->Socket->config();
         $this->assertSame($config, array(
-            'persistent'    => false,
-            'host'          => 'localhost',
-            'protocol'      => 'tcp',
-            'port'          => 80,
-            'timeout'       => 30
+            'persistent' => false,
+            'host' => 'localhost',
+            'protocol' => 'tcp',
+            'port' => 80,
+            'timeout' => 30
         ));
 
         $this->Socket->reset();

+ 2 - 2
tests/TestCase/ORM/TableTest.php

@@ -3261,7 +3261,7 @@ class TableTest extends TestCase
     public function testInitializeEvent()
     {
         $count = 0;
-        $cb = function ($event) use (&$count){
+        $cb = function ($event) use (&$count) {
             $count++;
         };
         EventManager::instance()->attach($cb, 'Model.initialize');
@@ -3294,7 +3294,7 @@ class TableTest extends TestCase
     public function testBuildValidatorEvent()
     {
         $count = 0;
-        $cb = function ($event) use (&$count){
+        $cb = function ($event) use (&$count) {
             $count++;
         };
         EventManager::instance()->attach($cb, 'Model.buildValidator');

+ 16 - 16
tests/test_app/config/acl.php

@@ -18,30 +18,30 @@
 // Roles
 // -------------------------------------
 $config['roles'] = array(
-    'Role/admin'                => null,
-    'Role/data_acquirer'        => null,
-    'Role/accounting'           => null,
-    'Role/database_manager'     => null,
-    'Role/sales'                => null,
-    'Role/data_analyst'         => 'Role/data_acquirer, Role/database_manager',
-    'Role/reports'              => 'Role/data_analyst',
+    'Role/admin' => null,
+    'Role/data_acquirer' => null,
+    'Role/accounting' => null,
+    'Role/database_manager' => null,
+    'Role/sales' => null,
+    'Role/data_analyst' => 'Role/data_acquirer, Role/database_manager',
+    'Role/reports' => 'Role/data_analyst',
     // allow inherited roles to be defined as an array or comma separated list
-    'Role/manager'              => array(
+    'Role/manager' => array(
         'Role/accounting',
         'Role/sales',
     ),
-    'Role/accounting_manager'   => 'Role/accounting',
+    'Role/accounting_manager' => 'Role/accounting',
     // managers
-    'User/hardy'                => 'Role/accounting_manager, Role/reports',
-    'User/stan'                 => 'Role/manager',
+    'User/hardy' => 'Role/accounting_manager, Role/reports',
+    'User/stan' => 'Role/manager',
     // accountants
-    'User/peter'                => 'Role/accounting',
-    'User/jeff'                 => 'Role/accounting',
+    'User/peter' => 'Role/accounting',
+    'User/jeff' => 'Role/accounting',
     // admins
-    'User/jan'                  => 'Role/admin',
+    'User/jan' => 'Role/admin',
     // database
-    'User/db_manager_1'         => 'Role/database_manager',
-    'User/db_manager_2'         => 'Role/database_manager',
+    'User/db_manager_1' => 'Role/database_manager',
+    'User/db_manager_2' => 'Role/database_manager',
 );
 
 //-------------------------------------