From e3a4bf943894bf061224afb4ff45c9e4e2b45509 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 25 Sep 2018 16:16:01 +0200 Subject: [PATCH 01/63] fix the build --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d105816..22d83a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND noninteractive # Install Dependencies RUN apt-get update \ - && apt-get install unzip git unixODBC-dev libpq-dev -y + && apt-get install unzip git unixodbc unixodbc-dev libpq-dev -y RUN docker-php-ext-install pdo_pgsql pdo_mysql RUN pecl install xdebug \ From bd691dcbd68bfb037794f8faf08d441f3b03bc60 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 25 Sep 2018 16:16:44 +0200 Subject: [PATCH 02/63] update to db-extractor-common 5.3.2 --- composer.json | 2 +- composer.lock | 358 ++++++++++++++++++++++++++------------------------ 2 files changed, 186 insertions(+), 174 deletions(-) diff --git a/composer.json b/composer.json index b54d14d..73ed6be 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": ">=5.6", - "keboola/db-extractor-common": "~5.2", + "keboola/db-extractor-common": "~5.3", "keboola/php-temp": "^0.1.6", "keboola/php-csv-db-import": "~2.3.0", "squizlabs/php_codesniffer": "^2.6", diff --git a/composer.lock b/composer.lock index 2c93f90..e32dca5 100644 --- a/composer.lock +++ b/composer.lock @@ -1,23 +1,23 @@ { "_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": "6de760d3b2a19b7030f9868832cb96d7", + "content-hash": "6c3c98f6b89af5903fbdd2d662dbdc56", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.52.13", + "version": "3.67.18", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "6d2f46b55a9620e41e2fc71eb9993d43ebb352c7" + "reference": "590d47c6f2b07d665737e02ef3b6cee3155e12a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6d2f46b55a9620e41e2fc71eb9993d43ebb352c7", - "reference": "6d2f46b55a9620e41e2fc71eb9993d43ebb352c7", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/590d47c6f2b07d665737e02ef3b6cee3155e12a8", + "reference": "590d47c6f2b07d665737e02ef3b6cee3155e12a8", "shasum": "" }, "require": { @@ -84,20 +84,20 @@ "s3", "sdk" ], - "time": "2018-02-20T20:46:59+00:00" + "time": "2018-09-24T21:19:19+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { @@ -107,7 +107,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "psr/log": "^1.0" }, "suggest": { @@ -116,7 +116,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -149,7 +149,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", @@ -300,21 +300,21 @@ }, { "name": "keboola/db-extractor-common", - "version": "5.3.1", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/keboola/db-extractor-common.git", - "reference": "7df4dfb44ec37cd1699bc57349d85f7d10bc9ef0" + "reference": "9ec7ddd6057cd84a4bf391ff98a1f3e73700a1fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/keboola/db-extractor-common/zipball/7df4dfb44ec37cd1699bc57349d85f7d10bc9ef0", - "reference": "7df4dfb44ec37cd1699bc57349d85f7d10bc9ef0", + "url": "https://api.github.com/repos/keboola/db-extractor-common/zipball/9ec7ddd6057cd84a4bf391ff98a1f3e73700a1fd", + "reference": "9ec7ddd6057cd84a4bf391ff98a1f3e73700a1fd", "shasum": "" }, "require": { "keboola/csv": "^1.1", - "keboola/php-datatypes": "^2.0.1", + "keboola/php-datatypes": "^3.2", "keboola/ssh-tunnel": "^1.0", "monolog/monolog": "^1.17", "nette/utils": "^2.4", @@ -342,7 +342,7 @@ "email": "miro@keboola.com" } ], - "time": "2018-01-29T09:58:19+00:00" + "time": "2018-09-25T13:36:49+00:00" }, { "name": "keboola/php-csv-db-import", @@ -385,21 +385,21 @@ }, { "name": "keboola/php-datatypes", - "version": "2.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/keboola/php-datatypes.git", - "reference": "4da9c61e8f711123ef3c1e041564557a79c0fcf8" + "reference": "f16967a5da1b67e4a9fb38b07a1b0df3e588abb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/keboola/php-datatypes/zipball/4da9c61e8f711123ef3c1e041564557a79c0fcf8", - "reference": "4da9c61e8f711123ef3c1e041564557a79c0fcf8", + "url": "https://api.github.com/repos/keboola/php-datatypes/zipball/f16967a5da1b67e4a9fb38b07a1b0df3e588abb8", + "reference": "f16967a5da1b67e4a9fb38b07a1b0df3e588abb8", "shasum": "" }, "require-dev": { "codeclimate/php-test-reporter": "~0.4", - "phpstan/phpstan": "~0.6", + "phpstan/phpstan": "~0.9", "phpunit/phpunit": "^5.0", "squizlabs/php_codesniffer": "^2.6" }, @@ -412,11 +412,11 @@ "notification-url": "https://packagist.org/downloads/", "authors": [ { - "name": "Ondrej Hlavacek", + "name": "Ondřej Hlaváček", "email": "ondrej.hlavacek@keboola.com" } ], - "time": "2017-05-30T16:30:33+00:00" + "time": "2018-08-02T15:13:46+00:00" }, { "name": "keboola/php-temp", @@ -641,16 +641,16 @@ }, { "name": "nette/utils", - "version": "v2.5.1", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "8a85ce76298c8a8941f912b8fa3ee93ca17d2ebc" + "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/8a85ce76298c8a8941f912b8fa3ee93ca17d2ebc", - "reference": "8a85ce76298c8a8941f912b8fa3ee93ca17d2ebc", + "url": "https://api.github.com/repos/nette/utils/zipball/17b9f76f2abd0c943adfb556e56f2165460b15ce", + "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce", "shasum": "" }, "require": { @@ -719,7 +719,7 @@ "utility", "validation" ], - "time": "2018-02-19T14:42:42+00:00" + "time": "2018-09-18T10:22:16+00:00" }, { "name": "pimple/pimple", @@ -997,21 +997,22 @@ }, { "name": "symfony/config", - "version": "v3.4.4", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "72689b934d6c6ecf73eca874e98933bf055313c9" + "reference": "7b08223b7f6abd859651c56bcabf900d1627d085" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/72689b934d6c6ecf73eca874e98933bf055313c9", - "reference": "72689b934d6c6ecf73eca874e98933bf055313c9", + "url": "https://api.github.com/repos/symfony/config/zipball/7b08223b7f6abd859651c56bcabf900d1627d085", + "reference": "7b08223b7f6abd859651c56bcabf900d1627d085", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0" + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/dependency-injection": "<3.3", @@ -1019,6 +1020,7 @@ }, "require-dev": { "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", "symfony/finder": "~3.3|~4.0", "symfony/yaml": "~3.0|~4.0" }, @@ -1055,24 +1057,25 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:05:02+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.4", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e078773ad6354af38169faf31c21df0f18ace03d" + "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e078773ad6354af38169faf31c21df0f18ace03d", - "reference": "e078773ad6354af38169faf31c21df0f18ace03d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", + "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { @@ -1104,20 +1107,78 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-08-10T07:29:05+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", - "version": "v3.4.4", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "09a5172057be8fc677840e591b17f385e58c7c0d" + "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/09a5172057be8fc677840e591b17f385e58c7c0d", - "reference": "09a5172057be8fc677840e591b17f385e58c7c0d", + "url": "https://api.github.com/repos/symfony/process/zipball/4d6b125d5293cbceedc2aa10f2c71617e76262e7", + "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7", "shasum": "" }, "require": { @@ -1153,24 +1214,25 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:03:43+00:00" + "time": "2018-08-03T10:42:44+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.4", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "eab73b6c21d27ae4cd037c417618dfd4befb0bfe" + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/eab73b6c21d27ae4cd037c417618dfd4befb0bfe", - "reference": "eab73b6c21d27ae4cd037c417618dfd4befb0bfe", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" @@ -1211,20 +1273,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:05:02+00:00" + "time": "2018-08-10T07:34:36+00:00" }, { "name": "tracy/tracy", - "version": "v2.4.11", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/nette/tracy.git", - "reference": "bcb93a9d4347be8779c83b200b64ea6f52d6f9ed" + "reference": "7f670b08a7f4ed0243373f9d003d139196273861" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/tracy/zipball/bcb93a9d4347be8779c83b200b64ea6f52d6f9ed", - "reference": "bcb93a9d4347be8779c83b200b64ea6f52d6f9ed", + "url": "https://api.github.com/repos/nette/tracy/zipball/7f670b08a7f4ed0243373f9d003d139196273861", + "reference": "7f670b08a7f4ed0243373f9d003d139196273861", "shasum": "" }, "require": { @@ -1234,7 +1296,8 @@ }, "require-dev": { "nette/di": "~2.3", - "nette/tester": "~1.7" + "nette/tester": "~1.7", + "nette/utils": "~2.3" }, "suggest": { "https://nette.org/donate": "Please support Tracy via a donation" @@ -1242,7 +1305,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -1276,7 +1339,7 @@ "nette", "profiler" ], - "time": "2018-02-01T18:11:38+00:00" + "time": "2018-09-24T22:35:07+00:00" }, { "name": "vkartaviy/retry", @@ -1387,32 +1450,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1437,7 +1500,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "guzzle/guzzle", @@ -1634,29 +1697,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -1675,7 +1744,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-10T14:09:06+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1726,33 +1795,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.5", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -1785,7 +1854,7 @@ "spy", "stub" ], - "time": "2018-02-19T10:16:54+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2598,21 +2667,20 @@ }, { "name": "symfony/console", - "version": "v3.4.4", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "26b6f419edda16c19775211987651cb27baea7f1" + "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/26b6f419edda16c19775211987651cb27baea7f1", - "reference": "26b6f419edda16c19775211987651cb27baea7f1", + "url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f", + "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -2621,14 +2689,14 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2636,7 +2704,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2663,76 +2731,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:03:43+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "53f6af2805daf52a43b393b93d2f24925d35c937" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/53f6af2805daf52a43b393b93d2f24925d35c937", - "reference": "53f6af2805daf52a43b393b93d2f24925d35c937", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-01-18T22:16:57+00:00" + "time": "2018-07-26T11:24:31+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.34", + "version": "v2.8.45", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc" + "reference": "84ae343f39947aa084426ed1138bb96bf94d1f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d64be24fc1eba62f9daace8a8918f797fc8e87cc", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/84ae343f39947aa084426ed1138bb96bf94d1f12", + "reference": "84ae343f39947aa084426ed1138bb96bf94d1f12", "shasum": "" }, "require": { @@ -2779,20 +2791,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-07-26T09:03:18+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -2804,7 +2816,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2838,29 +2850,29 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.4", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "c865551df7c17e63fc1f09f763db04387f91ae4d" + "reference": "966c982df3cca41324253dc0c7ffe76b6076b705" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/c865551df7c17e63fc1f09f763db04387f91ae4d", - "reference": "c865551df7c17e63fc1f09f763db04387f91ae4d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/966c982df3cca41324253dc0c7ffe76b6076b705", + "reference": "966c982df3cca41324253dc0c7ffe76b6076b705", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2887,7 +2899,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-07-26T11:00:49+00:00" }, { "name": "webmozart/assert", From 66ac45570bc7aad10441215d9f89281a0a2cfd47 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 14:05:03 +0200 Subject: [PATCH 03/63] tests for json config support --- tests/AbstractSnowflakeTest.php | 8 ++++ tests/SnowflakeEntrypointTest.php | 46 +++++++++++++------ .../data/getTablesAction/config.template.yml | 29 ++++++++++++ 3 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 tests/data/getTablesAction/config.template.yml diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index 5a8ef65..2bca452 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -258,4 +258,12 @@ protected function countTable(CsvFile $file) return $linesCount; } + + public function configTypesProvider(): array + { + return [ + ['yaml'], + ['json'], + ]; + } } diff --git a/tests/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php index dba052b..33971a7 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -1,12 +1,13 @@ getEnv($driver, 'DB_SCHEMA'); } - file_put_contents($rootPath . '/config.yml', Yaml::dump($config)); - - return new \SplFileInfo($rootPath . '/config.yml'); + // unlink any old configs written here + @unlink($rootPath . '/config.yml'); + @unlink($rootPath . '/config.json'); + + if ($configType === 'yaml') { + file_put_contents($rootPath . '/config.yml', Yaml::dump($config)); + } else if ($configType === 'json') { + file_put_contents($rootPath . '/config.json', json_encode($config)); + } else { + throw new UserException(sprintf("Unsupported configType [%s]", $configType)); + } } - public function testRunAction() + /** + * @param $configType + * @dataProvider configTypesProvider + */ + public function testRunAction(string $configType) { $dataPath = __DIR__ . '/data/runAction'; @@ -40,7 +53,7 @@ public function testRunAction() @unlink($dataPath . "/out/tables/in.c-main_tableColumns.csv.gz"); @unlink($dataPath . "/out/tables/in.c-main_tableColumns.csv.gz.manifest"); - $this->createConfigFile($dataPath); + $this->createConfigFile($dataPath, $configType); $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->setTimeout(300); @@ -54,11 +67,15 @@ public function testRunAction() $this->assertFileExists($dataPath . "/out/tables/in_c-main_tableColumns.csv.gz.manifest"); } - public function testConnectionAction() + /** + * @param $configType + * @dataProvider configTypesProvider + */ + public function testConnectionAction(string $configType) { $dataPath = __DIR__ . '/data/connectionAction'; - $this->createConfigFile($dataPath); + $this->createConfigFile($dataPath, $configType); $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->run(); @@ -87,13 +104,14 @@ public function testNonexistingTable() $this->assertEquals(1, $process->getExitCode()); } - public function testGetTablesAction() + /** + * @param $configType + * @dataProvider configTypesProvider + */ + public function testGetTablesAction(string $configType) { - $config = $this->getConfig(); - @unlink($this->dataDir . '/config.yml'); - $config['action'] = 'getTables'; - file_put_contents($this->dataDir . '/config.yml', Yaml::dump($config)); - + $this->createConfigFile(__DIR__ . '/data/getTablesAction', $configType); + $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $this->dataDir); $process->setTimeout(300); $process->run(); diff --git a/tests/data/getTablesAction/config.template.yml b/tests/data/getTablesAction/config.template.yml new file mode 100644 index 0000000..03474c9 --- /dev/null +++ b/tests/data/getTablesAction/config.template.yml @@ -0,0 +1,29 @@ +action: getTables +parameters: + tables: + - + id: 1 + name: sales + query: SELECT * FROM "sales" + outputTable: in.c-main.sales + incremental: false + primaryKey: null + enabled: true + - + id: 2 + name: escaping + query: SELECT * FROM "escaping" + outputTable: in.c-main.escaping + incremental: false + primaryKey: + - col1 + enabled: true + - + id: 3 + name: somedata + query: SELECT * FROM "somedata" + outputTable: in.c-main.somedata + incremental: true + primaryKey: + - somedataId + enabled: false From ae7ed776362c328c98aeda1709f63b8ad35b6140 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 14:05:12 +0200 Subject: [PATCH 04/63] ignore temp json configurations --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index b0544dc..869584e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,14 @@ test.php tests/data/config.yml tests/data/out/ tests/data/connectionAction/config.yml +tests/data/connectionAction/config.json tests/data/connectionAction/out/ tests/data/runAction/config.yml +tests/data/runAction/config.json tests/data/runAction/out/ +tests/data/getTablesAction/config.yml +tests/data/getTablesAction/config.json +tests/data/getTablesAction/out/ snowflake_linux_x8664_odbc.tgz snowsql-linux_x86_64.bash snowflake-odbc-x86_64.deb From 30bcc55ae2e23eb782b699fe3b10dfe09abe8bdb Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 14:08:15 +0200 Subject: [PATCH 05/63] Support json configurations --- run.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/run.php b/run.php index d3a62e7..4c488c6 100644 --- a/run.php +++ b/run.php @@ -21,12 +21,20 @@ throw new UserException('Data folder not set.'); } - $app = new SnowflakeApplication( - Yaml::parse( + if (file_exists($arguments["data"] . "/config.yml")) { + $config = Yaml::parse( file_get_contents($arguments["data"] . "/config.yml") - ), - $arguments["data"] - ); + ); + } else if (file_exists($arguments["data"] . "/config.json")) { + $config = json_decode( + file_get_contents($arguments["data"] . "/config.json"), + true + ); + } else { + throw new UserException('Invalid configuration file type'); + } + + $app = new SnowflakeApplication($config, $arguments["data"]); if ($app['action'] !== 'run') { $app['logger']->setHandlers(array(new NullHandler(Logger::INFO))); From 4d98fee7a91a145130f876507d2576d7b2cccd29 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 15:25:47 +0200 Subject: [PATCH 06/63] fix getTables run test --- tests/SnowflakeEntrypointTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php index 33971a7..39fd9e5 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -23,6 +23,7 @@ private function createConfigFile(string $rootPath, string $configType = 'yaml') if (isset($config['parameters']['tables'][2]['table'])) { $config['parameters']['tables'][2]['table']['schema'] = $this->getEnv($driver, 'DB_SCHEMA'); } + // unlink any old configs written here @unlink($rootPath . '/config.yml'); @unlink($rootPath . '/config.json'); @@ -110,9 +111,11 @@ public function testNonexistingTable() */ public function testGetTablesAction(string $configType) { - $this->createConfigFile(__DIR__ . '/data/getTablesAction', $configType); + $dataPath = __DIR__ . '/data/getTablesAction'; + + $this->createConfigFile($dataPath, $configType); - $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $this->dataDir); + $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath); $process->setTimeout(300); $process->run(); From 4babb76f8551421fe95bdf12ae1a396d0bee393c Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 15:46:09 +0200 Subject: [PATCH 07/63] use exception handling as in php-component --- run.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/run.php b/run.php index 4c488c6..8c24973 100644 --- a/run.php +++ b/run.php @@ -51,20 +51,20 @@ exit(0); } catch (UserException $e) { $logger->log('error', $e->getMessage(), (array) $e->getData()); - if (!$runAction) { echo $e->getMessage(); } - exit(1); -} catch (ApplicationException $e) { - $logger->log('error', $e->getMessage(), (array) $e->getData()); - exit(2); -} catch (\Exception $e) { - $logger->log('error', $e->getMessage(), [ - 'errFile' => $e->getFile(), - 'errLine' => $e->getLine(), - 'trace' => $e->getTrace() - ]); +} catch (\Throwable $e) { + $logger->critical( + get_class($e) . ':' . $e->getMessage(), + [ + 'errFile' => $e->getFile(), + 'errLine' => $e->getLine(), + 'errCode' => $e->getCode(), + 'errTrace' => $e->getTraceAsString(), + 'errPrevious' => $e->getPrevious() ? get_class($e->getPrevious()) : '', + ] + ); exit(2); } From c064ff29bed64c504e923b6eae677f970460f715 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 16:11:41 +0200 Subject: [PATCH 08/63] update to common 9.1.* --- composer.json | 10 +- composer.lock | 250 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 232 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 73ed6be..c88e3a4 100644 --- a/composer.json +++ b/composer.json @@ -6,14 +6,14 @@ "keywords": ["keboola", "snowflake", "db", "extractor"], "authors": [ { - "name": "Erik Žigo", - "email": "erik@keboola.com" + "name": "Keboola", + "email": "devel@keboola.com" } ], "require": { - "php": ">=5.6", - "keboola/db-extractor-common": "~5.3", - "keboola/php-temp": "^0.1.6", + "php": ">=7.1", + "keboola/db-extractor-common": "~9.1", + "keboola/php-temp": "^1.0", "keboola/php-csv-db-import": "~2.3.0", "squizlabs/php_codesniffer": "^2.6", "vkartaviy/retry": "^0.2" diff --git a/composer.lock b/composer.lock index e32dca5..adace47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6c3c98f6b89af5903fbdd2d662dbdc56", + "content-hash": "1f1d1ede73b41b70d51a87b72561e9d8", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.67.18", + "version": "3.67.19", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "590d47c6f2b07d665737e02ef3b6cee3155e12a8" + "reference": "8575c7470c301fd7f2ed25e78bf23198db68c1cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/590d47c6f2b07d665737e02ef3b6cee3155e12a8", - "reference": "590d47c6f2b07d665737e02ef3b6cee3155e12a8", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8575c7470c301fd7f2ed25e78bf23198db68c1cf", + "reference": "8575c7470c301fd7f2ed25e78bf23198db68c1cf", "shasum": "" }, "require": { @@ -84,7 +84,7 @@ "s3", "sdk" ], - "time": "2018-09-24T21:19:19+00:00" + "time": "2018-09-25T20:15:23+00:00" }, { "name": "guzzlehttp/guzzle", @@ -300,34 +300,39 @@ }, { "name": "keboola/db-extractor-common", - "version": "5.3.2", + "version": "9.1.11", "source": { "type": "git", "url": "https://github.com/keboola/db-extractor-common.git", - "reference": "9ec7ddd6057cd84a4bf391ff98a1f3e73700a1fd" + "reference": "a67d229d9672158ffb349cb3c5f24029e68bc570" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/keboola/db-extractor-common/zipball/9ec7ddd6057cd84a4bf391ff98a1f3e73700a1fd", - "reference": "9ec7ddd6057cd84a4bf391ff98a1f3e73700a1fd", + "url": "https://api.github.com/repos/keboola/db-extractor-common/zipball/a67d229d9672158ffb349cb3c5f24029e68bc570", + "reference": "a67d229d9672158ffb349cb3c5f24029e68bc570", "shasum": "" }, "require": { "keboola/csv": "^1.1", "keboola/php-datatypes": "^3.2", + "keboola/php-utils": "^2.3", "keboola/ssh-tunnel": "^1.0", "monolog/monolog": "^1.17", "nette/utils": "^2.4", - "php": ">=5.6", + "php": ">=7.1", "pimple/pimple": "^3.0", "symfony/config": "^3.0", "symfony/process": "^3.0", - "symfony/yaml": "^3.0" + "symfony/serializer": "^3.1", + "symfony/yaml": "^3.0", + "vkartaviy/retry": "^0.2" }, "require-dev": { + "aws/aws-sdk-php": "^3.67", + "keboola/coding-standard": "^2.0", "phpstan/phpstan": "^0.8", - "phpunit/phpunit": "4.6.*", - "squizlabs/php_codesniffer": "^2.6" + "phpunit/phpunit": "^5.0", + "symfony/finder": "*" }, "type": "library", "autoload": { @@ -336,13 +341,17 @@ } }, "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], "authors": [ { - "name": "Miroslav Cillik", - "email": "miro@keboola.com" + "name": "keboola", + "email": "devel@keboola.com" } ], - "time": "2018-09-25T13:36:49+00:00" + "description": "Common library from Keboola Database Extractors", + "time": "2018-09-22T12:54:02+00:00" }, { "name": "keboola/php-csv-db-import", @@ -420,16 +429,16 @@ }, { "name": "keboola/php-temp", - "version": "0.1.6", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/keboola/php-temp.git", - "reference": "ffe345e78ba0d35d970fc26fe2c1a36f7d20ca8c" + "reference": "2e3c2fc4cce8536a84cbad2a1586eb2eaebe5d3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/keboola/php-temp/zipball/ffe345e78ba0d35d970fc26fe2c1a36f7d20ca8c", - "reference": "ffe345e78ba0d35d970fc26fe2c1a36f7d20ca8c", + "url": "https://api.github.com/repos/keboola/php-temp/zipball/2e3c2fc4cce8536a84cbad2a1586eb2eaebe5d3b", + "reference": "2e3c2fc4cce8536a84cbad2a1586eb2eaebe5d3b", "shasum": "" }, "require": { @@ -465,7 +474,73 @@ "filesystem", "temp" ], - "time": "2016-03-23T17:48:01+00:00" + "time": "2017-11-13T13:02:19+00:00" + }, + { + "name": "keboola/php-utils", + "version": "2.3.1", + "source": { + "type": "git", + "url": "https://github.com/keboola/php-utils.git", + "reference": "ec4d582994f2961bd16a6f6be40d3e8608ef5ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/keboola/php-utils/zipball/ec4d582994f2961bd16a6f6be40d3e8608ef5ec3", + "reference": "ec4d582994f2961bd16a6f6be40d3e8608ef5ec3", + "shasum": "" + }, + "require": { + "keboola/php-temp": "^1.0", + "php": ">=5.6.0", + "seld/jsonlint": "^1.4" + }, + "require-dev": { + "codeclimate/php-test-reporter": "~0.2", + "phpunit/phpunit": "~5.0", + "squizlabs/php_codesniffer": "~2.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/Keboola/Utils/jsonDecode.php", + "src/Keboola/Utils/sanitizeUtf8.php", + "src/Keboola/Utils/objectToArray.php", + "src/Keboola/Utils/formatDateTime.php", + "src/Keboola/Utils/replaceDates.php", + "src/Keboola/Utils/replaceDatesInArray.php", + "src/Keboola/Utils/buildUrl.php", + "src/Keboola/Utils/httpBuildUrl.php", + "src/Keboola/Utils/returnBytes.php", + "src/Keboola/Utils/camelize.php", + "src/Keboola/Utils/getDataFromPath.php", + "src/Keboola/Utils/isValidDateTimeString.php", + "src/Keboola/Utils/flattenArray.php", + "src/Keboola/Utils/arrayToObject.php", + "src/Keboola/Utils/isEmptyObject.php", + "src/Keboola/Utils/stripInvalidUtf16.php", + "src/Keboola/Utils/toAscii.php", + "src/Keboola/Utils/sanitizeColumnName.php" + ], + "psr-0": { + "Keboola\\Utils": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Keboola", + "email": "devel@keboola.com" + } + ], + "description": "Misc utility functions", + "keywords": [ + "utility" + ], + "time": "2018-04-11T14:40:53+00:00" }, { "name": "keboola/ssh-tunnel", @@ -917,6 +992,55 @@ ], "time": "2016-10-10T12:19:37+00:00" }, + { + "name": "seld/jsonlint", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38", + "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2018-01-24T12:46:19+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "2.9.1", @@ -1216,6 +1340,85 @@ "homepage": "https://symfony.com", "time": "2018-08-03T10:42:44+00:00" }, + { + "name": "symfony/serializer", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "40031683816470610af87c2d03ea86d1cf0f0104" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/40031683816470610af87c2d03ea86d1cf0f0104", + "reference": "40031683816470610af87c2d03ea86d1cf0f0104", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.2", + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.2|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/property-info": "~3.1|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:58:24+00:00" + }, { "name": "symfony/yaml", "version": "v3.4.15", @@ -2291,6 +2494,7 @@ "github", "test" ], + "abandoned": "php-coveralls/php-coveralls", "time": "2017-10-14T23:15:34+00:00" }, { @@ -2958,7 +3162,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6" + "php": ">=7.1" }, "platform-dev": [] } From 704d0d2f8f0077a3efaba3370660012650407017 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 16:14:07 +0200 Subject: [PATCH 09/63] replace bootstrap with autoload --- phpunit.xml.dist | 2 +- run.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3a5c07d..654cefd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="vendor/keboola/db-extractor-common/bootstrap.php"> + bootstrap="vendor/autoload.php"> diff --git a/run.php b/run.php index 8c24973..2dc72ed 100644 --- a/run.php +++ b/run.php @@ -9,7 +9,7 @@ define('APP_NAME', 'ex-db-snowflake'); define('ROOT_PATH', __DIR__); -require_once(dirname(__FILE__) . "/vendor/keboola/db-extractor-common/bootstrap.php"); +require_once(dirname(__FILE__) . "/vendor/autoload.php"); $logger = new \Keboola\DbExtractor\Logger(APP_NAME); From 520efab94a14c17b55d819d971303b973c9786ea Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 18:26:43 +0200 Subject: [PATCH 10/63] update application constructor --- src/Keboola/DbExtractor/SnowflakeApplication.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Keboola/DbExtractor/SnowflakeApplication.php b/src/Keboola/DbExtractor/SnowflakeApplication.php index 156fa5a..feda6d6 100644 --- a/src/Keboola/DbExtractor/SnowflakeApplication.php +++ b/src/Keboola/DbExtractor/SnowflakeApplication.php @@ -5,12 +5,12 @@ class SnowflakeApplication extends Application { - public function __construct(array $config, $dataDir) + public function __construct(array $config, Logger $logger, array $state, string $dataDir) { $config['parameters']['data_dir'] = $dataDir; $config['parameters']['extractor_class'] = 'Snowflake'; - parent::__construct($config); + parent::__construct($config, $logger, $state); $this->setConfigDefinition(new SnowflakeConfigDefinition()); } From c41c03833107ad2068ade7138616acf323c18037 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 26 Sep 2018 18:27:13 +0200 Subject: [PATCH 11/63] use correct datadir and app construct --- tests/AbstractSnowflakeTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index 2bca452..a059d30 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -3,6 +3,7 @@ use Keboola\Csv\CsvFile; use Keboola\Db\Import\Snowflake\Connection; +use Keboola\DbExtractor\Logger; use Keboola\DbExtractor\Test\ExtractorTest; use Keboola\StorageApi\Client; use Keboola\StorageApi\Options\FileUploadOptions; @@ -22,6 +23,8 @@ abstract class AbstractSnowflakeTest extends ExtractorTest */ protected $storageApiClient; + protected $dataDir = __DIR__ . '/data'; + public function setUp() { parent::setUp(); @@ -52,11 +55,7 @@ public function setUp() $fileSystem->remove(__DIR__ . '/tests/data/connectionAction/out'); } - /** - * @param string $driver - * @return mixed - */ - public function getConfig($driver = 'snowflake') + public function getConfig(string $driver = 'snowflake', string $format = 'json'): array { $config = parent::getConfig($driver); @@ -78,7 +77,8 @@ public function getConfig($driver = 'snowflake') */ public function createApplication(array $config) { - $app = new SnowflakeApplication($config, $this->dataDir); + $logger = new Logger('ex-db-snowflake-tests'); + $app = new SnowflakeApplication($config, $logger, [], $this->dataDir); return $app; } From 8249b181704ab306ae33f06101b07410bc9253cd Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 15:12:44 +0200 Subject: [PATCH 12/63] update method signatures --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 0862400..8d2cc9d 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -42,14 +42,14 @@ class Snowflake extends Extractor */ private $temp; - public function __construct($parameters, Logger $logger) + public function __construct(array $parameters, array $state, Logger $logger) { $this->temp = new Temp('ex-snowflake'); - parent::__construct($parameters, $logger); + parent::__construct($parameters, $state, $logger); } - public function createConnection($dbParams) + public function createConnection(array $dbParams) { $this->snowSqlConfig = $this->crateSnowSqlConfig($dbParams); @@ -99,7 +99,7 @@ public function testConnection() } } - public function export(array $table) + public function export(array $table): array { $outputTable = $table['outputTable']; @@ -110,7 +110,7 @@ public function export(array $table) return $outputTable; } - private function getColumnInfo(string $query) + private function getColumnInfo(string $query): array { // Create temporary view from the supplied query $sql = sprintf( @@ -374,7 +374,7 @@ private function dataSizeFormatted(int $bytes) return round(pow(1024, $base - floor($base)), 2) . $suffixes[(int) floor($base)]; } - public function getTables(array $tables = null) + public function getTables(?array $tables = null): array { $sql = $this->schema ? "SHOW TABLES IN SCHEMA" : "SHOW TABLES IN DATABASE"; $arr = $this->db->fetchAll($sql); @@ -449,7 +449,7 @@ public function getTables(array $tables = null) return array_values($tableDefs); } - public function simpleQuery(array $table, array $columns = array()) + public function simpleQuery(array $table, array $columns = array()): string { if (count($columns) > 0) { return sprintf( From a155f1f21a6c76e498ed3da6d6132ecc63977caf Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 15:56:33 +0200 Subject: [PATCH 13/63] update to expected sigs and outputs --- composer.lock | 14 +++++++------- run.php | 2 +- src/Keboola/DbExtractor/Extractor/Snowflake.php | 15 +++++++++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index adace47..c9527a4 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.67.19", + "version": "3.67.20", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "8575c7470c301fd7f2ed25e78bf23198db68c1cf" + "reference": "6c8bc0f42ba73bab85da67c3af9131e455c3f14c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8575c7470c301fd7f2ed25e78bf23198db68c1cf", - "reference": "8575c7470c301fd7f2ed25e78bf23198db68c1cf", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6c8bc0f42ba73bab85da67c3af9131e455c3f14c", + "reference": "6c8bc0f42ba73bab85da67c3af9131e455c3f14c", "shasum": "" }, "require": { @@ -84,7 +84,7 @@ "s3", "sdk" ], - "time": "2018-09-25T20:15:23+00:00" + "time": "2018-09-26T20:06:30+00:00" }, { "name": "guzzlehttp/guzzle", @@ -386,7 +386,7 @@ "notification-url": "https://packagist.org/downloads/", "authors": [ { - "name": "Martin Halamíček", + "name": "Martin Halamicek", "email": "martin@keboola.com" } ], @@ -574,7 +574,7 @@ ], "authors": [ { - "name": "Miroslav Cillik", + "name": "Miroslav Čillík", "email": "miro@keboola.com" } ], diff --git a/run.php b/run.php index 2dc72ed..01a7100 100644 --- a/run.php +++ b/run.php @@ -34,7 +34,7 @@ throw new UserException('Invalid configuration file type'); } - $app = new SnowflakeApplication($config, $arguments["data"]); + $app = new SnowflakeApplication($config, $logger, [], $arguments["data"]); if ($app['action'] !== 'run') { $app['logger']->setHandlers(array(new NullHandler(Logger::INFO))); diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 8d2cc9d..a0ac498 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -105,9 +105,12 @@ public function export(array $table): array $this->logger->info("Exporting to " . $outputTable); - $this->exportAndDownload($table); + $rowCount = $this->exportAndDownload($table); - return $outputTable; + return [ + "outputTable"=> $outputTable, + "rows" => $rowCount, + ]; } private function getColumnInfo(string $query): array @@ -131,7 +134,7 @@ private function getColumnInfo(string $query): array return $this->db->fetchAll("DESC RESULT LAST_QUERY_ID()"); } - private function exportAndDownload(array $table) + private function exportAndDownload(array $table): int { if (!isset($table['query']) || $table['query'] === '') { $query = $this->simpleQuery($table['table'], $table['columns']); @@ -163,9 +166,11 @@ private function exportAndDownload(array $table) if (count($res) > 0 && (int) $res[0]['rows_unloaded'] === 0) { // query resulted in no rows, nothing left to do - return; + return 0; } + $rowCount = $res[0]['rows_unloaded']; + $this->logger->info("Downloading data from Snowflake"); $outputDataDir = $this->dataDir . '/out/tables/' . $tmpTableName . ".csv.gz"; @@ -236,6 +241,8 @@ function ($column) { )); $this->cleanupTableStage($tmpTableName); + + return $rowCount; } private function generateCopyCommand($stageTmpPath, $query) From f87fefd82577139c667918afe7d5bf1669f5c4dd Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 15:56:49 +0200 Subject: [PATCH 14/63] update tests to expected sigs and outputs --- tests/SnowflakeEntrypointTest.php | 1 + tests/SnowflakeTest.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php index 39fd9e5..870a034 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -59,6 +59,7 @@ public function testRunAction(string $configType) $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->setTimeout(300); $process->run(); + $this->assertEquals(0, $process->getExitCode(), sprintf('error output: ', $process->getErrorOutput())); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz"); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz.manifest"); diff --git a/tests/SnowflakeTest.php b/tests/SnowflakeTest.php index 4dd13b2..f6c070d 100644 --- a/tests/SnowflakeTest.php +++ b/tests/SnowflakeTest.php @@ -120,7 +120,7 @@ public function testRunWithoutTables() $this->assertEquals('success', $result['status']); } - public function testRun() + public function testRunMain() { $config = $this->getConfig(); $app = $this->createApplication($config); @@ -155,16 +155,19 @@ public function testRun() array_shift($csv1arr); $outCsv1 = new CsvFile($this->dataDir . '/out/tables/in_c-main_sales.csv.gz/part_0_0_0.csv'); $this->assertEquals($csv1arr, iterator_to_array($outCsv1)); + $this->assertEquals(100, $result['imported']['0']['rows']); $csv2arr = iterator_to_array($csv2); array_shift($csv2arr); $outCsv2 = new CsvFile($this->dataDir . '/out/tables/in_c-main_escaping.csv.gz/part_0_0_0.csv'); $this->assertEquals($csv2arr, iterator_to_array($outCsv2)); + $this->assertEquals(7, $result['imported']['1']['rows']); $csv3arr = iterator_to_array($csv3); array_shift($csv3arr); $outCsv3 = new CsvFile($this->dataDir . '/out/tables/in_c-main_tableColumns.csv.gz/part_0_0_0.csv'); $this->assertEquals($csv3arr, iterator_to_array($outCsv3)); + $this->assertEquals(4, $result['imported']['2']['rows']); } public function testRunWithoutSchema() From 5e0e5db411a6b8fe7b8327305ed87b2f672d45ff Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:08:53 +0200 Subject: [PATCH 15/63] add stan and cs --- composer.json | 24 +- composer.lock | 2108 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 1616 insertions(+), 516 deletions(-) diff --git a/composer.json b/composer.json index c88e3a4..3967d57 100644 --- a/composer.json +++ b/composer.json @@ -14,15 +14,14 @@ "php": ">=7.1", "keboola/db-extractor-common": "~9.1", "keboola/php-temp": "^1.0", - "keboola/php-csv-db-import": "~2.3.0", - "squizlabs/php_codesniffer": "^2.6", - "vkartaviy/retry": "^0.2" + "keboola/php-csv-db-import": "~2.3.0" }, "require-dev": { - "phpunit/phpunit": "4.6.*", + "phpunit/phpunit": "^7.0", "codeclimate/php-test-reporter": "^0.3", + "keboola/coding-standard": "^6.0", "keboola/storage-api-client": "^4.14", - "keboola/php-csv-db-import": "~2.3.0" + "phpstan/phpstan": "^0.8" }, "autoload": { "psr-4": { @@ -33,5 +32,20 @@ "psr-4": { "Keboola\\Test\\": "tests/" } + }, + "scripts": { + "tests": "phpunit", + "phpstan": "phpstan analyse --no-progress --level=max ./src ./tests", + "phpcs": "phpcs -n --ignore=vendor --extensions=php .", + "phpcbf": "phpcbf -n --ignore=vendor --extensions=php .", + "build": [ + "@phpcs", + "@phpstan", + "@tests" + ], + "ci": [ + "@composer validate --no-check-all --strict", + "@build" + ] } } diff --git a/composer.lock b/composer.lock index c9527a4..aeb3528 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1f1d1ede73b41b70d51a87b72561e9d8", + "content-hash": "87de9b0cdaf43ca91283cfde3a776190", "packages": [ { "name": "aws/aws-sdk-php", @@ -1041,84 +1041,6 @@ ], "time": "2018-01-24T12:46:19+00:00" }, - { - "name": "squizlabs/php_codesniffer", - "version": "2.9.1", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "bin": [ - "scripts/phpcs", - "scripts/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2017-05-22T02:43:20+00:00" - }, { "name": "symfony/config", "version": "v3.4.15", @@ -1801,6 +1723,83 @@ "abandoned": "guzzlehttp/guzzle", "time": "2015-03-18T18:23:50+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "1.2", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.2.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2018-06-13T13:22:40+00:00" + }, + { + "name": "keboola/coding-standard", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/keboola/phpcs-standard.git", + "reference": "4c247e4ecf8f9c134efc6b7efe30593923415655" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/keboola/phpcs-standard/zipball/4c247e4ecf8f9c134efc6b7efe30593923415655", + "reference": "4c247e4ecf8f9c134efc6b7efe30593923415655", + "shasum": "" + }, + "require": { + "slevomat/coding-standard": "4.4.6", + "squizlabs/php_codesniffer": "^3.2" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Keboola coding standard", + "time": "2018-09-03T10:12:38+00:00" + }, { "name": "keboola/storage-api-client", "version": "4.20.1", @@ -1845,207 +1844,852 @@ "time": "2016-12-22T13:13:19+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "name": "myclabs/deep-copy", + "version": "1.8.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "name": "nette/bootstrap", + "version": "v2.4.6", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "url": "https://github.com/nette/bootstrap.git", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" + "nette/di": "~2.4.7", + "nette/utils": "~2.4", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "latte/latte": "~2.2", + "nette/application": "~2.3", + "nette/caching": "~2.3", + "nette/database": "~2.3", + "nette/forms": "~2.3", + "nette/http": "~2.4.0", + "nette/mail": "~2.3", + "nette/robot-loader": "^2.4.2 || ^3.0", + "nette/safe-stream": "~2.2", + "nette/security": "~2.3", + "nette/tester": "~2.0", + "tracy/tracy": "^2.4.1" + }, + "suggest": { + "nette/robot-loader": "to use Configurator::createRobotLoader()", + "tracy/tracy": "to use Configurator::enableTracy()" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "2.4-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", + "homepage": "https://nette.org", + "keywords": [ + "bootstrapping", + "configurator", + "nette" + ], + "time": "2018-05-17T12:52:20+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "name": "nette/di", + "version": "v2.4.14", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "url": "https://github.com/nette/di.git", + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/nette/di/zipball/923da3e2c0aa53162ef455472c0ac7787b096c5a", + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "ext-tokenizer": "*", + "nette/neon": "^2.3.3 || ~3.0.0", + "nette/php-generator": "^2.6.1 || ~3.0.0", + "nette/utils": "^2.4.3 || ~3.0.0", + "php": ">=5.6.0" + }, + "conflict": { + "nette/bootstrap": "<2.4", + "nette/nette": "<2.2" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.4-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" } ], - "time": "2017-07-14T14:27:02+00:00" + "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", + "homepage": "https://nette.org", + "keywords": [ + "compiled", + "di", + "dic", + "factory", + "ioc", + "nette", + "static" + ], + "time": "2018-09-17T15:47:40+00:00" }, { - "name": "phpspec/prophecy", - "version": "1.8.0", + "name": "nette/finder", + "version": "v2.4.2", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "url": "https://github.com/nette/finder.git", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "nette/utils": "~2.4", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "2.4-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "David Grudl", + "homepage": "https://davidgrudl.com" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🔍 Nette Finder: find files and directories with an intuitive API.", + "homepage": "https://nette.org", + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2018-06-28T11:49:23+00:00" + }, + { + "name": "nette/neon", + "version": "v2.4.3", + "source": { + "type": "git", + "url": "https://github.com/nette/neon.git", + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398", + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "ext-json": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🍸 Nette NEON: encodes and decodes NEON file format.", + "homepage": "http://ne-on.org", + "keywords": [ + "export", + "import", + "neon", + "nette", + "yaml" + ], + "time": "2018-03-21T12:12:21+00:00" + }, + { + "name": "nette/php-generator", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/nette/php-generator.git", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "shasum": "" + }, + "require": { + "nette/utils": "^2.4.2 || ~3.0.0", + "php": ">=7.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", + "homepage": "https://nette.org", + "keywords": [ + "code", + "nette", + "php", + "scaffolding" + ], + "time": "2018-08-09T14:32:27+00:00" + }, + { + "name": "nette/robot-loader", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/nette/robot-loader.git", + "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/fc76c70e740b10f091e502b2e393d0be912f38d4", + "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/finder": "^2.3 || ^3.0", + "nette/utils": "^2.4 || ^3.0", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", + "homepage": "https://nette.org", + "keywords": [ + "autoload", + "class", + "interface", + "nette", + "trait" + ], + "time": "2018-08-13T14:19:06+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2018-02-05T13:05:30+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } ], "description": "Highly opinionated mocking framework for PHP 5.3+", "homepage": "https://github.com/phpspec/prophecy", @@ -2059,41 +2703,96 @@ ], "time": "2018-08-05T17:53:17+00:00" }, + { + "name": "phpstan/phpstan", + "version": "0.8.5", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0dfb4f00959c53378cf15e32a79a254acada35d7", + "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7", + "shasum": "" + }, + "require": { + "jean85/pretty-package-versions": "^1.0.2", + "nette/bootstrap": "^2.4 || ^3.0", + "nette/di": "^2.4 || ^3.0", + "nette/robot-loader": "^3.0.1", + "nette/utils": "^2.4 || ^3.0", + "nikic/php-parser": "^3.0.2", + "php": "~7.0", + "symfony/console": "~2.7 || ~3.0", + "symfony/finder": "~2.7 || ~3.0" + }, + "require-dev": { + "consistence/coding-standard": "^2.0.0", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpunit/phpunit": "^6.3", + "satooshi/php-coveralls": "^1.0", + "slevomat/coding-standard": "^3.1.1" + }, + "bin": [ + "bin/phpstan" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.8-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2017-09-06T17:15:07+00:00" + }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "6.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -2108,7 +2807,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2119,29 +2818,32 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2018-06-01T07:51:50+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2156,7 +2858,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2166,73 +2868,317 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2018-02-01T13:07:23+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2018-02-01T13:16:43+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "7.3.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "7b331efabbb628c518c408fdfcaf571156775de2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b331efabbb628c518c408fdfcaf571156775de2", + "reference": "7b331efabbb628c518c408fdfcaf571156775de2", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-09-08T15:14:29+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "satooshi/php-coveralls", + "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "9c07b63acbc9709344948b6fd4f63a32b2ef4127" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/9c07b63acbc9709344948b6fd4f63a32b2ef4127", + "reference": "9c07b63acbc9709344948b6fd4f63a32b2ef4127", "shasum": "" }, "require": { - "php": ">=5.3.3" + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", "keywords": [ - "template" + "ci", + "coverage", + "github", + "test" ], - "time": "2015-06-21T13:50:34+00:00" + "abandoned": "php-coveralls/php-coveralls", + "time": "2017-10-14T23:15:34+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -2247,42 +3193,39 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.12", + "name": "sebastian/comparator", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2295,63 +3238,57 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ - "tokenizer" + "comparator", + "compare", + "equality" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { - "name": "phpunit/phpunit", - "version": "4.6.10", + "name": "sebastian/diff", + "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7b5fe98b28302a8b25693b2298bca74463336975" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b5fe98b28302a8b25693b2298bca74463336975", - "reference": "7b5fe98b28302a8b25693b2298bca74463336975", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", - "phpunit/php-code-coverage": "~2.0,>=2.0.11", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "php": "^7.1" }, - "suggest": { - "phpunit/php-invoker": "~1.1" + "require-dev": { + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.6.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2364,51 +3301,49 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "phpunit", - "testing", - "xunit" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2015-06-03T05:03:30+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "name": "sebastian/environment", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2423,106 +3358,112 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ - "mock", - "xunit" + "Xdebug", + "environment", + "hhvm" ], - "time": "2015-10-02T06:51:40+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { - "name": "satooshi/php-coveralls", - "version": "v1.0.2", + "name": "sebastian/exporter", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/php-coveralls/php-coveralls.git", - "reference": "9c07b63acbc9709344948b6fd4f63a32b2ef4127" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/9c07b63acbc9709344948b6fd4f63a32b2ef4127", - "reference": "9c07b63acbc9709344948b6fd4f63a32b2ef4127", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": "^2.8 || ^3.0", - "php": "^5.3.3 || ^7.0", - "psr/log": "^1.0", - "symfony/config": "^2.1 || ^3.0 || ^4.0", - "symfony/console": "^2.1 || ^3.0 || ^4.0", - "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", - "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" }, - "bin": [ - "bin/coveralls" - ], "type": "library", - "autoload": { - "psr-4": { - "Satooshi\\": "src/Satooshi/" + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/php-coveralls/php-coveralls", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ - "ci", - "coverage", - "github", - "test" + "export", + "exporter" ], - "abandoned": "php-coveralls/php-coveralls", - "time": "2017-10-14T23:15:34+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "sebastian/global-state", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2535,56 +3476,44 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "comparator", - "compare", - "equality" + "global state" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.3", + "name": "sebastian/object-enumerator", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2596,47 +3525,40 @@ "license": [ "BSD-3-Clause" ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, + "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" }, { - "name": "sebastian/environment", - "version": "1.3.8", + "name": "sebastian/object-reflector", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -2654,41 +3576,34 @@ "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-08-18T05:49:44+00:00" + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { - "name": "sebastian/exporter", - "version": "1.2.2", + "name": "sebastian/recursion-context", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2705,14 +3620,6 @@ "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" @@ -2722,41 +3629,31 @@ "email": "aharvey@php.net" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-06-17T09:04:28+00:00" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "sebastian/resource-operations", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "php": ">=5.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -2774,37 +3671,31 @@ "email": "sebastian@phpunit.de" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.5", + "name": "sebastian/version", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "php": ">=5.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2817,42 +3708,88 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" }, { - "name": "sebastian/version", - "version": "1.0.6", + "name": "slevomat/coding-standard", + "version": "4.4.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "861e7b55d348c81a9dd0b3655dbbc83076d60c05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/861e7b55d348c81a9dd0b3655dbbc83076d60c05", + "reference": "861e7b55d348c81a9dd0b3655dbbc83076d60c05", "shasum": "" }, - "type": "library", + "require": { + "php": "^7.1", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.9.2", + "phing/phing": "2.16", + "phpstan/phpstan": "0.9.2", + "phpstan/phpstan-phpunit": "0.9.4", + "phpstan/phpstan-strict-rules": "0.9", + "phpunit/php-code-coverage": "6.0.1", + "phpunit/phpunit": "7.0.0" + }, + "type": "phpcodesniffer-standard", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "time": "2018-02-15T17:13:28+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2860,31 +3797,35 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "name": "Greg Sherwood", "role": "lead" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-09-23T23:08:17+00:00" }, { "name": "symfony/console", - "version": "v4.1.4", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f" + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f", + "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -2893,11 +3834,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -2908,7 +3849,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2935,7 +3876,63 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-07-26T11:19:56+00:00" + }, + { + "name": "symfony/debug", + "version": "v4.1.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "47ead688f1f2877f3f14219670f52e4722ee7052" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/47ead688f1f2877f3f14219670f52e4722ee7052", + "reference": "47ead688f1f2877f3f14219670f52e4722ee7052", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-08-03T11:13:38+00:00" }, { "name": "symfony/event-dispatcher", @@ -2997,6 +3994,55 @@ "homepage": "https://symfony.com", "time": "2018-07-26T09:03:18+00:00" }, + { + "name": "symfony/finder", + "version": "v3.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/8a84fcb207451df0013b2c74cbbf1b62d47b999a", + "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-07-26T11:19:56+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.9.0", @@ -3105,6 +4151,46 @@ "homepage": "https://symfony.com", "time": "2018-07-26T11:00:49+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, { "name": "webmozart/assert", "version": "1.3.0", From dc47936c5125e5f57150a79363779d91953056c7 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:10:09 +0200 Subject: [PATCH 16/63] use composer ci as command --- docker-compose.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 20c5f02..a5ed102 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,7 @@ services: app: build: . image: keboola/ex-db-snowflake - tty: true - stdin_open: true + command: composer ci environment: - STORAGE_API_TOKEN - SNOWFLAKE_DB_HOST @@ -16,9 +15,7 @@ services: - SNOWFLAKE_DB_WAREHOUSE dev: image: keboola/ex-db-snowflake - tty: true - stdin_open: true - command: vendor/bin/phpunit + command: composer ci volumes: - .:/code environment: From 5b98c9c429c3a7c3088ad1b51033e517a2a379ed Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:39:21 +0200 Subject: [PATCH 17/63] add keboola cs --- phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 phpcs.xml diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..67e37cf --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,4 @@ + + + + From 2580578a707f8d174c9c54da4034979c6fb53e79 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:39:44 +0200 Subject: [PATCH 18/63] phpcbf auto corrections --- driver/downloadDriver.php | 18 +- run.php | 2 +- .../SnowflakeConfigDefinition.php | 192 +++++++++--------- .../DbExtractor/Extractor/Snowflake.php | 152 ++++++++------ tests/AbstractSnowflakeTest.php | 70 ++++--- tests/SnowflakeEntrypointTest.php | 6 +- 6 files changed, 242 insertions(+), 198 deletions(-) diff --git a/driver/downloadDriver.php b/driver/downloadDriver.php index f27a3a8..7b1ff2e 100644 --- a/driver/downloadDriver.php +++ b/driver/downloadDriver.php @@ -7,23 +7,29 @@ require_once $basedir . '/vendor/autoload.php'; -$client = new \Aws\S3\S3Client([ +$client = new \Aws\S3\S3Client( + [ 'region' => 'us-east-1', 'version' => '2006-03-01', 'credentials' => [ 'key' => getenv('AWS_ACCESS_KEY'), 'secret' => getenv('AWS_SECRET_KEY'), ], -]); + ] +); -$client->getObject([ +$client->getObject( + [ 'Bucket' => 'keboola-configs', 'Key' => 'drivers/snowflake/snowflake-odbc-2.13.17.x86_64.deb', 'SaveAs' => './snowflake-odbc-x86_64.deb' -]); + ] +); -$client->getObject([ +$client->getObject( + [ 'Bucket' => 'keboola-configs', 'Key' => 'drivers/snowflake-snowsql/snowsql-1.1.50-linux_x86_64.bash', 'SaveAs' => './snowsql-linux_x86_64.bash' -]); + ] +); diff --git a/run.php b/run.php index 01a7100..175d821 100644 --- a/run.php +++ b/run.php @@ -9,7 +9,7 @@ define('APP_NAME', 'ex-db-snowflake'); define('ROOT_PATH', __DIR__); -require_once(dirname(__FILE__) . "/vendor/autoload.php"); +require_once dirname(__FILE__) . "/vendor/autoload.php"; $logger = new \Keboola\DbExtractor\Logger(APP_NAME); diff --git a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php index 5fa06f9..cf80c4b 100644 --- a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php +++ b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php @@ -18,81 +18,80 @@ public function getConfigTreeBuilder() $rootNode ->children() - ->scalarNode('data_dir') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('extractor_class') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->arrayNode('db') - ->children() - ->scalarNode('driver')->end() - ->scalarNode('host') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('port')->end() - ->scalarNode('warehouse')->end() - ->scalarNode('database') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('schema')->end() - ->scalarNode('user') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('password')->end() - ->scalarNode('#password')->end() - ->append($this->addSshNode()) - ->end() - ->end() - ->arrayNode('tables') - ->prototype('array') - ->children() - ->integerNode('id') - ->isRequired() - ->min(0) - ->end() - ->scalarNode('name') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('query')->end() - ->arrayNode('table') - ->children() - ->scalarNode('schema')->end() - ->scalarNode('tableName')->end() - ->end() - ->end() - ->arrayNode('columns') - ->prototype('scalar') - ->end() - ->end() - ->scalarNode('outputTable') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->booleanNode('incremental') - ->defaultValue(false) - ->end() - ->booleanNode('enabled') - ->defaultValue(true) - ->end() - ->arrayNode('primaryKey') - ->prototype('scalar') - ->end() - ->end() - ->integerNode('retries') - ->min(1) - ->end() - ->end() - ->end() - ->end() - ->end() - ; + ->scalarNode('data_dir') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('extractor_class') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->arrayNode('db') + ->children() + ->scalarNode('driver')->end() + ->scalarNode('host') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('port')->end() + ->scalarNode('warehouse')->end() + ->scalarNode('database') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('schema')->end() + ->scalarNode('user') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('password')->end() + ->scalarNode('#password')->end() + ->append($this->addSshNode()) + ->end() + ->end() + ->arrayNode('tables') + ->prototype('array') + ->children() + ->integerNode('id') + ->isRequired() + ->min(0) + ->end() + ->scalarNode('name') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('query')->end() + ->arrayNode('table') + ->children() + ->scalarNode('schema')->end() + ->scalarNode('tableName')->end() + ->end() + ->end() + ->arrayNode('columns') + ->prototype('scalar') + ->end() + ->end() + ->scalarNode('outputTable') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->booleanNode('incremental') + ->defaultValue(false) + ->end() + ->booleanNode('enabled') + ->defaultValue(true) + ->end() + ->arrayNode('primaryKey') + ->prototype('scalar') + ->end() + ->end() + ->integerNode('retries') + ->min(1) + ->end() + ->end() + ->end() + ->end() + ->end(); return $treeBuilder; } @@ -104,28 +103,27 @@ public function addSshNode() $node ->children() - ->booleanNode('enabled')->end() - ->arrayNode('keys') - ->children() - ->scalarNode('private')->end() - ->scalarNode('#private')->end() - ->scalarNode('public')->end() - ->end() - ->end() - ->scalarNode('sshHost')->end() - ->scalarNode('sshPort') - ->defaultValue("22") - ->end() - ->scalarNode('remoteHost') - ->end() - ->scalarNode('remotePort') - ->end() - ->scalarNode('localPort') - ->defaultValue("33006") - ->end() - ->scalarNode('user')->end() - ->end() - ; + ->booleanNode('enabled')->end() + ->arrayNode('keys') + ->children() + ->scalarNode('private')->end() + ->scalarNode('#private')->end() + ->scalarNode('public')->end() + ->end() + ->end() + ->scalarNode('sshHost')->end() + ->scalarNode('sshPort') + ->defaultValue("22") + ->end() + ->scalarNode('remoteHost') + ->end() + ->scalarNode('remotePort') + ->end() + ->scalarNode('localPort') + ->defaultValue("33006") + ->end() + ->scalarNode('user')->end() + ->end(); return $node; } diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index a0ac498..f5ecff7 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -86,10 +86,12 @@ public function testConnection() } try { - $this->db->query(sprintf( - 'USE WAREHOUSE %s;', - $this->db->quoteIdentifier($warehouse) - )); + $this->db->query( + sprintf( + 'USE WAREHOUSE %s;', + $this->db->quoteIdentifier($warehouse) + ) + ); } catch (\Exception $e) { if (preg_match('/Object does not exist/ui', $e->getMessage())) { throw new UserException(sprintf('Invalid warehouse "%s" specified', $warehouse)); @@ -139,9 +141,11 @@ private function exportAndDownload(array $table): int if (!isset($table['query']) || $table['query'] === '') { $query = $this->simpleQuery($table['table'], $table['columns']); $columnInfo = $this->getColumnInfo($query); - $objectColumns = array_filter($columnInfo, function ($column) { - return in_array($column['type'], self::SEMI_STRUCTURED_TYPES); - }); + $objectColumns = array_filter( + $columnInfo, function ($column) { + return in_array($column['type'], self::SEMI_STRUCTURED_TYPES); + } + ); if (!empty($objectColumns)) { $query = $this->simpleQueryWithCasting($table['table'], $columnInfo); } @@ -226,19 +230,25 @@ private function exportAndDownload(array $table): int file_put_contents( $outputDataDir . '.manifest', - Yaml::dump($this->createTableManifest($table, array_map( - function ($column) { - return $column['name']; - }, - $columnInfo - ))) + Yaml::dump( + $this->createTableManifest( + $table, array_map( + function ($column) { + return $column['name']; + }, + $columnInfo + ) + ) + ) ); - $this->logger->info(sprintf( - "%d files (%s) downloaded", - count($csvFiles), - $this->dataSizeFormatted($bytesDownloaded) - )); + $this->logger->info( + sprintf( + "%d files (%s) downloaded", + count($csvFiles), + $this->dataSizeFormatted($bytesDownloaded) + ) + ); $this->cleanupTableStage($tmpTableName); @@ -272,8 +282,8 @@ private function generateCopyCommand($stageTmpPath, $query) } /** - * @param $copyCommand - * @param int $maxTries + * @param $copyCommand + * @param int $maxTries * @return array * @throws \Exception */ @@ -283,25 +293,29 @@ private function executeCopyCommand($copyCommand, $maxTries = 5): array $backOffPolicy = new ExponentialBackOffPolicy(1000); $proxy = new RetryProxy($retryPolicy, $backOffPolicy); $counter = 0; - /** @var \Exception $lastException */ + /** + * @var \Exception $lastException +*/ $lastException = null; try { - $ret = $proxy->call(function () use ($copyCommand, &$counter, &$lastException) { - if ($counter > 0) { - $this->logger->info(sprintf('%s. Retrying... [%dx]', $lastException->getMessage(), $counter)); - } - try { - return $this->db->fetchAll($copyCommand); - } catch (\Exception $e) { - $lastException = new UserException( - sprintf("Copy Command failed: %s", $e->getMessage()), - 0, - $e - ); - $counter++; - throw $e; + $ret = $proxy->call( + function () use ($copyCommand, &$counter, &$lastException) { + if ($counter > 0) { + $this->logger->info(sprintf('%s. Retrying... [%dx]', $lastException->getMessage(), $counter)); + } + try { + return $this->db->fetchAll($copyCommand); + } catch (\Exception $e) { + $lastException = new UserException( + sprintf("Copy Command failed: %s", $e->getMessage()), + 0, + $e + ); + $counter++; + throw $e; + } } - }); + ); } catch (\Exception $e) { if ($lastException) { throw $lastException; @@ -422,9 +436,13 @@ public function getTables(?array $tables = null): array "SELECT * FROM information_schema.columns WHERE TABLE_NAME IN (%s) ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION", - implode(', ', array_map(function ($tableName) { - return "'" . $tableName . "'"; - }, $tableNameArray)) + implode( + ', ', array_map( + function ($tableName) { + return "'" . $tableName . "'"; + }, $tableNameArray + ) + ) ); $columns = $this->db->fetchAll($sql); @@ -461,9 +479,13 @@ public function simpleQuery(array $table, array $columns = array()): string if (count($columns) > 0) { return sprintf( "SELECT %s FROM %s.%s", - implode(', ', array_map(function ($column) { - return $this->db->quoteIdentifier($column); - }, $columns)), + implode( + ', ', array_map( + function ($column) { + return $this->db->quoteIdentifier($column); + }, $columns + ) + ), $this->db->quoteIdentifier($table['schema']), $this->db->quoteIdentifier($table['tableName']) ); @@ -480,24 +502,28 @@ private function simpleQueryWithCasting(array $table, array $columnInfo) : strin { return sprintf( "SELECT %s FROM %s.%s", - implode(', ', array_map(function ($column) { - if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { - return sprintf( - 'CAST(%s AS TEXT) AS %s', - $this->db->quoteIdentifier($column['name']), - $this->db->quoteIdentifier($column['name']) - ); - } - return $this->db->quoteIdentifier($column['name']); - }, $columnInfo)), + implode( + ', ', array_map( + function ($column) { + if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { + return sprintf( + 'CAST(%s AS TEXT) AS %s', + $this->db->quoteIdentifier($column['name']), + $this->db->quoteIdentifier($column['name']) + ); + } + return $this->db->quoteIdentifier($column['name']); + }, $columnInfo + ) + ), $this->db->quoteIdentifier($table['schema']), $this->db->quoteIdentifier($table['tableName']) ); } /** - * @param $output - * @param $path + * @param $output + * @param $path * @return \SplFileInfo[] * @throws \Exception */ @@ -522,13 +548,15 @@ function ($item) { foreach ($lines as $line) { if (!preg_match('/^downloaded$/ui', $line[2])) { - throw new \Exception(sprintf( - "Cannot download file: %s Status: %s Size: %s Message: %s", - $line[0], - $line[2], - $line[1], - $line[3] - )); + throw new \Exception( + sprintf( + "Cannot download file: %s Status: %s Size: %s Message: %s", + $line[0], + $line[2], + $line[1], + $line[3] + ) + ); } $file = new \SplFileInfo($path . '/' . $line[0]); @@ -548,7 +576,7 @@ private function quote($value) } /** - * @param $dbParams + * @param $dbParams * @return \SplFileInfo */ private function crateSnowSqlConfig($dbParams) diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index a059d30..d708176 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -41,9 +41,11 @@ public function setUp() sprintf("USE SCHEMA %s", $this->connection->quoteIdentifier($config['parameters']['db']['schema'])) ); - $this->storageApiClient = new Client([ + $this->storageApiClient = new Client( + [ 'token' => getenv('STORAGE_API_TOKEN') - ]); + ] + ); $this->setupTables(); @@ -72,7 +74,7 @@ public function getConfig(string $driver = 'snowflake', string $format = 'json') } /** - * @param array $config + * @param array $config * @return SnowflakeApplication */ public function createApplication(array $config) @@ -84,7 +86,7 @@ public function createApplication(array $config) } /** - * @param CsvFile $file + * @param CsvFile $file * @return string */ protected function generateTableName(CsvFile $file) @@ -107,10 +109,12 @@ private function setupTables() $types = new CsvFile($this->dataDir . '/snowflake/types.csv'); - $this->connection->query(sprintf( - 'DROP TABLE IF EXISTS %s', - $this->connection->quoteIdentifier('types') - )); + $this->connection->query( + sprintf( + 'DROP TABLE IF EXISTS %s', + $this->connection->quoteIdentifier('types') + ) + ); $this->connection->query( sprintf( @@ -135,11 +139,13 @@ private function setupTables() // create a view with a json object column $this->connection->query('DROP TABLE IF EXISTS "semi-structured"'); - $this->connection->query('CREATE TABLE "semi-structured" ( + $this->connection->query( + 'CREATE TABLE "semi-structured" ( "var" VARIANT, "obj" OBJECT, "arr" ARRAY - )'); + )' + ); $this->connection->query( 'INSERT INTO "semi-structured" SELECT @@ -186,8 +192,8 @@ private function generateCreateCommand($tableName, CsvFile $csv, $fileInfo) * Create table from csv file with text columns * * @param CsvFile $file - * @param string $tableName - optional name override (default uses filename) - * @param string $schemaName - optional schema in which to create the table + * @param string $tableName - optional name override (default uses filename) + * @param string $schemaName - optional schema in which to create the table */ protected function createTextTable(CsvFile $file, $tableName = null, $schemaName = null) { @@ -201,23 +207,29 @@ protected function createTextTable(CsvFile $file, $tableName = null, $schemaName ); } - $this->connection->query(sprintf( - 'DROP TABLE IF EXISTS %s', - $this->connection->quoteIdentifier($tableName) - )); + $this->connection->query( + sprintf( + 'DROP TABLE IF EXISTS %s', + $this->connection->quoteIdentifier($tableName) + ) + ); - $this->connection->query(sprintf( - 'CREATE TABLE %s (%s);', - $this->connection->quoteIdentifier($tableName), - implode( - ', ', - array_map(function ($column) { - $q = '"'; - return ($q . str_replace("$q", "$q$q", $column) . $q) . ' VARCHAR(200) NOT NULL'; - }, $file->getHeader()) - ), - $tableName - )); + $this->connection->query( + sprintf( + 'CREATE TABLE %s (%s);', + $this->connection->quoteIdentifier($tableName), + implode( + ', ', + array_map( + function ($column) { + $q = '"'; + return ($q . str_replace("$q", "$q$q", $column) . $q) . ' VARCHAR(200) NOT NULL'; + }, $file->getHeader() + ) + ), + $tableName + ) + ); $storageFileInfo = $this->storageApiClient->getFile( $this->storageApiClient->uploadFile( @@ -241,7 +253,7 @@ protected function createTextTable(CsvFile $file, $tableName = null, $schemaName /** * Count records in CSV (with headers) * - * @param CsvFile $file + * @param CsvFile $file * @return int */ protected function countTable(CsvFile $file) diff --git a/tests/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php index 870a034..fc3b52f 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -38,7 +38,7 @@ private function createConfigFile(string $rootPath, string $configType = 'yaml') } /** - * @param $configType + * @param $configType * @dataProvider configTypesProvider */ public function testRunAction(string $configType) @@ -70,7 +70,7 @@ public function testRunAction(string $configType) } /** - * @param $configType + * @param $configType * @dataProvider configTypesProvider */ public function testConnectionAction(string $configType) @@ -107,7 +107,7 @@ public function testNonexistingTable() } /** - * @param $configType + * @param $configType * @dataProvider configTypesProvider */ public function testGetTablesAction(string $configType) From 05e50a23fc2b3dbcb585b0476edfb0db38c7e774 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:42:15 +0200 Subject: [PATCH 19/63] phpcbf auto fixes part II --- driver/downloadDriver.php | 7 ++- run.php | 3 + .../SnowflakeConfigDefinition.php | 5 +- .../DbExtractor/Extractor/Snowflake.php | 63 ++++++++++--------- .../DbExtractor/SnowflakeApplication.php | 3 + .../DbExtractor/Utils/AccountUrlParser.php | 3 + tests/AbstractSnowflakeTest.php | 24 +++---- tests/AccountParseTest.php | 5 +- tests/SnowflakeEntrypointTest.php | 15 +++-- tests/SnowflakeTest.php | 37 ++++++----- 10 files changed, 98 insertions(+), 67 deletions(-) diff --git a/driver/downloadDriver.php b/driver/downloadDriver.php index 7b1ff2e..7d280d1 100644 --- a/driver/downloadDriver.php +++ b/driver/downloadDriver.php @@ -1,4 +1,7 @@ 'keboola-configs', 'Key' => 'drivers/snowflake/snowflake-odbc-2.13.17.x86_64.deb', - 'SaveAs' => './snowflake-odbc-x86_64.deb' + 'SaveAs' => './snowflake-odbc-x86_64.deb', ] ); @@ -30,6 +33,6 @@ [ 'Bucket' => 'keboola-configs', 'Key' => 'drivers/snowflake-snowsql/snowsql-1.1.50-linux_x86_64.bash', - 'SaveAs' => './snowsql-linux_x86_64.bash' + 'SaveAs' => './snowsql-linux_x86_64.bash', ] ); diff --git a/run.php b/run.php index 175d821..e9bdf4e 100644 --- a/run.php +++ b/run.php @@ -1,4 +1,7 @@ root('parameters'); diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index f5ecff7..a21cc2a 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -1,4 +1,7 @@ db->query('SELECT current_date;'); @@ -92,7 +95,7 @@ public function testConnection() $this->db->quoteIdentifier($warehouse) ) ); - } catch (\Exception $e) { + } catch (\Throwable $e) { if (preg_match('/Object does not exist/ui', $e->getMessage())) { throw new UserException(sprintf('Invalid warehouse "%s" specified', $warehouse)); } else { @@ -125,7 +128,7 @@ private function getColumnInfo(string $query): array try { $this->db->query($sql); - } catch (\Exception $e) { + } catch (\Throwable $e) { throw new UserException( sprintf('DB query "%s" failed: %s', rtrim(trim($query), ';'), $e->getMessage()), 0, @@ -142,7 +145,8 @@ private function exportAndDownload(array $table): int $query = $this->simpleQuery($table['table'], $table['columns']); $columnInfo = $this->getColumnInfo($query); $objectColumns = array_filter( - $columnInfo, function ($column) { + $columnInfo, + function ($column) { return in_array($column['type'], self::SEMI_STRUCTURED_TYPES); } ); @@ -162,7 +166,7 @@ private function exportAndDownload(array $table): int try { $res = $this->executeCopyCommand($copyCommand); - } catch (\Exception $e) { + } catch (\Throwable $e) { throw new UserException( sprintf('Copy Command: %s failed with message: %s', $copyCommand, $e->getMessage()) ); @@ -232,7 +236,8 @@ private function exportAndDownload(array $table): int $outputDataDir . '.manifest', Yaml::dump( $this->createTableManifest( - $table, array_map( + $table, + array_map( function ($column) { return $column['name']; }, @@ -287,14 +292,14 @@ private function generateCopyCommand($stageTmpPath, $query) * @return array * @throws \Exception */ - private function executeCopyCommand($copyCommand, $maxTries = 5): array + private function executeCopyCommand($copyCommand, int $maxTries = 5): array { $retryPolicy = new SimpleRetryPolicy($maxTries, ['PDOException', 'ErrorException', 'Exception']); $backOffPolicy = new ExponentialBackOffPolicy(1000); $proxy = new RetryProxy($retryPolicy, $backOffPolicy); $counter = 0; /** - * @var \Exception $lastException + * @var \Exception $lastException */ $lastException = null; try { @@ -305,7 +310,7 @@ function () use ($copyCommand, &$counter, &$lastException) { } try { return $this->db->fetchAll($copyCommand); - } catch (\Exception $e) { + } catch (\Throwable $e) { $lastException = new UserException( sprintf("Copy Command failed: %s", $e->getMessage()), 0, @@ -316,7 +321,7 @@ function () use ($copyCommand, &$counter, &$lastException) { } } ); - } catch (\Exception $e) { + } catch (\Throwable $e) { if ($lastException) { throw $lastException; } @@ -333,7 +338,7 @@ private function createTableManifest(array $table, array $columns): array 'enclosure' => CsvFile::DEFAULT_ENCLOSURE, 'primary_key' => $table['primaryKey'], 'incremental' => $table['incremental'], - 'columns' => $columns + 'columns' => $columns, ]; if (isset($table['table']) && isset($table['table']['tableName'])) { @@ -369,7 +374,7 @@ private function createTableManifest(array $table, array $columns): array if ($key !== 'name') { $columnMetadata[$column['name']][] = [ 'key' => "KBC." . $key, - 'value'=> $value + 'value'=> $value, ]; } } @@ -378,7 +383,7 @@ private function createTableManifest(array $table, array $columns): array foreach ($tableDetails as $key => $value) { $manifestData['metadata'][] = [ "key" => "KBC." . $key, - "value" => $value + "value" => $value, ]; } $manifestData['column_metadata'] = $columnMetadata; @@ -417,7 +422,7 @@ public function getTables(?array $tables = null): array 'name' => $table['name'], 'catalog' => (isset($table['database_name'])) ? $table['database_name'] : null, 'schema' => (isset($table['schema_name'])) ? $table['schema_name'] : null, - 'type' => $isView ? 'VIEW' : (isset($table['kind']) ? $table['kind'] : null) + 'type' => $isView ? 'VIEW' : (isset($table['kind']) ? $table['kind'] : null), ]; if (isset($table['rows'])) { $tableDefs[$table['schema_name'] . '.' . $table['name']]['rowCount'] = $table['rows']; @@ -437,10 +442,12 @@ public function getTables(?array $tables = null): array WHERE TABLE_NAME IN (%s) ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION", implode( - ', ', array_map( + ', ', + array_map( function ($tableName) { return "'" . $tableName . "'"; - }, $tableNameArray + }, + $tableNameArray ) ) ); @@ -463,7 +470,7 @@ function ($tableName) { "length" => $length, "nullable" => (trim($column['IS_NULLABLE']) === "NO") ? false : true, "type" => $column['DATA_TYPE'], - "ordinalPosition" => $column['ORDINAL_POSITION'] + "ordinalPosition" => $column['ORDINAL_POSITION'], ]; if (!array_key_exists('columns', $tableDefs[$curTable])) { @@ -480,10 +487,12 @@ public function simpleQuery(array $table, array $columns = array()): string return sprintf( "SELECT %s FROM %s.%s", implode( - ', ', array_map( + ', ', + array_map( function ($column) { return $this->db->quoteIdentifier($column); - }, $columns + }, + $columns ) ), $this->db->quoteIdentifier($table['schema']), @@ -503,7 +512,8 @@ private function simpleQueryWithCasting(array $table, array $columnInfo) : strin return sprintf( "SELECT %s FROM %s.%s", implode( - ', ', array_map( + ', ', + array_map( function ($column) { if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { return sprintf( @@ -513,7 +523,8 @@ function ($column) { ); } return $this->db->quoteIdentifier($column['name']); - }, $columnInfo + }, + $columnInfo ) ), $this->db->quoteIdentifier($table['schema']), @@ -575,11 +586,7 @@ private function quote($value) return "'" . addslashes($value) . "'"; } - /** - * @param $dbParams - * @return \SplFileInfo - */ - private function crateSnowSqlConfig($dbParams) + private function crateSnowSqlConfig($dbParams): \SplFileInfo { $cliConfig[] = ''; $cliConfig[] = '[options]'; @@ -623,11 +630,11 @@ private function getUserDefaultWarehouse() return null; } - private function execQuery($query) + private function execQuery($query): void { try { $this->db->query($query); - } catch (\Exception $e) { + } catch (\Throwable $e) { throw new UserException("Query execution error: " . $e->getMessage(), 0, $e); } } diff --git a/src/Keboola/DbExtractor/SnowflakeApplication.php b/src/Keboola/DbExtractor/SnowflakeApplication.php index feda6d6..2e86b03 100644 --- a/src/Keboola/DbExtractor/SnowflakeApplication.php +++ b/src/Keboola/DbExtractor/SnowflakeApplication.php @@ -1,4 +1,7 @@ storageApiClient = new Client( [ - 'token' => getenv('STORAGE_API_TOKEN') + 'token' => getenv('STORAGE_API_TOKEN'), ] ); @@ -77,7 +80,7 @@ public function getConfig(string $driver = 'snowflake', string $format = 'json') * @param array $config * @return SnowflakeApplication */ - public function createApplication(array $config) + public function createApplication(array $config): SnowflakeApplication { $logger = new Logger('ex-db-snowflake-tests'); $app = new SnowflakeApplication($config, $logger, [], $this->dataDir); @@ -85,11 +88,7 @@ public function createApplication(array $config) return $app; } - /** - * @param CsvFile $file - * @return string - */ - protected function generateTableName(CsvFile $file) + protected function generateTableName(CsvFile $file): string { $tableName = sprintf( '%s', @@ -99,7 +98,7 @@ protected function generateTableName(CsvFile $file) return $tableName; } - private function setupTables() + private function setupTables(): void { $salescsv = new CsvFile($this->dataDir . '/snowflake/sales.csv'); $this->createTextTable($salescsv); @@ -195,7 +194,7 @@ private function generateCreateCommand($tableName, CsvFile $csv, $fileInfo) * @param string $tableName - optional name override (default uses filename) * @param string $schemaName - optional schema in which to create the table */ - protected function createTextTable(CsvFile $file, $tableName = null, $schemaName = null) + protected function createTextTable(CsvFile $file, ?string $tableName = null, ?string $schemaName = null): void { if (!$tableName) { $tableName = $this->generateTableName($file); @@ -224,7 +223,8 @@ protected function createTextTable(CsvFile $file, $tableName = null, $schemaName function ($column) { $q = '"'; return ($q . str_replace("$q", "$q$q", $column) . $q) . ' VARCHAR(200) NOT NULL'; - }, $file->getHeader() + }, + $file->getHeader() ) ), $tableName @@ -256,7 +256,7 @@ function ($column) { * @param CsvFile $file * @return int */ - protected function countTable(CsvFile $file) + protected function countTable(CsvFile $file): int { $linesCount = 0; foreach ($file as $i => $line) { diff --git a/tests/AccountParseTest.php b/tests/AccountParseTest.php index 2bab01e..1c44efd 100644 --- a/tests/AccountParseTest.php +++ b/tests/AccountParseTest.php @@ -1,11 +1,14 @@ assertEquals( 'something', diff --git a/tests/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php index fc3b52f..706e246 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -1,4 +1,7 @@ assertEquals('success', $data['status']); } - public function testNonexistingTable() + public function testNonexistingTable(): void { $config = $this->getConfig(); $config['parameters']['tables'][0]['query'] = "SELECT * FROM non_existing_table"; @@ -110,7 +113,7 @@ public function testNonexistingTable() * @param $configType * @dataProvider configTypesProvider */ - public function testGetTablesAction(string $configType) + public function testGetTablesAction(string $configType): void { $dataPath = __DIR__ . '/data/getTablesAction'; @@ -125,7 +128,7 @@ public function testGetTablesAction(string $configType) $this->assertEquals("", $process->getErrorOutput()); } - public function testBadTypesRetries() + public function testBadTypesRetries(): void { $config = $this->getConfig(); $this->createTextTable(new \Keboola\Csv\CsvFile($this->dataDir . '/snowflake/badTypes.csv'), 'types'); diff --git a/tests/SnowflakeTest.php b/tests/SnowflakeTest.php index f6c070d..9a25605 100644 --- a/tests/SnowflakeTest.php +++ b/tests/SnowflakeTest.php @@ -1,4 +1,7 @@ getConfig(); $user = $config['parameters']['db']['user']; @@ -22,7 +25,7 @@ public function testDefaultWarehouse() try { $app->run(); $this->fail('Run extractor without warehouse should fail'); - } catch (\Exception $e) { + } catch (\Throwable $e) { $this->assertRegExp('/No active warehouse/ui', $e->getMessage()); } @@ -37,7 +40,7 @@ public function testDefaultWarehouse() $this->setUserDefaultWarehouse($user, $warehouse); } - public function testCredentials() + public function testCredentials(): void { $config = $this->getConfig(); $config['action'] = 'testConnection'; @@ -50,7 +53,7 @@ public function testCredentials() $this->assertEquals('success', $result['status']); } - public function testCredentialsWithoutSchema() + public function testCredentialsWithoutSchema(): void { $config = $this->getConfig(); $config['action'] = 'testConnection'; @@ -64,7 +67,7 @@ public function testCredentialsWithoutSchema() $this->assertEquals('success', $result['status']); } - public function testCredentialsDefaultWarehouse() + public function testCredentialsDefaultWarehouse(): void { $config = $this->getConfig(); $config['action'] = 'testConnection'; @@ -107,7 +110,7 @@ public function testCredentialsDefaultWarehouse() $this->setUserDefaultWarehouse($user, $warehouse); } - public function testRunWithoutTables() + public function testRunWithoutTables(): void { $config = $this->getConfig(); @@ -120,7 +123,7 @@ public function testRunWithoutTables() $this->assertEquals('success', $result['status']); } - public function testRunMain() + public function testRunMain(): void { $config = $this->getConfig(); $app = $this->createApplication($config); @@ -170,7 +173,7 @@ public function testRunMain() $this->assertEquals(4, $result['imported']['2']['rows']); } - public function testRunWithoutSchema() + public function testRunWithoutSchema(): void { $config = $this->getConfig(); unset($config['parameters']['db']['schema']); @@ -183,7 +186,7 @@ public function testRunWithoutSchema() try { $result = $app->run(); $this->fail('The query does not specify schema and no schema is specified in the connection.'); - } catch (\Exception $e) { + } catch (\Throwable $e) { $this->assertContains('no schema is specified', $e->getMessage()); } @@ -198,7 +201,7 @@ public function testRunWithoutSchema() $this->validateExtraction($config['parameters']['tables'][0]); } - public function testRunEmptyQuery() + public function testRunEmptyQuery(): void { $csv = new CsvFile($this->dataDir . '/snowflake/escaping.csv'); $this->createTextTable($csv); @@ -219,7 +222,7 @@ public function testRunEmptyQuery() $this->assertFileNotExists($outputManifestFile); } - public function testGetTables() + public function testGetTables(): void { $config = $this->getConfig(); $config['action'] = 'getTables'; @@ -510,7 +513,7 @@ public function testGetTables() $this->assertEquals($expectedData, $result['tables']); } - public function testGetTablesWithoutSchema() + public function testGetTablesWithoutSchema(): void { $config = $this->getConfig(); $config['action'] = 'getTables'; @@ -832,7 +835,7 @@ public function testGetTablesWithoutSchema() $this->assertEquals($expectedData, $result['tables']); } - public function testManifestMetadata() + public function testManifestMetadata(): void { $config = $this->getConfig(); @@ -1021,14 +1024,14 @@ public function testManifestMetadata() $this->assertEquals($expectedColumnMetadata, $outputManifest['column_metadata']); } - public function testSemiStructured() + public function testSemiStructured(): void { $config = $this->getConfig(); $table = $config['parameters']['tables'][0]; unset($table['query']); $table['table'] = [ 'tableName' => 'semi-structured', - 'schema' => $this->getEnv('snowflake', 'DB_SCHEMA') + 'schema' => $this->getEnv('snowflake', 'DB_SCHEMA'), ]; $table['outputTable'] = 'in.c-main.semi-structured'; $table['primaryKey'] = null; @@ -1070,7 +1073,7 @@ private function getUserDefaultWarehouse($user) return null; } - private function setUserDefaultWarehouse($user, $warehouse = null) + private function setUserDefaultWarehouse($user, $warehouse = null): void { if ($warehouse) { $sql = sprintf( @@ -1092,7 +1095,7 @@ private function setUserDefaultWarehouse($user, $warehouse = null) } } - private function validateExtraction(array $query, $expectedFiles = 1) + private function validateExtraction(array $query, $expectedFiles = 1): void { $dirPath = $this->dataDir . '/out/tables'; From 9918927adf0c7132b51dec164613e0941c9d1cb7 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:49:01 +0200 Subject: [PATCH 20/63] turn off formatting for config definition --- .../SnowflakeConfigDefinition.php | 201 +++++++++--------- 1 file changed, 100 insertions(+), 101 deletions(-) diff --git a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php index 094c5aa..515ffbf 100644 --- a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php +++ b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php @@ -4,130 +4,129 @@ namespace Keboola\DbExtractor\Configuration; +use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class SnowflakeConfigDefinition implements ConfigurationInterface { - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('parameters'); + // @formatter:off $rootNode ->children() - ->scalarNode('data_dir') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('extractor_class') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->arrayNode('db') - ->children() - ->scalarNode('driver')->end() - ->scalarNode('host') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('port')->end() - ->scalarNode('warehouse')->end() - ->scalarNode('database') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('schema')->end() - ->scalarNode('user') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('password')->end() - ->scalarNode('#password')->end() - ->append($this->addSshNode()) - ->end() - ->end() - ->arrayNode('tables') - ->prototype('array') - ->children() - ->integerNode('id') - ->isRequired() - ->min(0) - ->end() - ->scalarNode('name') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('query')->end() - ->arrayNode('table') - ->children() - ->scalarNode('schema')->end() - ->scalarNode('tableName')->end() - ->end() - ->end() - ->arrayNode('columns') - ->prototype('scalar') - ->end() - ->end() - ->scalarNode('outputTable') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->booleanNode('incremental') - ->defaultValue(false) - ->end() - ->booleanNode('enabled') - ->defaultValue(true) - ->end() - ->arrayNode('primaryKey') - ->prototype('scalar') - ->end() - ->end() - ->integerNode('retries') - ->min(1) - ->end() - ->end() - ->end() - ->end() + ->scalarNode('data_dir') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('extractor_class') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->arrayNode('db') + ->children() + ->scalarNode('driver')->end() + ->scalarNode('host') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('port')->end() + ->scalarNode('warehouse')->end() + ->scalarNode('database') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('schema')->end() + ->scalarNode('user') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('password')->end() + ->scalarNode('#password')->end() + ->append($this->addSshNode()) + ->end() + ->end() + ->arrayNode('tables') + ->prototype('array') + ->children() + ->integerNode('id') + ->isRequired() + ->min(0) + ->end() + ->scalarNode('name') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('query')->end() + ->arrayNode('table') + ->children() + ->scalarNode('schema')->end() + ->scalarNode('tableName')->end() + ->end() + ->end() + ->arrayNode('columns') + ->prototype('scalar') + ->end() + ->end() + ->scalarNode('outputTable') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->booleanNode('incremental') + ->defaultValue(false) + ->end() + ->booleanNode('enabled') + ->defaultValue(true) + ->end() + ->arrayNode('primaryKey') + ->prototype('scalar') + ->end() + ->end() + ->integerNode('retries') + ->min(1) + ->end() + ->end() + ->end() + ->end() ->end(); - + // @formatter:on return $treeBuilder; } - public function addSshNode() + public function addSshNode(): NodeDefinition { $builder = new TreeBuilder(); $node = $builder->root('ssh'); + // @formatter:off $node ->children() - ->booleanNode('enabled')->end() - ->arrayNode('keys') - ->children() - ->scalarNode('private')->end() - ->scalarNode('#private')->end() - ->scalarNode('public')->end() - ->end() - ->end() - ->scalarNode('sshHost')->end() - ->scalarNode('sshPort') - ->defaultValue("22") - ->end() - ->scalarNode('remoteHost') - ->end() - ->scalarNode('remotePort') - ->end() - ->scalarNode('localPort') - ->defaultValue("33006") - ->end() - ->scalarNode('user')->end() + ->booleanNode('enabled')->end() + ->arrayNode('keys') + ->children() + ->scalarNode('private')->end() + ->scalarNode('#private')->end() + ->scalarNode('public')->end() + ->end() + ->end() + ->scalarNode('sshHost')->end() + ->scalarNode('sshPort') + ->defaultValue("22") + ->end() + ->scalarNode('remoteHost') + ->end() + ->scalarNode('remotePort') + ->end() + ->scalarNode('localPort') + ->defaultValue("33006") + ->end() + ->scalarNode('user')->end() ->end(); + // @formatter:on return $node; } } From 88ad336d249e5ef414a84bdb9e8ecdb63c3acf74 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 27 Sep 2018 17:55:47 +0200 Subject: [PATCH 21/63] fix type declarations --- .../DbExtractor/Extractor/Snowflake.php | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index a21cc2a..edb8728 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -23,7 +23,7 @@ class Snowflake extends Extractor { - const SEMI_STRUCTURED_TYPES = ['VARIANT' , 'OBJECT', 'ARRAY']; + public const SEMI_STRUCTURED_TYPES = ['VARIANT' , 'OBJECT', 'ARRAY']; /** * @var Connection @@ -35,9 +35,16 @@ class Snowflake extends Extractor */ private $snowSqlConfig; + /** @var string */ private $warehouse; + + /** @var string */ private $database; + + /** @var string */ private $schema; + + /** @var string */ private $user; /** @@ -52,7 +59,7 @@ public function __construct(array $parameters, array $state, Logger $logger) parent::__construct($parameters, $state, $logger); } - public function createConnection(array $dbParams) + public function createConnection(array $dbParams): Connection { $this->snowSqlConfig = $this->crateSnowSqlConfig($dbParams); @@ -260,7 +267,7 @@ function ($column) { return $rowCount; } - private function generateCopyCommand($stageTmpPath, $query) + private function generateCopyCommand(string $stageTmpPath, string $query): string { $csvOptions = []; $csvOptions[] = sprintf('FIELD_DELIMITER = %s', $this->quote(CsvFile::DEFAULT_DELIMITER)); @@ -292,15 +299,13 @@ private function generateCopyCommand($stageTmpPath, $query) * @return array * @throws \Exception */ - private function executeCopyCommand($copyCommand, int $maxTries = 5): array + private function executeCopyCommand(string $copyCommand, int $maxTries = 5): array { $retryPolicy = new SimpleRetryPolicy($maxTries, ['PDOException', 'ErrorException', 'Exception']); $backOffPolicy = new ExponentialBackOffPolicy(1000); $proxy = new RetryProxy($retryPolicy, $backOffPolicy); $counter = 0; - /** - * @var \Exception $lastException -*/ + /** @var \Exception $lastException */ $lastException = null; try { $ret = $proxy->call( @@ -393,7 +398,7 @@ private function createTableManifest(array $table, array $columns): array return $manifestData; } - private function dataSizeFormatted(int $bytes) + private function dataSizeFormatted(int $bytes): string { $base = log($bytes) / log(1024); $suffixes = [' B', ' KB', ' MB', ' GB', ' TB']; @@ -532,13 +537,7 @@ function ($column) { ); } - /** - * @param $output - * @param $path - * @return \SplFileInfo[] - * @throws \Exception - */ - private function parseFiles($output, $path) + private function parseFiles(string $output, string $path): \SplFileInfo { $files = []; $lines = explode("\n", $output); @@ -581,12 +580,12 @@ function ($item) { return $files; } - private function quote($value) + private function quote(string $value): string { return "'" . addslashes($value) . "'"; } - private function crateSnowSqlConfig($dbParams): \SplFileInfo + private function crateSnowSqlConfig(array $dbParams): \SplFileInfo { $cliConfig[] = ''; $cliConfig[] = '[options]'; @@ -612,7 +611,7 @@ private function crateSnowSqlConfig($dbParams): \SplFileInfo return $file; } - private function getUserDefaultWarehouse() + private function getUserDefaultWarehouse(): ?string { $sql = sprintf( "DESC USER %s;", From 991ca7f2c934fe48b3510e1bac75458b03f78e79 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Mon, 1 Oct 2018 12:40:30 +0200 Subject: [PATCH 22/63] cs updates --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 6 ++++-- src/Keboola/DbExtractor/Utils/AccountUrlParser.php | 2 +- tests/AbstractSnowflakeTest.php | 12 +++++++++--- tests/SnowflakeTest.php | 6 +++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index edb8728..21cb9a6 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -417,7 +417,9 @@ public function getTables(?array $tables = null): array $tableNameArray = []; $tableDefs = []; foreach ($arr as $table) { - if (($this->schema && $table['schema_name'] !== $this->schema) || $table['schema_name'] === 'INFORMATION_SCHEMA') { + if (($this->schema && $table['schema_name'] !== $this->schema) + || $table['schema_name'] === 'INFORMATION_SCHEMA' + ) { continue; } if (is_null($tables) || !(array_search($table['name'], array_column($tables, 'tableName')) === false)) { @@ -629,7 +631,7 @@ private function getUserDefaultWarehouse(): ?string return null; } - private function execQuery($query): void + private function execQuery(string $query): void { try { $this->db->query($query); diff --git a/src/Keboola/DbExtractor/Utils/AccountUrlParser.php b/src/Keboola/DbExtractor/Utils/AccountUrlParser.php index 7a8168a..b46d786 100644 --- a/src/Keboola/DbExtractor/Utils/AccountUrlParser.php +++ b/src/Keboola/DbExtractor/Utils/AccountUrlParser.php @@ -6,7 +6,7 @@ class AccountUrlParser { - public static function parse($host) + public static function parse(string $host): array { $hostParts = explode('.', $host); return implode('.', array_slice($hostParts, 0, count($hostParts) - 2)); diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index 4bf89ec..5d209bd 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -26,6 +26,7 @@ abstract class AbstractSnowflakeTest extends ExtractorTest */ protected $storageApiClient; + /** @var string */ protected $dataDir = __DIR__ . '/data'; public function setUp(): void @@ -117,7 +118,12 @@ private function setupTables(): void $this->connection->query( sprintf( - 'CREATE TABLE %s ("character" VARCHAR(100) NOT NULL, "integer" NUMBER(6,0), "decimal" NUMBER(10,2), "date" DATE);', + 'CREATE TABLE %s ( + "character" VARCHAR(100) NOT NULL, + "integer" NUMBER(6,0), + "decimal" NUMBER(10,2), + "date" DATE + );', $this->connection->quoteIdentifier('types') ) ); @@ -154,12 +160,12 @@ private function setupTables(): void ); } - private function quote($value) + private function quote(string $value): string { return "'" . addslashes($value) . "'"; } - private function generateCreateCommand($tableName, CsvFile $csv, $fileInfo) + private function generateCreateCommand(string $tableName, CsvFile $csv, \SplFileInfo $fileInfo): string { $csvOptions = []; $csvOptions[] = sprintf('FIELD_DELIMITER = %s', $this->connection->quoteIdentifier($csv->getDelimiter())); diff --git a/tests/SnowflakeTest.php b/tests/SnowflakeTest.php index 9a25605..40cac49 100644 --- a/tests/SnowflakeTest.php +++ b/tests/SnowflakeTest.php @@ -1055,7 +1055,7 @@ public function testSemiStructured(): void ); } - private function getUserDefaultWarehouse($user) + private function getUserDefaultWarehouse(string $user): ?string { $sql = sprintf( "DESC USER %s;", @@ -1073,7 +1073,7 @@ private function getUserDefaultWarehouse($user) return null; } - private function setUserDefaultWarehouse($user, $warehouse = null): void + private function setUserDefaultWarehouse(string $user, ?string $warehouse = null): void { if ($warehouse) { $sql = sprintf( @@ -1095,7 +1095,7 @@ private function setUserDefaultWarehouse($user, $warehouse = null): void } } - private function validateExtraction(array $query, $expectedFiles = 1): void + private function validateExtraction(array $query, int $expectedFiles = 1): void { $dirPath = $this->dataDir . '/out/tables'; From 4a0c1b2ca4df218192ae885f2ceab5704d747806 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Mon, 1 Oct 2018 12:48:50 +0200 Subject: [PATCH 23/63] stan fixes --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 6 +++--- tests/SnowflakeTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 21cb9a6..1e9bf51 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -539,19 +539,19 @@ function ($column) { ); } - private function parseFiles(string $output, string $path): \SplFileInfo + private function parseFiles(string $output, string $path): array { $files = []; $lines = explode("\n", $output); $lines = array_map( - function ($item) { + function ($item): array { $item = trim($item, '|'); return array_map('trim', explode('|', $item)); }, array_filter( $lines, - function ($item) { + function ($item): bool { $item = trim($item); return preg_match('/^\|.+\|$/ui', $item) && preg_match('/([a-z0-9\_\-\.]+\.gz)/ui', $item); } diff --git a/tests/SnowflakeTest.php b/tests/SnowflakeTest.php index 40cac49..5b9b1c6 100644 --- a/tests/SnowflakeTest.php +++ b/tests/SnowflakeTest.php @@ -1095,7 +1095,7 @@ private function setUserDefaultWarehouse(string $user, ?string $warehouse = null } } - private function validateExtraction(array $query, int $expectedFiles = 1): void + private function validateExtraction(array $query, int $expectedFiles = 1): ?array { $dirPath = $this->dataDir . '/out/tables'; @@ -1125,7 +1125,7 @@ function ($fileName) use ($dirPath, $outputTable) { ); if (!$expectedFiles) { - return; + return null; } $this->assertCount($expectedFiles, $manifestFiles); From bd1336397ffca3d2d47177508b95a6a69722ae4c Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 3 Oct 2018 15:29:29 +0200 Subject: [PATCH 24/63] stan fixes --- composer.json | 8 +- composer.lock | 1299 ++++------------- phpunit.xml.dist | 4 - .../DbExtractor/Extractor/Snowflake.php | 6 - .../DbExtractor}/AbstractSnowflakeTest.php | 11 +- .../DbExtractor}/AccountParseTest.php | 2 +- .../DbExtractor}/SnowflakeEntrypointTest.php | 24 +- .../DbExtractor}/SnowflakeTest.php | 2 +- 8 files changed, 270 insertions(+), 1086 deletions(-) rename tests/{ => Keboola/DbExtractor}/AbstractSnowflakeTest.php (97%) rename tests/{ => Keboola/DbExtractor}/AccountParseTest.php (94%) rename tests/{ => Keboola/DbExtractor}/SnowflakeEntrypointTest.php (90%) rename tests/{ => Keboola/DbExtractor}/SnowflakeTest.php (99%) diff --git a/composer.json b/composer.json index 3967d57..9bbe184 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ "keboola/php-csv-db-import": "~2.3.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "~5.0", "codeclimate/php-test-reporter": "^0.3", "keboola/coding-standard": "^6.0", "keboola/storage-api-client": "^4.14", - "phpstan/phpstan": "^0.8" + "phpstan/phpstan-shim": "^0.9.2" }, "autoload": { "psr-4": { @@ -30,12 +30,12 @@ }, "autoload-dev": { "psr-4": { - "Keboola\\Test\\": "tests/" + "Keboola\\DbExtractor\\Tests\\": "tests/Keboola/DbExtractor/" } }, "scripts": { "tests": "phpunit", - "phpstan": "phpstan analyse --no-progress --level=max ./src ./tests", + "phpstan": "phpstan analyse --no-progress --level=max --debug ./src ./tests", "phpcs": "phpcs -n --ignore=vendor --extensions=php .", "phpcbf": "phpcbf -n --ignore=vendor --extensions=php .", "build": [ diff --git a/composer.lock b/composer.lock index aeb3528..8333387 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "87de9b0cdaf43ca91283cfde3a776190", + "content-hash": "f38337c209a310b909a9381af9ece791", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.67.20", + "version": "3.68.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "6c8bc0f42ba73bab85da67c3af9131e455c3f14c" + "reference": "2986beb07a14bcde94608e940ee7e5cba1ed4e38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6c8bc0f42ba73bab85da67c3af9131e455c3f14c", - "reference": "6c8bc0f42ba73bab85da67c3af9131e455c3f14c", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2986beb07a14bcde94608e940ee7e5cba1ed4e38", + "reference": "2986beb07a14bcde94608e940ee7e5cba1ed4e38", "shasum": "" }, "require": { @@ -84,7 +84,7 @@ "s3", "sdk" ], - "time": "2018-09-26T20:06:30+00:00" + "time": "2018-10-02T21:11:29+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1043,16 +1043,16 @@ }, { "name": "symfony/config", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7b08223b7f6abd859651c56bcabf900d1627d085" + "reference": "e5389132dc6320682de3643091121c048ff796b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7b08223b7f6abd859651c56bcabf900d1627d085", - "reference": "7b08223b7f6abd859651c56bcabf900d1627d085", + "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", + "reference": "e5389132dc6320682de3643091121c048ff796b3", "shasum": "" }, "require": { @@ -1103,20 +1103,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-09-08T13:15:14+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c" + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", - "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", "shasum": "" }, "require": { @@ -1153,7 +1153,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-08-10T07:29:05+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1215,16 +1215,16 @@ }, { "name": "symfony/process", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7" + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4d6b125d5293cbceedc2aa10f2c71617e76262e7", - "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7", + "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", "shasum": "" }, "require": { @@ -1260,20 +1260,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-08-03T10:42:44+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "40031683816470610af87c2d03ea86d1cf0f0104" + "reference": "8bc00ef47a428bfebc4641f29d158e7c56137fcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/40031683816470610af87c2d03ea86d1cf0f0104", - "reference": "40031683816470610af87c2d03ea86d1cf0f0104", + "url": "https://api.github.com/repos/symfony/serializer/zipball/8bc00ef47a428bfebc4641f29d158e7c56137fcb", + "reference": "8bc00ef47a428bfebc4641f29d158e7c56137fcb", "shasum": "" }, "require": { @@ -1339,20 +1339,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:58:24+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8" + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c2f4812ead9f847cb69e90917ca7502e6892d6b8", - "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", "shasum": "" }, "require": { @@ -1398,7 +1398,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-08-10T07:34:36+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "tracy/tracy", @@ -1723,57 +1723,6 @@ "abandoned": "guzzlehttp/guzzle", "time": "2015-03-18T18:23:50+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.2", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "shasum": "" - }, - "require": { - "ocramius/package-versions": "^1.2.0", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "time": "2018-06-13T13:22:40+00:00" - }, { "name": "keboola/coding-standard", "version": "6.0.0", @@ -1889,604 +1838,7 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" - }, - { - "name": "nette/bootstrap", - "version": "v2.4.6", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", - "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", - "shasum": "" - }, - "require": { - "nette/di": "~2.4.7", - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.4.0", - "nette/mail": "~2.3", - "nette/robot-loader": "^2.4.2 || ^3.0", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~2.0", - "tracy/tracy": "^2.4.1" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "time": "2018-05-17T12:52:20+00:00" - }, - { - "name": "nette/di", - "version": "v2.4.14", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/923da3e2c0aa53162ef455472c0ac7787b096c5a", - "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^2.3.3 || ~3.0.0", - "nette/php-generator": "^2.6.1 || ~3.0.0", - "nette/utils": "^2.4.3 || ~3.0.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/bootstrap": "<2.4", - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "time": "2018-09-17T15:47:40+00:00" - }, - { - "name": "nette/finder", - "version": "v2.4.2", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", - "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", - "shasum": "" - }, - "require": { - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🔍 Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "time": "2018-06-28T11:49:23+00:00" - }, - { - "name": "nette/neon", - "version": "v2.4.3", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398", - "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "homepage": "http://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "time": "2018-03-21T12:12:21+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", - "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2018-08-09T14:32:27+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.1.0", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/fc76c70e740b10f091e502b2e393d0be912f38d4", - "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.3 || ^3.0", - "nette/utils": "^2.4 || ^3.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "time": "2018-08-13T14:19:06+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v3.1.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2018-02-28T20:30:58+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", - "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0.0", - "php": "^7.1.0" - }, - "require-dev": { - "composer/composer": "^1.6.3", - "ext-zip": "*", - "infection/infection": "^0.7.1", - "phpunit/phpunit": "^7.0.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2018-02-05T13:05:30+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2704,95 +2056,78 @@ "time": "2018-08-05T17:53:17+00:00" }, { - "name": "phpstan/phpstan", - "version": "0.8.5", + "name": "phpstan/phpstan-shim", + "version": "0.9.2", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7" + "url": "https://github.com/phpstan/phpstan-shim.git", + "reference": "e4720fb2916be05de02869780072253e7e0e8a75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0dfb4f00959c53378cf15e32a79a254acada35d7", - "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7", + "url": "https://api.github.com/repos/phpstan/phpstan-shim/zipball/e4720fb2916be05de02869780072253e7e0e8a75", + "reference": "e4720fb2916be05de02869780072253e7e0e8a75", "shasum": "" }, "require": { - "jean85/pretty-package-versions": "^1.0.2", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/utils": "^2.4 || ^3.0", - "nikic/php-parser": "^3.0.2", - "php": "~7.0", - "symfony/console": "~2.7 || ~3.0", - "symfony/finder": "~2.7 || ~3.0" + "php": "~7.0" }, - "require-dev": { - "consistence/coding-standard": "^2.0.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpunit/phpunit": "^6.3", - "satooshi/php-coveralls": "^1.0", - "slevomat/coding-standard": "^3.1.1" + "replace": { + "phpstan/phpstan": "self.version" }, "bin": [ - "bin/phpstan" + "phpstan", + "phpstan.phar" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.8-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" + "dev-master": "0.9-dev" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", - "time": "2017-09-06T17:15:07+00:00" + "description": "PHPStan Phar distribution", + "time": "2018-01-28T14:29:27+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.0.7", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -2807,7 +2142,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -2818,32 +2153,29 @@ "testing", "xunit" ], - "time": "2018-06-01T07:51:50+00:00" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -2858,7 +2190,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -2868,7 +2200,7 @@ "filesystem", "iterator" ], - "time": "2018-09-13T20:33:42+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -2913,28 +2245,28 @@ }, { "name": "phpunit/php-timer", - "version": "2.0.0", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -2949,7 +2281,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -2958,33 +2290,33 @@ "keywords": [ "timer" ], - "time": "2018-02-01T13:07:23+00:00" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "3.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.1" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3007,57 +2339,55 @@ "keywords": [ "tokenizer" ], - "time": "2018-02-01T13:16:43+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "7.3.5", + "version": "5.7.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7b331efabbb628c518c408fdfcaf571156775de2" + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b331efabbb628c518c408fdfcaf571156775de2", - "reference": "7b331efabbb628c518c408fdfcaf571156775de2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.0", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" }, "conflict": { - "phpunit/phpunit-mock-objects": "*" + "phpdocumentor/reflection-docblock": "3.0.2" }, "require-dev": { "ext-pdo": "*" }, "suggest": { - "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "~1.1" }, "bin": [ "phpunit" @@ -3065,7 +2395,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.3-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -3091,7 +2421,66 @@ "testing", "xunit" ], - "time": "2018-09-08T15:14:29+00:00" + "time": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" }, { "name": "satooshi/php-coveralls", @@ -3202,30 +2591,30 @@ }, { "name": "sebastian/comparator", - "version": "3.0.2", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -3256,39 +2645,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "homepage": "http://www.github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2018-07-12T15:12:46+00:00" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", - "version": "3.0.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "366541b989927187c4ca70490a35615d3fef2dce" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", - "reference": "366541b989927187c4ca70490a35615d3fef2dce", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -3313,37 +2701,34 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "diff" ], - "time": "2018-06-10T07:54:39+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3368,34 +2753,34 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3435,27 +2820,27 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.2" }, "suggest": { "ext-uopz": "*" @@ -3463,7 +2848,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -3486,34 +2871,33 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3533,77 +2917,32 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3631,7 +2970,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -3811,21 +3150,20 @@ }, { "name": "symfony/console", - "version": "v3.4.15", + "version": "v4.1.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73" + "reference": "d3dbe91fd5b8b11ecb73508c844bc6a490de15b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73", - "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "url": "https://api.github.com/repos/symfony/console/zipball/d3dbe91fd5b8b11ecb73508c844bc6a490de15b4", + "reference": "d3dbe91fd5b8b11ecb73508c844bc6a490de15b4", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3834,11 +3172,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3849,7 +3187,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3876,67 +3214,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" - }, - { - "name": "symfony/debug", - "version": "v4.1.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "47ead688f1f2877f3f14219670f52e4722ee7052" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/47ead688f1f2877f3f14219670f52e4722ee7052", - "reference": "47ead688f1f2877f3f14219670f52e4722ee7052", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-08-03T11:13:38+00:00" + "time": "2018-09-30T03:38:13+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.45", + "version": "v2.8.46", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -3994,55 +3276,6 @@ "homepage": "https://symfony.com", "time": "2018-07-26T09:03:18+00:00" }, - { - "name": "symfony/finder", - "version": "v3.4.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8a84fcb207451df0013b2c74cbbf1b62d47b999a", - "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.9.0", @@ -4104,7 +3337,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.1.4", + "version": "v4.1.5", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -4151,46 +3384,6 @@ "homepage": "https://symfony.com", "time": "2018-07-26T11:00:49+00:00" }, - { - "name": "theseer/tokenizer", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" - }, { "name": "webmozart/assert", "version": "1.3.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 654cefd..a4af4f7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,10 +10,6 @@ syntaxCheck="false" bootstrap="vendor/autoload.php"> - - - - tests diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 1e9bf51..ac44931 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -293,12 +293,6 @@ private function generateCopyCommand(string $stageTmpPath, string $query): strin ); } - /** - * @param $copyCommand - * @param int $maxTries - * @return array - * @throws \Exception - */ private function executeCopyCommand(string $copyCommand, int $maxTries = 5): array { $retryPolicy = new SimpleRetryPolicy($maxTries, ['PDOException', 'ErrorException', 'Exception']); diff --git a/tests/AbstractSnowflakeTest.php b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php similarity index 97% rename from tests/AbstractSnowflakeTest.php rename to tests/Keboola/DbExtractor/AbstractSnowflakeTest.php index 5d209bd..7b78b38 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Keboola\Test; +namespace Keboola\DbExtractor\Tests; use Keboola\Csv\CsvFile; use Keboola\Db\Import\Snowflake\Connection; @@ -128,7 +128,7 @@ private function setupTables(): void ) ); $storageFileInfo = $this->storageApiClient->getFile( - $this->storageApiClient->uploadFile( + (string) $this->storageApiClient->uploadFile( (string) $types, new FileUploadOptions() ), @@ -165,7 +165,7 @@ private function quote(string $value): string return "'" . addslashes($value) . "'"; } - private function generateCreateCommand(string $tableName, CsvFile $csv, \SplFileInfo $fileInfo): string + private function generateCreateCommand(string $tableName, CsvFile $csv, array $fileInfo): string { $csvOptions = []; $csvOptions[] = sprintf('FIELD_DELIMITER = %s', $this->connection->quoteIdentifier($csv->getDelimiter())); @@ -232,13 +232,12 @@ function ($column) { }, $file->getHeader() ) - ), - $tableName + ) ) ); $storageFileInfo = $this->storageApiClient->getFile( - $this->storageApiClient->uploadFile( + (string) $this->storageApiClient->uploadFile( (string) $file, new FileUploadOptions() ), diff --git a/tests/AccountParseTest.php b/tests/Keboola/DbExtractor/AccountParseTest.php similarity index 94% rename from tests/AccountParseTest.php rename to tests/Keboola/DbExtractor/AccountParseTest.php index 1c44efd..21c7b6f 100644 --- a/tests/AccountParseTest.php +++ b/tests/Keboola/DbExtractor/AccountParseTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Keboola\Test; +namespace Keboola\DbExtractor\Tests; use Keboola\DbExtractor\Utils\AccountUrlParser; diff --git a/tests/SnowflakeEntrypointTest.php b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php similarity index 90% rename from tests/SnowflakeEntrypointTest.php rename to tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php index 706e246..cfb4ee6 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Keboola\Test; +namespace Keboola\DbExtractor\Tests; use Keboola\DbExtractor\Exception\UserException; use Symfony\Component\Process\Process; @@ -10,21 +10,23 @@ class SnowflakeEntrypointTest extends AbstractSnowflakeTest { + public const DRIVER = 'snowflake'; + + public const ROOT_PATH = __DIR__ . '/../../..'; + private function createConfigFile(string $rootPath, string $configType = 'yaml'): void { - $driver = 'snowflake'; - $config = Yaml::parse(file_get_contents($rootPath . '/config.template.yml')); - $config['parameters']['db']['user'] = $this->getEnv($driver, 'DB_USER', true); - $config['parameters']['db']['#password'] = $this->getEnv($driver, 'DB_PASSWORD', true); - $config['parameters']['db']['schema'] = $this->getEnv($driver, 'DB_SCHEMA'); - $config['parameters']['db']['host'] = $this->getEnv($driver, 'DB_HOST'); - $config['parameters']['db']['port'] = $this->getEnv($driver, 'DB_PORT'); - $config['parameters']['db']['database'] = $this->getEnv($driver, 'DB_DATABASE'); - $config['parameters']['db']['warehouse'] = $this->getEnv($driver, 'DB_WAREHOUSE'); + $config['parameters']['db']['user'] = $this->getEnv(self::DRIVER, 'DB_USER', true); + $config['parameters']['db']['#password'] = $this->getEnv(self::DRIVER, 'DB_PASSWORD', true); + $config['parameters']['db']['schema'] = $this->getEnv(self::DRIVER, 'DB_SCHEMA'); + $config['parameters']['db']['host'] = $this->getEnv(self::DRIVER, 'DB_HOST'); + $config['parameters']['db']['port'] = $this->getEnv(self::DRIVER, 'DB_PORT'); + $config['parameters']['db']['database'] = $this->getEnv(self::DRIVER, 'DB_DATABASE'); + $config['parameters']['db']['warehouse'] = $this->getEnv(self::DRIVER, 'DB_WAREHOUSE'); if (isset($config['parameters']['tables'][2]['table'])) { - $config['parameters']['tables'][2]['table']['schema'] = $this->getEnv($driver, 'DB_SCHEMA'); + $config['parameters']['tables'][2]['table']['schema'] = $this->getEnv(self::DRIVER, 'DB_SCHEMA'); } // unlink any old configs written here diff --git a/tests/SnowflakeTest.php b/tests/Keboola/DbExtractor/SnowflakeTest.php similarity index 99% rename from tests/SnowflakeTest.php rename to tests/Keboola/DbExtractor/SnowflakeTest.php index 5b9b1c6..8bd3ff0 100644 --- a/tests/SnowflakeTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Keboola\Test; +namespace Keboola\DbExtractor\Tests; use Keboola\Csv\CsvFile; use Keboola\DbExtractor\Exception\UserException; From ec626bfcd0905a9b0178dbbf32dbb94fa1206035 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 3 Oct 2018 15:35:18 +0200 Subject: [PATCH 25/63] ini-set param type fix --- driver/downloadDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/downloadDriver.php b/driver/downloadDriver.php index 7d280d1..57346e8 100644 --- a/driver/downloadDriver.php +++ b/driver/downloadDriver.php @@ -3,7 +3,7 @@ declare(strict_types=1); date_default_timezone_set('Europe/Prague'); -ini_set('display_errors', true); +ini_set('display_errors', 'true'); error_reporting(E_ALL); $basedir = dirname(__DIR__); From 0ad1b43777d59ed2ae31563d73bf8d51d1aa0376 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 3 Oct 2018 15:42:03 +0200 Subject: [PATCH 26/63] use composer ci from travis --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8576999..059d68b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,7 @@ install: - docker-compose run --rm drivers-download composer install - docker-compose run --rm drivers-download php driver/downloadDriver.php - docker-compose build app - - docker-compose run --rm app vendor/bin/phpcs --standard=psr2 --ignore=vendor -n . - - docker-compose run --rm app vendor/bin/phpunit + - docker-compose run --rm app script: - docker pull quay.io/keboola/developer-portal-cli-v2:latest From 7d50d1d327500e6168377a96d342ebf8e08237e5 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 10 Oct 2018 17:43:49 +0200 Subject: [PATCH 27/63] rollback phpunit and phpstan" --- Dockerfile | 3 +- composer.json | 6 +- composer.lock | 1067 +++++++++++++++++++++++++++++++++++-------------- 3 files changed, 773 insertions(+), 303 deletions(-) diff --git a/Dockerfile b/Dockerfile index 22d83a6..fe22cf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM php:7.1 -MAINTAINER Erik Zigo + +ENV COMPOSER_ALLOW_SUPERUSER=1 ENV DEBIAN_FRONTEND noninteractive # Install Dependencies diff --git a/composer.json b/composer.json index 9bbe184..ce0cef6 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ "keboola/php-csv-db-import": "~2.3.0" }, "require-dev": { - "phpunit/phpunit": "~5.0", + "phpunit/phpunit": "4.6.*", "codeclimate/php-test-reporter": "^0.3", "keboola/coding-standard": "^6.0", "keboola/storage-api-client": "^4.14", - "phpstan/phpstan-shim": "^0.9.2" + "phpstan/phpstan": "^0.8" }, "autoload": { "psr-4": { @@ -35,7 +35,7 @@ }, "scripts": { "tests": "phpunit", - "phpstan": "phpstan analyse --no-progress --level=max --debug ./src ./tests", + "phpstan": "phpstan analyse --no-progress --level=max ./src ./tests", "phpcs": "phpcs -n --ignore=vendor --extensions=php .", "phpcbf": "phpcbf -n --ignore=vendor --extensions=php .", "build": [ diff --git a/composer.lock b/composer.lock index 8333387..95d018d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f38337c209a310b909a9381af9ece791", + "content-hash": "c2667f6d0dffd323fa540d352fb28773", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.68.1", + "version": "3.69.3", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "2986beb07a14bcde94608e940ee7e5cba1ed4e38" + "reference": "92ade997fc057d22bbee902468f749ef8db1c162" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2986beb07a14bcde94608e940ee7e5cba1ed4e38", - "reference": "2986beb07a14bcde94608e940ee7e5cba1ed4e38", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/92ade997fc057d22bbee902468f749ef8db1c162", + "reference": "92ade997fc057d22bbee902468f749ef8db1c162", "shasum": "" }, "require": { @@ -38,6 +38,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 +48,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 +87,7 @@ "s3", "sdk" ], - "time": "2018-10-02T21:11:29+00:00" + "time": "2018-10-09T20:35:16+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1723,6 +1726,57 @@ "abandoned": "guzzlehttp/guzzle", "time": "2015-03-18T18:23:50+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "1.2", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.2.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2018-06-13T13:22:40+00:00" + }, { "name": "keboola/coding-standard", "version": "6.0.0", @@ -1793,52 +1847,499 @@ "time": "2016-12-22T13:13:19+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.8.1", + "name": "nette/bootstrap", + "version": "v2.4.6", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "url": "https://github.com/nette/bootstrap.git", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", "shasum": "" }, "require": { - "php": "^7.1" + "nette/di": "~2.4.7", + "nette/utils": "~2.4", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "latte/latte": "~2.2", + "nette/application": "~2.3", + "nette/caching": "~2.3", + "nette/database": "~2.3", + "nette/forms": "~2.3", + "nette/http": "~2.4.0", + "nette/mail": "~2.3", + "nette/robot-loader": "^2.4.2 || ^3.0", + "nette/safe-stream": "~2.2", + "nette/security": "~2.3", + "nette/tester": "~2.0", + "tracy/tracy": "^2.4.1" + }, + "suggest": { + "nette/robot-loader": "to use Configurator::createRobotLoader()", + "tracy/tracy": "to use Configurator::enableTracy()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", + "homepage": "https://nette.org", + "keywords": [ + "bootstrapping", + "configurator", + "nette" + ], + "time": "2018-05-17T12:52:20+00:00" + }, + { + "name": "nette/di", + "version": "v2.4.14", + "source": { + "type": "git", + "url": "https://github.com/nette/di.git", + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/di/zipball/923da3e2c0aa53162ef455472c0ac7787b096c5a", + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/neon": "^2.3.3 || ~3.0.0", + "nette/php-generator": "^2.6.1 || ~3.0.0", + "nette/utils": "^2.4.3 || ~3.0.0", + "php": ">=5.6.0" + }, + "conflict": { + "nette/bootstrap": "<2.4", + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", + "homepage": "https://nette.org", + "keywords": [ + "compiled", + "di", + "dic", + "factory", + "ioc", + "nette", + "static" + ], + "time": "2018-09-17T15:47:40+00:00" + }, + { + "name": "nette/finder", + "version": "v2.4.2", + "source": { + "type": "git", + "url": "https://github.com/nette/finder.git", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", + "shasum": "" + }, + "require": { + "nette/utils": "~2.4", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🔍 Nette Finder: find files and directories with an intuitive API.", + "homepage": "https://nette.org", + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2018-06-28T11:49:23+00:00" + }, + { + "name": "nette/neon", + "version": "v2.4.3", + "source": { + "type": "git", + "url": "https://github.com/nette/neon.git", + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398", + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "ext-json": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🍸 Nette NEON: encodes and decodes NEON file format.", + "homepage": "http://ne-on.org", + "keywords": [ + "export", + "import", + "neon", + "nette", + "yaml" + ], + "time": "2018-03-21T12:12:21+00:00" + }, + { + "name": "nette/php-generator", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/nette/php-generator.git", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "shasum": "" + }, + "require": { + "nette/utils": "^2.4.2 || ~3.0.0", + "php": ">=7.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", + "homepage": "https://nette.org", + "keywords": [ + "code", + "nette", + "php", + "scaffolding" + ], + "time": "2018-08-09T14:32:27+00:00" + }, + { + "name": "nette/robot-loader", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/nette/robot-loader.git", + "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/fc76c70e740b10f091e502b2e393d0be912f38d4", + "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/finder": "^2.3 || ^3.0", + "nette/utils": "^2.4 || ^3.0", + "php": ">=5.6.0" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", + "homepage": "https://nette.org", + "keywords": [ + "autoload", + "class", + "interface", + "nette", + "trait" + ], + "time": "2018-08-13T14:19:06+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", + "shasum": "" }, - "replace": { - "myclabs/deep-copy": "self.version" + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "composer/composer": "^1.6.3", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } }, - "type": "library", "autoload": { "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + "PackageVersions\\": "src/PackageVersions" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } ], - "time": "2018-06-11T23:09:50+00:00" + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2018-02-05T13:05:30+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2056,78 +2557,94 @@ "time": "2018-08-05T17:53:17+00:00" }, { - "name": "phpstan/phpstan-shim", - "version": "0.9.2", + "name": "phpstan/phpstan", + "version": "0.8.5", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-shim.git", - "reference": "e4720fb2916be05de02869780072253e7e0e8a75" + "url": "https://github.com/phpstan/phpstan.git", + "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-shim/zipball/e4720fb2916be05de02869780072253e7e0e8a75", - "reference": "e4720fb2916be05de02869780072253e7e0e8a75", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0dfb4f00959c53378cf15e32a79a254acada35d7", + "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7", "shasum": "" }, "require": { - "php": "~7.0" + "jean85/pretty-package-versions": "^1.0.2", + "nette/bootstrap": "^2.4 || ^3.0", + "nette/di": "^2.4 || ^3.0", + "nette/robot-loader": "^3.0.1", + "nette/utils": "^2.4 || ^3.0", + "nikic/php-parser": "^3.0.2", + "php": "~7.0", + "symfony/console": "~2.7 || ~3.0", + "symfony/finder": "~2.7 || ~3.0" }, - "replace": { - "phpstan/phpstan": "self.version" + "require-dev": { + "consistence/coding-standard": "^2.0.0", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpunit/phpunit": "^6.3", + "satooshi/php-coveralls": "^1.0", + "slevomat/coding-standard": "^3.1.1" }, "bin": [ - "phpstan", - "phpstan.phar" + "bin/phpstan" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.9-dev" + "dev-master": "0.8-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan Phar distribution", - "time": "2018-01-28T14:29:27+00:00" + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2017-09-06T17:15:07+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -2153,7 +2670,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2294,29 +2811,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "~4.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -2339,54 +2856,44 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.27", + "version": "4.6.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "reference": "7b5fe98b28302a8b25693b2298bca74463336975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b5fe98b28302a8b25693b2298bca74463336975", + "reference": "7b5fe98b28302a8b25693b2298bca74463336975", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "~1.3,>=1.3.1", + "phpunit/php-code-coverage": "~2.0,>=2.0.11", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.2", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" }, "suggest": { - "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -2395,7 +2902,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "4.6.x-dev" } }, "autoload": { @@ -2421,33 +2928,30 @@ "testing", "xunit" ], - "time": "2018-02-01T05:50:59+00:00" + "time": "2015-06-03T05:03:30+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" @@ -2455,7 +2959,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { @@ -2480,7 +2984,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2015-10-02T06:51:40+00:00" }, { "name": "satooshi/php-coveralls", @@ -2544,51 +3048,6 @@ "abandoned": "php-coveralls/php-coveralls", "time": "2017-10-14T23:15:34+00:00" }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, { "name": "sebastian/comparator", "version": "1.2.4", @@ -2707,28 +3166,28 @@ }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2753,25 +3212,25 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "sebastian/recursion-context": "~1.0" }, "require-dev": { "ext-mbstring": "*", @@ -2780,7 +3239,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2820,7 +3279,7 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/global-state", @@ -2873,64 +3332,18 @@ ], "time": "2015-10-12T03:26:01+00:00" }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -2942,7 +3355,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -2970,73 +3383,23 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, - "require": { - "php": ">=5.6" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -3055,7 +3418,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "slevomat/coding-standard", @@ -3150,20 +3513,21 @@ }, { "name": "symfony/console", - "version": "v4.1.5", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d3dbe91fd5b8b11ecb73508c844bc6a490de15b4" + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d3dbe91fd5b8b11ecb73508c844bc6a490de15b4", - "reference": "d3dbe91fd5b8b11ecb73508c844bc6a490de15b4", + "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3172,11 +3536,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3187,7 +3551,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3214,7 +3578,63 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-09-30T03:38:13+00:00" + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "symfony/debug", + "version": "v4.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "e3f76ce6198f81994e019bb2b4e533e9de1b9b90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/e3f76ce6198f81994e019bb2b4e533e9de1b9b90", + "reference": "e3f76ce6198f81994e019bb2b4e533e9de1b9b90", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:36:10+00:00" }, { "name": "symfony/event-dispatcher", @@ -3276,6 +3696,55 @@ "homepage": "https://symfony.com", "time": "2018-07-26T09:03:18+00:00" }, + { + "name": "symfony/finder", + "version": "v3.4.17", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-10-03T08:46:40+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.9.0", @@ -3337,16 +3806,16 @@ }, { "name": "symfony/stopwatch", - "version": "v4.1.5", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "966c982df3cca41324253dc0c7ffe76b6076b705" + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/966c982df3cca41324253dc0c7ffe76b6076b705", - "reference": "966c982df3cca41324253dc0c7ffe76b6076b705", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5bfc064125b73ff81229e19381ce1c34d3416f4b", + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b", "shasum": "" }, "require": { @@ -3382,7 +3851,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:00:49+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "webmozart/assert", From 2a6fa1fb1dbada2f7aacf8ff6db4011ac7878268 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 10 Oct 2018 17:44:20 +0200 Subject: [PATCH 28/63] remove deprecated constants --- run.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/run.php b/run.php index e9bdf4e..ece5dde 100644 --- a/run.php +++ b/run.php @@ -3,18 +3,14 @@ declare(strict_types=1); use Keboola\DbExtractor\SnowflakeApplication; -use Keboola\DbExtractor\Exception\ApplicationException; use Keboola\DbExtractor\Exception\UserException; use Keboola\DbExtractor\Logger; use Monolog\Handler\NullHandler; use Symfony\Component\Yaml\Yaml; -define('APP_NAME', 'ex-db-snowflake'); -define('ROOT_PATH', __DIR__); +require_once __DIR__ . "/vendor/autoload.php"; -require_once dirname(__FILE__) . "/vendor/autoload.php"; - -$logger = new \Keboola\DbExtractor\Logger(APP_NAME); +$logger = new Logger('ex-db-snowflake'); try { $runAction = true; From 1174638c95fb13304d528822cae92936384acd1a Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 10 Oct 2018 17:44:54 +0200 Subject: [PATCH 29/63] wip: trying to fix phpstan recursion error --- .../SnowflakeConfigDefinition.php | 96 ++++--------------- 1 file changed, 21 insertions(+), 75 deletions(-) diff --git a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php index 515ffbf..5b0d21c 100644 --- a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php +++ b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php @@ -4,19 +4,16 @@ namespace Keboola\DbExtractor\Configuration; -use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; -class SnowflakeConfigDefinition implements ConfigurationInterface +class SnowflakeConfigDefinition extends ConfigDefinition { public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('parameters'); // @formatter:off - $rootNode + $treeBuilder->root('parameters') ->children() ->scalarNode('data_dir') ->isRequired() @@ -51,82 +48,31 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->arrayNode('tables') ->prototype('array') - ->children() - ->integerNode('id') - ->isRequired() - ->min(0) - ->end() - ->scalarNode('name') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->scalarNode('query')->end() - ->arrayNode('table') - ->children() - ->scalarNode('schema')->end() - ->scalarNode('tableName')->end() + ->children() + ->integerNode('id')->isRequired()->min(0)->end() + ->scalarNode('name')->isRequired()->cannotBeEmpty()->end() + ->scalarNode('query')->end() + ->arrayNode('table') + ->children() + ->scalarNode('schema')->end() + ->scalarNode('tableName')->end() + ->end() ->end() - ->end() - ->arrayNode('columns') - ->prototype('scalar') - ->end() - ->end() - ->scalarNode('outputTable') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->booleanNode('incremental') - ->defaultValue(false) - ->end() - ->booleanNode('enabled') - ->defaultValue(true) - ->end() - ->arrayNode('primaryKey') - ->prototype('scalar') - ->end() - ->end() - ->integerNode('retries') - ->min(1) + ->arrayNode('columns') + ->prototype('scalar')->end() + ->end() + ->scalarNode('outputTable')->isRequired()->cannotBeEmpty()->end() + ->booleanNode('incremental')->defaultValue(false)->end() + ->booleanNode('enabled')->defaultValue(true)->end() + ->arrayNode('primaryKey') + ->prototype('scalar')->end() + ->end() + ->integerNode('retries')->min(1)->end() ->end() ->end() - ->end() ->end() ->end(); // @formatter:on return $treeBuilder; } - - public function addSshNode(): NodeDefinition - { - $builder = new TreeBuilder(); - $node = $builder->root('ssh'); - - // @formatter:off - $node - ->children() - ->booleanNode('enabled')->end() - ->arrayNode('keys') - ->children() - ->scalarNode('private')->end() - ->scalarNode('#private')->end() - ->scalarNode('public')->end() - ->end() - ->end() - ->scalarNode('sshHost')->end() - ->scalarNode('sshPort') - ->defaultValue("22") - ->end() - ->scalarNode('remoteHost') - ->end() - ->scalarNode('remotePort') - ->end() - ->scalarNode('localPort') - ->defaultValue("33006") - ->end() - ->scalarNode('user')->end() - ->end(); - - // @formatter:on - return $node; - } } From 833ef184054772ff8e1c866af3234736334a6032 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 10 Oct 2018 17:45:20 +0200 Subject: [PATCH 30/63] remove deprecated const reference --- tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php index cfb4ee6..adc19aa 100644 --- a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php @@ -61,7 +61,7 @@ public function testRunAction(string $configType): void $this->createConfigFile($dataPath, $configType); - $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); + $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->setTimeout(300); $process->run(); @@ -84,7 +84,7 @@ public function testConnectionAction(string $configType): void $this->createConfigFile($dataPath, $configType); - $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); + $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->run(); $output = $process->getOutput(); @@ -104,7 +104,7 @@ public function testNonexistingTable(): void @unlink($this->dataDir . '/config.yml'); file_put_contents($this->dataDir . '/config.yml', Yaml::dump($config)); - $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $this->dataDir); + $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $this->dataDir); $process->setTimeout(300); $process->run(); @@ -121,7 +121,7 @@ public function testGetTablesAction(string $configType): void $this->createConfigFile($dataPath, $configType); - $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $dataPath); + $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $dataPath); $process->setTimeout(300); $process->run(); @@ -143,7 +143,7 @@ public function testBadTypesRetries(): void @unlink($this->dataDir . '/config.yml'); file_put_contents($this->dataDir . '/config.yml', Yaml::dump($config)); - $process = new Process('php ' . ROOT_PATH . '/run.php --data=' . $this->dataDir); + $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $this->dataDir); $process->setTimeout(300); $process->run(); From f1b2eef1290963c3b02b24332e43a2195e5dd1c3 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 11 Oct 2018 17:58:04 +0200 Subject: [PATCH 31/63] use stan-shim 0.10 --- composer.json | 2 +- composer.lock | 732 +++----------------------------------------------- 2 files changed, 36 insertions(+), 698 deletions(-) diff --git a/composer.json b/composer.json index ce0cef6..bd8ac6f 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "codeclimate/php-test-reporter": "^0.3", "keboola/coding-standard": "^6.0", "keboola/storage-api-client": "^4.14", - "phpstan/phpstan": "^0.8" + "phpstan/phpstan-shim": "^0.10" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 95d018d..dfa6fe0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c2667f6d0dffd323fa540d352fb28773", + "content-hash": "b05532007e3541c75d25904dd83868a5", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.69.3", + "version": "3.69.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "92ade997fc057d22bbee902468f749ef8db1c162" + "reference": "8e66716ee7bf6a4a4881647c6d96aa8619e82152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/92ade997fc057d22bbee902468f749ef8db1c162", - "reference": "92ade997fc057d22bbee902468f749ef8db1c162", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8e66716ee7bf6a4a4881647c6d96aa8619e82152", + "reference": "8e66716ee7bf6a4a4881647c6d96aa8619e82152", "shasum": "" }, "require": { @@ -87,7 +87,7 @@ "s3", "sdk" ], - "time": "2018-10-09T20:35:16+00:00" + "time": "2018-10-10T22:18:53+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1726,57 +1726,6 @@ "abandoned": "guzzlehttp/guzzle", "time": "2015-03-18T18:23:50+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.2", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "shasum": "" - }, - "require": { - "ocramius/package-versions": "^1.2.0", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "time": "2018-06-13T13:22:40+00:00" - }, { "name": "keboola/coding-standard", "version": "6.0.0", @@ -1846,501 +1795,6 @@ "homepage": "http://keboola.com", "time": "2016-12-22T13:13:19+00:00" }, - { - "name": "nette/bootstrap", - "version": "v2.4.6", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", - "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", - "shasum": "" - }, - "require": { - "nette/di": "~2.4.7", - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.4.0", - "nette/mail": "~2.3", - "nette/robot-loader": "^2.4.2 || ^3.0", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~2.0", - "tracy/tracy": "^2.4.1" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "time": "2018-05-17T12:52:20+00:00" - }, - { - "name": "nette/di", - "version": "v2.4.14", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/923da3e2c0aa53162ef455472c0ac7787b096c5a", - "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^2.3.3 || ~3.0.0", - "nette/php-generator": "^2.6.1 || ~3.0.0", - "nette/utils": "^2.4.3 || ~3.0.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/bootstrap": "<2.4", - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "time": "2018-09-17T15:47:40+00:00" - }, - { - "name": "nette/finder", - "version": "v2.4.2", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", - "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", - "shasum": "" - }, - "require": { - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🔍 Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "time": "2018-06-28T11:49:23+00:00" - }, - { - "name": "nette/neon", - "version": "v2.4.3", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398", - "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "homepage": "http://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "time": "2018-03-21T12:12:21+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", - "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2018-08-09T14:32:27+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.1.0", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/fc76c70e740b10f091e502b2e393d0be912f38d4", - "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.3 || ^3.0", - "nette/utils": "^2.4 || ^3.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "time": "2018-08-13T14:19:06+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v3.1.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2018-02-28T20:30:58+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", - "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0.0", - "php": "^7.1.0" - }, - "require-dev": { - "composer/composer": "^1.6.3", - "ext-zip": "*", - "infection/infection": "^0.7.1", - "phpunit/phpunit": "^7.0.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2018-02-05T13:05:30+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -2557,58 +2011,48 @@ "time": "2018-08-05T17:53:17+00:00" }, { - "name": "phpstan/phpstan", - "version": "0.8.5", + "name": "phpstan/phpstan-shim", + "version": "0.10.3", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7" + "url": "https://github.com/phpstan/phpstan-shim.git", + "reference": "1b12b7b684201385c1bd4bdb8e50ff062b33bb5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0dfb4f00959c53378cf15e32a79a254acada35d7", - "reference": "0dfb4f00959c53378cf15e32a79a254acada35d7", + "url": "https://api.github.com/repos/phpstan/phpstan-shim/zipball/1b12b7b684201385c1bd4bdb8e50ff062b33bb5c", + "reference": "1b12b7b684201385c1bd4bdb8e50ff062b33bb5c", "shasum": "" }, "require": { - "jean85/pretty-package-versions": "^1.0.2", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/utils": "^2.4 || ^3.0", - "nikic/php-parser": "^3.0.2", - "php": "~7.0", - "symfony/console": "~2.7 || ~3.0", - "symfony/finder": "~2.7 || ~3.0" + "php": "~7.1" }, - "require-dev": { - "consistence/coding-standard": "^2.0.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpunit/phpunit": "^6.3", - "satooshi/php-coveralls": "^1.0", - "slevomat/coding-standard": "^3.1.1" + "replace": { + "nikic/php-parser": "^4.0.2", + "phpstan/phpdoc-parser": "^0.3", + "phpstan/phpstan": "self.version" }, "bin": [ - "bin/phpstan" + "phpstan", + "phpstan.phar" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.8-dev" + "dev-master": "0.10-dev" } }, "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", - "time": "2017-09-06T17:15:07+00:00" + "description": "PHPStan Phar distribution", + "time": "2018-08-12T16:21:59+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3513,21 +2957,20 @@ }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/dc7122fe5f6113cfaba3b3de575d31112c9aa60b", + "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3536,11 +2979,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3551,7 +2994,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3578,63 +3021,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "symfony/debug", - "version": "v4.1.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "e3f76ce6198f81994e019bb2b4e533e9de1b9b90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e3f76ce6198f81994e019bb2b4e533e9de1b9b90", - "reference": "e3f76ce6198f81994e019bb2b4e533e9de1b9b90", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-10-02T16:36:10+00:00" + "time": "2018-10-03T08:15:46+00:00" }, { "name": "symfony/event-dispatcher", @@ -3696,55 +3083,6 @@ "homepage": "https://symfony.com", "time": "2018-07-26T09:03:18+00:00" }, - { - "name": "symfony/finder", - "version": "v3.4.17", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.9.0", From 540437ce706f973522f0aec1a430718e6284981a Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 11 Oct 2018 17:58:12 +0200 Subject: [PATCH 32/63] stan fixes --- .../Configuration/SnowflakeConfigDefinition.php | 5 ++++- src/Keboola/DbExtractor/Extractor/Snowflake.php | 8 ++++---- .../DbExtractor/Utils/AccountUrlParser.php | 2 +- .../DbExtractor/SnowflakeEntrypointTest.php | 10 +++++----- tests/Keboola/DbExtractor/SnowflakeTest.php | 16 ++++++++-------- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php index 5b0d21c..f22a728 100644 --- a/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php +++ b/src/Keboola/DbExtractor/Configuration/SnowflakeConfigDefinition.php @@ -4,6 +4,7 @@ namespace Keboola\DbExtractor\Configuration; +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; class SnowflakeConfigDefinition extends ConfigDefinition @@ -11,9 +12,11 @@ class SnowflakeConfigDefinition extends ConfigDefinition public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder(); + /** @var ArrayNodeDefinition $rootNode */ + $rootNode = $treeBuilder->root('parameters'); // @formatter:off - $treeBuilder->root('parameters') + $rootNode ->children() ->scalarNode('data_dir') ->isRequired() diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index ac44931..4192c02 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -210,7 +210,7 @@ function ($column) { ); $snowSql = $this->temp->createTmpFile('snowsql.sql'); - file_put_contents($snowSql, implode("\n", $sql)); + file_put_contents($snowSql->getPathname(), implode("\n", $sql)); $this->logger->debug(trim(implode("\n", $sql))); @@ -258,7 +258,7 @@ function ($column) { sprintf( "%d files (%s) downloaded", count($csvFiles), - $this->dataSizeFormatted($bytesDownloaded) + $this->dataSizeFormatted((int) $bytesDownloaded) ) ); @@ -321,7 +321,7 @@ function () use ($copyCommand, &$counter, &$lastException) { } ); } catch (\Throwable $e) { - if ($lastException) { + if ($lastException !== null) { throw $lastException; } throw $e; @@ -602,7 +602,7 @@ private function crateSnowSqlConfig(array $dbParams): \SplFileInfo } $file = $this->temp->createFile('snowsql.config'); - file_put_contents($file, implode("\n", $cliConfig)); + file_put_contents($file->getPathname(), implode("\n", $cliConfig)); return $file; } diff --git a/src/Keboola/DbExtractor/Utils/AccountUrlParser.php b/src/Keboola/DbExtractor/Utils/AccountUrlParser.php index b46d786..4d77bef 100644 --- a/src/Keboola/DbExtractor/Utils/AccountUrlParser.php +++ b/src/Keboola/DbExtractor/Utils/AccountUrlParser.php @@ -6,7 +6,7 @@ class AccountUrlParser { - public static function parse(string $host): array + public static function parse(string $host): string { $hostParts = explode('.', $host); return implode('.', array_slice($hostParts, 0, count($hostParts) - 2)); diff --git a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php index adc19aa..0637a66 100644 --- a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php @@ -16,7 +16,7 @@ class SnowflakeEntrypointTest extends AbstractSnowflakeTest private function createConfigFile(string $rootPath, string $configType = 'yaml'): void { - $config = Yaml::parse(file_get_contents($rootPath . '/config.template.yml')); + $config = Yaml::parse((string) file_get_contents($rootPath . '/config.template.yml')); $config['parameters']['db']['user'] = $this->getEnv(self::DRIVER, 'DB_USER', true); $config['parameters']['db']['#password'] = $this->getEnv(self::DRIVER, 'DB_PASSWORD', true); $config['parameters']['db']['schema'] = $this->getEnv(self::DRIVER, 'DB_SCHEMA'); @@ -43,8 +43,8 @@ private function createConfigFile(string $rootPath, string $configType = 'yaml') } /** - * @param $configType * @dataProvider configTypesProvider + * @param string $configType */ public function testRunAction(string $configType): void { @@ -65,7 +65,7 @@ public function testRunAction(string $configType): void $process->setTimeout(300); $process->run(); - $this->assertEquals(0, $process->getExitCode(), sprintf('error output: ', $process->getErrorOutput())); + $this->assertEquals(0, $process->getExitCode(), sprintf('error output: %s', $process->getErrorOutput())); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz"); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz.manifest"); $this->assertFileExists($dataPath . "/out/tables/in_c-main_escaping.csv.gz"); @@ -75,8 +75,8 @@ public function testRunAction(string $configType): void } /** - * @param $configType * @dataProvider configTypesProvider + * @param string $configType */ public function testConnectionAction(string $configType): void { @@ -112,8 +112,8 @@ public function testNonexistingTable(): void } /** - * @param $configType * @dataProvider configTypesProvider + * @param string $configType */ public function testGetTablesAction(string $configType): void { diff --git a/tests/Keboola/DbExtractor/SnowflakeTest.php b/tests/Keboola/DbExtractor/SnowflakeTest.php index 8bd3ff0..ab535ef 100644 --- a/tests/Keboola/DbExtractor/SnowflakeTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeTest.php @@ -848,7 +848,7 @@ public function testManifestMetadata(): void $result = $app->run(); $outputManifest = Yaml::parse( - file_get_contents($this->dataDir . '/out/tables/in_c-main_tableColumns.csv.gz.manifest') + (string) file_get_contents($this->dataDir . '/out/tables/in_c-main_tableColumns.csv.gz.manifest') ); $this->assertArrayHasKey('destination', $outputManifest); @@ -1048,7 +1048,7 @@ public function testSemiStructured(): void exec("gunzip -d " . escapeshellarg($archiveFile), $output, $return); $this->assertEquals(0, $return); - $rawFile = new \SplFileInfo($this->dataDir . '/out/tables/in_c-main_semi-structured.csv.gz/part_0_0_0.csv'); + $rawFile = $this->dataDir . '/out/tables/in_c-main_semi-structured.csv.gz/part_0_0_0.csv'; $this->assertEquals( file_get_contents($this->dataDir . '/snowflake/expected-semi-structured.csv'), file_get_contents($rawFile) @@ -1106,7 +1106,7 @@ function ($manifestFileName) use ($dirPath) { return $dirPath . '/' . $manifestFileName; }, array_filter( - scandir($dirPath), + (array) scandir($dirPath), function ($fileName) use ($dirPath, $outputTable) { $filePath = $dirPath . '/' . $fileName; if (is_dir($filePath)) { @@ -1118,7 +1118,7 @@ function ($fileName) use ($dirPath, $outputTable) { return false; } - $manifest = Yaml::parse(file_get_contents($file)); + $manifest = Yaml::parse((string) file_get_contents($file->getPathname())); return $manifest['destination'] === $outputTable; } ) @@ -1132,7 +1132,7 @@ function ($fileName) use ($dirPath, $outputTable) { $columns = []; foreach ($manifestFiles as $file) { // manifest validation - $params = Yaml::parse(file_get_contents($file)); + $params = Yaml::parse((string) file_get_contents($file)); $this->assertArrayHasKey('destination', $params); $this->assertArrayHasKey('incremental', $params); @@ -1152,13 +1152,13 @@ function ($fileName) use ($dirPath, $outputTable) { $this->assertEquals($query['outputTable'], $params['destination']); } - $csvDir = new \SplFileInfo(str_replace('.manifest', '', $file)); + $csvDir = str_replace('.manifest', '', $file); $this->assertTrue(is_dir($csvDir)); - foreach (array_diff(scandir($csvDir), array('..', '.')) as $csvFile) { + foreach (array_diff((array) scandir($csvDir), array('..', '.')) as $csvFile) { // archive validation - $archiveFile = new \SplFileInfo($csvDir . "/" . $csvFile); + $archiveFile = $csvDir . "/" . $csvFile; $pos = strrpos($archiveFile, ".gz"); $rawFile = new \SplFileInfo(substr_replace($archiveFile, '', $pos, strlen(".gz"))); From 37611f15a20d7617de4911f561ee0f44bdccdfc6 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 16 Oct 2018 13:57:38 +0200 Subject: [PATCH 33/63] add phpstan.neon --- composer.json | 2 +- phpstan.neon | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 phpstan.neon diff --git a/composer.json b/composer.json index bd8ac6f..7770cfe 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ }, "scripts": { "tests": "phpunit", - "phpstan": "phpstan analyse --no-progress --level=max ./src ./tests", + "phpstan": "phpstan analyse --no-progress --level=max -c phpstan.neon ./src ./tests", "phpcs": "phpcs -n --ignore=vendor --extensions=php .", "phpcbf": "phpcbf -n --ignore=vendor --extensions=php .", "build": [ diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..f318682 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,3 @@ +parameters: + ignoreErrors: + - '#Cannot call method scalarNode()#' From 1ba870af6c5b540fc34845ae0e7b7b49a284d7e9 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Fri, 26 Oct 2018 15:11:29 +0200 Subject: [PATCH 34/63] strict type casting for row count --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 4192c02..2bd43c0 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -184,7 +184,7 @@ function ($column) { return 0; } - $rowCount = $res[0]['rows_unloaded']; + $rowCount = (int) $res[0]['rows_unloaded']; $this->logger->info("Downloading data from Snowflake"); From 47ab800dfe2c4ad16943d8452896c652b6a190b3 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Fri, 26 Oct 2018 15:11:47 +0200 Subject: [PATCH 35/63] fix datadir location --- tests/Keboola/DbExtractor/AbstractSnowflakeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php index 7b78b38..c340016 100644 --- a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php +++ b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php @@ -27,7 +27,7 @@ abstract class AbstractSnowflakeTest extends ExtractorTest protected $storageApiClient; /** @var string */ - protected $dataDir = __DIR__ . '/data'; + protected $dataDir = __DIR__ . '/../../data'; public function setUp(): void { From 8bfe9ecc6966e259aaae310cfb04d019a9897504 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Mon, 29 Oct 2018 13:44:47 +0100 Subject: [PATCH 36/63] remove timeout on composer processes --- composer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 7770cfe..f07dd4e 100644 --- a/composer.json +++ b/composer.json @@ -47,5 +47,9 @@ "@composer validate --no-check-all --strict", "@build" ] + }, + "config": { + "process-timeout": 0, + "sort-packages": true } } From 61bfa6035fb2b2020bc17cace786c6673fb237d4 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Mon, 29 Oct 2018 15:38:09 +0100 Subject: [PATCH 37/63] fix dataPaths for run tests --- tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php index 0637a66..0904df8 100644 --- a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php @@ -48,7 +48,7 @@ private function createConfigFile(string $rootPath, string $configType = 'yaml') */ public function testRunAction(string $configType): void { - $dataPath = __DIR__ . '/data/runAction'; + $dataPath = __DIR__ . '/../../data/runAction'; @unlink($dataPath . "/out/tables/in.c-main_sales.csv.gz"); @unlink($dataPath . "/out/tables/in.c-main_sales.csv.gz.manifest"); @@ -80,7 +80,7 @@ public function testRunAction(string $configType): void */ public function testConnectionAction(string $configType): void { - $dataPath = __DIR__ . '/data/connectionAction'; + $dataPath = __DIR__ . '/../../data/connectionAction'; $this->createConfigFile($dataPath, $configType); @@ -117,7 +117,7 @@ public function testNonexistingTable(): void */ public function testGetTablesAction(string $configType): void { - $dataPath = __DIR__ . '/data/getTablesAction'; + $dataPath = __DIR__ . '/../../data/getTablesAction'; $this->createConfigFile($dataPath, $configType); From a6eb0e3f8ad83c009cf8f5986de1b078b832a4e6 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Mon, 29 Oct 2018 17:45:02 +0100 Subject: [PATCH 38/63] fix dirs for dir cleanup --- tests/Keboola/DbExtractor/AbstractSnowflakeTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php index c340016..b7cba94 100644 --- a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php +++ b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php @@ -54,11 +54,11 @@ public function setUp(): void $this->setupTables(); $fileSystem = new Filesystem(); - $fileSystem->remove(__DIR__ . '/data/out'); - $fileSystem->remove(__DIR__ . '/data/runAction/config.yml'); - $fileSystem->remove(__DIR__ . '/data/runAction/out'); - $fileSystem->remove(__DIR__ . '/data/connectionAction/config.yml'); - $fileSystem->remove(__DIR__ . '/tests/data/connectionAction/out'); + $fileSystem->remove($this->dataDir . '/out'); + $fileSystem->remove($this->dataDir . '/runAction/config.yml'); + $fileSystem->remove($this->dataDir . '/runAction/out'); + $fileSystem->remove($this->dataDir . '/connectionAction/config.yml'); + $fileSystem->remove($this->dataDir . '/connectionAction/out'); } public function getConfig(string $driver = 'snowflake', string $format = 'json'): array From 67c139e10f42f655fcaaf21e81caaf686866a54a Mon Sep 17 00:00:00 2001 From: pivnicek Date: Mon, 29 Oct 2018 17:55:36 +0100 Subject: [PATCH 39/63] add dir cleaning for getTables and json files --- tests/Keboola/DbExtractor/AbstractSnowflakeTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php index b7cba94..44a7e2b 100644 --- a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php +++ b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php @@ -56,9 +56,14 @@ public function setUp(): void $fileSystem = new Filesystem(); $fileSystem->remove($this->dataDir . '/out'); $fileSystem->remove($this->dataDir . '/runAction/config.yml'); + $fileSystem->remove($this->dataDir . '/runAction/config.json'); $fileSystem->remove($this->dataDir . '/runAction/out'); $fileSystem->remove($this->dataDir . '/connectionAction/config.yml'); + $fileSystem->remove($this->dataDir . '/connectionAction/config.json'); $fileSystem->remove($this->dataDir . '/connectionAction/out'); + $fileSystem->remove($this->dataDir . '/getTablesAction/config.yml'); + $fileSystem->remove($this->dataDir . '/getTablesAction/config.json'); + $fileSystem->remove($this->dataDir . '/getTablesAction/out'); } public function getConfig(string $driver = 'snowflake', string $format = 'json'): array From 8c47742662c4b3c358b3e3b630d8c49c93e8f1f4 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 30 Oct 2018 10:16:21 +0100 Subject: [PATCH 40/63] fix indentation --- driver/downloadDriver.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/driver/downloadDriver.php b/driver/downloadDriver.php index 57346e8..9e70d97 100644 --- a/driver/downloadDriver.php +++ b/driver/downloadDriver.php @@ -12,27 +12,27 @@ $client = new \Aws\S3\S3Client( [ - 'region' => 'us-east-1', - 'version' => '2006-03-01', - 'credentials' => [ - 'key' => getenv('AWS_ACCESS_KEY'), - 'secret' => getenv('AWS_SECRET_KEY'), - ], + 'region' => 'us-east-1', + 'version' => '2006-03-01', + 'credentials' => [ + 'key' => getenv('AWS_ACCESS_KEY'), + 'secret' => getenv('AWS_SECRET_KEY'), + ], ] ); $client->getObject( [ - 'Bucket' => 'keboola-configs', - 'Key' => 'drivers/snowflake/snowflake-odbc-2.13.17.x86_64.deb', - 'SaveAs' => './snowflake-odbc-x86_64.deb', + 'Bucket' => 'keboola-configs', + 'Key' => 'drivers/snowflake/snowflake-odbc-2.13.17.x86_64.deb', + 'SaveAs' => './snowflake-odbc-x86_64.deb', ] ); $client->getObject( [ - 'Bucket' => 'keboola-configs', - 'Key' => 'drivers/snowflake-snowsql/snowsql-1.1.50-linux_x86_64.bash', - 'SaveAs' => './snowsql-linux_x86_64.bash', + 'Bucket' => 'keboola-configs', + 'Key' => 'drivers/snowflake-snowsql/snowsql-1.1.50-linux_x86_64.bash', + 'SaveAs' => './snowsql-linux_x86_64.bash', ] ); From 8751ba973ffb479677a7535fa328b78c447d8f15 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 30 Oct 2018 10:17:17 +0100 Subject: [PATCH 41/63] improve error message --- run.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.php b/run.php index ece5dde..fc2f609 100644 --- a/run.php +++ b/run.php @@ -30,7 +30,7 @@ true ); } else { - throw new UserException('Invalid configuration file type'); + throw new UserException('Could not find configuration file'); } $app = new SnowflakeApplication($config, $logger, [], $arguments["data"]); From cf59ee6c1e84583c11a8e182df91dd2575a42d0e Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 30 Oct 2018 10:21:52 +0100 Subject: [PATCH 42/63] add typehinting to closures --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 2bd43c0..482fdb2 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -153,7 +153,7 @@ private function exportAndDownload(array $table): int $columnInfo = $this->getColumnInfo($query); $objectColumns = array_filter( $columnInfo, - function ($column) { + function ($column): bool { return in_array($column['type'], self::SEMI_STRUCTURED_TYPES); } ); @@ -245,7 +245,7 @@ function ($column) { $this->createTableManifest( $table, array_map( - function ($column) { + function ($column): string { return $column['name']; }, $columnInfo @@ -445,7 +445,7 @@ public function getTables(?array $tables = null): array implode( ', ', array_map( - function ($tableName) { + function ($tableName): string { return "'" . $tableName . "'"; }, $tableNameArray @@ -490,7 +490,7 @@ public function simpleQuery(array $table, array $columns = array()): string implode( ', ', array_map( - function ($column) { + function ($column): string { return $this->db->quoteIdentifier($column); }, $columns @@ -515,7 +515,7 @@ private function simpleQueryWithCasting(array $table, array $columnInfo) : strin implode( ', ', array_map( - function ($column) { + function ($column): string { if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { return sprintf( 'CAST(%s AS TEXT) AS %s', From b09fe651df275121bc8e59639e668c45ac4c35b7 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 30 Oct 2018 13:40:34 +0100 Subject: [PATCH 43/63] write manifest as json --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 482fdb2..6f0add5 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -241,7 +241,7 @@ function ($column): bool { file_put_contents( $outputDataDir . '.manifest', - Yaml::dump( + json_encode( $this->createTableManifest( $table, array_map( From 8670748cc40ba6e2a8b092ae13243d89c927db88 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Tue, 30 Oct 2018 13:43:13 +0100 Subject: [PATCH 44/63] remove unnecessary method doc comments --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 8 ++++---- tests/Keboola/DbExtractor/AbstractSnowflakeTest.php | 10 ---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 6f0add5..d43fd57 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -35,16 +35,16 @@ class Snowflake extends Extractor */ private $snowSqlConfig; - /** @var string */ + /** @var string */ private $warehouse; - /** @var string */ + /** @var string */ private $database; - /** @var string */ + /** @var string */ private $schema; - /** @var string */ + /** @var string */ private $user; /** diff --git a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php index 44a7e2b..268d80b 100644 --- a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php +++ b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php @@ -82,10 +82,6 @@ public function getConfig(string $driver = 'snowflake', string $format = 'json') return $config; } - /** - * @param array $config - * @return SnowflakeApplication - */ public function createApplication(array $config): SnowflakeApplication { $logger = new Logger('ex-db-snowflake-tests'); @@ -260,12 +256,6 @@ function ($column) { $this->assertEquals($this->countTable($file), (int) $result[0]['ROWCOUNT']); } - /** - * Count records in CSV (with headers) - * - * @param CsvFile $file - * @return int - */ protected function countTable(CsvFile $file): int { $linesCount = 0; From 973a601bc0957572c410d687b1e37a3f724703e1 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 15:26:33 +0100 Subject: [PATCH 45/63] remove unused uses --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index d43fd57..067cfaa 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -5,7 +5,6 @@ namespace Keboola\DbExtractor\Extractor; use Keboola\Csv\CsvFile; -use Keboola\Db\Import\Exception; use Keboola\DbExtractor\Exception\UserException; use Keboola\DbExtractor\Logger; use Keboola\Db\Import\Snowflake\Connection; @@ -18,7 +17,6 @@ use Retry\Policy\SimpleRetryPolicy; use Retry\RetryProxy; use Symfony\Component\Process\Process; -use Symfony\Component\Yaml\Yaml; class Snowflake extends Extractor { From ea85899847c276b65990051a429f14beecb0ebc3 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 17:18:45 +0100 Subject: [PATCH 46/63] debug tests --- .../DbExtractor/SnowflakeEntrypointTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php index 0904df8..14e27c1 100644 --- a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php +++ b/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php @@ -65,6 +65,9 @@ public function testRunAction(string $configType): void $process->setTimeout(300); $process->run(); + var_export($process->getOutput()); + var_export($process->getErrorOutput()); + $this->assertEquals(0, $process->getExitCode(), sprintf('error output: %s', $process->getErrorOutput())); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz"); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz.manifest"); @@ -87,6 +90,9 @@ public function testConnectionAction(string $configType): void $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->run(); + var_export($process->getOutput()); + var_export($process->getErrorOutput()); + $output = $process->getOutput(); $this->assertEquals(0, $process->getExitCode()); @@ -108,6 +114,9 @@ public function testNonexistingTable(): void $process->setTimeout(300); $process->run(); + var_export($process->getOutput()); + var_export($process->getErrorOutput()); + $this->assertEquals(1, $process->getExitCode()); } @@ -125,6 +134,9 @@ public function testGetTablesAction(string $configType): void $process->setTimeout(300); $process->run(); + var_export($process->getOutput()); + var_export($process->getErrorOutput()); + $this->assertJson($process->getOutput()); $this->assertEquals(0, $process->getExitCode()); $this->assertEquals("", $process->getErrorOutput()); @@ -147,6 +159,9 @@ public function testBadTypesRetries(): void $process->setTimeout(300); $process->run(); + var_export($process->getOutput()); + var_export($process->getErrorOutput()); + // make sure we tried 4 additional times $this->assertContains('[4x]', $process->getOutput()); $this->assertContains('failed with message:', $process->getErrorOutput()); From 3a60372cdaf5e8da8414e90c6e1e9ecddd31a14b Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 17:23:59 +0100 Subject: [PATCH 47/63] fix doc spacing --- tests/Keboola/DbExtractor/AbstractSnowflakeTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php index 268d80b..ef3f68b 100644 --- a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php +++ b/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php @@ -198,8 +198,8 @@ private function generateCreateCommand(string $tableName, CsvFile $csv, array $f * Create table from csv file with text columns * * @param CsvFile $file - * @param string $tableName - optional name override (default uses filename) - * @param string $schemaName - optional schema in which to create the table + * @param string $tableName - optional name override (default uses filename) + * @param string $schemaName - optional schema in which to create the table */ protected function createTextTable(CsvFile $file, ?string $tableName = null, ?string $schemaName = null): void { From cd858c2ed1265e7d4c76c6a235223a9a3dbe1967 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 17:24:18 +0100 Subject: [PATCH 48/63] fix typo in method name --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 067cfaa..6deb7bb 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -59,7 +59,7 @@ public function __construct(array $parameters, array $state, Logger $logger) public function createConnection(array $dbParams): Connection { - $this->snowSqlConfig = $this->crateSnowSqlConfig($dbParams); + $this->snowSqlConfig = $this->createSnowSqlConfig($dbParams); $connection = new Connection($dbParams); @@ -579,7 +579,7 @@ private function quote(string $value): string return "'" . addslashes($value) . "'"; } - private function crateSnowSqlConfig(array $dbParams): \SplFileInfo + private function createSnowSqlConfig(array $dbParams): \SplFileInfo { $cliConfig[] = ''; $cliConfig[] = '[options]'; From b350ab4f256bcdd9bb2aed395391a9644e8c937a Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 17:26:12 +0100 Subject: [PATCH 49/63] use quote method --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 6deb7bb..57f308f 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -444,7 +444,7 @@ public function getTables(?array $tables = null): array ', ', array_map( function ($tableName): string { - return "'" . $tableName . "'"; + return $this->quote($tableName); }, $tableNameArray ) From 7e776f6bb333fa62f256a4ab7effd9fc62f94bfe Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 17:43:08 +0100 Subject: [PATCH 50/63] remove useless diffs --- driver/downloadDriver.php | 42 +++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/driver/downloadDriver.php b/driver/downloadDriver.php index 9e70d97..2005327 100644 --- a/driver/downloadDriver.php +++ b/driver/downloadDriver.php @@ -10,29 +10,23 @@ require_once $basedir . '/vendor/autoload.php'; -$client = new \Aws\S3\S3Client( - [ - 'region' => 'us-east-1', - 'version' => '2006-03-01', - 'credentials' => [ - 'key' => getenv('AWS_ACCESS_KEY'), - 'secret' => getenv('AWS_SECRET_KEY'), - ], - ] -); +$client = new \Aws\S3\S3Client([ + 'region' => 'us-east-1', + 'version' => '2006-03-01', + 'credentials' => [ + 'key' => getenv('AWS_ACCESS_KEY'), + 'secret' => getenv('AWS_SECRET_KEY'), + ], +]); -$client->getObject( - [ - 'Bucket' => 'keboola-configs', - 'Key' => 'drivers/snowflake/snowflake-odbc-2.13.17.x86_64.deb', - 'SaveAs' => './snowflake-odbc-x86_64.deb', - ] -); +$client->getObject([ + 'Bucket' => 'keboola-configs', + 'Key' => 'drivers/snowflake/snowflake-odbc-2.13.17.x86_64.deb', + 'SaveAs' => './snowflake-odbc-x86_64.deb', +]); -$client->getObject( - [ - 'Bucket' => 'keboola-configs', - 'Key' => 'drivers/snowflake-snowsql/snowsql-1.1.50-linux_x86_64.bash', - 'SaveAs' => './snowsql-linux_x86_64.bash', - ] -); +$client->getObject([ + 'Bucket' => 'keboola-configs', + 'Key' => 'drivers/snowflake-snowsql/snowsql-1.1.50-linux_x86_64.bash', + 'SaveAs' => './snowsql-linux_x86_64.bash', +]); From e46972d5bccbfbd3788b041e30da07e5cf9b2390 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 17:47:48 +0100 Subject: [PATCH 51/63] improve conditional aesthetics --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 57f308f..4be6b33 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -409,7 +409,8 @@ public function getTables(?array $tables = null): array $tableNameArray = []; $tableDefs = []; foreach ($arr as $table) { - if (($this->schema && $table['schema_name'] !== $this->schema) + if ( + ($this->schema && $table['schema_name'] !== $this->schema) || $table['schema_name'] === 'INFORMATION_SCHEMA' ) { continue; From b7155dd182a9c1886ffa68048268c0b8e41f01a0 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 18:05:16 +0100 Subject: [PATCH 52/63] move tests to top-level tests directory --- composer.json | 2 +- tests/{Keboola/DbExtractor => }/AbstractSnowflakeTest.php | 2 +- tests/{Keboola/DbExtractor => }/AccountParseTest.php | 0 .../{Keboola/DbExtractor => }/SnowflakeEntrypointTest.php | 8 ++++---- tests/{Keboola/DbExtractor => }/SnowflakeTest.php | 0 5 files changed, 6 insertions(+), 6 deletions(-) rename tests/{Keboola/DbExtractor => }/AbstractSnowflakeTest.php (99%) rename tests/{Keboola/DbExtractor => }/AccountParseTest.php (100%) rename tests/{Keboola/DbExtractor => }/SnowflakeEntrypointTest.php (96%) rename tests/{Keboola/DbExtractor => }/SnowflakeTest.php (100%) diff --git a/composer.json b/composer.json index f07dd4e..f2dc02c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "autoload-dev": { "psr-4": { - "Keboola\\DbExtractor\\Tests\\": "tests/Keboola/DbExtractor/" + "Keboola\\DbExtractor\\Tests\\": "tests/" } }, "scripts": { diff --git a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php similarity index 99% rename from tests/Keboola/DbExtractor/AbstractSnowflakeTest.php rename to tests/AbstractSnowflakeTest.php index ef3f68b..3223b13 100644 --- a/tests/Keboola/DbExtractor/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -27,7 +27,7 @@ abstract class AbstractSnowflakeTest extends ExtractorTest protected $storageApiClient; /** @var string */ - protected $dataDir = __DIR__ . '/../../data'; + protected $dataDir = __DIR__ . '/data'; public function setUp(): void { diff --git a/tests/Keboola/DbExtractor/AccountParseTest.php b/tests/AccountParseTest.php similarity index 100% rename from tests/Keboola/DbExtractor/AccountParseTest.php rename to tests/AccountParseTest.php diff --git a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php similarity index 96% rename from tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php rename to tests/SnowflakeEntrypointTest.php index 14e27c1..d7b5fba 100644 --- a/tests/Keboola/DbExtractor/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -12,7 +12,7 @@ class SnowflakeEntrypointTest extends AbstractSnowflakeTest { public const DRIVER = 'snowflake'; - public const ROOT_PATH = __DIR__ . '/../../..'; + public const ROOT_PATH = __DIR__ . '/..'; private function createConfigFile(string $rootPath, string $configType = 'yaml'): void { @@ -48,7 +48,7 @@ private function createConfigFile(string $rootPath, string $configType = 'yaml') */ public function testRunAction(string $configType): void { - $dataPath = __DIR__ . '/../../data/runAction'; + $dataPath = __DIR__ . '/data/runAction'; @unlink($dataPath . "/out/tables/in.c-main_sales.csv.gz"); @unlink($dataPath . "/out/tables/in.c-main_sales.csv.gz.manifest"); @@ -83,7 +83,7 @@ public function testRunAction(string $configType): void */ public function testConnectionAction(string $configType): void { - $dataPath = __DIR__ . '/../../data/connectionAction'; + $dataPath = __DIR__ . '/data/connectionAction'; $this->createConfigFile($dataPath, $configType); @@ -126,7 +126,7 @@ public function testNonexistingTable(): void */ public function testGetTablesAction(string $configType): void { - $dataPath = __DIR__ . '/../../data/getTablesAction'; + $dataPath = __DIR__ . '/data/getTablesAction'; $this->createConfigFile($dataPath, $configType); diff --git a/tests/Keboola/DbExtractor/SnowflakeTest.php b/tests/SnowflakeTest.php similarity index 100% rename from tests/Keboola/DbExtractor/SnowflakeTest.php rename to tests/SnowflakeTest.php From 7ea2ff409cb7ba6bb152cee4d2f638b526afa6ac Mon Sep 17 00:00:00 2001 From: pivnicek Date: Wed, 7 Nov 2018 18:14:25 +0100 Subject: [PATCH 53/63] revert aesthetic conditional, sniff doesn't like it --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 4be6b33..57f308f 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -409,8 +409,7 @@ public function getTables(?array $tables = null): array $tableNameArray = []; $tableDefs = []; foreach ($arr as $table) { - if ( - ($this->schema && $table['schema_name'] !== $this->schema) + if (($this->schema && $table['schema_name'] !== $this->schema) || $table['schema_name'] === 'INFORMATION_SCHEMA' ) { continue; From a0cbdcae4e28d0bdc8160acc1ac8b400d96b3528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 10:43:32 +0100 Subject: [PATCH 54/63] Fix long conditional --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 57f308f..77a2a89 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -389,7 +389,7 @@ private function createTableManifest(array $table, array $columns): array return $manifestData; } - + private function dataSizeFormatted(int $bytes): string { $base = log($bytes) / log(1024); @@ -409,9 +409,7 @@ public function getTables(?array $tables = null): array $tableNameArray = []; $tableDefs = []; foreach ($arr as $table) { - if (($this->schema && $table['schema_name'] !== $this->schema) - || $table['schema_name'] === 'INFORMATION_SCHEMA' - ) { + if ($this->shouldTableBeSkipped($table)) { continue; } if (is_null($tables) || !(array_search($table['name'], array_column($tables, 'tableName')) === false)) { @@ -480,6 +478,13 @@ function ($tableName): string { return array_values($tableDefs); } + private function shouldTableBeSkipped(array $table): bool + { + $isFromDifferentSchema = $this->schema && $table['schema_name'] !== $this->schema; + $isFromInformationSchema = $table['schema_name'] === 'INFORMATION_SCHEMA'; + return $isFromDifferentSchema || $isFromInformationSchema; + } + public function simpleQuery(array $table, array $columns = array()): string { if (count($columns) > 0) { From 56b21b7b0f16072feaf9a6923bc39e022642067d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:03:27 +0100 Subject: [PATCH 55/63] Revert useless diffs --- .../DbExtractor/Extractor/Snowflake.php | 126 ++++++++---------- tests/AbstractSnowflakeTest.php | 6 +- 2 files changed, 56 insertions(+), 76 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 77a2a89..c14b852 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -94,12 +94,10 @@ public function testConnection(): void } try { - $this->db->query( - sprintf( - 'USE WAREHOUSE %s;', - $this->db->quoteIdentifier($warehouse) - ) - ); + $this->db->query(sprintf( + 'USE WAREHOUSE %s;', + $this->db->quoteIdentifier($warehouse) + )); } catch (\Throwable $e) { if (preg_match('/Object does not exist/ui', $e->getMessage())) { throw new UserException(sprintf('Invalid warehouse "%s" specified', $warehouse)); @@ -149,12 +147,9 @@ private function exportAndDownload(array $table): int if (!isset($table['query']) || $table['query'] === '') { $query = $this->simpleQuery($table['table'], $table['columns']); $columnInfo = $this->getColumnInfo($query); - $objectColumns = array_filter( - $columnInfo, - function ($column): bool { - return in_array($column['type'], self::SEMI_STRUCTURED_TYPES); - } - ); + $objectColumns = array_filter($columnInfo, function ($column): bool { + return in_array($column['type'], self::SEMI_STRUCTURED_TYPES); + }); if (!empty($objectColumns)) { $query = $this->simpleQueryWithCasting($table['table'], $columnInfo); } @@ -300,24 +295,22 @@ private function executeCopyCommand(string $copyCommand, int $maxTries = 5): arr /** @var \Exception $lastException */ $lastException = null; try { - $ret = $proxy->call( - function () use ($copyCommand, &$counter, &$lastException) { - if ($counter > 0) { - $this->logger->info(sprintf('%s. Retrying... [%dx]', $lastException->getMessage(), $counter)); - } - try { - return $this->db->fetchAll($copyCommand); - } catch (\Throwable $e) { - $lastException = new UserException( - sprintf("Copy Command failed: %s", $e->getMessage()), - 0, - $e - ); - $counter++; - throw $e; - } + $ret = $proxy->call(function () use ($copyCommand, &$counter, &$lastException) { + if ($counter > 0) { + $this->logger->info(sprintf('%s. Retrying... [%dx]', $lastException->getMessage(), $counter)); } - ); + try { + return $this->db->fetchAll($copyCommand); + } catch (\Throwable $e) { + $lastException = new UserException( + sprintf("Copy Command failed: %s", $e->getMessage()), + 0, + $e + ); + $counter++; + throw $e; + } + }); } catch (\Throwable $e) { if ($lastException !== null) { throw $lastException; @@ -438,15 +431,12 @@ public function getTables(?array $tables = null): array "SELECT * FROM information_schema.columns WHERE TABLE_NAME IN (%s) ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION", - implode( - ', ', - array_map( - function ($tableName): string { - return $this->quote($tableName); - }, - $tableNameArray - ) - ) + implode(', ', array_map( + function ($tableName): string { + return $this->quote($tableName); + }, + $tableNameArray + )) ); $columns = $this->db->fetchAll($sql); @@ -490,15 +480,12 @@ public function simpleQuery(array $table, array $columns = array()): string if (count($columns) > 0) { return sprintf( "SELECT %s FROM %s.%s", - implode( - ', ', - array_map( - function ($column): string { - return $this->db->quoteIdentifier($column); - }, - $columns - ) - ), + implode(', ', array_map( + function ($column): string { + return $this->db->quoteIdentifier($column); + }, + $columns + )), $this->db->quoteIdentifier($table['schema']), $this->db->quoteIdentifier($table['tableName']) ); @@ -515,22 +502,19 @@ private function simpleQueryWithCasting(array $table, array $columnInfo) : strin { return sprintf( "SELECT %s FROM %s.%s", - implode( - ', ', - array_map( - function ($column): string { - if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { - return sprintf( - 'CAST(%s AS TEXT) AS %s', - $this->db->quoteIdentifier($column['name']), - $this->db->quoteIdentifier($column['name']) - ); - } - return $this->db->quoteIdentifier($column['name']); - }, - $columnInfo - ) - ), + implode(', ', array_map( + function ($column): string { + if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { + return sprintf( + 'CAST(%s AS TEXT) AS %s', + $this->db->quoteIdentifier($column['name']), + $this->db->quoteIdentifier($column['name']) + ); + } + return $this->db->quoteIdentifier($column['name']); + }, + $columnInfo + )), $this->db->quoteIdentifier($table['schema']), $this->db->quoteIdentifier($table['tableName']) ); @@ -557,15 +541,13 @@ function ($item): bool { foreach ($lines as $line) { if (!preg_match('/^downloaded$/ui', $line[2])) { - throw new \Exception( - sprintf( - "Cannot download file: %s Status: %s Size: %s Message: %s", - $line[0], - $line[2], - $line[1], - $line[3] - ) - ); + throw new \Exception(sprintf( + "Cannot download file: %s Status: %s Size: %s Message: %s", + $line[0], + $line[2], + $line[1], + $line[3] + )); } $file = new \SplFileInfo($path . '/' . $line[0]); diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index 3223b13..caaef7f 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -45,11 +45,9 @@ public function setUp(): void sprintf("USE SCHEMA %s", $this->connection->quoteIdentifier($config['parameters']['db']['schema'])) ); - $this->storageApiClient = new Client( - [ + $this->storageApiClient = new Client([ 'token' => getenv('STORAGE_API_TOKEN'), - ] - ); + ]); $this->setupTables(); From 40330ddd9dcc60b0186b3f92a72008737cd09fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:10:58 +0100 Subject: [PATCH 56/63] fixup! Revert useless diffs --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index c14b852..85f9257 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -247,13 +247,11 @@ function ($column): string { ) ); - $this->logger->info( - sprintf( - "%d files (%s) downloaded", - count($csvFiles), - $this->dataSizeFormatted((int) $bytesDownloaded) - ) - ); + $this->logger->info(sprintf( + "%d files (%s) downloaded", + count($csvFiles), + $this->dataSizeFormatted((int) $bytesDownloaded) + )); $this->cleanupTableStage($tmpTableName); From c711c8460b96d80e554c6d74570b0849c77edbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:12:17 +0100 Subject: [PATCH 57/63] fixup! Revert useless diffs --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 85f9257..fa37bd4 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -429,12 +429,9 @@ public function getTables(?array $tables = null): array "SELECT * FROM information_schema.columns WHERE TABLE_NAME IN (%s) ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION", - implode(', ', array_map( - function ($tableName): string { - return $this->quote($tableName); - }, - $tableNameArray - )) + implode(', ', array_map(function ($tableName): string { + return $this->quote($tableName); + },$tableNameArray)) ); $columns = $this->db->fetchAll($sql); From 62a171f206dded0f49ddcab5a58fc50b2b6bed04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:13:08 +0100 Subject: [PATCH 58/63] fixup! Revert useless diffs --- src/Keboola/DbExtractor/Extractor/Snowflake.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index fa37bd4..6a1dc2a 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -431,7 +431,7 @@ public function getTables(?array $tables = null): array ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION", implode(', ', array_map(function ($tableName): string { return $this->quote($tableName); - },$tableNameArray)) + }, $tableNameArray)) ); $columns = $this->db->fetchAll($sql); @@ -475,12 +475,9 @@ public function simpleQuery(array $table, array $columns = array()): string if (count($columns) > 0) { return sprintf( "SELECT %s FROM %s.%s", - implode(', ', array_map( - function ($column): string { - return $this->db->quoteIdentifier($column); - }, - $columns - )), + implode(', ', array_map(function ($column): string { + return $this->db->quoteIdentifier($column); + }, $columns)), $this->db->quoteIdentifier($table['schema']), $this->db->quoteIdentifier($table['tableName']) ); From 09d12034422dcd4c53dedd7318245f879b2c60b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:14:14 +0100 Subject: [PATCH 59/63] fixup! Revert useless diffs --- .../DbExtractor/Extractor/Snowflake.php | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Keboola/DbExtractor/Extractor/Snowflake.php b/src/Keboola/DbExtractor/Extractor/Snowflake.php index 6a1dc2a..6097727 100644 --- a/src/Keboola/DbExtractor/Extractor/Snowflake.php +++ b/src/Keboola/DbExtractor/Extractor/Snowflake.php @@ -494,19 +494,16 @@ private function simpleQueryWithCasting(array $table, array $columnInfo) : strin { return sprintf( "SELECT %s FROM %s.%s", - implode(', ', array_map( - function ($column): string { - if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { - return sprintf( - 'CAST(%s AS TEXT) AS %s', - $this->db->quoteIdentifier($column['name']), - $this->db->quoteIdentifier($column['name']) - ); - } - return $this->db->quoteIdentifier($column['name']); - }, - $columnInfo - )), + implode(', ', array_map(function ($column): string { + if (in_array($column['type'], self::SEMI_STRUCTURED_TYPES)) { + return sprintf( + 'CAST(%s AS TEXT) AS %s', + $this->db->quoteIdentifier($column['name']), + $this->db->quoteIdentifier($column['name']) + ); + } + return $this->db->quoteIdentifier($column['name']); + }, $columnInfo)), $this->db->quoteIdentifier($table['schema']), $this->db->quoteIdentifier($table['tableName']) ); From b80dfa646041850f9e55358764d4d761aa6eaf43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:16:38 +0100 Subject: [PATCH 60/63] fixup! Revert useless diffs --- tests/AbstractSnowflakeTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index caaef7f..eb6a0c6 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -108,12 +108,10 @@ private function setupTables(): void $types = new CsvFile($this->dataDir . '/snowflake/types.csv'); - $this->connection->query( - sprintf( - 'DROP TABLE IF EXISTS %s', - $this->connection->quoteIdentifier('types') - ) - ); + $this->connection->query(sprintf( + 'DROP TABLE IF EXISTS %s', + $this->connection->quoteIdentifier('types') + )); $this->connection->query( sprintf( From ff8ca40688349854058859df61b0ab173548822d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:18:41 +0100 Subject: [PATCH 61/63] fixup! Revert useless diffs --- tests/AbstractSnowflakeTest.php | 37 +++++++++++++-------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index eb6a0c6..1fb2be8 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -194,7 +194,7 @@ private function generateCreateCommand(string $tableName, CsvFile $csv, array $f * Create table from csv file with text columns * * @param CsvFile $file - * @param string $tableName - optional name override (default uses filename) + * @param string $tableName - optional name override (default uses filename) * @param string $schemaName - optional schema in which to create the table */ protected function createTextTable(CsvFile $file, ?string $tableName = null, ?string $schemaName = null): void @@ -209,29 +209,22 @@ protected function createTextTable(CsvFile $file, ?string $tableName = null, ?st ); } - $this->connection->query( - sprintf( - 'DROP TABLE IF EXISTS %s', - $this->connection->quoteIdentifier($tableName) - ) - ); + $this->connection->query(sprintf( + 'DROP TABLE IF EXISTS %s', + $this->connection->quoteIdentifier($tableName) + )); - $this->connection->query( - sprintf( - 'CREATE TABLE %s (%s);', - $this->connection->quoteIdentifier($tableName), - implode( - ', ', - array_map( - function ($column) { - $q = '"'; - return ($q . str_replace("$q", "$q$q", $column) . $q) . ' VARCHAR(200) NOT NULL'; - }, - $file->getHeader() - ) - ) + $this->connection->query(sprintf( + 'CREATE TABLE %s (%s);', + $this->connection->quoteIdentifier($tableName), + implode( + ', ', + array_map(function ($column) { + $q = '"'; + return ($q . str_replace("$q", "$q$q", $column) . $q) . ' VARCHAR(200) NOT NULL'; + }, $file->getHeader()) ) - ); + )); $storageFileInfo = $this->storageApiClient->getFile( (string) $this->storageApiClient->uploadFile( From 9c73355a0c49c868e88c2fc2a554a817d5ae4df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fejfar?= Date: Thu, 8 Nov 2018 11:21:38 +0100 Subject: [PATCH 62/63] reformat SQL --- tests/AbstractSnowflakeTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/AbstractSnowflakeTest.php b/tests/AbstractSnowflakeTest.php index 1fb2be8..49d4a8c 100644 --- a/tests/AbstractSnowflakeTest.php +++ b/tests/AbstractSnowflakeTest.php @@ -143,10 +143,10 @@ private function setupTables(): void $this->connection->query('DROP TABLE IF EXISTS "semi-structured"'); $this->connection->query( 'CREATE TABLE "semi-structured" ( - "var" VARIANT, - "obj" OBJECT, - "arr" ARRAY - )' + "var" VARIANT, + "obj" OBJECT, + "arr" ARRAY + )' ); $this->connection->query( 'INSERT INTO "semi-structured" From dec8f9f960a10b8a0919a585d8c538ad0cdc59b2 Mon Sep 17 00:00:00 2001 From: pivnicek Date: Thu, 8 Nov 2018 13:04:17 +0100 Subject: [PATCH 63/63] get rid of debug dumps --- tests/SnowflakeEntrypointTest.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/SnowflakeEntrypointTest.php b/tests/SnowflakeEntrypointTest.php index d7b5fba..9971a51 100644 --- a/tests/SnowflakeEntrypointTest.php +++ b/tests/SnowflakeEntrypointTest.php @@ -65,9 +65,6 @@ public function testRunAction(string $configType): void $process->setTimeout(300); $process->run(); - var_export($process->getOutput()); - var_export($process->getErrorOutput()); - $this->assertEquals(0, $process->getExitCode(), sprintf('error output: %s', $process->getErrorOutput())); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz"); $this->assertFileExists($dataPath . "/out/tables/in_c-main_sales.csv.gz.manifest"); @@ -90,9 +87,6 @@ public function testConnectionAction(string $configType): void $process = new Process('php ' . self::ROOT_PATH . '/run.php --data=' . $dataPath . ' 2>&1'); $process->run(); - var_export($process->getOutput()); - var_export($process->getErrorOutput()); - $output = $process->getOutput(); $this->assertEquals(0, $process->getExitCode()); @@ -114,9 +108,6 @@ public function testNonexistingTable(): void $process->setTimeout(300); $process->run(); - var_export($process->getOutput()); - var_export($process->getErrorOutput()); - $this->assertEquals(1, $process->getExitCode()); } @@ -134,9 +125,6 @@ public function testGetTablesAction(string $configType): void $process->setTimeout(300); $process->run(); - var_export($process->getOutput()); - var_export($process->getErrorOutput()); - $this->assertJson($process->getOutput()); $this->assertEquals(0, $process->getExitCode()); $this->assertEquals("", $process->getErrorOutput()); @@ -159,9 +147,6 @@ public function testBadTypesRetries(): void $process->setTimeout(300); $process->run(); - var_export($process->getOutput()); - var_export($process->getErrorOutput()); - // make sure we tried 4 additional times $this->assertContains('[4x]', $process->getOutput()); $this->assertContains('failed with message:', $process->getErrorOutput());