Browse Source

Merge branch 'master' into 3.next

Mark Story 7 years ago
parent
commit
00cdb32ee1

+ 1 - 1
src/Cache/Engine/FileEngine.php

@@ -413,7 +413,7 @@ class FileEngine extends CacheEngine
     }
 
     /**
-     * Determine is cache directory is writable
+     * Determine if cache directory is writable
      *
      * @return bool
      */

+ 1 - 1
src/Console/CommandRunner.php

@@ -298,7 +298,7 @@ class CommandRunner implements EventDispatcherInterface
     /**
      * Resolve the command name into a name that exists in the collection.
      *
-     * Apply backwards compatibile inflections and aliases.
+     * Apply backwards compatible inflections and aliases.
      *
      * @param \Cake\Console\CommandCollection $commands The command collection to check.
      * @param \Cake\Console\ConsoleIo $io ConsoleIo object for errors.

+ 1 - 1
src/Controller/Controller.php

@@ -499,7 +499,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
     }
 
     /**
-     * Disbale automatic action rendering.
+     * Disable automatic action rendering.
      *
      * @return $this
      * @since 3.6.0

+ 1 - 1
src/Database/FunctionsBuilder.php

@@ -205,7 +205,7 @@ class FunctionsBuilder
      * Add the time unit to the date expression
      *
      * @param string $expression Expression to obtain the date part from.
-     * @param string $value Value to be added. Use negative to substract.
+     * @param string $value Value to be added. Use negative to subtract.
      * @param string $unit Unit of the value e.g. hour or day.
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression

+ 1 - 1
src/Database/Schema/MysqlSchema.php

@@ -139,7 +139,7 @@ class MysqlSchema extends BaseSchema
         }
         if (strpos($col, 'blob') !== false || $col === 'binary') {
             $lengthName = substr($col, 0, -4);
-            $length = isset(TableSchema::$columnLengths[$lengthName]) ? TableSchema::$columnLengths[$lengthName] : null;
+            $length = isset(TableSchema::$columnLengths[$lengthName]) ? TableSchema::$columnLengths[$lengthName] : $length;
 
             return ['type' => TableSchema::TYPE_BINARY, 'length' => $length];
         }

+ 2 - 2
src/Database/Schema/SqliteSchema.php

@@ -102,8 +102,8 @@ class SqliteSchema extends BaseSchema
         if ($col === 'binary' && $length === 16) {
             return ['type' => TableSchema::TYPE_BINARY_UUID, 'length' => null];
         }
-        if (in_array($col, ['blob', 'clob'])) {
-            return ['type' => TableSchema::TYPE_BINARY, 'length' => null];
+        if (in_array($col, ['blob', 'clob', 'binary'])) {
+            return ['type' => TableSchema::TYPE_BINARY, 'length' => $length];
         }
         if (in_array($col, ['date', 'time', 'timestamp', 'datetime'])) {
             return ['type' => $col, 'length' => null];

+ 1 - 1
src/Datasource/EntityTrait.php

@@ -981,7 +981,7 @@ trait EntityTrait
 
             // String messages are appended to the list,
             // while more complex error structures need their
-            // keys perserved for nested validator.
+            // keys preserved for nested validator.
             if (is_string($error)) {
                 $this->_errors[$f][] = $error;
             } else {

+ 1 - 1
src/Http/Middleware/EncryptedCookieMiddleware.php

@@ -45,7 +45,7 @@ class EncryptedCookieMiddleware
     protected $cookieNames;
 
     /**
-     * Encrpytion key to use.
+     * Encryption key to use.
      *
      * @var string
      */

+ 1 - 1
src/Http/ServerRequestFactory.php

@@ -79,7 +79,7 @@ abstract class ServerRequestFactory extends BaseFactory
      * Build a UriInterface object.
      *
      * Add in some CakePHP specific logic/properties that help
-     * perserve backwards compatibility.
+     * preserve backwards compatibility.
      *
      * @param array $server The server parameters.
      * @param array $headers The normalized headers

+ 1 - 1
src/ORM/Table.php

@@ -1848,7 +1848,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
      *   listeners will receive the entity and the options array as arguments. The type
      *   of operation performed (insert or update) can be determined by checking the
      *   entity's method `isNew`, true meaning an insert and false an update.
-     * - Model.afterSaveCommit: Will be triggered after the transaction is commited
+     * - Model.afterSaveCommit: Will be triggered after the transaction is committed
      *   for atomic save, listeners will receive the entity and the options array
      *   as arguments.
      *

+ 1 - 1
src/Routing/RouteBuilder.php

@@ -1062,7 +1062,7 @@ class RouteBuilder
                 throw new RuntimeException($message);
             }
         }
-        $this->middleware = array_merge($this->middleware, $names);
+        $this->middleware = array_unique(array_merge($this->middleware, $names));
 
         return $this;
     }

+ 1 - 1
src/Utility/Crypto/Mcrypt.php

@@ -33,7 +33,7 @@ class Mcrypt
      * @param string $key Key to use as the encryption key for encrypted data.
      * @param string $operation Operation to perform, encrypt or decrypt
      * @throws \LogicException When there are errors.
-     * @return string Encrytped binary string data, or decrypted data depending on operation.
+     * @return string Encrypted binary string data, or decrypted data depending on operation.
      * @deprecated 3.3.0 This method will be removed in 4.0.0.
      */
     public static function rijndael($text, $key, $operation)

+ 2 - 2
src/Validation/Validation.php

@@ -1373,7 +1373,7 @@ class Validation
      * Validates the image width.
      *
      * @param array $file The uploaded file data from PHP.
-     * @param string $operator Comparision operator.
+     * @param string $operator Comparison operator.
      * @param int $width Min or max width.
      * @return bool
      */
@@ -1391,7 +1391,7 @@ class Validation
      * Validates the image width.
      *
      * @param array $file The uploaded file data from PHP.
-     * @param string $operator Comparision operator.
+     * @param string $operator Comparison operator.
      * @param int $height Min or max width.
      * @return bool
      */

+ 4 - 0
tests/TestCase/Database/Schema/MysqlSchemaTest.php

@@ -124,6 +124,10 @@ class MysqlSchemaTest extends TestCase
                 ['type' => 'binaryuuid', 'length' => null]
             ],
             [
+                'BINARY(1)',
+                ['type' => 'binary', 'length' => 1]
+            ],
+            [
                 'TEXT',
                 ['type' => 'text', 'length' => null]
             ],

+ 4 - 0
tests/TestCase/Database/Schema/SqliteSchemaTest.php

@@ -88,6 +88,10 @@ class SqliteSchemaTest extends TestCase
                 ['type' => 'binaryuuid', 'length' => null]
             ],
             [
+                'BINARY(1)',
+                ['type' => 'binary', 'length' => 1]
+            ],
+            [
                 'BLOB',
                 ['type' => 'binary', 'length' => null]
             ],

+ 1 - 1
tests/TestCase/Database/Schema/SqlserverSchemaTest.php

@@ -198,7 +198,7 @@ SQL;
                 50,
                 null,
                 null,
-                // Sqlserver returns double lenghts for unicode columns
+                // Sqlserver returns double lengths for unicode columns
                 ['type' => 'string', 'length' => 25]
             ],
             [

+ 1 - 1
tests/TestCase/I18n/I18nTest.php

@@ -266,7 +266,7 @@ class I18nTest extends TestCase
     }
 
     /**
-     * Tests the __() functions with explict null params
+     * Tests the __() functions with explicit null params
      *
      * @return void
      */

+ 1 - 1
tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php

@@ -173,7 +173,7 @@ class TranslateBehaviorTest extends TestCase
 
     /**
      * Tests that fields from a translated model use the I18n class locale
-     * and that it propogates to associated models
+     * and that it propagates to associated models
      *
      * @return void
      */

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

@@ -4986,7 +4986,7 @@ class TableTest extends TestCase
     }
 
     /**
-     * Integration test for replacing entities with HasMany and an empty target list. The transaction must be successfull
+     * Integration test for replacing entities with HasMany and an empty target list. The transaction must be successful
      *
      * @return void
      */
@@ -5028,7 +5028,7 @@ class TableTest extends TestCase
     }
 
     /**
-     * Integration test for replacing entities with HasMany and no already persisted entities. The transaction must be successfull.
+     * Integration test for replacing entities with HasMany and no already persisted entities. The transaction must be successful.
      * Replace operation should prevent considering 0 changed records an error when they are not found in the table
      *
      * @return void
@@ -6542,7 +6542,7 @@ class TableTest extends TestCase
 
     /**
      * Tests that passing a coned entity that was marked as new to save() will
-     * actaully save it as a new entity
+     * actually save it as a new entity
      *
      * @group save
      * @return void

+ 1 - 1
tests/TestCase/Routing/Route/RouteTest.php

@@ -582,7 +582,7 @@ class RouteTest extends TestCase
         $this->assertRegExp($result, '/source/view');
         $this->assertRegExp($result, '/source/view/other/params');
         $this->assertNotRegExp($result, '/chaw_test/wiki');
-        $this->assertNotRegExp($result, '/source/wierd_action');
+        $this->assertNotRegExp($result, '/source/weird_action');
     }
 
     /**

+ 19 - 0
tests/TestCase/Routing/RouteBuilderTest.php

@@ -1082,6 +1082,25 @@ class RouteBuilderTest extends TestCase
     }
 
     /**
+     * Test that applyMiddleware() uses unique middleware set
+     *
+     * @return void
+     */
+    public function testApplyMiddlewareUnique()
+    {
+        $func = function () {
+        };
+        $routes = new RouteBuilder($this->collection, '/api');
+        $routes->registerMiddleware('test', $func)
+            ->registerMiddleware('test2', $func);
+
+        $routes->applyMiddleware('test', 'test2');
+        $routes->applyMiddleware('test2', 'test');
+
+        $this->assertAttributeEquals(['test', 'test2'], 'middleware', $routes);
+    }
+
+    /**
      * Test applying middleware results in middleware attached to the route.
      *
      * @return void

+ 1 - 1
tests/TestCase/Utility/HashTest.php

@@ -1189,7 +1189,7 @@ class HashTest extends TestCase
     }
 
     /**
-     * Test the attribute presense selector.
+     * Test the attribute presence selector.
      *
      * @dataProvider articleDataSets
      * @return void

+ 1 - 1
tests/TestCase/Utility/TextTest.php

@@ -468,7 +468,7 @@ TEXT;
     }
 
     /**
-     * test wrapBlock() indentical to wrap()
+     * test wrapBlock() identical to wrap()
      *
      * @return void
      */

+ 1 - 1
tests/TestCase/Validation/ValidationTest.php

@@ -1978,7 +1978,7 @@ class ValidationTest extends TestCase
      */
     public function testEmailDeep()
     {
-        $this->skipIf((bool)gethostbynamel('example.abcd'), 'Your DNS service responds for non-existant domains, skipping deep email checks.');
+        $this->skipIf((bool)gethostbynamel('example.abcd'), 'Your DNS service responds for non-existent domains, skipping deep email checks.');
 
         $this->assertTrue(Validation::email('abc.efg@cakephp.org', true));
         $this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true));

+ 1 - 1
tests/TestCase/View/Helper/PaginatorHelperTest.php

@@ -842,7 +842,7 @@ class PaginatorHelperTest extends TestCase
     /**
      * Returns data sets of:
      *  * the name of the field being sorted on
-     *  * url paramters to pass to paginator sort
+     *  * url parameters to pass to paginator sort
      *  * expected result as a string
      *
      * @return array

+ 2 - 2
tests/TestCase/View/ViewTest.php

@@ -1941,7 +1941,7 @@ TEXT;
     }
 
     /**
-     * Test extend() preceeded by an element()
+     * Test extend() preceded by an element()
      *
      * @return void
      */
@@ -1958,7 +1958,7 @@ TEXT;
     }
 
     /**
-     * Test extend() preceeded by an element()
+     * Test extend() preceded by an element()
      *
      * @return void
      */