From b2d2a69965712b1f19e19aa44e8d3bf77d26f07f Mon Sep 17 00:00:00 2001 From: Petra Barus Date: Fri, 22 Feb 2019 10:54:46 +0700 Subject: [PATCH] Upgrade to PHP 7.2 and Yii 2.0.15. (#31) --- .gitignore | 1 + .travis.yml | 13 +- build.xml | 6 +- composer.json | 4 +- composer.lock | 319 +++++++++++++++++++------------------ phpunit.xml | 5 + sonar-project.properties | 3 + src/ActiveDataProvider.php | 4 +- src/ActiveRecord.php | 2 +- src/Connection.php | 4 +- src/QueryBuilder.php | 15 +- 11 files changed, 211 insertions(+), 165 deletions(-) create mode 100644 sonar-project.properties diff --git a/.gitignore b/.gitignore index 6bddae8..3552a22 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ vendor/ # composer.lock /nbproject/ .idea +reports \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e548787..48c5709 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,14 @@ language: php php: - - 7.0 - - 7.1 + - 7.2 + - 7.3 + +addons: + sonarcloud: + organization: "urbanindo" + token: + secure: "yg0wLj5oe3V3aOIyQWwPczAccmZDC+1rpkCmUFeim604Xj3GvSPcK7uSMQrhH9pPwD6svh1zCleHh04GX+kz3kKXBYWV5tIy7g8cgTmD1CFPYeVd7kdq5B7O8gKkPWfTQ8ecVSNQU134Yc6sbDYtVh2kPtZltvkmWzyVyzWimdkr3fTYOvOuiyC0+L/Ka/OpZpuPuSWSAURiMpM9V2FBsCe0rOP+NgZBcYcO3H76I662Jf2LosziruxQHNXnpyj1FNstI27KM4NNlZods17+SAhFRoF+msIi96eyAu/PI7hz+Duac6TPg5fdn7G/gZt/ciYnHjOZhF18sEX2Ot0PqDoazLmn0fG7Q6TwDJPS+A9NJn++pVJiyfEdZZX+zy/Pj6/H1+F0oS0njoEcUXQSSiBfhC1E7kkmTWZj2MEFpC+wD/Wbh9QNjrlY9woevOzmUW7/WypkphtDGz68uVzzqYmQGyZqAtYkcJkZyZoNgTzQo3R9eYZmfOcmZhhcn2F8ayasrMXOo14yOisdFwb75uWhyDUGwOro3QYeEEkI0k9j7YbceITctCjQy7z4dSSDEERxUxvf1n5o28RfArd11Jqz877c4WwtRs79MwrFeOsDOrdUr3eVkwvZTxNbHyUYNYsHQGe7xnfpyssPydQCxZ+DObKElAZrxaqj7/WjQkI=" sudo: required @@ -17,4 +23,5 @@ script: - ./vendor/bin/phing test after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) + - sonar-scanner diff --git a/build.xml b/build.xml index 9d77cdd..fe2e087 100644 --- a/build.xml +++ b/build.xml @@ -3,7 +3,11 @@ - + + + + + diff --git a/composer.json b/composer.json index 874099b..1570791 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ ], "minimum-stability": "dev", "require": { - "php": ">=7.0", - "yiisoft/yii2": "^2.0.13", + "php": ">=7.2", + "yiisoft/yii2": "~2.0.15", "aws/aws-sdk-php": "~3.28" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 09b164c..2f7b080 100644 --- a/composer.lock +++ b/composer.lock @@ -1,31 +1,30 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "539f5b2c11466f9a38c47047da2c7ef5", + "content-hash": "15add8bb7cbcd2fd2e22ad1d16293191", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.61.9", + "version": "3.87.16", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "57041356c1bb7fdcaba2e181feec56f854b52e38" + "reference": "b6954b03e1c212b849ecf103e5f593b15b06b058" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/57041356c1bb7fdcaba2e181feec56f854b52e38", - "reference": "57041356c1bb7fdcaba2e181feec56f854b52e38", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b6954b03e1c212b849ecf103e5f593b15b06b058", + "reference": "b6954b03e1c212b849ecf103e5f593b15b06b058", "shasum": "" }, "require": { "ext-json": "*", "ext-pcre": "*", "ext-simplexml": "*", - "ext-spl": "*", - "guzzlehttp/guzzle": "^5.3.1|^6.2.1", + "guzzlehttp/guzzle": "^5.3.3|^6.2.1", "guzzlehttp/promises": "~1.0", "guzzlehttp/psr7": "^1.4.1", "mtdowling/jmespath.php": "~2.2", @@ -38,6 +37,8 @@ "doctrine/cache": "~1.4", "ext-dom": "*", "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", "nette/neon": "^2.3", "phpunit/phpunit": "^4.8.35|^5.4.3", "psr/cache": "^1.0" @@ -46,7 +47,8 @@ "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", "doctrine/cache": "To use the DoctrineCacheAdapter", "ext-curl": "To send requests using cURL", - "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages" + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" }, "type": "library", "extra": { @@ -84,7 +86,7 @@ "s3", "sdk" ], - "time": "2018-06-19T20:26:38+00:00" + "time": "2019-02-21T19:16:06+00:00" }, { "name": "bower-asset/inputmask", @@ -143,21 +145,20 @@ "jquery", "mask", "plugins" - ], - "time": "2017-11-21T11:46:23+00:00" + ] }, { "name": "bower-asset/jquery", - "version": "3.2.1", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/jquery/jquery-dist.git", - "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e" + "reference": "9e8ec3d10fad04748176144f108d7355662ae75e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/77d2a51d0520d2ee44173afdf4e40a9201f5964e", - "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e", + "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/9e8ec3d10fad04748176144f108d7355662ae75e", + "reference": "9e8ec3d10fad04748176144f108d7355662ae75e", "shasum": "" }, "type": "bower-asset-library", @@ -175,8 +176,7 @@ "javascript", "jquery", "library" - ], - "time": "2017-03-20T19:02:00+00:00" + ] }, { "name": "bower-asset/punycode", @@ -204,8 +204,7 @@ "node_modules", "package.json" ] - }, - "time": "2014-10-22T12:02:42+00:00" + } }, { "name": "bower-asset/yii2-pjax", @@ -242,8 +241,7 @@ }, "license": [ "MIT" - ], - "time": "2017-10-14T08:42:41+00:00" + ] }, { "name": "cebe/markdown", @@ -251,12 +249,12 @@ "source": { "type": "git", "url": "https://github.com/cebe/markdown.git", - "reference": "530bc7dcbdfea5ad2da030110ee3ac07cc797f90" + "reference": "eeb1bf622e80f337479e00a5db94c56e7cf1326b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cebe/markdown/zipball/530bc7dcbdfea5ad2da030110ee3ac07cc797f90", - "reference": "530bc7dcbdfea5ad2da030110ee3ac07cc797f90", + "url": "https://api.github.com/repos/cebe/markdown/zipball/eeb1bf622e80f337479e00a5db94c56e7cf1326b", + "reference": "eeb1bf622e80f337479e00a5db94c56e7cf1326b", "shasum": "" }, "require": { @@ -303,7 +301,7 @@ "markdown", "markdown-extra" ], - "time": "2018-06-13T20:42:05+00:00" + "time": "2018-12-10T09:41:35+00:00" }, { "name": "ezyang/htmlpurifier", @@ -358,15 +356,16 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b4e2ffb457f37d629a6ec9b72fd0d9c85f3dfe2c" + "reference": "6c50a6299b2465053d317bd32845ede91db62393" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b4e2ffb457f37d629a6ec9b72fd0d9c85f3dfe2c", - "reference": "b4e2ffb457f37d629a6ec9b72fd0d9c85f3dfe2c", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/6c50a6299b2465053d317bd32845ede91db62393", + "reference": "6c50a6299b2465053d317bd32845ede91db62393", "shasum": "" }, "require": { + "ext-json": "*", "guzzlehttp/promises": "^1.0", "guzzlehttp/psr7": "^1.4", "php": ">=5.5" @@ -374,7 +373,7 @@ "require-dev": { "ext-curl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" + "psr/log": "^1.1" }, "suggest": { "psr/log": "Required for using the Log middleware" @@ -386,12 +385,12 @@ } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -415,7 +414,7 @@ "rest", "web service" ], - "time": "2018-06-14T22:09:16+00:00" + "time": "2019-01-14T15:11:47+00:00" }, { "name": "guzzlehttp/promises", @@ -423,12 +422,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "136531aa4e42f9b1971a47fb0faf60da00d2fefa" + "reference": "926eaa3ff73cde2becf652b785831bcb7618568a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/136531aa4e42f9b1971a47fb0faf60da00d2fefa", - "reference": "136531aa4e42f9b1971a47fb0faf60da00d2fefa", + "url": "https://api.github.com/repos/guzzle/promises/zipball/926eaa3ff73cde2becf652b785831bcb7618568a", + "reference": "926eaa3ff73cde2becf652b785831bcb7618568a", "shasum": "" }, "require": { @@ -466,7 +465,7 @@ "keywords": [ "promise" ], - "time": "2018-03-25T01:26:01+00:00" + "time": "2018-10-30T00:20:04+00:00" }, { "name": "guzzlehttp/psr7", @@ -474,24 +473,28 @@ "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "58f6e264ef0e4107c8b3d15a9c2e653b2bce0b4d" + "reference": "31ea59d632d3ac145300fffb2873a195172c0814" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/58f6e264ef0e4107c8b3d15a9c2e653b2bce0b4d", - "reference": "58f6e264ef0e4107c8b3d15a9c2e653b2bce0b4d", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/31ea59d632d3ac145300fffb2873a195172c0814", + "reference": "31ea59d632d3ac145300fffb2873a195172c0814", "shasum": "" }, "require": { "php": ">=5.4.0", "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { @@ -526,13 +529,14 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2018-06-08T08:55:26+00:00" + "time": "2019-02-20T09:29:56+00:00" }, { "name": "mtdowling/jmespath.php", @@ -641,23 +645,23 @@ }, { "name": "ralouphie/getallheaders", - "version": "2.0.5", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + "reference": "beb49b96960f0cbf17e7fbcaaddc8eb434e126eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/beb49b96960f0cbf17e7fbcaaddc8eb434e126eb", + "reference": "beb49b96960f0cbf17e7fbcaaddc8eb434e126eb", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~3.7.0", + "phpunit/phpunit": "^5", "satooshi/php-coveralls": ">=1.0" }, "type": "library", @@ -677,7 +681,7 @@ } ], "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" + "time": "2018-12-11T21:53:24+00:00" }, { "name": "yiisoft/yii2", @@ -685,17 +689,17 @@ "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-framework.git", - "reference": "a741165ee91603518286fc28d4ee273ae3a0ef60" + "reference": "f6921f4a8626d3ba37b71d5ed692ba87170ab3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/a741165ee91603518286fc28d4ee273ae3a0ef60", - "reference": "a741165ee91603518286fc28d4ee273ae3a0ef60", + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/f6921f4a8626d3ba37b71d5ed692ba87170ab3c9", + "reference": "f6921f4a8626d3ba37b71d5ed692ba87170ab3c9", "shasum": "" }, "require": { "bower-asset/inputmask": "~3.2.2 | ~3.3.5", - "bower-asset/jquery": "3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", + "bower-asset/jquery": "3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", "bower-asset/punycode": "1.3.*", "bower-asset/yii2-pjax": "~2.0.1", "cebe/markdown": "~1.0.0 | ~1.1.0 | ~1.2.0", @@ -777,7 +781,7 @@ "framework", "yii2" ], - "time": "2018-06-14T17:23:10+00:00" + "time": "2019-02-17T15:33:29+00:00" }, { "name": "yiisoft/yii2-composer", @@ -785,19 +789,20 @@ "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-composer.git", - "reference": "884efe0ba2c1619e345da3388dead094ccbea616" + "reference": "2caf2e7c6127085315d43d5034326f7bdf83b6a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/884efe0ba2c1619e345da3388dead094ccbea616", - "reference": "884efe0ba2c1619e345da3388dead094ccbea616", + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/2caf2e7c6127085315d43d5034326f7bdf83b6a6", + "reference": "2caf2e7c6127085315d43d5034326f7bdf83b6a6", "shasum": "" }, "require": { "composer-plugin-api": "^1.0" }, "require-dev": { - "composer/composer": "^1.0" + "composer/composer": "^1.0", + "phpunit/phpunit": "<7" }, "type": "composer-plugin", "extra": { @@ -831,38 +836,39 @@ "extension installer", "yii2" ], - "time": "2018-05-04T21:18:11+00:00" + "time": "2019-02-18T10:24:42+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "16ca33ecc67a625de250f476531dfe5de4c32ff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/16ca33ecc67a625de250f476531dfe5de4c32ff2", + "reference": "16ca33ecc67a625de250f476531dfe5de4c32ff2", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^5.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-shim": "^0.9.2", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -882,12 +888,12 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2019-02-20T06:21:04+00:00" }, { "name": "flow/jsonpath", @@ -895,12 +901,12 @@ "source": { "type": "git", "url": "https://github.com/FlowCommunications/JSONPath.git", - "reference": "2909fcad962cd933dfe392febda53eee54e81235" + "reference": "099214730f4d279a00697442c93b4a89215191c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/2909fcad962cd933dfe392febda53eee54e81235", - "reference": "2909fcad962cd933dfe392febda53eee54e81235", + "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/099214730f4d279a00697442c93b4a89215191c9", + "reference": "099214730f4d279a00697442c93b4a89215191c9", "shasum": "" }, "require": { @@ -928,7 +934,7 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2018-03-04T16:41:37+00:00" + "time": "2018-11-07T14:21:34+00:00" }, { "name": "fzaninotto/faker", @@ -936,12 +942,12 @@ "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "c0f369a281700a1e92f2fdf1ea8b0609cf8766bd" + "reference": "76b1c25e614c5e09adeb62f1b953536697a41a4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/c0f369a281700a1e92f2fdf1ea8b0609cf8766bd", - "reference": "c0f369a281700a1e92f2fdf1ea8b0609cf8766bd", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/76b1c25e614c5e09adeb62f1b953536697a41a4b", + "reference": "76b1c25e614c5e09adeb62f1b953536697a41a4b", "shasum": "" }, "require": { @@ -955,7 +961,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -978,29 +984,32 @@ "faker", "fixtures" ], - "time": "2018-06-18T15:52:10+00:00" + "time": "2019-01-09T06:29:58+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -1023,20 +1032,20 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "phar-io/manifest", - "version": "dev-master", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "014feadb268809af7c8e2f7ccd396b8494901f58" + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/014feadb268809af7c8e2f7ccd396b8494901f58", - "reference": "014feadb268809af7c8e2f7ccd396b8494901f58", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", "shasum": "" }, "require": { @@ -1078,7 +1087,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-04-07T07:07:10+00:00" + "time": "2017-03-05T18:14:27+00:00" }, { "name": "phar-io/version", @@ -1378,12 +1387,12 @@ "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "6471ce6aa91ec03e9fdf3ca188e277104d8a7d1c" + "reference": "7e272180527c34a97680de85eb5aba0847a664e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6471ce6aa91ec03e9fdf3ca188e277104d8a7d1c", - "reference": "6471ce6aa91ec03e9fdf3ca188e277104d8a7d1c", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/7e272180527c34a97680de85eb5aba0847a664e0", + "reference": "7e272180527c34a97680de85eb5aba0847a664e0", "shasum": "" }, "require": { @@ -1400,12 +1409,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -1433,7 +1442,7 @@ "spy", "stub" ], - "time": "2018-05-09T14:00:54+00:00" + "time": "2018-12-18T15:40:51+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1774,12 +1783,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce" + "reference": "13862f9c620ffbc8895792abe2a9e473326fb905" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3eaf040f20154d27d6da59ca2c6e28ac8fd56dce", - "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/13862f9c620ffbc8895792abe2a9e473326fb905", + "reference": "13862f9c620ffbc8895792abe2a9e473326fb905", "shasum": "" }, "require": { @@ -1792,7 +1801,7 @@ "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^6.5" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -1825,7 +1834,8 @@ "mock", "xunit" ], - "time": "2018-05-29T13:50:43+00:00" + "abandoned": true, + "time": "2018-09-09T05:48:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1833,12 +1843,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "22f5f5ff892d51035dd1fb4cd6b224a640ffb206" + "reference": "383c44e104c1fd46ecc915f55145bd2831318747" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/22f5f5ff892d51035dd1fb4cd6b224a640ffb206", - "reference": "22f5f5ff892d51035dd1fb4cd6b224a640ffb206", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/383c44e104c1fd46ecc915f55145bd2831318747", + "reference": "383c44e104c1fd46ecc915f55145bd2831318747", "shasum": "" }, "require": { @@ -1870,7 +1880,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2018-05-15T05:52:48+00:00" + "time": "2019-02-11T12:48:46+00:00" }, { "name": "sebastian/comparator", @@ -2003,7 +2013,7 @@ "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { "phpunit/phpunit": "^6.1" @@ -2044,12 +2054,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "20962714658cf74b1d293a98a30ec108e2e81ca9" + "reference": "8be786b3b65fbe706733d44a4b4a53d5391a4772" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/20962714658cf74b1d293a98a30ec108e2e81ca9", - "reference": "20962714658cf74b1d293a98a30ec108e2e81ca9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/8be786b3b65fbe706733d44a4b4a53d5391a4772", + "reference": "8be786b3b65fbe706733d44a4b4a53d5391a4772", "shasum": "" }, "require": { @@ -2103,7 +2113,7 @@ "export", "exporter" ], - "time": "2018-05-15T05:51:07+00:00" + "time": "2019-02-11T12:49:46+00:00" }, { "name": "sebastian/global-state", @@ -2120,7 +2130,9 @@ "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -2162,12 +2174,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "06d95dc84f06fc6cc246b8bf48facebcf0fe8069" + "reference": "41af86e2a7b06e7e364c81a705b1f7caf6110218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/06d95dc84f06fc6cc246b8bf48facebcf0fe8069", - "reference": "06d95dc84f06fc6cc246b8bf48facebcf0fe8069", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/41af86e2a7b06e7e364c81a705b1f7caf6110218", + "reference": "41af86e2a7b06e7e364c81a705b1f7caf6110218", "shasum": "" }, "require": { @@ -2201,7 +2213,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2018-05-15T05:52:18+00:00" + "time": "2019-02-11T12:50:05+00:00" }, { "name": "sebastian/object-reflector", @@ -2209,12 +2221,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "7707193304715e3caddf28fc73c02c12ed6f350c" + "reference": "fae17b5d19ab523c9e821e5559d27e4c8a5bdee1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/7707193304715e3caddf28fc73c02c12ed6f350c", - "reference": "7707193304715e3caddf28fc73c02c12ed6f350c", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/fae17b5d19ab523c9e821e5559d27e4c8a5bdee1", + "reference": "fae17b5d19ab523c9e821e5559d27e4c8a5bdee1", "shasum": "" }, "require": { @@ -2246,7 +2258,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2018-05-15T05:50:44+00:00" + "time": "2019-02-11T12:48:12+00:00" }, { "name": "sebastian/recursion-context", @@ -2254,12 +2266,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "dbe1869c13935c6080c834fc61424834b9ad5907" + "reference": "87b0893f697db6d75943e26d50bf91c82796a371" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/dbe1869c13935c6080c834fc61424834b9ad5907", - "reference": "dbe1869c13935c6080c834fc61424834b9ad5907", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/87b0893f697db6d75943e26d50bf91c82796a371", + "reference": "87b0893f697db6d75943e26d50bf91c82796a371", "shasum": "" }, "require": { @@ -2299,7 +2311,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2018-05-15T05:52:05+00:00" + "time": "2019-02-11T12:48:28+00:00" }, { "name": "sebastian/resource-operations", @@ -2316,7 +2328,7 @@ "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { @@ -2392,12 +2404,12 @@ "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "8a457eb0e3dcd366b85fd0ee1e6509cf17e47814" + "reference": "4665f6411253f737658f9aae12e6cafd3ca26b13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/8a457eb0e3dcd366b85fd0ee1e6509cf17e47814", - "reference": "8a457eb0e3dcd366b85fd0ee1e6509cf17e47814", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4665f6411253f737658f9aae12e6cafd3ca26b13", + "reference": "4665f6411253f737658f9aae12e6cafd3ca26b13", "shasum": "" }, "require": { @@ -2462,7 +2474,7 @@ "phpcs", "standards" ], - "time": "2018-02-11T23:06:14+00:00" + "time": "2018-11-07T22:53:13+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2470,12 +2482,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "9d31bef82d2e9b033f335d60b96611757f98c605" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/9d31bef82d2e9b033f335d60b96611757f98c605", - "reference": "9d31bef82d2e9b033f335d60b96611757f98c605", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -2487,7 +2499,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2520,24 +2532,24 @@ "polyfill", "portable" ], - "time": "2018-05-17T18:32:56+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/yaml", - "version": "3.4.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" + "reference": "9744e5991d1436620c3d01b507160b31803546f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9744e5991d1436620c3d01b507160b31803546f3", + "reference": "9744e5991d1436620c3d01b507160b31803546f3", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -2552,7 +2564,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2579,7 +2591,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-03T23:18:14+00:00" + "time": "2019-01-25T20:45:15+00:00" }, { "name": "theseer/tokenizer", @@ -2623,20 +2635,21 @@ }, { "name": "webmozart/assert", - "version": "dev-master", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "53927dddf3afa2088b355188e143bba42159bf5d" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/53927dddf3afa2088b355188e143bba42159bf5d", - "reference": "53927dddf3afa2088b355188e143bba42159bf5d", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -2669,11 +2682,11 @@ "check", "validate" ], - "time": "2018-05-29T14:25:02+00:00" + "time": "2018-12-25T11:19:39+00:00" }, { "name": "yiisoft/yii2-coding-standards", - "version": "dev-master", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-coding-standards.git", @@ -2749,7 +2762,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": ">=7.2" }, "platform-dev": [] } diff --git a/phpunit.xml b/phpunit.xml index c39edb3..e866141 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -4,4 +4,9 @@ ./test + + + ./src + + \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..4cf0130 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=urbanindo_yii2-dynamodb +sonar.sources=./src +sonar.php.coverage.reportPaths=reports/clover.xml diff --git a/src/ActiveDataProvider.php b/src/ActiveDataProvider.php index 21aa3c0..70b0478 100644 --- a/src/ActiveDataProvider.php +++ b/src/ActiveDataProvider.php @@ -70,7 +70,7 @@ public function init() { parent::init(); if (is_string($this->db)) { - $this->db = Instance::ensure($this->db, Connection::className()); + $this->db = Instance::ensure($this->db, Connection::class); } } @@ -140,7 +140,7 @@ protected function prepareModels() $models = $query->all($this->db); if ($pagination !== false) { $peek = current(array_slice($models, -1)); - + if ($peek != null) { /* @var $peek ActiveRecord */ $nextLastKey = ArrayHelper::getValue($peek->getResponseData(), 'LastEvaluatedKey'); diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index 9228e56..cc4b55c 100644 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -98,7 +98,7 @@ public static function tableName() */ public static function find($options = []) { - return Yii::createObject(ActiveQuery::className(), [ + return Yii::createObject(ActiveQuery::class, [ get_called_class(), $options ]); diff --git a/src/Connection.php b/src/Connection.php index 17e3807..32bfaa4 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -30,7 +30,7 @@ class Connection extends \yii\base\Component * @var DynamoDbClient */ protected $_client; - + /** * The query builder. * @var QueryBuilder @@ -65,7 +65,7 @@ public function getClient() public function createCommand(array $config = []) { $command = Yii::createObject(array_merge($config, [ - 'class' => Command::className(), + 'class' => Command::class, 'db' => $this ])); return $command; diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index 8815590..a6af9d2 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -668,12 +668,25 @@ public function buildInCondition($operator, $operands, &$params) return $operator === 'IN' ? '0=1' : ''; } $values = (array) $values; - if (count($column) > 1) { + if (is_array($column) && count($column) > 1) { return $this->buildCompositeInCondition($operator, $column, $values, $params); } if (is_array($column)) { $column = reset($column); } + return $this->buildInConditionMultiple($operator, $values, $column, $params); + } + + /** + * @param string $operator + * @param array $values + * @param string $column + * @param mixed $params + * @return string + * @throws Exception + */ + private function buildInConditionMultiple($operator, $values, $column, &$params) + { foreach ($values as $i => $value) { if (is_array($value)) { $value = isset($value[$column]) ? $value[$column] : null;