geek před 4 roky
rodič
revize
c81d35c6de
100 změnil soubory, kde provedl 1063 přidání a 653 odebrání
  1. 18 23
      application/api/BaseController.php
  2. 24 3
      application/api/controller/Admin.php
  3. 6 6
      application/common/until/Token.php
  4. 2 1
      composer.json
  5. 562 264
      composer.lock
  6. 1 1
      config/cache.php
  7. 1 1
      config/session.php
  8. 10 0
      public/api.yaml
  9. 3 4
      vendor/cakephp/cache/Cache.php
  10. 5 5
      vendor/cakephp/cache/CacheEngine.php
  11. 2 2
      vendor/cakephp/cache/CacheEngineInterface.php
  12. 7 4
      vendor/cakephp/cache/CacheRegistry.php
  13. 6 7
      vendor/cakephp/cache/Engine/ApcuEngine.php
  14. 3 3
      vendor/cakephp/cache/Engine/ArrayEngine.php
  15. 4 4
      vendor/cakephp/cache/Engine/FileEngine.php
  16. 11 18
      vendor/cakephp/cache/Engine/MemcachedEngine.php
  17. 0 1
      vendor/cakephp/cache/Engine/NullEngine.php
  18. 27 16
      vendor/cakephp/cache/Engine/RedisEngine.php
  19. 3 4
      vendor/cakephp/cache/Engine/WincacheEngine.php
  20. 4 5
      vendor/cakephp/cache/Engine/XcacheEngine.php
  21. 2 2
      vendor/cakephp/cache/README.md
  22. 2 2
      vendor/cakephp/cache/SimpleCacheEngine.php
  23. 0 1
      vendor/cakephp/collection/Collection.php
  24. 5 6
      vendor/cakephp/collection/CollectionInterface.php
  25. 41 28
      vendor/cakephp/collection/CollectionTrait.php
  26. 7 6
      vendor/cakephp/collection/ExtractTrait.php
  27. 1 2
      vendor/cakephp/collection/Iterator/BufferedIterator.php
  28. 1 1
      vendor/cakephp/collection/Iterator/ExtractIterator.php
  29. 0 1
      vendor/cakephp/collection/Iterator/FilterIterator.php
  30. 0 1
      vendor/cakephp/collection/Iterator/InsertIterator.php
  31. 1 1
      vendor/cakephp/collection/Iterator/MapReduce.php
  32. 1 2
      vendor/cakephp/collection/Iterator/NestIterator.php
  33. 0 1
      vendor/cakephp/collection/Iterator/NoChildrenIterator.php
  34. 0 1
      vendor/cakephp/collection/Iterator/ReplaceIterator.php
  35. 0 1
      vendor/cakephp/collection/Iterator/SortIterator.php
  36. 0 1
      vendor/cakephp/collection/Iterator/StoppableIterator.php
  37. 0 1
      vendor/cakephp/collection/Iterator/TreeIterator.php
  38. 0 1
      vendor/cakephp/collection/Iterator/TreePrinter.php
  39. 0 1
      vendor/cakephp/collection/Iterator/UnfoldIterator.php
  40. 2 3
      vendor/cakephp/collection/Iterator/ZipIterator.php
  41. 1 1
      vendor/cakephp/collection/README.md
  42. 6 7
      vendor/cakephp/core/App.php
  43. 0 1
      vendor/cakephp/core/BasePlugin.php
  44. 1 2
      vendor/cakephp/core/ClassLoader.php
  45. 10 9
      vendor/cakephp/core/Configure.php
  46. 0 1
      vendor/cakephp/core/Configure/ConfigEngineInterface.php
  47. 0 1
      vendor/cakephp/core/Configure/Engine/IniConfig.php
  48. 0 1
      vendor/cakephp/core/Configure/Engine/JsonConfig.php
  49. 2 3
      vendor/cakephp/core/Configure/Engine/PhpConfig.php
  50. 0 1
      vendor/cakephp/core/Configure/FileConfigTrait.php
  51. 0 1
      vendor/cakephp/core/ConventionsTrait.php
  52. 4 3
      vendor/cakephp/core/Exception/Exception.php
  53. 3 1
      vendor/cakephp/core/Exception/MissingPluginException.php
  54. 26 3
      vendor/cakephp/core/InstanceConfigTrait.php
  55. 13 12
      vendor/cakephp/core/ObjectRegistry.php
  56. 6 7
      vendor/cakephp/core/Plugin.php
  57. 40 19
      vendor/cakephp/core/PluginCollection.php
  58. 2 0
      vendor/cakephp/core/PluginInterface.php
  59. 2 2
      vendor/cakephp/core/README.md
  60. 0 1
      vendor/cakephp/core/Retry/CommandRetry.php
  61. 1 1
      vendor/cakephp/core/Retry/RetryStrategyInterface.php
  62. 27 7
      vendor/cakephp/core/StaticConfigTrait.php
  63. 7 7
      vendor/cakephp/core/functions.php
  64. 23 12
      vendor/cakephp/database/Connection.php
  65. 0 1
      vendor/cakephp/database/Dialect/MysqlDialectTrait.php
  66. 1 2
      vendor/cakephp/database/Dialect/PostgresDialectTrait.php
  67. 2 3
      vendor/cakephp/database/Dialect/SqliteDialectTrait.php
  68. 7 7
      vendor/cakephp/database/Dialect/SqlserverDialectTrait.php
  69. 1 2
      vendor/cakephp/database/Dialect/TupleComparisonTranslatorTrait.php
  70. 21 2
      vendor/cakephp/database/Driver.php
  71. 1 2
      vendor/cakephp/database/Driver/Mysql.php
  72. 1 2
      vendor/cakephp/database/Driver/PDODriverTrait.php
  73. 2 3
      vendor/cakephp/database/Driver/Postgres.php
  74. 2 3
      vendor/cakephp/database/Driver/Sqlite.php
  75. 2 3
      vendor/cakephp/database/Driver/Sqlserver.php
  76. 6 5
      vendor/cakephp/database/DriverInterface.php
  77. 0 1
      vendor/cakephp/database/Exception.php
  78. 0 1
      vendor/cakephp/database/Exception/MissingConnectionException.php
  79. 0 1
      vendor/cakephp/database/Exception/MissingDriverException.php
  80. 0 1
      vendor/cakephp/database/Exception/MissingExtensionException.php
  81. 0 1
      vendor/cakephp/database/Exception/NestedTransactionRollbackException.php
  82. 3 5
      vendor/cakephp/database/Expression/BetweenExpression.php
  83. 0 7
      vendor/cakephp/database/Expression/CaseExpression.php
  84. 8 10
      vendor/cakephp/database/Expression/Comparison.php
  85. 0 1
      vendor/cakephp/database/Expression/FieldInterface.php
  86. 0 1
      vendor/cakephp/database/Expression/FieldTrait.php
  87. 5 3
      vendor/cakephp/database/Expression/FunctionExpression.php
  88. 2 7
      vendor/cakephp/database/Expression/IdentifierExpression.php
  89. 0 1
      vendor/cakephp/database/Expression/OrderByExpression.php
  90. 4 5
      vendor/cakephp/database/Expression/QueryExpression.php
  91. 14 8
      vendor/cakephp/database/Expression/TupleComparison.php
  92. 5 5
      vendor/cakephp/database/Expression/UnaryExpression.php
  93. 3 3
      vendor/cakephp/database/Expression/ValuesExpression.php
  94. 0 1
      vendor/cakephp/database/ExpressionInterface.php
  95. 0 1
      vendor/cakephp/database/FieldTypeConverter.php
  96. 37 14
      vendor/cakephp/database/FunctionsBuilder.php
  97. 0 1
      vendor/cakephp/database/IdentifierQuoter.php
  98. 0 1
      vendor/cakephp/database/Log/LoggedQuery.php
  99. 0 1
      vendor/cakephp/database/Log/LoggingStatement.php
  100. 0 0
      vendor/cakephp/database/Log/QueryLogger.php

+ 18 - 23
application/api/BaseController.php

@@ -1,5 +1,5 @@
 <?php
-declare (strict_types = 1);
+declare (strict_types=1);
 
 namespace app\api;
 
@@ -13,8 +13,7 @@ use think\Validate;
 /**
  * 控制器基础类
  */
-abstract class BaseController
-{
+abstract class BaseController {
     /**
      * Request实例
      * @var \think\Request
@@ -42,48 +41,44 @@ abstract class BaseController
     public $userId = 0;
 
     public $isAdmin = 0;
-    
+
     /**
      * 构造方法
      * @access public
-     * @param  App  $app  应用对象
+     * @param App $app 应用对象
      */
-    public function __construct(App $app)
-    {
-        $this->app     = $app;
+    public function __construct(App $app) {
+        $this->app = $app;
         $this->request = $this->app->request;
         Session::start();
-//        $this->request['Accept'] = 'application/json';
+        //$this->request['Accept'] = 'application/json';
         $route = [
-            '/api/Token/getToken',
+            '/api/token/getToken',
             '/api/index',
             '/api/user/login',
             '/api/admin/login',
+            '/api/admin/verifyimg',
         ];
-        if (!in_array($this->request->baseUrl(),$route)){
+        if (!in_array(strtolower($this->request->baseUrl()), $route)) {
             if (empty($this->request->header('token'))) {
                 throw new ApiException('token不为空');
-            }else{
-                $token = new Token();
-                $decodeToken = $token->decodeToken();
-                $this->userId = $decodeToken['userId'];
-                $this->isAdmin = $decodeToken['isAdmin'];
             }
-//            $token = new Token();
-//            $decodeToken = $token->decodeToken();
-//            $this->userId = $decodeToken['userId'];
-//            $this->isAdmin = $decodeToken['isAdmin'];
+
+            $token = new Token();
+            $decodeToken = $token->decodeToken();
+            $this->userId = $decodeToken['userId'];
+            $this->isAdmin = $decodeToken['isAdmin'];
         }
         // 控制器初始化
         $this->initialize();
     }
 
     // 初始化
-    protected function initialize()
-    {}
+    protected function initialize() {
+    }
 
     protected function isAdmin() {
-        if ($this->isAdmin == 1){
+        if ($this->isAdmin == 1) {
             return true;
         }
         return false;

+ 24 - 3
application/api/controller/Admin.php

@@ -9,6 +9,7 @@ use app\api\model\AdminModel;
 use app\api\model\GroupModel;
 use app\api\model\StoreModel;
 use app\common\until\Until;
+use think\captcha\Captcha;
 use think\Db;
 use think\Exception;
 use think\Request;
@@ -145,9 +146,10 @@ class Admin extends BaseController {
      *     @OA\MediaType(
      *       mediaType="multipart/form-data",
      *         @OA\Schema(
-     *           @OA\Property(description="登入账号", property="account", type="string", default="admin01"),
-     *           @OA\Property(description="登入密码", property="password", type="string", default="123465"),
-     *           required={"account","password"})
+     *           @OA\Property(description="登入账号", property="account", type="string", default="admin"),
+     *           @OA\Property(description="登入密码", property="password", type="string", default="123456"),
+     *           @OA\Property(description="登入密码", property="password", type="string", default="akjs"),
+     *           required={"account","password,code"})
      *       )
      *     ),
      *   @OA\Response(response="200", description="请求成功")
@@ -158,8 +160,13 @@ class Admin extends BaseController {
         $rule = [
             'account|用户名' => 'require',
             'password|内容'  => 'require',
+            'code|验证码'    => 'require'
         ];
         Until::check($rule, $input);
+        if( !captcha_check($input['code'] )) {
+            // 验证失败
+            throw new ApiException('验证码错误');
+        }
         $model = (new AdminModel());
         $where[] = ['a.account', '=', $input['account']];
         $where[] = ['a.password', '=', $input['password']];
@@ -229,4 +236,18 @@ class Admin extends BaseController {
         Until::output(['isSuccess' => $isSuccess]);
     }
 
+    /**
+     * @OA\GET(path="/api/Admin/verifyImg",
+     *   tags={"管理员管理"},
+     *   summary="生成二维码",
+     *   @OA\RequestBody(
+     *     ),
+     *   @OA\Response(response="200", description="请求成功")
+     * )
+     */
+    public function verifyImg() {
+        $captcha = new Captcha();
+        return $captcha->entry();
+    }
+
 }

+ 6 - 6
application/common/until/Token.php

@@ -19,16 +19,16 @@ class Token {
     public $expTime = 3600;
 
     public function __construct() {
-        $this->jwtKey = env('app.jwt_key', 'Rn4zNAX9e3li5dfI6mBuWLvbacTZq123');
+        $this->jwtKey = env('app.jwt_key','Rn4zNAX9e3li5dfI6mBuWLvbacTZq123');
     }
 
 
-    public function getToken(int $userId, string $visitor = '', $isAdmin = true) {
+    public function getToken(int $userId,string $visitor = '',$isAdmin = true) {
         $payload = [
-            "iat"     => time(),
-            "exp"     => time() + (3600 * 24 * 7),
-            "userId"  => $userId,
-            "visitor" => $visitor,
+            "iat"    => time(),
+            "exp"    => time() + (3600 * 24 * 7),
+            "userId" => $userId,
+            "visitor"=> $visitor,
             'isAdmin' => $isAdmin ? 1 : 0
         ];
         $token = JWT::encode($payload, $this->jwtKey);

+ 2 - 1
composer.json

@@ -23,7 +23,8 @@
         "ext-json": "*",
         "firebase/php-jwt": "^5.2",
         "guzzlehttp/guzzle": "~6.0",
-        "zircote/swagger-php": "^3.1"
+        "zircote/swagger-php": "^3.1",
+        "topthink/think-captcha": "~2.0"
     }
     ,
     "require-dev": {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 562 - 264
composer.lock


+ 1 - 1
config/cache.php

@@ -15,7 +15,7 @@
 
 return [
     // 驱动方式
-    'type'   => 'file',
+    'type'   => 'redis',
     // 缓存保存目录
     'path'   => '',
     // 缓存前缀

+ 1 - 1
config/session.php

@@ -20,7 +20,7 @@ return [
     // SESSION 前缀
     'prefix'         => 'think',
     // 驱动方式 支持redis memcache memcached
-    'type'           => '',
+    'type'           => 'redis',
     // 是否自动开启 SESSION
     'auto_start'     => true,
 ];

+ 10 - 0
public/api.yaml

@@ -199,6 +199,16 @@ paths:
       responses:
         '200':
           description: 请求成功
+  /api/Admin/verifyImg:
+    get:
+      tags:
+        - 管理员管理
+      summary: 生成二维码
+      operationId: 'app\api\controller\Admin::verifyImg'
+      requestBody: {  }
+      responses:
+        '200':
+          description: 请求成功
   /api/Brand/index:
     post:
       tags:

+ 3 - 4
vendor/cakephp/cache/Cache.php

@@ -65,14 +65,13 @@ use RuntimeException;
  */
 class Cache
 {
-
     use StaticConfigTrait;
 
     /**
      * An array mapping url schemes to fully qualified caching engine
      * class names.
      *
-     * @var array
+     * @var string[]
      */
     protected static $_dsnClassMap = [
         'array' => 'Cake\Cache\Engine\ArrayEngine',
@@ -417,7 +416,7 @@ class Cache
      * @param string $key Identifier for the data
      * @param int $offset How much to add
      * @param string $config Optional string configuration name. Defaults to 'default'
-     * @return mixed new value, or false if the data doesn't exist, is not integer,
+     * @return int|false New value, or false if the data doesn't exist, is not integer,
      *    or if there was an error fetching it.
      */
     public static function increment($key, $offset = 1, $config = 'default')
@@ -436,7 +435,7 @@ class Cache
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
      * @param string $config Optional string configuration name. Defaults to 'default'
-     * @return mixed new value, or false if the data doesn't exist, is not integer,
+     * @return int|false New value, or false if the data doesn't exist, is not integer,
      *   or if there was an error fetching it
      */
     public static function decrement($key, $offset = 1, $config = 'default')

+ 5 - 5
vendor/cakephp/cache/CacheEngine.php

@@ -147,7 +147,7 @@ abstract class CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to add
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     abstract public function increment($key, $offset = 1);
 
@@ -156,7 +156,7 @@ abstract class CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     abstract public function decrement($key, $offset = 1);
 
@@ -231,7 +231,7 @@ abstract class CacheEngine
      * and returns the `group value` for each of them, this is
      * the token representing each group in the cache key
      *
-     * @return array
+     * @return string[]
      */
     public function groups()
     {
@@ -242,7 +242,7 @@ abstract class CacheEngine
      * Generates a safe key for use with cache engine storage engines.
      *
      * @param string $key the key passed over
-     * @return bool|string string key or false
+     * @return string|false string key or false
      */
     public function key($key)
     {
@@ -264,7 +264,7 @@ abstract class CacheEngine
      * Generates a safe key, taking account of the configured key prefix
      *
      * @param string $key the key passed over
-     * @return mixed string $key or false
+     * @return string Key
      * @throws \InvalidArgumentException If key's value is empty
      */
     protected function _key($key)

+ 2 - 2
vendor/cakephp/cache/CacheEngineInterface.php

@@ -40,7 +40,7 @@ interface CacheEngineInterface
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to add
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function increment($key, $offset = 1);
 
@@ -49,7 +49,7 @@ interface CacheEngineInterface
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function decrement($key, $offset = 1);
 

+ 7 - 4
vendor/cakephp/cache/CacheRegistry.php

@@ -23,10 +23,11 @@ use RuntimeException;
  * An object registry for cache engines.
  *
  * Used by Cake\Cache\Cache to load and manage cache engines.
+ *
+ * @extends \Cake\Core\ObjectRegistry<\Cake\Cache\CacheEngine>
  */
 class CacheRegistry extends ObjectRegistry
 {
-
     /**
      * Resolve a cache engine classname.
      *
@@ -50,7 +51,7 @@ class CacheRegistry extends ObjectRegistry
      * Part of the template method for Cake\Core\ObjectRegistry::load()
      *
      * @param string $class The classname that is missing.
-     * @param string $plugin The plugin the cache is missing in.
+     * @param string|null $plugin The plugin the cache is missing in.
      * @return void
      * @throws \BadMethodCallException
      */
@@ -94,7 +95,7 @@ class CacheRegistry extends ObjectRegistry
         }
 
         $config = $instance->getConfig();
-        if ($config['probability'] && time() % $config['probability'] === 0) {
+        if (!empty($config['probability']) && time() % $config['probability'] === 0) {
             $instance->gc();
         }
 
@@ -105,10 +106,12 @@ class CacheRegistry extends ObjectRegistry
      * Remove a single adapter from the registry.
      *
      * @param string $name The adapter name.
-     * @return void
+     * @return $this
      */
     public function unload($name)
     {
         unset($this->_loaded[$name]);
+
+        return $this;
     }
 }

+ 6 - 7
vendor/cakephp/cache/Engine/ApcuEngine.php

@@ -14,7 +14,7 @@
  */
 namespace Cake\Cache\Engine;
 
-use APCuIterator;
+use APCUIterator;
 use Cake\Cache\CacheEngine;
 
 /**
@@ -22,7 +22,6 @@ use Cake\Cache\CacheEngine;
  */
 class ApcuEngine extends CacheEngine
 {
-
     /**
      * Contains the compiled group names
      * (prefixed with the global configuration prefix)
@@ -84,7 +83,7 @@ class ApcuEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to increment
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      * @link https://secure.php.net/manual/en/function.apcu-inc.php
      */
     public function increment($key, $offset = 1)
@@ -99,7 +98,7 @@ class ApcuEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New decremented value, false otherwise
+     * @return int|false New decremented value, false otherwise
      * @link https://secure.php.net/manual/en/function.apcu-dec.php
      */
     public function decrement($key, $offset = 1)
@@ -137,8 +136,8 @@ class ApcuEngine extends CacheEngine
         if ($check) {
             return true;
         }
-        if (class_exists('APCuIterator', false)) {
-            $iterator = new APCuIterator(
+        if (class_exists(APCUIterator::class, false)) {
+            $iterator = new APCUIterator(
                 '/^' . preg_quote($this->_config['prefix'], '/') . '/',
                 APC_ITER_NONE
             );
@@ -179,7 +178,7 @@ class ApcuEngine extends CacheEngine
      * If the group initial value was not found, then it initializes
      * the group accordingly.
      *
-     * @return array
+     * @return string[]
      * @link https://secure.php.net/manual/en/function.apcu-fetch.php
      * @link https://secure.php.net/manual/en/function.apcu-store.php
      */

+ 3 - 3
vendor/cakephp/cache/Engine/ArrayEngine.php

@@ -84,7 +84,7 @@ class ArrayEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to increment
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function increment($key, $offset = 1)
     {
@@ -102,7 +102,7 @@ class ArrayEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New decremented value, false otherwise
+     * @return int|false New decremented value, false otherwise
      */
     public function decrement($key, $offset = 1)
     {
@@ -147,7 +147,7 @@ class ArrayEngine extends CacheEngine
      * If the group initial value was not found, then it initializes
      * the group accordingly.
      *
-     * @return array
+     * @return string[]
      */
     public function groups()
     {

+ 4 - 4
vendor/cakephp/cache/Engine/FileEngine.php

@@ -33,7 +33,6 @@ use SplFileObject;
  */
 class FileEngine extends CacheEngine
 {
-
     /**
      * Instance of SplFileObject class
      *
@@ -68,7 +67,7 @@ class FileEngine extends CacheEngine
         'path' => null,
         'prefix' => 'cake_',
         'probability' => 100,
-        'serialize' => true
+        'serialize' => true,
     ];
 
     /**
@@ -284,7 +283,7 @@ class FileEngine extends CacheEngine
             }
 
             $path = $path->getRealPath() . DIRECTORY_SEPARATOR;
-            if (!in_array($path, $cleared)) {
+            if (!in_array($path, $cleared, true)) {
                 $this->_clearDirectory($path, $now, $threshold);
                 $cleared[] = $path;
             }
@@ -395,7 +394,8 @@ class FileEngine extends CacheEngine
         if (!$createKey && !$path->isFile()) {
             return false;
         }
-        if (empty($this->_File) ||
+        if (
+            empty($this->_File) ||
             $this->_File->getBasename() !== $key ||
             $this->_File->valid() === false
         ) {

+ 11 - 18
vendor/cakephp/cache/Engine/MemcachedEngine.php

@@ -29,7 +29,6 @@ use Memcached;
  */
 class MemcachedEngine extends CacheEngine
 {
-
     /**
      * memcached wrapper.
      *
@@ -111,7 +110,7 @@ class MemcachedEngine extends CacheEngine
         $this->_serializers = [
             'igbinary' => Memcached::SERIALIZER_IGBINARY,
             'json' => Memcached::SERIALIZER_JSON,
-            'php' => Memcached::SERIALIZER_PHP
+            'php' => Memcached::SERIALIZER_PHP,
         ];
         if (defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {
             $this->_serializers['msgpack'] = Memcached::SERIALIZER_MSGPACK;
@@ -205,7 +204,8 @@ class MemcachedEngine extends CacheEngine
             );
         }
 
-        if ($serializer !== 'php' &&
+        if (
+            $serializer !== 'php' &&
             !constant('Memcached::HAVE_' . strtoupper($serializer))
         ) {
             throw new InvalidArgumentException(
@@ -219,7 +219,8 @@ class MemcachedEngine extends CacheEngine
         );
 
         // Check for Amazon ElastiCache instance
-        if (defined('Memcached::OPT_CLIENT_MODE') &&
+        if (
+            defined('Memcached::OPT_CLIENT_MODE') &&
             defined('Memcached::DYNAMIC_CLIENT_MODE')
         ) {
             $this->_Memcached->setOption(
@@ -281,7 +282,7 @@ class MemcachedEngine extends CacheEngine
      * Read an option value from the memcached connection.
      *
      * @param string $name The option name to read.
-     * @return string|int|null|bool
+     * @return string|int|bool|null
      */
     public function getOption($name)
     {
@@ -292,20 +293,16 @@ class MemcachedEngine extends CacheEngine
      * Write data for key into cache. When using memcached as your cache engine
      * remember that the Memcached pecl extension does not support cache expiry
      * times greater than 30 days in the future. Any duration greater than 30 days
-     * will be treated as never expiring.
+     * will be treated as real Unix time value rather than an offset from current time.
      *
      * @param string $key Identifier for the data
      * @param mixed $value Data to be cached
      * @return bool True if the data was successfully cached, false on failure
-     * @see https://secure.php.net/manual/en/memcache.set.php
+     * @see https://www.php.net/manual/en/memcached.set.php
      */
     public function write($key, $value)
     {
         $duration = $this->_config['duration'];
-        if ($duration > 30 * DAY) {
-            $duration = 0;
-        }
-
         $key = $this->_key($key);
 
         return $this->_Memcached->set($key, $value, $duration);
@@ -378,7 +375,7 @@ class MemcachedEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to increment
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function increment($key, $offset = 1)
     {
@@ -392,7 +389,7 @@ class MemcachedEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New decremented value, false otherwise
+     * @return int|false New decremented value, false otherwise
      */
     public function decrement($key, $offset = 1)
     {
@@ -475,10 +472,6 @@ class MemcachedEngine extends CacheEngine
     public function add($key, $value)
     {
         $duration = $this->_config['duration'];
-        if ($duration > 30 * DAY) {
-            $duration = 0;
-        }
-
         $key = $this->_key($key);
 
         return $this->_Memcached->add($key, $value, $duration);
@@ -489,7 +482,7 @@ class MemcachedEngine extends CacheEngine
      * If the group initial value was not found, then it initializes
      * the group accordingly.
      *
-     * @return array
+     * @return string[]
      */
     public function groups()
     {

+ 0 - 1
vendor/cakephp/cache/Engine/NullEngine.php

@@ -23,7 +23,6 @@ use Cake\Cache\CacheEngine;
  */
 class NullEngine extends CacheEngine
 {
-
     /**
      * {@inheritDoc}
      */

+ 27 - 16
vendor/cakephp/cache/Engine/RedisEngine.php

@@ -24,7 +24,6 @@ use RedisException;
  */
 class RedisEngine extends CacheEngine
 {
-
     /**
      * Redis wrapper.
      *
@@ -169,7 +168,7 @@ class RedisEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to increment
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function increment($key, $offset = 1)
     {
@@ -178,7 +177,7 @@ class RedisEngine extends CacheEngine
 
         $value = (int)$this->_Redis->incrBy($key, $offset);
         if ($duration > 0) {
-            $this->_Redis->setTimeout($key, $duration);
+            $this->_Redis->expire($key, $duration);
         }
 
         return $value;
@@ -189,7 +188,7 @@ class RedisEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New decremented value, false otherwise
+     * @return int|false New decremented value, false otherwise
      */
     public function decrement($key, $offset = 1)
     {
@@ -198,7 +197,7 @@ class RedisEngine extends CacheEngine
 
         $value = (int)$this->_Redis->decrBy($key, $offset);
         if ($duration > 0) {
-            $this->_Redis->setTimeout($key, $duration);
+            $this->_Redis->expire($key, $duration);
         }
 
         return $value;
@@ -214,7 +213,7 @@ class RedisEngine extends CacheEngine
     {
         $key = $this->_key($key);
 
-        return $this->_Redis->delete($key) > 0;
+        return $this->_Redis->del($key) > 0;
     }
 
     /**
@@ -228,14 +227,27 @@ class RedisEngine extends CacheEngine
         if ($check) {
             return true;
         }
-        $keys = $this->_Redis->getKeys($this->_config['prefix'] . '*');
 
-        $result = [];
-        foreach ($keys as $key) {
-            $result[] = $this->_Redis->delete($key) > 0;
+        $this->_Redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
+
+        $isAllDeleted = true;
+        $iterator = null;
+        $pattern = $this->_config['prefix'] . '*';
+
+        while (true) {
+            $keys = $this->_Redis->scan($iterator, $pattern);
+
+            if ($keys === false) {
+                break;
+            }
+
+            foreach ($keys as $key) {
+                $isDeleted = ($this->_Redis->del($key) > 0);
+                $isAllDeleted = $isAllDeleted && $isDeleted;
+            }
         }
 
-        return !in_array(false, $result);
+        return $isAllDeleted;
     }
 
     /**
@@ -245,7 +257,7 @@ class RedisEngine extends CacheEngine
      * @param string $key Identifier for the data.
      * @param mixed $value Data to be cached.
      * @return bool True if the data was successfully cached, false on failure.
-     * @link https://github.com/phpredis/phpredis#setnx
+     * @link https://github.com/phpredis/phpredis#set
      */
     public function add($key, $value)
     {
@@ -256,9 +268,8 @@ class RedisEngine extends CacheEngine
             $value = serialize($value);
         }
 
-        // setNx() doesn't have an expiry option, so follow up with an expiry
-        if ($this->_Redis->setNx($key, $value)) {
-            return $this->_Redis->setTimeout($key, $duration);
+        if ($this->_Redis->set($key, $value, ['nx', 'ex' => $duration])) {
+            return true;
         }
 
         return false;
@@ -269,7 +280,7 @@ class RedisEngine extends CacheEngine
      * If the group initial value was not found, then it initializes
      * the group accordingly.
      *
-     * @return array
+     * @return string[]
      */
     public function groups()
     {

+ 3 - 4
vendor/cakephp/cache/Engine/WincacheEngine.php

@@ -23,7 +23,6 @@ use Cake\Cache\CacheEngine;
  */
 class WincacheEngine extends CacheEngine
 {
-
     /**
      * Contains the compiled group names
      * (prefixed with the global configuration prefix)
@@ -85,7 +84,7 @@ class WincacheEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to increment
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function increment($key, $offset = 1)
     {
@@ -99,7 +98,7 @@ class WincacheEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New decremented value, false otherwise
+     * @return int|false New decremented value, false otherwise
      */
     public function decrement($key, $offset = 1)
     {
@@ -151,7 +150,7 @@ class WincacheEngine extends CacheEngine
      * If the group initial value was not found, then it initializes
      * the group accordingly.
      *
-     * @return array
+     * @return string[]
      */
     public function groups()
     {

+ 4 - 5
vendor/cakephp/cache/Engine/XcacheEngine.php

@@ -24,7 +24,6 @@ use Cake\Cache\CacheEngine;
  */
 class XcacheEngine extends CacheEngine
 {
-
     /**
      * The default config used unless overridden by runtime configuration
      *
@@ -46,7 +45,7 @@ class XcacheEngine extends CacheEngine
         'prefix' => null,
         'probability' => 100,
         'PHP_AUTH_USER' => 'user',
-        'PHP_AUTH_PW' => 'password'
+        'PHP_AUTH_PW' => 'password',
     ];
 
     /**
@@ -125,7 +124,7 @@ class XcacheEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to increment
-     * @return bool|int New incremented value, false otherwise
+     * @return int|false New incremented value, false otherwise
      */
     public function increment($key, $offset = 1)
     {
@@ -140,7 +139,7 @@ class XcacheEngine extends CacheEngine
      *
      * @param string $key Identifier for the data
      * @param int $offset How much to subtract
-     * @return bool|int New decremented value, false otherwise
+     * @return int|false New decremented value, false otherwise
      */
     public function decrement($key, $offset = 1)
     {
@@ -187,7 +186,7 @@ class XcacheEngine extends CacheEngine
      * If the group initial value was not found, then it initializes
      * the group accordingly.
      *
-     * @return array
+     * @return string[]
      */
     public function groups()
     {

+ 2 - 2
vendor/cakephp/cache/README.md

@@ -39,7 +39,7 @@ $object = new FileEngine($config);
 Cache::config('other', $object);
 ```
 
-You can now read a write from the cache:
+You can now read and write from the cache:
 
 ```php
 $data = Cache::remember('my_cache_key', function () {
@@ -52,6 +52,6 @@ the callback will be executed and the returned data will be cached for future ca
 
 ## Documentation
 
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/caching.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/caching.html)
 
 

+ 2 - 2
vendor/cakephp/cache/SimpleCacheEngine.php

@@ -100,7 +100,7 @@ class SimpleCacheEngine implements CacheInterface, CacheEngineInterface
      *
      * @param string $key The key of the item to store.
      * @param mixed $value The value of the item to store, must be serializable.
-     * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
+     * @param \DateInterval|int|null $ttl Optional. The TTL value of this item. If no value is sent and
      *   the driver supports TTL then the library may set a default value
      *   for it or let the driver take care of that.
      * @return bool True on success and false on failure.
@@ -176,7 +176,7 @@ class SimpleCacheEngine implements CacheInterface, CacheEngineInterface
      * Persists a set of key => value pairs in the cache, with an optional TTL.
      *
      * @param iterable $values A list of key => value pairs for a multiple-set operation.
-     * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
+     * @param \DateInterval|int|null $ttl Optional. The TTL value of this item. If no value is sent and
      *   the driver supports TTL then the library may set a default value
      *   for it or let the driver take care of that.
      * @return bool True on success and false on failure.

+ 0 - 1
vendor/cakephp/collection/Collection.php

@@ -26,7 +26,6 @@ use Traversable;
  */
 class Collection extends IteratorIterator implements CollectionInterface, Serializable
 {
-
     use CollectionTrait;
 
     /**

+ 5 - 6
vendor/cakephp/collection/CollectionInterface.php

@@ -26,7 +26,6 @@ use JsonSerializable;
  */
 interface CollectionInterface extends Iterator, JsonSerializable
 {
-
     /**
      * Executes the passed callable for each of the elements in this collection
      * and passes both the value and key for them on each step.
@@ -42,7 +41,7 @@ interface CollectionInterface extends Iterator, JsonSerializable
      *
      * @param callable $c callable function that will receive each of the elements
      * in this collection
-     * @return \Cake\Collection\CollectionInterface
+     * @return $this
      */
     public function each(callable $c);
 
@@ -256,7 +255,7 @@ interface CollectionInterface extends Iterator, JsonSerializable
      * @param callable|string $callback the callback or column name to use for sorting
      * @param int $type the type of comparison to perform, either SORT_STRING
      * SORT_NUMERIC or SORT_NATURAL
-     * @see \Cake\Collection\CollectionIterface::sortBy()
+     * @see \Cake\Collection\CollectionInterface::sortBy()
      * @return mixed The value of the top element in the collection
      */
     public function max($callback, $type = \SORT_NUMERIC);
@@ -762,7 +761,8 @@ interface CollectionInterface extends Iterator, JsonSerializable
     public function toList();
 
     /**
-     * Convert a result set into JSON.
+     * Returns the data that can be converted to JSON. This returns the same data
+     * as `toArray()` which contains only unique keys.
      *
      * Part of JsonSerializable interface.
      *
@@ -1113,13 +1113,12 @@ interface CollectionInterface extends Iterator, JsonSerializable
      * Calling this method at the same time that you are iterating this collections, for example in
      * a foreach, will result in undefined behavior. Avoid doing this.
      *
-     *
      * @return int
      */
     public function count();
 
     /**
-     * Returns the number of unique keys in this iterator. This is, the number of
+     * Returns the number of unique keys in this iterator. This is the same as the number of
      * elements the collection will contain after calling `toArray()`
      *
      * This method comes with a number of caveats. Please refer to `CollectionInterface::count()`

+ 41 - 28
vendor/cakephp/collection/CollectionTrait.php

@@ -35,14 +35,27 @@ use RecursiveIteratorIterator;
 use Traversable;
 
 /**
- * Offers a handful of method to manipulate iterators
+ * Offers a handful of methods to manipulate iterators
  */
 trait CollectionTrait
 {
-
     use ExtractTrait;
 
     /**
+     * Returns a new collection.
+     *
+     * Allows classes which use this trait to determine their own
+     * type of returned collection interface
+     *
+     * @param mixed ...$args Constructor arguments.
+     * @return \Cake\Collection\CollectionInterface
+     */
+    protected function newCollection(...$args)
+    {
+        return new Collection(...$args);
+    }
+
+    /**
      * {@inheritDoc}
      */
     public function each(callable $c)
@@ -258,7 +271,7 @@ trait CollectionTrait
             $group[$callback($value)][] = $value;
         }
 
-        return new Collection($group);
+        return $this->newCollection($group);
     }
 
     /**
@@ -272,7 +285,7 @@ trait CollectionTrait
             $group[$callback($value)] = $value;
         }
 
-        return new Collection($group);
+        return $this->newCollection($group);
     }
 
     /**
@@ -292,7 +305,7 @@ trait CollectionTrait
             $mr->emit(count($values), $key);
         };
 
-        return new Collection(new MapReduce($this->unwrap(), $mapper, $reducer));
+        return $this->newCollection(new MapReduce($this->unwrap(), $mapper, $reducer));
     }
 
     /**
@@ -318,10 +331,10 @@ trait CollectionTrait
      */
     public function shuffle()
     {
-        $elements = $this->toArray();
+        $elements = $this->toList();
         shuffle($elements);
 
-        return new Collection($elements);
+        return $this->newCollection($elements);
     }
 
     /**
@@ -329,7 +342,7 @@ trait CollectionTrait
      */
     public function sample($size = 10)
     {
-        return new Collection(new LimitIterator($this->shuffle(), 0, $size));
+        return $this->newCollection(new LimitIterator($this->shuffle(), 0, $size));
     }
 
     /**
@@ -337,7 +350,7 @@ trait CollectionTrait
      */
     public function take($size = 1, $from = 0)
     {
-        return new Collection(new LimitIterator($this, $from, $size));
+        return $this->newCollection(new LimitIterator($this, $from, $size));
     }
 
     /**
@@ -345,7 +358,7 @@ trait CollectionTrait
      */
     public function skip($howMany)
     {
-        return new Collection(new LimitIterator($this, $howMany));
+        return $this->newCollection(new LimitIterator($this, $howMany));
     }
 
     /**
@@ -412,19 +425,19 @@ trait CollectionTrait
 
         $iterator = $this->optimizeUnwrap();
         if (is_array($iterator)) {
-            return new Collection(array_slice($iterator, $howMany * -1));
+            return $this->newCollection(array_slice($iterator, $howMany * -1));
         }
 
         if ($iterator instanceof Countable) {
             $count = count($iterator);
 
             if ($count === 0) {
-                return new Collection([]);
+                return $this->newCollection([]);
             }
 
             $iterator = new LimitIterator($iterator, max(0, $count - $howMany), $howMany);
 
-            return new Collection($iterator);
+            return $this->newCollection($iterator);
         }
 
         $generator = function ($iterator, $howMany) {
@@ -497,7 +510,7 @@ trait CollectionTrait
             }
         };
 
-        return new Collection($generator($iterator, $howMany));
+        return $this->newCollection($generator($iterator, $howMany));
     }
 
     /**
@@ -507,9 +520,9 @@ trait CollectionTrait
     {
         $list = new AppendIterator();
         $list->append($this->unwrap());
-        $list->append((new Collection($items))->unwrap());
+        $list->append($this->newCollection($items)->unwrap());
 
-        return new Collection($list);
+        return $this->newCollection($list);
     }
 
     /**
@@ -531,7 +544,7 @@ trait CollectionTrait
      */
     public function prepend($items)
     {
-        return (new Collection($items))->append($this);
+        return $this->newCollection($items)->append($this);
     }
 
     /**
@@ -556,7 +569,7 @@ trait CollectionTrait
         $options = [
             'keyPath' => $this->_propertyExtractor($keyPath),
             'valuePath' => $this->_propertyExtractor($valuePath),
-            'groupPath' => $groupPath ? $this->_propertyExtractor($groupPath) : null
+            'groupPath' => $groupPath ? $this->_propertyExtractor($groupPath) : null,
         ];
 
         $mapper = function ($value, $key, $mapReduce) use ($options) {
@@ -586,7 +599,7 @@ trait CollectionTrait
             $mapReduce->emit($result, $key);
         };
 
-        return new Collection(new MapReduce($this->unwrap(), $mapper, $reducer));
+        return $this->newCollection(new MapReduce($this->unwrap(), $mapper, $reducer));
     }
 
     /**
@@ -631,7 +644,7 @@ trait CollectionTrait
             $parents[$key][$nestingKey] = $children;
         };
 
-        return (new Collection(new MapReduce($this->unwrap(), $mapper, $reducer)))
+        return $this->newCollection(new MapReduce($this->unwrap(), $mapper, $reducer))
             ->map(function ($value) use (&$isObject) {
                 /** @var \ArrayIterator $value */
                 return $isObject ? $value : $value->getArrayCopy();
@@ -689,7 +702,7 @@ trait CollectionTrait
      */
     public function compile($preserveKeys = true)
     {
-        return new Collection($this->toArray($preserveKeys));
+        return $this->newCollection($this->toArray($preserveKeys));
     }
 
     /**
@@ -703,7 +716,7 @@ trait CollectionTrait
             }
         };
 
-        return new Collection($generator());
+        return $this->newCollection($generator());
     }
 
     /**
@@ -727,7 +740,7 @@ trait CollectionTrait
         $modes = [
             'desc' => TreeIterator::SELF_FIRST,
             'asc' => TreeIterator::CHILD_FIRST,
-            'leaves' => TreeIterator::LEAVES_ONLY
+            'leaves' => TreeIterator::LEAVES_ONLY,
         ];
 
         return new TreeIterator(
@@ -761,7 +774,7 @@ trait CollectionTrait
             };
         }
 
-        return new Collection(
+        return $this->newCollection(
             new RecursiveIteratorIterator(
                 new UnfoldIterator($this->unwrap(), $transformer),
                 RecursiveIteratorIterator::LEAVES_ONLY
@@ -776,7 +789,7 @@ trait CollectionTrait
     {
         $result = $handler($this);
 
-        return $result instanceof CollectionInterface ? $result : new Collection($result);
+        return $result instanceof CollectionInterface ? $result : $this->newCollection($result);
     }
 
     /**
@@ -900,7 +913,7 @@ trait CollectionTrait
     public function cartesianProduct(callable $operation = null, callable $filter = null)
     {
         if ($this->isEmpty()) {
-            return new Collection([]);
+            return $this->newCollection([]);
         }
 
         $collectionArrays = [];
@@ -942,7 +955,7 @@ trait CollectionTrait
             }
         }
 
-        return new Collection($result);
+        return $this->newCollection($result);
     }
 
     /**
@@ -966,7 +979,7 @@ trait CollectionTrait
             $result[] = array_column($arrayValue, $column);
         }
 
-        return new Collection($result);
+        return $this->newCollection($result);
     }
 
     /**

+ 7 - 6
vendor/cakephp/collection/ExtractTrait.php

@@ -22,7 +22,6 @@ use Traversable;
  */
 trait ExtractTrait
 {
-
     /**
      * Returns a callable that can be used to extract a property or column from
      * an array or object based on a dot separated path.
@@ -57,7 +56,7 @@ trait ExtractTrait
      * It will return arrays for elements in represented with `{*}`
      *
      * @param array|\ArrayAccess $data Data.
-     * @param array $path Path to extract from.
+     * @param string[] $path Path to extract from.
      * @return mixed
      */
     protected function _extract($data, $path)
@@ -71,8 +70,10 @@ trait ExtractTrait
                 continue;
             }
 
-            if ($collectionTransform &&
-                !($data instanceof Traversable || is_array($data))) {
+            if (
+                $collectionTransform &&
+                !($data instanceof Traversable || is_array($data))
+            ) {
                 return null;
             }
 
@@ -98,7 +99,7 @@ trait ExtractTrait
      * by iterating over the column names contained in $path
      *
      * @param array|\ArrayAccess $data Data.
-     * @param array $path Path to extract from.
+     * @param string[] $path Path to extract from.
      * @return mixed
      */
     protected function _simpleExtract($data, $path)
@@ -122,7 +123,7 @@ trait ExtractTrait
      * @param array $conditions A key-value list of conditions to match where the
      * key is the property path to get from the current item and the value is the
      * value to be compared the item with.
-     * @return callable
+     * @return \Closure
      */
     protected function _createMatcherFilter(array $conditions)
     {

+ 1 - 2
vendor/cakephp/collection/Iterator/BufferedIterator.php

@@ -25,7 +25,6 @@ use SplDoublyLinkedList;
  */
 class BufferedIterator extends Collection implements Countable, Serializable
 {
-
     /**
      * The in-memory cache containing results from previous iterators
      *
@@ -140,7 +139,7 @@ class BufferedIterator extends Collection implements Countable, Serializable
             $this->_key = parent::key();
             $this->_buffer->push([
                 'key' => $this->_key,
-                'value' => $this->_current
+                'value' => $this->_current,
             ]);
         }
 

+ 1 - 1
vendor/cakephp/collection/Iterator/ExtractIterator.php

@@ -24,7 +24,6 @@ use Cake\Collection\CollectionInterface;
  */
 class ExtractIterator extends Collection
 {
-
     /**
      * A callable responsible for extracting a single value for each
      * item in the collection.
@@ -98,6 +97,7 @@ class ExtractIterator extends Collection
         $callback = $this->_extractor;
         $res = [];
 
+        /** @var \ArrayObject $iterator */
         foreach ($iterator->getArrayCopy() as $k => $v) {
             $res[$k] = $callback($v);
         }

+ 0 - 1
vendor/cakephp/collection/Iterator/FilterIterator.php

@@ -27,7 +27,6 @@ use Iterator;
  */
 class FilterIterator extends Collection
 {
-
     /**
      * The callback used to filter the elements in this collection
      *

+ 0 - 1
vendor/cakephp/collection/Iterator/InsertIterator.php

@@ -24,7 +24,6 @@ use Cake\Collection\Collection;
  */
 class InsertIterator extends Collection
 {
-
     /**
      * The collection from which to extract the values to be inserted
      *

+ 1 - 1
vendor/cakephp/collection/Iterator/MapReduce.php

@@ -26,7 +26,6 @@ use Traversable;
  */
 class MapReduce implements IteratorAggregate
 {
-
     /**
      * Holds the shuffled results that were emitted from the map
      * phase
@@ -183,6 +182,7 @@ class MapReduce implements IteratorAggregate
             throw new LogicException('No reducer function was provided');
         }
 
+        /** @var callable $reducer */
         $reducer = $this->_reducer;
         foreach ($this->_intermediate as $key => $list) {
             $reducer($list, $key, $this);

+ 1 - 2
vendor/cakephp/collection/Iterator/NestIterator.php

@@ -24,7 +24,6 @@ use Traversable;
  */
 class NestIterator extends Collection implements RecursiveIterator
 {
-
     /**
      * The name of the property that contains the nested items for each element
      *
@@ -48,7 +47,7 @@ class NestIterator extends Collection implements RecursiveIterator
     /**
      * Returns a traversable containing the children for the current item
      *
-     * @return \Traversable
+     * @return \RecursiveIterator
      */
     public function getChildren()
     {

+ 0 - 1
vendor/cakephp/collection/Iterator/NoChildrenIterator.php

@@ -24,7 +24,6 @@ use RecursiveIterator;
  */
 class NoChildrenIterator extends Collection implements RecursiveIterator
 {
-
     /**
      * Returns false as there are no children iterators in this collection
      *

+ 0 - 1
vendor/cakephp/collection/Iterator/ReplaceIterator.php

@@ -24,7 +24,6 @@ use Cake\Collection\CollectionInterface;
  */
 class ReplaceIterator extends Collection
 {
-
     /**
      * The callback function to be used to transform values
      *

+ 0 - 1
vendor/cakephp/collection/Iterator/SortIterator.php

@@ -39,7 +39,6 @@ use DateTimeInterface;
  */
 class SortIterator extends Collection
 {
-
     /**
      * Wraps this iterator around the passed items so when iterated they are returned
      * in order.

+ 0 - 1
vendor/cakephp/collection/Iterator/StoppableIterator.php

@@ -28,7 +28,6 @@ use Cake\Collection\CollectionInterface;
  */
 class StoppableIterator extends Collection
 {
-
     /**
      * The condition to evaluate for each item of the collection
      *

+ 0 - 1
vendor/cakephp/collection/Iterator/TreeIterator.php

@@ -24,7 +24,6 @@ use RecursiveIteratorIterator;
  */
 class TreeIterator extends RecursiveIteratorIterator
 {
-
     use CollectionTrait;
 
     /**

+ 0 - 1
vendor/cakephp/collection/Iterator/TreePrinter.php

@@ -23,7 +23,6 @@ use RecursiveIteratorIterator;
  */
 class TreePrinter extends RecursiveIteratorIterator
 {
-
     use CollectionTrait;
 
     /**

+ 0 - 1
vendor/cakephp/collection/Iterator/UnfoldIterator.php

@@ -26,7 +26,6 @@ use RecursiveIterator;
  */
 class UnfoldIterator extends IteratorIterator implements RecursiveIterator
 {
-
     /**
      * A function that is passed each element in this iterator and
      * must return an array or Traversable object.

+ 2 - 3
vendor/cakephp/collection/Iterator/ZipIterator.php

@@ -44,13 +44,12 @@ use Serializable;
  */
 class ZipIterator extends MultipleIterator implements CollectionInterface, Serializable
 {
-
     use CollectionTrait;
 
     /**
      * The function to use for zipping items together
      *
-     * @var callable
+     * @var callable|null
      */
     protected $_callback;
 
@@ -87,7 +86,7 @@ class ZipIterator extends MultipleIterator implements CollectionInterface, Seria
      * Returns the value resulting out of zipping all the elements for all the
      * iterators with the same positional index.
      *
-     * @return mixed
+     * @return array|false
      */
     public function current()
     {

+ 1 - 1
vendor/cakephp/collection/README.md

@@ -28,4 +28,4 @@ you have in your application as well.
 
 ## Documentation
 
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/collections.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/collections.html)

+ 6 - 7
vendor/cakephp/core/App.php

@@ -36,11 +36,10 @@ namespace Cake\Core;
  * Plugins can be located with App as well. Using Plugin::path('DebugKit') for example, will
  * give you the full path to the DebugKit plugin.
  *
- * @link https://book.cakephp.org/3.0/en/core-libraries/app.html
+ * @link https://book.cakephp.org/3/en/core-libraries/app.html
  */
 class App
 {
-
     /**
      * Return the class name namespaced. This method checks if the class is defined on the
      * application/plugin, otherwise try to load from the CakePHP core
@@ -48,7 +47,7 @@ class App
      * @param string $class Class name
      * @param string $type Type of class
      * @param string $suffix Class name suffix
-     * @return false|string False if the class is not found or namespaced class name
+     * @return string|false False if the class is not found or namespaced class name
      */
     public static function className($class, $type = '', $suffix = '')
     {
@@ -129,7 +128,7 @@ class App
 
         $nonPluginNamespaces = [
             'Cake',
-            str_replace('\\', '/', Configure::read('App.namespace'))
+            str_replace('\\', '/', Configure::read('App.namespace')),
         ];
         if (in_array($pluginName, $nonPluginNamespaces)) {
             return $name;
@@ -172,8 +171,8 @@ class App
      *
      * @param string $type type of path
      * @param string|null $plugin name of plugin
-     * @return array
-     * @link https://book.cakephp.org/3.0/en/core-libraries/app.html#finding-paths-to-namespaces
+     * @return string[]
+     * @link https://book.cakephp.org/3/en/core-libraries/app.html#finding-paths-to-namespaces
      */
     public static function path($type, $plugin = null)
     {
@@ -205,7 +204,7 @@ class App
      * Will return the full path to the cache engines package.
      *
      * @param string $type Package type.
-     * @return array Full path to package
+     * @return string[] Full path to package
      */
     public static function core($type)
     {

+ 0 - 1
vendor/cakephp/core/BasePlugin.php

@@ -24,7 +24,6 @@ use ReflectionClass;
  */
 class BasePlugin implements PluginInterface
 {
-
     /**
      * Do bootstrapping or not
      *

+ 1 - 2
vendor/cakephp/core/ClassLoader.php

@@ -18,7 +18,6 @@ namespace Cake\Core;
  */
 class ClassLoader
 {
-
     /**
      * An associative array where the key is a namespace prefix and the value
      * is an array of base directories for classes in that namespace.
@@ -97,7 +96,7 @@ class ClassLoader
      *
      * @param string $prefix The namespace prefix.
      * @param string $relativeClass The relative class name.
-     * @return mixed Boolean false if no mapped file can be loaded, or the
+     * @return string|false Boolean false if no mapped file can be loaded, or the
      * name of the mapped file that was loaded.
      */
     protected function _loadMappedFile($prefix, $relativeClass)

+ 10 - 9
vendor/cakephp/core/Configure.php

@@ -28,18 +28,17 @@ use RuntimeException;
  * as methods for loading additional configuration files or storing runtime configuration
  * for future use.
  *
- * @link https://book.cakephp.org/3.0/en/development/configuration.html
+ * @link https://book.cakephp.org/3/en/development/configuration.html
  */
 class Configure
 {
-
     /**
      * Array of values currently stored in Configure.
      *
      * @var array
      */
     protected static $_values = [
-        'debug' => false
+        'debug' => false,
     ];
 
     /**
@@ -79,7 +78,7 @@ class Configure
      * Alternatively can be an array containing key(s) and value(s).
      * @param mixed $value Value to set for var
      * @return bool True if write was successful
-     * @link https://book.cakephp.org/3.0/en/development/configuration.html#writing-configuration-data
+     * @link https://book.cakephp.org/3/en/development/configuration.html#writing-configuration-data
      */
     public static function write($config, $value = null)
     {
@@ -116,7 +115,7 @@ class Configure
      * @param string|null $var Variable to obtain. Use '.' to access array elements.
      * @param mixed $default The return value when the configure does not exist
      * @return mixed Value stored in configure, or null.
-     * @link https://book.cakephp.org/3.0/en/development/configuration.html#reading-configuration-data
+     * @link https://book.cakephp.org/3/en/development/configuration.html#reading-configuration-data
      */
     public static function read($var = null, $default = null)
     {
@@ -159,7 +158,7 @@ class Configure
      * @param string $var Variable to obtain. Use '.' to access array elements.
      * @return mixed Value stored in configure.
      * @throws \RuntimeException if the requested configuration is not set.
-     * @link https://book.cakephp.org/3.0/en/development/configuration.html#reading-configuration-data
+     * @link https://book.cakephp.org/3/en/development/configuration.html#reading-configuration-data
      */
     public static function readOrFail($var)
     {
@@ -181,7 +180,7 @@ class Configure
      *
      * @param string $var the var to be deleted
      * @return void
-     * @link https://book.cakephp.org/3.0/en/development/configuration.html#deleting-configuration-data
+     * @link https://book.cakephp.org/3/en/development/configuration.html#deleting-configuration-data
      */
     public static function delete($var)
     {
@@ -332,7 +331,7 @@ class Configure
      * @param string $config Name of the configured engine to use to read the resource identified by $key.
      * @param bool $merge if config files should be merged instead of simply overridden
      * @return bool False if file not found, true if load successful.
-     * @link https://book.cakephp.org/3.0/en/development/configuration.html#reading-and-writing-configuration-files
+     * @link https://book.cakephp.org/3/en/development/configuration.html#reading-and-writing-configuration-files
      */
     public static function load($key, $config = 'default', $merge = true)
     {
@@ -373,7 +372,7 @@ class Configure
      * @param string $key The identifier to create in the config adapter.
      *   This could be a filename or a cache key depending on the adapter being used.
      * @param string $config The name of the configured adapter to dump data with.
-     * @param array $keys The name of the top-level keys you want to dump.
+     * @param string[] $keys The name of the top-level keys you want to dump.
      *   This allows you save only some data stored in Configure.
      * @return bool Success
      * @throws \Cake\Core\Exception\Exception if the adapter does not implement a `dump` method.
@@ -440,6 +439,7 @@ class Configure
      * @param string $cacheConfig The cache configuration to save into. Defaults to 'default'
      * @param array|null $data Either an array of data to store, or leave empty to store all values.
      * @return bool Success
+     * @throws \RuntimeException
      */
     public static function store($name, $cacheConfig = 'default', $data = null)
     {
@@ -460,6 +460,7 @@ class Configure
      * @param string $name Name of the stored config file to load.
      * @param string $cacheConfig Name of the Cache configuration to read from.
      * @return bool Success.
+     * @throws \RuntimeException
      */
     public static function restore($name, $cacheConfig = 'default')
     {

+ 0 - 1
vendor/cakephp/core/Configure/ConfigEngineInterface.php

@@ -19,7 +19,6 @@ namespace Cake\Core\Configure;
  */
 interface ConfigEngineInterface
 {
-
     /**
      * Read a configuration file/storage key
      *

+ 0 - 1
vendor/cakephp/core/Configure/Engine/IniConfig.php

@@ -53,7 +53,6 @@ use Cake\Utility\Hash;
  */
 class IniConfig implements ConfigEngineInterface
 {
-
     use FileConfigTrait;
 
     /**

+ 0 - 1
vendor/cakephp/core/Configure/Engine/JsonConfig.php

@@ -38,7 +38,6 @@ use Cake\Core\Exception\Exception;
  */
 class JsonConfig implements ConfigEngineInterface
 {
-
     use FileConfigTrait;
 
     /**

+ 2 - 3
vendor/cakephp/core/Configure/Engine/PhpConfig.php

@@ -30,7 +30,7 @@ use Cake\Core\Exception\Exception;
  * ```
  * <?php
  * return [
- *     'debug' => 0,
+ *     'debug' => false,
  *     'Security' => [
  *         'salt' => 'its-secret'
  *     ],
@@ -40,11 +40,10 @@ use Cake\Core\Exception\Exception;
  * ];
  * ```
  *
- * @see Cake\Core\Configure::load() for how to load custom configuration files.
+ * @see \Cake\Core\Configure::load() for how to load custom configuration files.
  */
 class PhpConfig implements ConfigEngineInterface
 {
-
     use FileConfigTrait;
 
     /**

+ 0 - 1
vendor/cakephp/core/Configure/FileConfigTrait.php

@@ -22,7 +22,6 @@ use Cake\Core\Plugin;
  */
 trait FileConfigTrait
 {
-
     /**
      * The path this engine finds files on.
      *

+ 0 - 1
vendor/cakephp/core/ConventionsTrait.php

@@ -21,7 +21,6 @@ use Cake\Utility\Inflector;
  */
 trait ConventionsTrait
 {
-
     /**
      * Creates a fixture name
      *

+ 4 - 3
vendor/cakephp/core/Exception/Exception.php

@@ -16,10 +16,11 @@ use RuntimeException;
 
 /**
  * Base class that all CakePHP Exceptions extend.
+ *
+ * @method int getCode()
  */
 class Exception extends RuntimeException
 {
-
     /**
      * Array of attributes that are passed in from the constructor, and
      * made available in the view when a development error is displayed.
@@ -53,7 +54,7 @@ class Exception extends RuntimeException
      * Constructor.
      *
      * Allows you to create exceptions that are treated as framework errors and disabled
-     * when debug = 0.
+     * when debug mode is off.
      *
      * @param string|array $message Either the string of the error message, or an array of attributes
      *   that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
@@ -92,7 +93,7 @@ class Exception extends RuntimeException
      *  - an associative array of "header name" => "header value"
      *  - an array of string headers is also accepted (deprecated)
      * @param string|null $value The header value.
-     * @return array
+     * @return array|null
      */
     public function responseHeader($header = null, $value = null)
     {

+ 3 - 1
vendor/cakephp/core/Exception/MissingPluginException.php

@@ -17,6 +17,8 @@ namespace Cake\Core\Exception;
  */
 class MissingPluginException extends Exception
 {
-
+    /**
+     * @inheritDoc
+     */
     protected $_messageTemplate = 'Plugin %s could not be found.';
 }

+ 26 - 3
vendor/cakephp/core/InstanceConfigTrait.php

@@ -16,6 +16,7 @@ namespace Cake\Core;
 
 use Cake\Core\Exception\Exception;
 use Cake\Utility\Hash;
+use InvalidArgumentException;
 
 /**
  * A trait for reading and writing instance config
@@ -24,7 +25,6 @@ use Cake\Utility\Hash;
  */
 trait InstanceConfigTrait
 {
-
     /**
      * Runtime config
      *
@@ -110,8 +110,8 @@ trait InstanceConfigTrait
      * ```
      *
      * @param string|null $key The key to get or null for the whole config.
-     * @param mixed $default The return value when the key does not exist.
-     * @return mixed Config value being read.
+     * @param mixed|null $default The return value when the key does not exist.
+     * @return mixed|null Configuration data at the named key or null if the key does not exist.
      */
     public function getConfig($key = null, $default = null)
     {
@@ -188,6 +188,29 @@ trait InstanceConfigTrait
     }
 
     /**
+     * Returns the config for this specific key.
+     *
+     * The config value for this key must exist, it can never be null.
+     *
+     * @param string|null $key The key to get.
+     * @return mixed Configuration data at the named key
+     * @throws \InvalidArgumentException
+     */
+    public function getConfigOrFail($key)
+    {
+        if (!isset($key)) {
+            throw new InvalidArgumentException('$key must not be null.');
+        }
+
+        $config = $this->getConfig($key);
+        if ($config === null) {
+            throw new InvalidArgumentException(sprintf('Expected configuration `%s` not found.', $key));
+        }
+
+        return $config;
+    }
+
+    /**
      * Merge provided config with existing config. Unlike `config()` which does
      * a recursive merge for nested keys, this method does a simple merge.
      *

+ 13 - 12
vendor/cakephp/core/ObjectRegistry.php

@@ -39,7 +39,6 @@ use RuntimeException;
  */
 abstract class ObjectRegistry implements Countable, IteratorAggregate
 {
-
     /**
      * Map of loaded objects.
      *
@@ -120,7 +119,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
     {
         /** @var \Cake\Core\InstanceConfigTrait $existing */
         $existing = $this->_loaded[$name];
-        $msg = sprintf('The "%s" alias has already been loaded', $name);
+        $msg = sprintf('The "%s" alias has already been loaded.', $name);
         $hasConfig = method_exists($existing, 'config');
         if (!$hasConfig) {
             throw new RuntimeException($msg);
@@ -131,22 +130,24 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
         $existingConfig = $existing->getConfig();
         unset($config['enabled'], $existingConfig['enabled']);
 
-        $fail = false;
+        $failure = null;
         foreach ($config as $key => $value) {
             if (!array_key_exists($key, $existingConfig)) {
-                $fail = true;
+                $failure = " The `{$key}` was not defined in the previous configuration data.";
                 break;
             }
             if (isset($existingConfig[$key]) && $existingConfig[$key] !== $value) {
-                $fail = true;
+                $failure = sprintf(
+                    ' The `%s` key has a value of `%s` but previously had a value of `%s`',
+                    $key,
+                    json_encode($value),
+                    json_encode($existingConfig[$key])
+                );
                 break;
             }
         }
-        if ($fail) {
-            $msg .= ' with the following config: ';
-            $msg .= var_export($existingConfig, true);
-            $msg .= ' which differs from ' . var_export($config, true);
-            throw new RuntimeException($msg);
+        if ($failure) {
+            throw new RuntimeException($msg . $failure);
         }
     }
 
@@ -154,7 +155,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
      * Should resolve the classname for a given object type.
      *
      * @param string $class The class to resolve.
-     * @return string|bool The resolved name or false for failure.
+     * @return string|false The resolved name or false for failure.
      */
     abstract protected function _resolveClassName($class);
 
@@ -162,7 +163,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
      * Throw an exception when the requested object name is missing.
      *
      * @param string $class The class that is missing.
-     * @param string $plugin The plugin $class is missing from.
+     * @param string|null $plugin The plugin $class is missing from.
      * @return void
      * @throws \Exception
      */

+ 6 - 7
vendor/cakephp/core/Plugin.php

@@ -22,11 +22,10 @@ use DirectoryIterator;
  *
  * It also can retrieve plugin paths and load their bootstrap and routes files.
  *
- * @link https://book.cakephp.org/3.0/en/plugins.html
+ * @link https://book.cakephp.org/3/en/plugins.html
  */
 class Plugin
 {
-
     /**
      * Holds a list of all loaded plugins and their configuration
      *
@@ -134,7 +133,7 @@ class Plugin
             'console' => true,
             'classBase' => 'src',
             'ignoreMissing' => false,
-            'name' => $plugin
+            'name' => $plugin,
         ];
 
         if (!isset($config['path'])) {
@@ -247,7 +246,7 @@ class Plugin
      * Returns the filesystem path for plugin's folder containing class folders.
      *
      * @param string $name name of the plugin in CamelCase format.
-     * @return string Path to the plugin folder container class folders.
+     * @return string Path to the plugin folder containing class files.
      * @throws \Cake\Core\Exception\MissingPluginException If plugin has not been loaded.
      */
     public static function classPath($name)
@@ -261,7 +260,7 @@ class Plugin
      * Returns the filesystem path for plugin's folder containing config files.
      *
      * @param string $name name of the plugin in CamelCase format.
-     * @return string Path to the plugin folder container config files.
+     * @return string Path to the plugin folder containing config files.
      * @throws \Cake\Core\Exception\MissingPluginException If plugin has not been loaded.
      */
     public static function configPath($name)
@@ -303,7 +302,7 @@ class Plugin
      * Loads the routes file for a plugin, or all plugins configured to load their respective routes file.
      *
      * If you need fine grained control over how routes are loaded for plugins, you
-     * can use {@see Cake\Routing\RouteBuilder::loadPlugin()}
+     * can use {@see \Cake\Routing\RouteBuilder::loadPlugin()}
      *
      * @param string|null $name name of the plugin, if null will operate on all
      *   plugins having enabled the loading of routes files.
@@ -315,7 +314,7 @@ class Plugin
     {
         deprecationWarning(
             'You no longer need to call `Plugin::routes()` after upgrading to use Http\Server. ' .
-            'See https://book.cakephp.org/3.0/en/development/application.html#adding-the-new-http-stack-to-an-existing-application ' .
+            'See https://book.cakephp.org/3/en/development/application.html#adding-the-new-http-stack-to-an-existing-application ' .
             'for upgrade information.'
         );
         if ($name === null) {

+ 40 - 19
vendor/cakephp/core/PluginCollection.php

@@ -28,6 +28,9 @@ use Iterator;
  * This class implements the Iterator interface to allow plugins
  * to be iterated, handling the situation where a plugin's hook
  * method (usually bootstrap) loads another plugin during iteration.
+ *
+ * While its implementation supported nested iteration it does not
+ * support using `continue` or `break` inside loops.
  */
 class PluginCollection implements Iterator, Countable
 {
@@ -41,16 +44,23 @@ class PluginCollection implements Iterator, Countable
     /**
      * Names of plugins
      *
-     * @var array
+     * @var string[]
      */
     protected $names = [];
 
     /**
-     * Iterator position.
+     * Iterator position stack.
+     *
+     * @var int[]
+     */
+    protected $positions = [];
+
+    /**
+     * Loop depth
      *
      * @var int
      */
-    protected $position = 0;
+    protected $loopDepth = -1;
 
     /**
      * Constructor
@@ -166,6 +176,9 @@ class PluginCollection implements Iterator, Countable
     public function clear()
     {
         $this->plugins = [];
+        $this->names = [];
+        $this->positions = [];
+        $this->loopDepth = -1;
 
         return $this;
     }
@@ -198,13 +211,25 @@ class PluginCollection implements Iterator, Countable
     }
 
     /**
+     * Implementation of Countable.
+     *
+     * Get the number of plugins in the collection.
+     *
+     * @return int
+     */
+    public function count()
+    {
+        return count($this->plugins);
+    }
+
+    /**
      * Part of Iterator Interface
      *
      * @return void
      */
     public function next()
     {
-        $this->position++;
+        $this->positions[$this->loopDepth]++;
     }
 
     /**
@@ -214,7 +239,7 @@ class PluginCollection implements Iterator, Countable
      */
     public function key()
     {
-        return $this->names[$this->position];
+        return $this->names[$this->positions[$this->loopDepth]];
     }
 
     /**
@@ -224,7 +249,8 @@ class PluginCollection implements Iterator, Countable
      */
     public function current()
     {
-        $name = $this->names[$this->position];
+        $position = $this->positions[$this->loopDepth];
+        $name = $this->names[$position];
 
         return $this->plugins[$name];
     }
@@ -236,7 +262,8 @@ class PluginCollection implements Iterator, Countable
      */
     public function rewind()
     {
-        $this->position = 0;
+        $this->positions[] = 0;
+        $this->loopDepth += 1;
     }
 
     /**
@@ -246,19 +273,13 @@ class PluginCollection implements Iterator, Countable
      */
     public function valid()
     {
-        return $this->position < count($this->plugins);
-    }
+        $valid = isset($this->names[$this->positions[$this->loopDepth]]);
+        if (!$valid) {
+            array_pop($this->positions);
+            $this->loopDepth -= 1;
+        }
 
-    /**
-     * Implementation of Countable.
-     *
-     * Get the number of plugins in the collection.
-     *
-     * @return int
-     */
-    public function count()
-    {
-        return count($this->plugins);
+        return $valid;
     }
 
     /**

+ 2 - 0
vendor/cakephp/core/PluginInterface.php

@@ -19,6 +19,8 @@ interface PluginInterface
 {
     /**
      * List of valid hooks.
+     *
+     * @var string[]
      */
     const VALID_HOOKS = ['routes', 'bootstrap', 'console', 'middleware'];
 

+ 2 - 2
vendor/cakephp/core/README.md

@@ -26,7 +26,7 @@ Configure::load('app', 'default', false);
 Configure::load('other_config', 'default');
 ```
 
-And Write the configuration back into files:
+And write the configuration back into files:
 
 ```php
 Configure::dump('my_config', 'default');
@@ -34,4 +34,4 @@ Configure::dump('my_config', 'default');
 
 ## Documentation
 
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/development/configuration.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/development/configuration.html)

+ 0 - 1
vendor/cakephp/core/Retry/CommandRetry.php

@@ -24,7 +24,6 @@ use Exception;
  */
 class CommandRetry
 {
-
     /**
      * The strategy to follow should the executed action fail.
      *

+ 1 - 1
vendor/cakephp/core/Retry/RetryStrategyInterface.php

@@ -25,7 +25,7 @@ interface RetryStrategyInterface
     /**
      * Returns true if the action can be retried, false otherwise.
      *
-     * @param Exception $exception The exception that caused the action to fail
+     * @param \Exception $exception The exception that caused the action to fail
      * @param int $retryCount The number of times the action has been already called
      * @return bool Whether or not it is OK to retry the action
      */

+ 27 - 7
vendor/cakephp/core/StaticConfigTrait.php

@@ -27,7 +27,6 @@ use LogicException;
  */
 trait StaticConfigTrait
 {
-
     /**
      * Configuration sets.
      *
@@ -67,7 +66,7 @@ trait StaticConfigTrait
      * ```
      *
      * @param string|array $key The name of the configuration, or an array of multiple configs.
-     * @param array $config An array of name => configuration data for adapter.
+     * @param array|object|null $config An array of name => configuration data for adapter.
      * @throws \BadMethodCallException When trying to modify an existing config.
      * @throws \LogicException When trying to store an invalid structured config array.
      * @return void
@@ -110,7 +109,7 @@ trait StaticConfigTrait
      * Reads existing configuration.
      *
      * @param string $key The name of the configuration.
-     * @return array|null Array of configuration data.
+     * @return mixed|null Configuration data at the named key or null if the key does not exist.
      */
     public static function getConfig($key)
     {
@@ -178,6 +177,27 @@ trait StaticConfigTrait
     }
 
     /**
+     * Reads existing configuration for a specific key.
+     *
+     * The config value for this key must exist, it can never be null.
+     *
+     * @param string|null $key The name of the configuration.
+     * @return mixed Configuration data at the named key.
+     * @throws \InvalidArgumentException If value does not exist.
+     */
+    public static function getConfigOrFail($key)
+    {
+        if (!isset($key)) {
+            throw new InvalidArgumentException('$key must not be null.');
+        }
+        if (!isset(static::$_config[$key])) {
+            throw new InvalidArgumentException(sprintf('Expected configuration `%s` not found.', $key));
+        }
+
+        return static::$_config[$key];
+    }
+
+    /**
      * Drops a constructed adapter.
      *
      * If you wish to modify an existing configuration, you should drop it,
@@ -340,7 +360,7 @@ REGEXP;
     /**
      * Updates the DSN class map for this class.
      *
-     * @param array $map Additions/edits to the class map to apply.
+     * @param string[] $map Additions/edits to the class map to apply.
      * @return void
      */
     public static function setDsnClassMap(array $map)
@@ -351,7 +371,7 @@ REGEXP;
     /**
      * Returns the DSN class map for this class.
      *
-     * @return array
+     * @return string[]
      */
     public static function getDsnClassMap()
     {
@@ -362,8 +382,8 @@ REGEXP;
      * Returns or updates the DSN class map for this class.
      *
      * @deprecated 3.4.0 Use setDsnClassMap()/getDsnClassMap() instead.
-     * @param array|null $map Additions/edits to the class map to apply.
-     * @return array
+     * @param string[]|null $map Additions/edits to the class map to apply.
+     * @return string[]
      */
     public static function dsnClassMap(array $map = null)
     {

+ 7 - 7
vendor/cakephp/core/functions.php

@@ -33,7 +33,7 @@ if (!function_exists('h')) {
      * @param string|null $charset Character set to use when escaping. Defaults to config value in `mb_internal_encoding()`
      * or 'UTF-8'.
      * @return mixed Wrapped text.
-     * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#h
+     * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#h
      */
     function h($text, $double = true, $charset = null)
     {
@@ -91,7 +91,7 @@ if (!function_exists('pluginSplit')) {
      * @param bool $dotAppend Set to true if you want the plugin to have a '.' appended to it.
      * @param string|null $plugin Optional default plugin to use if no plugin is found. Defaults to null.
      * @return array Array with 2 indexes. 0 => plugin name, 1 => class name.
-     * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pluginSplit
+     * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#pluginSplit
      */
     function pluginSplit($name, $dotAppend = false, $plugin = null)
     {
@@ -141,7 +141,7 @@ if (!function_exists('pr')) {
      *
      * @param mixed $var Variable to print out.
      * @return mixed the same $var that was passed to this function
-     * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pr
+     * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#pr
      * @see debug()
      */
     function pr($var)
@@ -170,7 +170,7 @@ if (!function_exists('pj')) {
      * @param mixed $var Variable to print out.
      * @return mixed the same $var that was passed to this function
      * @see pr()
-     * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pj
+     * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#pj
      */
     function pj($var)
     {
@@ -179,7 +179,7 @@ if (!function_exists('pj')) {
         }
 
         $template = (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') ? '<pre class="pj">%s</pre>' : "\n%s\n\n";
-        printf($template, trim(json_encode($var, JSON_PRETTY_PRINT)));
+        printf($template, trim(json_encode($var, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)));
 
         return $var;
     }
@@ -194,9 +194,9 @@ if (!function_exists('env')) {
      * environment information.
      *
      * @param string $key Environment variable name.
-     * @param string|null $default Specify a default value in case the environment variable is not defined.
+     * @param string|bool|null $default Specify a default value in case the environment variable is not defined.
      * @return string|bool|null Environment variable setting.
-     * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#env
+     * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#env
      */
     function env($key, $default = null)
     {

+ 23 - 12
vendor/cakephp/database/Connection.php

@@ -29,13 +29,13 @@ use Cake\Database\Schema\Collection as SchemaCollection;
 use Cake\Datasource\ConnectionInterface;
 use Cake\Log\Log;
 use Exception;
+use Throwable;
 
 /**
  * Represents a connection with a database server.
  */
 class Connection implements ConnectionInterface
 {
-
     use TypeConverterTrait;
 
     /**
@@ -107,7 +107,15 @@ class Connection implements ConnectionInterface
     /**
      * Constructor.
      *
-     * @param array $config configuration for connecting to database
+     * ### Available options:
+     * - `driver` Sort name or FCQN for driver.
+     * - `log` Boolean indicating whether to use query logging.
+     * - `name` Connection name.
+     * - `cacheMetaData` Boolean indicating whether metadata (datasource schemas) should be cached.
+     *    If set to a string it will be used as the name of cache config to use.
+     * - `cacheKeyPrefix` Custom prefix to use when generation cache keys. Defaults to connection name.
+     *
+     * @param array $config Configuration array.
      */
     public function __construct($config)
     {
@@ -654,7 +662,7 @@ class Connection implements ConnectionInterface
     /**
      * Creates a new save point for nested transactions.
      *
-     * @param string $name The save point name.
+     * @param string|int $name The save point name.
      * @return void
      */
     public function createSavePoint($name)
@@ -665,7 +673,7 @@ class Connection implements ConnectionInterface
     /**
      * Releases a save point by its name.
      *
-     * @param string $name The save point name.
+     * @param string|int $name The save point name.
      * @return void
      */
     public function releaseSavePoint($name)
@@ -676,7 +684,7 @@ class Connection implements ConnectionInterface
     /**
      * Rollback a save point by its name.
      *
-     * @param string $name The save point name.
+     * @param string|int $name The save point name.
      * @return void
      */
     public function rollbackSavepoint($name)
@@ -730,12 +738,15 @@ class Connection implements ConnectionInterface
      * });
      * ```
      */
-    public function transactional(callable $callback)
+    public function transactional(callable $transaction)
     {
         $this->begin();
 
         try {
-            $result = $callback($this);
+            $result = $transaction($this);
+        } catch (Throwable $e) {
+            $this->rollback(false);
+            throw $e;
         } catch (Exception $e) {
             $this->rollback(false);
             throw $e;
@@ -778,13 +789,13 @@ class Connection implements ConnectionInterface
      * });
      * ```
      */
-    public function disableConstraints(callable $callback)
+    public function disableConstraints(callable $operation)
     {
-        return $this->getDisconnectRetry()->run(function () use ($callback) {
+        return $this->getDisconnectRetry()->run(function () use ($operation) {
             $this->disableForeignKeys();
 
             try {
-                $result = $callback($this);
+                $result = $operation($this);
             } catch (Exception $e) {
                 $this->enableForeignKeys();
                 throw $e;
@@ -995,7 +1006,7 @@ class Connection implements ConnectionInterface
             'username' => '*****',
             'host' => '*****',
             'database' => '*****',
-            'port' => '*****'
+            'port' => '*****',
         ];
         $replace = array_intersect_key($secrets, $this->_config);
         $config = $replace + $this->_config;
@@ -1007,7 +1018,7 @@ class Connection implements ConnectionInterface
             'transactionStarted' => $this->_transactionStarted,
             'useSavePoints' => $this->_useSavePoints,
             'logQueries' => $this->_logQueries,
-            'logger' => $this->_logger
+            'logger' => $this->_logger,
         ];
     }
 }

+ 0 - 1
vendor/cakephp/database/Dialect/MysqlDialectTrait.php

@@ -25,7 +25,6 @@ use Cake\Database\SqlDialectTrait;
  */
 trait MysqlDialectTrait
 {
-
     use SqlDialectTrait;
 
     /**

+ 1 - 2
vendor/cakephp/database/Dialect/PostgresDialectTrait.php

@@ -26,7 +26,6 @@ use Cake\Database\SqlDialectTrait;
  */
 trait PostgresDialectTrait
 {
-
     use SqlDialectTrait;
 
     /**
@@ -88,7 +87,7 @@ trait PostgresDialectTrait
         $namespace = 'Cake\Database\Expression';
 
         return [
-            $namespace . '\FunctionExpression' => '_transformFunctionExpression'
+            $namespace . '\FunctionExpression' => '_transformFunctionExpression',
         ];
     }
 

+ 2 - 3
vendor/cakephp/database/Dialect/SqliteDialectTrait.php

@@ -26,7 +26,6 @@ use Cake\Database\SqliteCompiler;
  */
 trait SqliteDialectTrait
 {
-
     use SqlDialectTrait;
     use TupleComparisonTranslatorTrait;
 
@@ -63,7 +62,7 @@ trait SqliteDialectTrait
         'minute' => 'M',
         'second' => 'S',
         'week' => 'W',
-        'year' => 'Y'
+        'year' => 'Y',
     ];
 
     /**
@@ -78,7 +77,7 @@ trait SqliteDialectTrait
 
         return [
             $namespace . '\FunctionExpression' => '_transformFunctionExpression',
-            $namespace . '\TupleComparison' => '_transformTupleComparison'
+            $namespace . '\TupleComparison' => '_transformTupleComparison',
         ];
     }
 

+ 7 - 7
vendor/cakephp/database/Dialect/SqlserverDialectTrait.php

@@ -33,7 +33,6 @@ use PDO;
  */
 trait SqlserverDialectTrait
 {
-
     use SqlDialectTrait;
     use TupleComparisonTranslatorTrait;
 
@@ -116,7 +115,8 @@ trait SqlserverDialectTrait
                 ->clause('order')
                 ->iterateParts(function ($direction, $orderBy) use ($select, $order) {
                     $key = $orderBy;
-                    if (isset($select[$orderBy]) &&
+                    if (
+                        isset($select[$orderBy]) &&
                         $select[$orderBy] instanceof ExpressionInterface
                     ) {
                         $key = $select[$orderBy]->sql(new ValueBinder());
@@ -132,7 +132,7 @@ trait SqlserverDialectTrait
 
         $query = clone $original;
         $query->select([
-                '_cake_page_rownum_' => new UnaryExpression('ROW_NUMBER() OVER', $order)
+                '_cake_page_rownum_' => new UnaryExpression('ROW_NUMBER() OVER', $order),
             ])->limit(null)
             ->offset(null)
             ->order([], true);
@@ -190,7 +190,7 @@ trait SqlserverDialectTrait
                     ->setConjunction(' ');
 
                 return [
-                    '_cake_distinct_pivot_' => $over
+                    '_cake_distinct_pivot_' => $over,
                 ];
             })
             ->limit(null)
@@ -227,7 +227,7 @@ trait SqlserverDialectTrait
 
         return [
             $namespace . '\FunctionExpression' => '_transformFunctionExpression',
-            $namespace . '\TupleComparison' => '_transformTupleComparison'
+            $namespace . '\TupleComparison' => '_transformTupleComparison',
         ];
     }
 
@@ -380,7 +380,7 @@ trait SqlserverDialectTrait
      */
     public function disableForeignKeySQL()
     {
-        return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
+        return 'EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
     }
 
     /**
@@ -388,6 +388,6 @@ trait SqlserverDialectTrait
      */
     public function enableForeignKeySQL()
     {
-        return 'EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
+        return 'EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
     }
 }

+ 1 - 2
vendor/cakephp/database/Dialect/TupleComparisonTranslatorTrait.php

@@ -26,12 +26,11 @@ use Cake\Database\Query;
  */
 trait TupleComparisonTranslatorTrait
 {
-
     /**
      * Receives a TupleExpression and changes it so that it conforms to this
      * SQL dialect.
      *
-     * It transforms expressions looking like '(a, b) IN ((c, d), (e, f)' into an
+     * It transforms expressions looking like '(a, b) IN ((c, d), (e, f))' into an
      * equivalent expression of the form '((a = c) AND (b = d)) OR ((a = e) AND (b = f))'.
      *
      * It can also transform transform expressions where the right hand side is a query

+ 21 - 2
vendor/cakephp/database/Driver.php

@@ -15,6 +15,7 @@
 namespace Cake\Database;
 
 use Cake\Database\Query;
+use Cake\Database\Schema\TableSchema;
 use Cake\Database\Statement\PDOStatement;
 use InvalidArgumentException;
 use PDO;
@@ -302,7 +303,8 @@ abstract class Driver implements DriverInterface
         if (is_float($value)) {
             return str_replace(',', '.', (string)$value);
         }
-        if ((is_int($value) || $value === '0') || (
+        if (
+            (is_int($value) || $value === '0') || (
             is_numeric($value) && strpos($value, ',') === false &&
             $value[0] !== '0' && strpos($value, 'e') === false)
         ) {
@@ -427,6 +429,23 @@ abstract class Driver implements DriverInterface
     }
 
     /**
+     * Constructs new TableSchema.
+     *
+     * @param string $table The table name.
+     * @param array $columns The list of columns for the schema.
+     * @return \Cake\Database\Schema\TableSchemaInterface
+     */
+    public function newTableSchema($table, array $columns = [])
+    {
+        $className = TableSchema::class;
+        if (isset($this->_config['tableSchema'])) {
+            $className = $this->_config['tableSchema'];
+        }
+
+        return new $className($table, $columns);
+    }
+
+    /**
      * Destructor
      */
     public function __destruct()
@@ -443,7 +462,7 @@ abstract class Driver implements DriverInterface
     public function __debugInfo()
     {
         return [
-            'connected' => $this->_connection !== null
+            'connected' => $this->_connection !== null,
         ];
     }
 }

+ 1 - 2
vendor/cakephp/database/Driver/Mysql.php

@@ -25,7 +25,6 @@ use PDO;
  */
 class Mysql extends Driver
 {
-
     use MysqlDialectTrait;
 
     /**
@@ -122,7 +121,7 @@ class Mysql extends Driver
      */
     public function enabled()
     {
-        return in_array('mysql', PDO::getAvailableDrivers());
+        return in_array('mysql', PDO::getAvailableDrivers(), true);
     }
 
     /**

+ 1 - 2
vendor/cakephp/database/Driver/PDODriverTrait.php

@@ -26,7 +26,6 @@ use PDOException;
  */
 trait PDODriverTrait
 {
-
     /**
      * Instance of PDO.
      *
@@ -59,7 +58,7 @@ trait PDODriverTrait
      * If first argument is passed, it will set internal connection object or
      * result to the value passed
      *
-     * @param null|\PDO $connection The PDO connection instance.
+     * @param \PDO|null $connection The PDO connection instance.
      * @return \PDO connection object used internally
      */
     public function connection($connection = null)

+ 2 - 3
vendor/cakephp/database/Driver/Postgres.php

@@ -23,7 +23,6 @@ use PDO;
  */
 class Postgres extends Driver
 {
-
     use PostgresDialectTrait;
 
     /**
@@ -59,7 +58,7 @@ class Postgres extends Driver
         $config['flags'] += [
             PDO::ATTR_PERSISTENT => $config['persistent'],
             PDO::ATTR_EMULATE_PREPARES => false,
-            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
         ];
         if (empty($config['unix_socket'])) {
             $dsn = "pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']}";
@@ -95,7 +94,7 @@ class Postgres extends Driver
      */
     public function enabled()
     {
-        return in_array('pgsql', PDO::getAvailableDrivers());
+        return in_array('pgsql', PDO::getAvailableDrivers(), true);
     }
 
     /**

+ 2 - 3
vendor/cakephp/database/Driver/Sqlite.php

@@ -26,7 +26,6 @@ use PDO;
  */
 class Sqlite extends Driver
 {
-
     use SqliteDialectTrait;
 
     /**
@@ -61,7 +60,7 @@ class Sqlite extends Driver
         $config['flags'] += [
             PDO::ATTR_PERSISTENT => $config['persistent'],
             PDO::ATTR_EMULATE_PREPARES => false,
-            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
         ];
 
         $databaseExists = file_exists($config['database']);
@@ -91,7 +90,7 @@ class Sqlite extends Driver
      */
     public function enabled()
     {
-        return in_array('sqlite', PDO::getAvailableDrivers());
+        return in_array('sqlite', PDO::getAvailableDrivers(), true);
     }
 
     /**

+ 2 - 3
vendor/cakephp/database/Driver/Sqlserver.php

@@ -25,7 +25,6 @@ use PDO;
  */
 class Sqlserver extends Driver
 {
-
     use SqlserverDialectTrait;
 
     /**
@@ -76,7 +75,7 @@ class Sqlserver extends Driver
 
         $config['flags'] += [
             PDO::ATTR_EMULATE_PREPARES => false,
-            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
         ];
 
         if (!empty($config['encoding'])) {
@@ -132,7 +131,7 @@ class Sqlserver extends Driver
      */
     public function enabled()
     {
-        return in_array('sqlsrv', PDO::getAvailableDrivers());
+        return in_array('sqlsrv', PDO::getAvailableDrivers(), true);
     }
 
     /**

+ 6 - 5
vendor/cakephp/database/DriverInterface.php

@@ -20,6 +20,7 @@ use Cake\Database\Query;
  * Interface for database driver.
  *
  * @method $this disableAutoQuoting()
+ * @method \Cake\Database\Schema\TableSchemaInterface newTableSchema()
  */
 interface DriverInterface
 {
@@ -91,7 +92,7 @@ interface DriverInterface
     /**
      * Get the SQL for releasing a save point.
      *
-     * @param string $name The table name.
+     * @param string|int $name The table name.
      * @return string
      */
     public function releaseSavePointSQL($name);
@@ -99,7 +100,7 @@ interface DriverInterface
     /**
      * Get the SQL for creating a save point.
      *
-     * @param string $name The table name.
+     * @param string|int $name The table name.
      * @return string
      */
     public function savePointSQL($name);
@@ -107,7 +108,7 @@ interface DriverInterface
     /**
      * Get the SQL for rollingback a save point.
      *
-     * @param string $name The table name.
+     * @param string|int $name The table name.
      * @return string
      */
     public function rollbackSavePointSQL($name);
@@ -130,7 +131,7 @@ interface DriverInterface
      * Returns whether the driver supports adding or dropping constraints
      * to already created tables.
      *
-     * @return bool true if driver supports dynamic constraints.
+     * @return bool True if driver supports dynamic constraints.
      */
     public function supportsDynamicConstraints();
 
@@ -145,7 +146,7 @@ interface DriverInterface
      * Returns a value in a safe representation to be used in a query string
      *
      * @param mixed $value The value to quote.
-     * @param string $type Type to be used for determining kind of quoting to perform.
+     * @param int $type Type to be used for determining kind of quoting to perform.
      * @return string
      */
     public function quote($value, $type);

+ 0 - 1
vendor/cakephp/database/Exception.php

@@ -21,5 +21,4 @@ use Cake\Core\Exception\Exception as CakeException;
  */
 class Exception extends CakeException
 {
-
 }

+ 0 - 1
vendor/cakephp/database/Exception/MissingConnectionException.php

@@ -21,7 +21,6 @@ use Cake\Core\Exception\Exception;
  */
 class MissingConnectionException extends Exception
 {
-
     /**
      * {@inheritDoc}
      */

+ 0 - 1
vendor/cakephp/database/Exception/MissingDriverException.php

@@ -21,7 +21,6 @@ use Cake\Core\Exception\Exception;
  */
 class MissingDriverException extends Exception
 {
-
     /**
      * {@inheritDoc}
      */

+ 0 - 1
vendor/cakephp/database/Exception/MissingExtensionException.php

@@ -21,7 +21,6 @@ use Cake\Core\Exception\Exception;
  */
 class MissingExtensionException extends Exception
 {
-
     /**
      * {@inheritDoc}
      */

+ 0 - 1
vendor/cakephp/database/Exception/NestedTransactionRollbackException.php

@@ -21,7 +21,6 @@ use Cake\Core\Exception\Exception;
  */
 class NestedTransactionRollbackException extends Exception
 {
-
     /**
      * Constructor
      *

+ 3 - 5
vendor/cakephp/database/Expression/BetweenExpression.php

@@ -23,7 +23,6 @@ use Cake\Database\ValueBinder;
  */
 class BetweenExpression implements ExpressionInterface, FieldInterface
 {
-
     use ExpressionTypeCasterTrait;
     use FieldTrait;
 
@@ -79,7 +78,7 @@ class BetweenExpression implements ExpressionInterface, FieldInterface
     {
         $parts = [
             'from' => $this->_from,
-            'to' => $this->_to
+            'to' => $this->_to,
         ];
 
         $field = $this->_field;
@@ -100,13 +99,12 @@ class BetweenExpression implements ExpressionInterface, FieldInterface
 
     /**
      * {@inheritDoc}
-     *
      */
-    public function traverse(callable $callable)
+    public function traverse(callable $visitor)
     {
         foreach ([$this->_field, $this->_from, $this->_to] as $part) {
             if ($part instanceof ExpressionInterface) {
-                $callable($part);
+                $visitor($part);
             }
         }
     }

+ 0 - 7
vendor/cakephp/database/Expression/CaseExpression.php

@@ -23,7 +23,6 @@ use Cake\Database\ValueBinder;
  */
 class CaseExpression implements ExpressionInterface
 {
-
     use ExpressionTypeCasterTrait;
 
     /**
@@ -80,7 +79,6 @@ class CaseExpression implements ExpressionInterface
      * @param array|\Cake\Database\ExpressionInterface $conditions Must be a ExpressionInterface instance, or an array of ExpressionInterface instances.
      * @param array|\Cake\Database\ExpressionInterface $values associative array of values of each condition
      * @param array $types associative array of types to be associated with the values
-     *
      * @return $this
      */
     public function add($conditions = [], $values = [], $types = [])
@@ -107,7 +105,6 @@ class CaseExpression implements ExpressionInterface
      * @param array|\Cake\Database\ExpressionInterface $conditions Must be a ExpressionInterface instance, or an array of ExpressionInterface instances.
      * @param array|\Cake\Database\ExpressionInterface $values associative array of values of each condition
      * @param array $types associative array of types to be associated with the values
-     *
      * @return void
      */
     protected function _addExpressions($conditions, $values, $types)
@@ -161,7 +158,6 @@ class CaseExpression implements ExpressionInterface
      *
      * @param \Cake\Database\ExpressionInterface|string|array|null $value Value to set
      * @param string|null $type Type of value
-     *
      * @return void
      */
     public function elseValue($value = null, $type = null)
@@ -187,7 +183,6 @@ class CaseExpression implements ExpressionInterface
      *
      * @param array|string|\Cake\Database\ExpressionInterface $part The part to compile
      * @param \Cake\Database\ValueBinder $generator Sql generator
-     *
      * @return string
      */
     protected function _compile($part, ValueBinder $generator)
@@ -207,7 +202,6 @@ class CaseExpression implements ExpressionInterface
      * Converts the Node into a SQL string fragment.
      *
      * @param \Cake\Database\ValueBinder $generator Placeholder generator object
-     *
      * @return string
      */
     public function sql(ValueBinder $generator)
@@ -229,7 +223,6 @@ class CaseExpression implements ExpressionInterface
 
     /**
      * {@inheritDoc}
-     *
      */
     public function traverse(callable $visitor)
     {

+ 8 - 10
vendor/cakephp/database/Expression/Comparison.php

@@ -26,7 +26,6 @@ use Cake\Database\ValueBinder;
  */
 class Comparison implements ExpressionInterface, FieldInterface
 {
-
     use ExpressionTypeCasterTrait;
     use FieldTrait;
 
@@ -71,7 +70,7 @@ class Comparison implements ExpressionInterface, FieldInterface
      *
      * @param string|\Cake\Database\ExpressionInterface $field the field name to compare to a value
      * @param mixed $value The value to be used in comparison
-     * @param string $type the type name used to cast the value
+     * @param string|null $type the type name used to cast the value
      * @param string $operator the operator used for comparing field and value
      */
     public function __construct($field, $value, $type, $operator)
@@ -165,23 +164,22 @@ class Comparison implements ExpressionInterface, FieldInterface
 
     /**
      * {@inheritDoc}
-     *
      */
-    public function traverse(callable $callable)
+    public function traverse(callable $visitor)
     {
         if ($this->_field instanceof ExpressionInterface) {
-            $callable($this->_field);
-            $this->_field->traverse($callable);
+            $visitor($this->_field);
+            $this->_field->traverse($visitor);
         }
 
         if ($this->_value instanceof ExpressionInterface) {
-            $callable($this->_value);
-            $this->_value->traverse($callable);
+            $visitor($this->_value);
+            $this->_value->traverse($visitor);
         }
 
         foreach ($this->_valueExpressions as $v) {
-            $callable($v);
-            $v->traverse($callable);
+            $visitor($v);
+            $v->traverse($visitor);
         }
     }
 

+ 0 - 1
vendor/cakephp/database/Expression/FieldInterface.php

@@ -20,7 +20,6 @@ namespace Cake\Database\Expression;
  */
 interface FieldInterface
 {
-
     /**
      * Sets the field name
      *

+ 0 - 1
vendor/cakephp/database/Expression/FieldTrait.php

@@ -19,7 +19,6 @@ namespace Cake\Database\Expression;
  */
 trait FieldTrait
 {
-
     /**
      * The field name or expression to be used in the left hand side of the operator
      *

+ 5 - 3
vendor/cakephp/database/Expression/FunctionExpression.php

@@ -15,6 +15,7 @@
 namespace Cake\Database\Expression;
 
 use Cake\Database\ExpressionInterface;
+use Cake\Database\Query;
 use Cake\Database\TypedResultInterface;
 use Cake\Database\TypedResultTrait;
 use Cake\Database\Type\ExpressionTypeCasterTrait;
@@ -28,7 +29,6 @@ use Cake\Database\ValueBinder;
  */
 class FunctionExpression extends QueryExpression implements TypedResultInterface
 {
-
     use ExpressionTypeCasterTrait;
     use TypedResultTrait;
 
@@ -171,8 +171,10 @@ class FunctionExpression extends QueryExpression implements TypedResultInterface
     {
         $parts = [];
         foreach ($this->_conditions as $condition) {
-            if ($condition instanceof ExpressionInterface) {
-                $condition = sprintf('%s', $condition->sql($generator));
+            if ($condition instanceof Query) {
+                $condition = sprintf('(%s)', $condition->sql($generator));
+            } elseif ($condition instanceof ExpressionInterface) {
+                $condition = $condition->sql($generator);
             } elseif (is_array($condition)) {
                 $p = $generator->placeholder('param');
                 $generator->bind($p, $condition['value'], $condition['type']);

+ 2 - 7
vendor/cakephp/database/Expression/IdentifierExpression.php

@@ -27,7 +27,6 @@ use Cake\Database\ValueBinder;
  */
 class IdentifierExpression implements ExpressionInterface
 {
-
     /**
      * Holds the identifier string
      *
@@ -78,13 +77,9 @@ class IdentifierExpression implements ExpressionInterface
     }
 
     /**
-     * This method is a no-op, this is a leaf type of expression,
-     * hence there is nothing to traverse
-     *
-     * @param callable $callable The callable to traverse with.
-     * @return void
+     * @inheritDoc
      */
-    public function traverse(callable $callable)
+    public function traverse(callable $visitor)
     {
     }
 }

+ 0 - 1
vendor/cakephp/database/Expression/OrderByExpression.php

@@ -22,7 +22,6 @@ use Cake\Database\ValueBinder;
  */
 class OrderByExpression extends QueryExpression
 {
-
     /**
      * Constructor
      *

+ 4 - 5
vendor/cakephp/database/Expression/QueryExpression.php

@@ -31,7 +31,6 @@ use Countable;
  */
 class QueryExpression implements ExpressionInterface, Countable
 {
-
     use TypeMapTrait;
 
     /**
@@ -573,15 +572,15 @@ class QueryExpression implements ExpressionInterface, Countable
      *
      * Callback function receives as only argument an instance of ExpressionInterface
      *
-     * @param callable $callable The callable to apply to all sub-expressions.
+     * @param callable $visitor The callable to apply to all sub-expressions.
      * @return void
      */
-    public function traverse(callable $callable)
+    public function traverse(callable $visitor)
     {
         foreach ($this->_conditions as $c) {
             if ($c instanceof ExpressionInterface) {
-                $callable($c);
-                $c->traverse($callable);
+                $visitor($c);
+                $c->traverse($visitor);
             }
         }
     }

+ 14 - 8
vendor/cakephp/database/Expression/TupleComparison.php

@@ -23,6 +23,12 @@ use Cake\Database\ValueBinder;
  */
 class TupleComparison extends Comparison
 {
+    /**
+     * The type to be used for casting the value to a database representation
+     *
+     * @var array
+     */
+    protected $_type;
 
     /**
      * Constructor
@@ -97,7 +103,7 @@ class TupleComparison extends Comparison
             if ($isMulti) {
                 $bound = [];
                 foreach ($value as $k => $val) {
-                    $valType = $multiType ? $type[$k] : $type;
+                    $valType = $multiType && isset($type[$k]) ? $type[$k] : $type;
                     $bound[] = $this->_bindValue($generator, $val, $valType);
                 }
 
@@ -135,19 +141,19 @@ class TupleComparison extends Comparison
      *
      * Callback function receives as its only argument an instance of an ExpressionInterface
      *
-     * @param callable $callable The callable to apply to sub-expressions
+     * @param callable $visitor The callable to apply to sub-expressions
      * @return void
      */
-    public function traverse(callable $callable)
+    public function traverse(callable $visitor)
     {
         foreach ($this->getField() as $field) {
-            $this->_traverseValue($field, $callable);
+            $this->_traverseValue($field, $visitor);
         }
 
         $value = $this->getValue();
         if ($value instanceof ExpressionInterface) {
-            $callable($value);
-            $value->traverse($callable);
+            $visitor($value);
+            $value->traverse($visitor);
 
             return;
         }
@@ -155,10 +161,10 @@ class TupleComparison extends Comparison
         foreach ($value as $i => $val) {
             if ($this->isMulti()) {
                 foreach ($val as $v) {
-                    $this->_traverseValue($v, $callable);
+                    $this->_traverseValue($v, $visitor);
                 }
             } else {
-                $this->_traverseValue($val, $callable);
+                $this->_traverseValue($val, $visitor);
             }
         }
     }

+ 5 - 5
vendor/cakephp/database/Expression/UnaryExpression.php

@@ -22,16 +22,17 @@ use Cake\Database\ValueBinder;
  */
 class UnaryExpression implements ExpressionInterface
 {
-
     /**
      * Indicates that the operation is in pre-order
      *
+     * @var int
      */
     const PREFIX = 0;
 
     /**
      * Indicates that the operation is in post-order
      *
+     * @var int
      */
     const POSTFIX = 1;
 
@@ -92,13 +93,12 @@ class UnaryExpression implements ExpressionInterface
 
     /**
      * {@inheritDoc}
-     *
      */
-    public function traverse(callable $callable)
+    public function traverse(callable $visitor)
     {
         if ($this->_value instanceof ExpressionInterface) {
-            $callable($this->_value);
-            $this->_value->traverse($callable);
+            $visitor($this->_value);
+            $this->_value->traverse($visitor);
         }
     }
 

+ 3 - 3
vendor/cakephp/database/Expression/ValuesExpression.php

@@ -29,7 +29,6 @@ use Cake\Database\ValueBinder;
  */
 class ValuesExpression implements ExpressionInterface
 {
-
     use ExpressionTypeCasterTrait;
     use TypeMapTrait;
 
@@ -84,7 +83,8 @@ class ValuesExpression implements ExpressionInterface
      */
     public function add($data)
     {
-        if ((count($this->_values) && $data instanceof Query) ||
+        if (
+            (count($this->_values) && $data instanceof Query) ||
             ($this->_query && is_array($data))
         ) {
             throw new Exception(
@@ -376,7 +376,7 @@ class ValuesExpression implements ExpressionInterface
 
         foreach ($this->_values as $row => $values) {
             foreach ($types as $col => $type) {
-                /* @var \Cake\Database\Type\ExpressionTypeInterface $type */
+                /** @var \Cake\Database\Type\ExpressionTypeInterface $type */
                 $this->_values[$row][$col] = $type->toExpression($values[$col]);
             }
         }

+ 0 - 1
vendor/cakephp/database/ExpressionInterface.php

@@ -19,7 +19,6 @@ namespace Cake\Database;
  */
 interface ExpressionInterface
 {
-
     /**
      * Converts the Node into a SQL string fragment.
      *

+ 0 - 1
vendor/cakephp/database/FieldTypeConverter.php

@@ -24,7 +24,6 @@ use Cake\Database\Type\OptionalConvertInterface;
  */
 class FieldTypeConverter
 {
-
     /**
      * An array containing the name of the fields and the Type objects
      * each should use when converting them.

+ 37 - 14
vendor/cakephp/database/FunctionsBuilder.php

@@ -23,7 +23,6 @@ use Cake\Database\Expression\FunctionExpression;
  */
 class FunctionsBuilder
 {
-
     /**
      * Returns a new instance of a FunctionExpression. This is used for generating
      * arbitrary function calls in the final SQL string.
@@ -44,7 +43,7 @@ class FunctionsBuilder
      * argument.
      *
      * @param string $name name of the function to build
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @param string $return The return type for the function
      * @return \Cake\Database\Expression\FunctionExpression
@@ -73,7 +72,7 @@ class FunctionsBuilder
     /**
      * Returns a FunctionExpression representing a call to SQL SUM function.
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -90,7 +89,7 @@ class FunctionsBuilder
     /**
      * Returns a FunctionExpression representing a call to SQL AVG function.
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -102,7 +101,7 @@ class FunctionsBuilder
     /**
      * Returns a FunctionExpression representing a call to SQL MAX function.
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -114,7 +113,7 @@ class FunctionsBuilder
     /**
      * Returns a FunctionExpression representing a call to SQL MIN function.
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -126,7 +125,7 @@ class FunctionsBuilder
     /**
      * Returns a FunctionExpression representing a call to SQL COUNT function.
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -160,6 +159,30 @@ class FunctionsBuilder
     }
 
     /**
+     * Returns a FunctionExpression representing a call to SQL CAST function.
+     *
+     * @param string|\Cake\Database\ExpressionInterface $field Field or expression to cast.
+     * @param string $type The target data type
+     * @return \Cake\Database\Expression\FunctionExpression
+     */
+    public function cast($field, $type = '')
+    {
+        if (is_array($field)) {
+            deprecationWarning(
+                'Build cast function by FunctionsBuilder::cast(array $args) is deprecated. ' .
+                'Use FunctionsBuilder::cast($field, string $type) instead.'
+            );
+
+            return $this->_build('CAST', $field);
+        }
+
+        $expression = $this->_literalArgumentFunction('CAST', $field);
+        $expression->setConjunction(' AS')->add([$type => 'literal']);
+
+        return $expression;
+    }
+
+    /**
      * Returns a FunctionExpression representing the difference in days between
      * two dates.
      *
@@ -176,20 +199,20 @@ class FunctionsBuilder
      * Returns the specified date part from the SQL expression.
      *
      * @param string $part Part of the date to return.
-     * @param string $expression Expression to obtain the date part from.
+     * @param string|\Cake\Database\ExpressionInterface $expression Expression to obtain the date part from.
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
     public function datePart($part, $expression, $types = [])
     {
-        return $this->extract($part, $expression);
+        return $this->extract($part, $expression, $types);
     }
 
     /**
      * Returns the specified date part from the SQL expression.
      *
      * @param string $part Part of the date to return.
-     * @param string $expression Expression to obtain the date part from.
+     * @param string|\Cake\Database\ExpressionInterface $expression Expression to obtain the date part from.
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -204,8 +227,8 @@ 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 subtract.
+     * @param string|\Cake\Database\ExpressionInterface $expression Expression to obtain the date part from.
+     * @param string|int $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
@@ -226,7 +249,7 @@ class FunctionsBuilder
      * Returns a FunctionExpression representing a call to SQL WEEKDAY function.
      * 1 - Sunday, 2 - Monday, 3 - Tuesday...
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */
@@ -239,7 +262,7 @@ class FunctionsBuilder
      * Returns a FunctionExpression representing a call to SQL WEEKDAY function.
      * 1 - Sunday, 2 - Monday, 3 - Tuesday...
      *
-     * @param mixed $expression the function argument
+     * @param string|\Cake\Database\ExpressionInterface $expression the function argument
      * @param array $types list of types to bind to the arguments
      * @return \Cake\Database\Expression\FunctionExpression
      */

+ 0 - 1
vendor/cakephp/database/IdentifierQuoter.php

@@ -25,7 +25,6 @@ use Cake\Database\Expression\OrderByExpression;
  */
 class IdentifierQuoter
 {
-
     /**
      * The driver instance used to do the identifier quoting
      *

+ 0 - 1
vendor/cakephp/database/Log/LoggedQuery.php

@@ -22,7 +22,6 @@ namespace Cake\Database\Log;
  */
 class LoggedQuery
 {
-
     /**
      * Query string that was executed
      *

+ 0 - 1
vendor/cakephp/database/Log/LoggingStatement.php

@@ -24,7 +24,6 @@ use Exception;
  */
 class LoggingStatement extends StatementDecorator
 {
-
     /**
      * Logger instance responsible for actually doing the logging task
      *

+ 0 - 0
vendor/cakephp/database/Log/QueryLogger.php


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů