From 6660645ecdeb35a02e6ddd7b5bf997fafdead994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Votruba?= Date: Sat, 6 Jan 2018 21:25:47 +0100 Subject: [PATCH] Update dev dependencies (#187) * composer: update dev dependencies * phpstan fixes * phpstan fixes * phpstan fixes * phpstan fixes * drop probably forgotten humbug configs * apply cs * fix cs bug * compsoer: add coding standard and phsptan dev friendly scripts * ecs: add skipped errors * cs: fix PHP 7.1 * fix cs * ecs: exclude strict fixer that break code * ecs: cleanup commented sets * travis: use composer scripts for testing to prevent duplicated setup --- .gitignore | 1 - .travis.yml | 4 +- composer.json | 14 +- composer.lock | 744 +++++++++--------- easy-coding-standard.neon | 25 +- humbug.json.dist | 11 - phpstan.neon | 18 +- src/Phpml/Classification/DecisionTree.php | 10 +- .../DecisionTree/DecisionTreeLeaf.php | 8 +- .../Classification/Ensemble/RandomForest.php | 4 +- .../Classification/Linear/DecisionStump.php | 10 +- .../Classification/Linear/Perceptron.php | 6 +- src/Phpml/Classification/NaiveBayes.php | 2 +- src/Phpml/Clustering/FuzzyCMeans.php | 2 +- src/Phpml/DimensionReduction/KernelPCA.php | 6 +- src/Phpml/FeatureExtraction/StopWords.php | 2 +- src/Phpml/Helper/OneVsRest.php | 2 +- .../Helper/Optimizer/ConjugateGradient.php | 2 +- src/Phpml/Helper/Optimizer/Optimizer.php | 2 +- src/Phpml/Math/Set.php | 8 +- .../Training/Backpropagation.php | 12 +- src/Phpml/Regression/LeastSquares.php | 1 + .../Linear/LogisticRegressionTest.php | 12 +- tests/Phpml/Metric/AccuracyTest.php | 2 +- .../Network/MultilayerPerceptronTest.php | 3 +- 25 files changed, 457 insertions(+), 454 deletions(-) delete mode 100644 humbug.json.dist diff --git a/.gitignore b/.gitignore index 38ef5a0..3ffb1da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /vendor/ -humbuglog.* .php_cs.cache /build diff --git a/.travis.yml b/.travis.yml index bf26816..f415daf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,8 @@ install: script: - vendor/bin/phpunit $PHPUNIT_FLAGS - - if [[ $STATIC_ANALYSIS != "" ]]; then vendor/bin/ecs check src tests; fi - - if [[ $STATIC_ANALYSIS != "" ]]; then vendor/bin/phpstan.phar analyse src tests --level max --configuration phpstan.neon; fi + - if [[ $STATIC_ANALYSIS != "" ]]; then composer check-cs; fi + - if [[ $STATIC_ANALYSIS != "" ]]; then composer phpstan; fi after_success: - | diff --git a/composer.json b/composer.json index b08d6f8..149ce27 100644 --- a/composer.json +++ b/composer.json @@ -15,11 +15,10 @@ "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.4", - "symplify/easy-coding-standard": "v3.0.0-RC3", - "symplify/coding-standard": "v3.0.0-RC3", - "symplify/package-builder": "v3.0.0-RC3", - "phpstan/phpstan-shim": "^0.8" + "phpunit/phpunit": "^6.5", + "symplify/easy-coding-standard": "^3.1", + "symplify/coding-standard": "^3.1", + "phpstan/phpstan-shim": "^0.9" }, "autoload": { "psr-4": { @@ -30,5 +29,10 @@ "psr-4": { "Phpml\\Tests\\": "tests/Phpml" } + }, + "scripts": { + "check-cs": "vendor/bin/ecs check src tests bin", + "fix-cs": "vendor/bin/ecs check src tests bin --fix", + "phpstan": "vendor/bin/phpstan.phar analyse src tests bin --level max --configuration phpstan.neon" } } diff --git a/composer.lock b/composer.lock index 4236a2d..9318786 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "032ab1160f58aff496453a86648f7012", + "content-hash": "1efc0df70ee999e80ff6a3770fd3b6c0", "packages": [], "packages-dev": [ { @@ -71,16 +71,16 @@ }, { "name": "doctrine/annotations", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f" + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5beebb01b025c94e93686b7a0ed3edae81fe3e7f", - "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", "shasum": "" }, "require": { @@ -89,12 +89,12 @@ }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -135,7 +135,7 @@ "docblock", "parser" ], - "time": "2017-07-22T10:58:02+00:00" + "time": "2017-12-06T07:11:42+00:00" }, { "name": "doctrine/instantiator", @@ -247,16 +247,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.8.2", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "b331701944cbe492e466d2b46b2880068803eb08" + "reference": "454ddbe65da6a9297446f442bad244e8a99a9a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/b331701944cbe492e466d2b46b2880068803eb08", - "reference": "b331701944cbe492e466d2b46b2880068803eb08", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/454ddbe65da6a9297446f442bad244e8a99a9a38", + "reference": "454ddbe65da6a9297446f442bad244e8a99a9a38", "shasum": "" }, "require": { @@ -283,7 +283,8 @@ "require-dev": { "johnkary/phpunit-speedtrap": "^1.1 || ^2.0@dev", "justinrainbow/json-schema": "^5.0", - "php-coveralls/php-coveralls": "^1.0.2", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.0", "php-cs-fixer/accessible-object": "^1.0", "phpunit/phpunit": "^5.7.23 || ^6.4.3", "symfony/phpunit-bridge": "^3.2.2 || ^4.0" @@ -323,7 +324,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2017-11-19T22:51:25+00:00" + "time": "2017-12-08T16:36:20+00:00" }, { "name": "gecko-packages/gecko-php-unit", @@ -1127,29 +1128,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" + "reference": "66465776cfc249844bde6d117abff1d22e06c2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0@dev", + "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\\": [ @@ -1168,7 +1175,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-08-30T18:51:59+00:00" + "time": "2017-11-27T17:38:31+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1282,31 +1289,32 @@ }, { "name": "phpstan/phpstan-shim", - "version": "0.8.5", + "version": "0.9.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-shim.git", - "reference": "0b174a61fd99dea61f15ea6bd3bc424389f273d4" + "reference": "e3bea4f40f14316cf76390e7fd58181dca840977" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-shim/zipball/0b174a61fd99dea61f15ea6bd3bc424389f273d4", - "reference": "0b174a61fd99dea61f15ea6bd3bc424389f273d4", + "url": "https://api.github.com/repos/phpstan/phpstan-shim/zipball/e3bea4f40f14316cf76390e7fd58181dca840977", + "reference": "e3bea4f40f14316cf76390e7fd58181dca840977", "shasum": "" }, "require": { "php": "~7.0" }, - "provide": { - "phpstan/phpstan": "0.8" + "replace": { + "phpstan/phpstan": "self.version" }, "bin": [ + "phpstan", "phpstan.phar" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.8-dev" + "dev-master": "0.9-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -1314,20 +1322,20 @@ "MIT" ], "description": "PHPStan Phar distribution", - "time": "2017-10-24T04:16:00+00:00" + "time": "2017-12-02T20:14:45+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.2.3", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d" + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", - "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", "shasum": "" }, "require": { @@ -1336,14 +1344,13 @@ "php": "^7.0", "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0", + "phpunit/php-token-stream": "^2.0.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.5", "phpunit/phpunit": "^6.0" }, "suggest": { @@ -1352,7 +1359,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -1367,7 +1374,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1378,20 +1385,20 @@ "testing", "xunit" ], - "time": "2017-11-03T13:47:33+00:00" + "time": "2017-12-06T09:29:45+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.3", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "8ebba84e5bd74fc5fdeb916b38749016c7232f93" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/8ebba84e5bd74fc5fdeb916b38749016c7232f93", - "reference": "8ebba84e5bd74fc5fdeb916b38749016c7232f93", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -1425,7 +1432,7 @@ "filesystem", "iterator" ], - "time": "2017-11-24T15:00:59+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1519,16 +1526,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { @@ -1564,20 +1571,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20T05:47:52+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "6.4.4", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932" + "reference": "83d27937a310f2984fd575686138597147bdc7df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/562f7dc75d46510a4ed5d16189ae57fbe45a9932", - "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/83d27937a310f2984fd575686138597147bdc7df", + "reference": "83d27937a310f2984fd575686138597147bdc7df", "shasum": "" }, "require": { @@ -1591,12 +1598,12 @@ "phar-io/version": "^1.0", "php": "^7.0", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2.2", - "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^4.0.3", - "sebastian/comparator": "^2.0.2", + "phpunit/phpunit-mock-objects": "^5.0.5", + "sebastian/comparator": "^2.1", "sebastian/diff": "^2.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", @@ -1622,7 +1629,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.4.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -1648,33 +1655,33 @@ "testing", "xunit" ], - "time": "2017-11-08T11:26:09+00:00" + "time": "2017-12-17T06:31:19+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "4.0.4", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.5", "php": "^7.0", "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.0" + "sebastian/exporter": "^3.1" }, "conflict": { "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.5" }, "suggest": { "ext-soap": "*" @@ -1682,7 +1689,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -1697,7 +1704,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1707,7 +1714,7 @@ "mock", "xunit" ], - "time": "2017-08-03T14:08:16+00:00" + "time": "2018-01-06T05:45:45+00:00" }, { "name": "psr/container", @@ -1852,16 +1859,16 @@ }, { "name": "sebastian/comparator", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1174d9018191e93cb9d719edec01257fc05f8158" + "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", - "reference": "1174d9018191e93cb9d719edec01257fc05f8158", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b11c729f95109b56a0fe9650c6a63a0fcd8c439f", + "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f", "shasum": "" }, "require": { @@ -1912,7 +1919,7 @@ "compare", "equality" ], - "time": "2017-11-03T07:16:52+00:00" + "time": "2017-12-22T14:50:35+00:00" }, { "name": "sebastian/diff", @@ -2366,27 +2373,27 @@ }, { "name": "slevomat/coding-standard", - "version": "4.0.0", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "bab653d0f7f2e3ed13796f7803067d252f00a25a" + "reference": "998b5e96ce36a55d7821d17f39d296a17c05b481" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/bab653d0f7f2e3ed13796f7803067d252f00a25a", - "reference": "bab653d0f7f2e3ed13796f7803067d252f00a25a", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/998b5e96ce36a55d7821d17f39d296a17c05b481", + "reference": "998b5e96ce36a55d7821d17f39d296a17c05b481", "shasum": "" }, "require": { - "php": "^7.0", - "squizlabs/php_codesniffer": "^3.0.1" + "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.8.4", - "phpunit/phpunit": "6.3.0" + "phpstan/phpstan": "0.9.1", + "phpunit/phpunit": "6.5.5" }, "type": "phpcodesniffer-standard", "autoload": { @@ -2399,20 +2406,20 @@ "MIT" ], "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "time": "2017-09-15T17:47:36+00:00" + "time": "2018-01-04T14:00:21+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.1.1", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e" + "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d667e245d5dcd4d7bf80f26f2c947d476b66213e", - "reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7c00c3000ac0ce79c96fcbfef86b49a71158cd1", + "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1", "shasum": "" }, "require": { @@ -2450,34 +2457,32 @@ "phpcs", "standards" ], - "time": "2017-10-16T22:40:25+00:00" + "time": "2017-12-19T21:44:46+00:00" }, { "name": "symfony/config", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "8d2649077dc54dfbaf521d31f217383d82303c5f" + "reference": "0e86d267db0851cf55f339c97df00d693fe8592f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/8d2649077dc54dfbaf521d31f217383d82303c5f", - "reference": "8d2649077dc54dfbaf521d31f217383d82303c5f", + "url": "https://api.github.com/repos/symfony/config/zipball/0e86d267db0851cf55f339c97df00d693fe8592f", + "reference": "0e86d267db0851cf55f339c97df00d693fe8592f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0" + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3", - "symfony/finder": "~3.3", - "symfony/yaml": "~3.0" + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -2485,7 +2490,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2512,48 +2517,48 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-11-07T14:16:22+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/console", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805" + "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/63cd7960a0a522c3537f6326706d7f3b8de65805", - "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805", + "url": "https://api.github.com/repos/symfony/console/zipball/fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", + "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/filesystem": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2580,36 +2585,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-11-16T15:24:32+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/debug", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "74557880e2846b5c84029faa96b834da37e29810" + "reference": "9ae4223a661b56a9abdce144de4886cca37f198f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/74557880e2846b5c84029faa96b834da37e29810", - "reference": "74557880e2846b5c84029faa96b834da37e29810", + "url": "https://api.github.com/repos/symfony/debug/zipball/9ae4223a661b56a9abdce144de4886cca37f198f", + "reference": "9ae4223a661b56a9abdce144de4886cca37f198f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "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" + "symfony/http-kernel": "<3.4" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2636,38 +2641,39 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-11-10T16:38:39+00:00" + "time": "2018-01-03T17:15:19+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "4e84f5af2c2d51ee3dee72df40b7fc08f49b4ab8" + "reference": "67bf5e4f4da85624f30a5e43b7f43225c8b71959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/4e84f5af2c2d51ee3dee72df40b7fc08f49b4ab8", - "reference": "4e84f5af2c2d51ee3dee72df40b7fc08f49b4ab8", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/67bf5e4f4da85624f30a5e43b7f43225c8b71959", + "reference": "67bf5e4f4da85624f30a5e43b7f43225c8b71959", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<3.3.1", - "symfony/finder": "<3.3", - "symfony/yaml": "<3.3" + "symfony/config": "<3.4", + "symfony/finder": "<3.4", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" }, "provide": { "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/yaml": "~3.3" + "symfony/config": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/config": "", @@ -2679,7 +2685,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2706,34 +2712,34 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-11-13T18:10:32+00:00" + "time": "2018-01-04T15:52:56+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "271d8c27c3ec5ecee6e2ac06016232e249d638d9" + "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/271d8c27c3ec5ecee6e2ac06016232e249d638d9", - "reference": "271d8c27c3ec5ecee6e2ac06016232e249d638d9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74d33aac36208c4d6757807d9f598f0133a3a4eb", + "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -2742,7 +2748,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2769,29 +2775,29 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:47:03+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/filesystem", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "77db266766b54db3ee982fe51868328b887ce15c" + "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/77db266766b54db3ee982fe51868328b887ce15c", - "reference": "77db266766b54db3ee982fe51868328b887ce15c", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/760e47a4ee64b4c48f4b30017011e09d4c0f05ed", + "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2818,29 +2824,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-11-07T14:12:55+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/finder", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" + "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", + "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", + "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2867,33 +2873,33 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:47:03+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "5943f0f19817a7e05992d20a90729b0dc93faf36" + "reference": "03fe5171e35966f43453e2e5c15d7fe65f7fb23b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5943f0f19817a7e05992d20a90729b0dc93faf36", - "reference": "5943f0f19817a7e05992d20a90729b0dc93faf36", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/03fe5171e35966f43453e2e5c15d7fe65f7fb23b", + "reference": "03fe5171e35966f43453e2e5c15d7fe65f7fb23b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.8|~3.0" + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2920,66 +2926,66 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-11-13T18:13:16+00:00" + "time": "2018-01-03T17:15:19+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a2a942172b742217ab2ccd9399494af2aa17c766" + "reference": "f707ed09d3b5799a26c985de480d48b48540d41a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a2a942172b742217ab2ccd9399494af2aa17c766", - "reference": "a2a942172b742217ab2ccd9399494af2aa17c766", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f707ed09d3b5799a26c985de480d48b48540d41a", + "reference": "f707ed09d3b5799a26c985de480d48b48540d41a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "psr/log": "~1.0", - "symfony/debug": "~2.8|~3.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "^3.3.11" + "symfony/debug": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0" }, "conflict": { - "symfony/config": "<2.8", - "symfony/dependency-injection": "<3.3", - "symfony/var-dumper": "<3.3", + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/var-dumper": "<3.4", "twig/twig": "<1.34|<2.4,>=2" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/cache": "~1.0", - "symfony/browser-kit": "~2.8|~3.0", - "symfony/class-loader": "~2.8|~3.0", - "symfony/config": "~2.8|~3.0", - "symfony/console": "~2.8|~3.0", - "symfony/css-selector": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/dom-crawler": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/finder": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0", - "symfony/routing": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0", - "symfony/templating": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0", - "symfony/var-dumper": "~3.3" + "symfony/browser-kit": "~3.4|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/css-selector": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/dom-crawler": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0", + "symfony/templating": "~3.4|~4.0", + "symfony/translation": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0" }, "suggest": { "symfony/browser-kit": "", - "symfony/class-loader": "", "symfony/config": "", "symfony/console": "", "symfony/dependency-injection": "", - "symfony/finder": "", "symfony/var-dumper": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3006,29 +3012,29 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-11-16T18:14:43+00:00" + "time": "2018-01-05T08:54:25+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "623d9c210a137205f7e6e98166105625402cbb2f" + "reference": "30d9240b30696a69e893534c9fc4a5c72ab6689b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/623d9c210a137205f7e6e98166105625402cbb2f", - "reference": "623d9c210a137205f7e6e98166105625402cbb2f", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/30d9240b30696a69e893534c9fc4a5c72ab6689b", + "reference": "30d9240b30696a69e893534c9fc4a5c72ab6689b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3060,7 +3066,7 @@ "configuration", "options" ], - "time": "2017-11-05T15:47:03+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3237,25 +3243,25 @@ }, { "name": "symfony/process", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d" + "reference": "2145b3e8137e463b1051b79440a59b38220944f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d", - "reference": "a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d", + "url": "https://api.github.com/repos/symfony/process/zipball/2145b3e8137e463b1051b79440a59b38220944f0", + "reference": "2145b3e8137e463b1051b79440a59b38220944f0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3282,29 +3288,29 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-11-13T15:31:11+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "1e93c3139ef6c799831fe03efd0fb1c7aecb3365" + "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e93c3139ef6c799831fe03efd0fb1c7aecb3365", - "reference": "1e93c3139ef6c799831fe03efd0fb1c7aecb3365", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/d52321f0e2b596bd03b5d1dd6eebe71caa925704", + "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3331,27 +3337,30 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-11-10T19:02:53+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.13", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" + "reference": "b84f646b9490d2101e2c25ddeec77ceefbda2eee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", - "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b84f646b9490d2101e2c25ddeec77ceefbda2eee", + "reference": "b84f646b9490d2101e2c25ddeec77ceefbda2eee", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -3359,7 +3368,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3386,48 +3395,86 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-11-10T18:26:04+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { - "name": "symplify/coding-standard", - "version": "v3.0.0-RC3", + "name": "symplify/better-reflection-docblock", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/Symplify/CodingStandard.git", - "reference": "0a3958f1cb6ce733def98f3abdf52a4e6c723879" + "url": "https://github.com/Symplify/BetterReflectionDocBlock.git", + "reference": "7746ed526ffedfb4907a7ff83606a9e0f1e55c56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Symplify/CodingStandard/zipball/0a3958f1cb6ce733def98f3abdf52a4e6c723879", - "reference": "0a3958f1cb6ce733def98f3abdf52a4e6c723879", + "url": "https://api.github.com/repos/Symplify/BetterReflectionDocBlock/zipball/7746ed526ffedfb4907a7ff83606a9e0f1e55c56", + "reference": "7746ed526ffedfb4907a7ff83606a9e0f1e55c56", "shasum": "" }, "require": { - "friendsofphp/php-cs-fixer": "^2.8", - "nette/finder": "^2.4|^3.0", - "nette/utils": "^2.4|^3.0", "php": "^7.1", - "slevomat/coding-standard": "^4.0", - "squizlabs/php_codesniffer": "^3.1" + "phpdocumentor/reflection-docblock": "4.2", + "symplify/package-builder": "^3.1" }, "require-dev": { - "gecko-packages/gecko-php-unit": "3.0 as 2.2", - "nette/application": "^2.4", - "phpunit/phpunit": "^6.4", - "symplify/easy-coding-standard": "^2.5|^3.0", - "symplify/package-builder": "^2.5|^3.0" + "phpunit/phpunit": "^6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { "psr-4": { - "Symplify\\CodingStandard\\": "src", - "Symplify\\CodingStandard\\SniffTokenWrapper\\": "packages/SniffTokenWrapper/src", - "Symplify\\CodingStandard\\FixerTokenWrapper\\": "packages/FixerTokenWrapper/src" + "Symplify\\BetterReflectionDocBlock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slim wrapper around phpdocumentor/reflection-docblock with better DX and simpler API.", + "time": "2018-01-02T22:35:18+00:00" + }, + { + "name": "symplify/coding-standard", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/Symplify/CodingStandard.git", + "reference": "0985870bd373d65c69747c2ae854761497f96aac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Symplify/CodingStandard/zipball/0985870bd373d65c69747c2ae854761497f96aac", + "reference": "0985870bd373d65c69747c2ae854761497f96aac", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^2.9", + "nette/finder": "^2.4", + "nette/utils": "^2.4", + "php": "^7.1", + "phpdocumentor/reflection-docblock": "4.2", + "squizlabs/php_codesniffer": "^3.2", + "symplify/token-runner": "^3.1" + }, + "require-dev": { + "nette/application": "^2.4", + "phpunit/phpunit": "^6.5", + "symplify/easy-coding-standard": "^3.1", + "symplify/package-builder": "^3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symplify\\CodingStandard\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3435,45 +3482,44 @@ "MIT" ], "description": "Set of Symplify rules for PHP_CodeSniffer.", - "time": "2017-11-18T01:05:00+00:00" + "time": "2018-01-03T00:42:03+00:00" }, { "name": "symplify/easy-coding-standard", - "version": "v3.0.0-RC3", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/Symplify/EasyCodingStandard.git", - "reference": "7f2e7728a184c72945da482b23eb05b796f6502c" + "reference": "0018936e9acecfa6df0919e2e05923d0b3677435" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Symplify/EasyCodingStandard/zipball/7f2e7728a184c72945da482b23eb05b796f6502c", - "reference": "7f2e7728a184c72945da482b23eb05b796f6502c", + "url": "https://api.github.com/repos/Symplify/EasyCodingStandard/zipball/0018936e9acecfa6df0919e2e05923d0b3677435", + "reference": "0018936e9acecfa6df0919e2e05923d0b3677435", "shasum": "" }, "require": { - "friendsofphp/php-cs-fixer": "^2.8", - "nette/caching": "^2.4|^3.0", - "nette/di": "^2.4|^3.0", - "nette/neon": "^2.4|^3.0", + "friendsofphp/php-cs-fixer": "^2.9", + "nette/caching": "^2.4", + "nette/di": "^2.4", + "nette/neon": "^2.4", "nette/robot-loader": "^2.4|^3.0.1", - "nette/utils": "^2.4|^3.0", + "nette/utils": "^2.4", "php": "^7.1", - "sebastian/diff": "^1.4|^2.0", - "slevomat/coding-standard": "^4.0", - "squizlabs/php_codesniffer": "^3.1", - "symfony/config": "^3.3|^4.0", - "symfony/console": "^3.3|^4.0", - "symfony/dependency-injection": "^3.3|^4.0", - "symfony/finder": "^3.3|^4.0", - "symfony/http-kernel": "^3.3|^4.0", - "symfony/yaml": "^3.3|^4.0", - "symplify/coding-standard": "^2.5|^3.0", - "symplify/package-builder": "^2.5|^3.0", - "tracy/tracy": "^2.4|^3.0" + "slevomat/coding-standard": "^4.1", + "squizlabs/php_codesniffer": "^3.2", + "symfony/config": "^4.0", + "symfony/console": "^4.0", + "symfony/dependency-injection": "^4.0", + "symfony/finder": "^4.0", + "symfony/http-kernel": "^4.0", + "symfony/yaml": "^4.0", + "symplify/coding-standard": "^3.1", + "symplify/package-builder": "^3.1", + "symplify/token-runner": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.4" }, "bin": [ "bin/easy-coding-standard", @@ -3481,11 +3527,6 @@ "bin/easy-coding-standard.php" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { "psr-4": { "Symplify\\EasyCodingStandard\\": "src", @@ -3501,42 +3542,38 @@ "MIT" ], "description": "Use Coding Standard with 0-knowledge of PHP-CS-Fixer and PHP_CodeSniffer.", - "time": "2017-11-18T14:13:17+00:00" + "time": "2018-01-03T00:41:52+00:00" }, { "name": "symplify/package-builder", - "version": "v3.0.0-RC3", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/Symplify/PackageBuilder.git", - "reference": "c86f75165ed2370563a9d4ff6604bbb24cffd5e5" + "reference": "0149e25615b98df5cdb25a155a1f10002cf1958a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Symplify/PackageBuilder/zipball/c86f75165ed2370563a9d4ff6604bbb24cffd5e5", - "reference": "c86f75165ed2370563a9d4ff6604bbb24cffd5e5", + "url": "https://api.github.com/repos/Symplify/PackageBuilder/zipball/0149e25615b98df5cdb25a155a1f10002cf1958a", + "reference": "0149e25615b98df5cdb25a155a1f10002cf1958a", "shasum": "" }, "require": { - "nette/di": "^2.4|^3.0", - "nette/neon": "^2.4|^3.0", + "nette/di": "^2.4", + "nette/neon": "^2.4", "php": "^7.1", - "symfony/config": "^3.3|^4.0", - "symfony/console": "^3.3|^4.0", - "symfony/dependency-injection": "^3.3|^4.0", - "symfony/http-kernel": "^3.3|^4.0", - "symfony/yaml": "^3.3|^4.0" + "symfony/config": "^4.0", + "symfony/console": "^4.0", + "symfony/dependency-injection": "^4.0", + "symfony/finder": "^4.0", + "symfony/http-kernel": "^4.0", + "symfony/yaml": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.4", + "phpunit/phpunit": "^6.5", "tracy/tracy": "^2.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { "psr-4": { "Symplify\\PackageBuilder\\": "src" @@ -3547,7 +3584,47 @@ "MIT" ], "description": "Dependency Injection, Console and Kernel toolkit for Symplify packages.", - "time": "2017-11-17T13:58:38+00:00" + "time": "2018-01-02T22:35:18+00:00" + }, + { + "name": "symplify/token-runner", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/Symplify/TokenRunner.git", + "reference": "5c4cc4f24507b6cbdb33026dfad5b46660c5b3ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Symplify/TokenRunner/zipball/5c4cc4f24507b6cbdb33026dfad5b46660c5b3ec", + "reference": "5c4cc4f24507b6cbdb33026dfad5b46660c5b3ec", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^2.9", + "nette/finder": "^2.4", + "nette/utils": "^2.4", + "php": "^7.1", + "phpdocumentor/reflection-docblock": "^4.2", + "squizlabs/php_codesniffer": "^3.2", + "symplify/better-reflection-docblock": "^3.1", + "symplify/package-builder": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symplify\\TokenRunner\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Set of utils for PHP_CodeSniffer and PHP CS Fixer.", + "time": "2018-01-02T22:35:18+00:00" }, { "name": "theseer/tokenizer", @@ -3589,73 +3666,6 @@ "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": "tracy/tracy", - "version": "v2.4.10", - "source": { - "type": "git", - "url": "https://github.com/nette/tracy.git", - "reference": "5b302790edd71924dfe4ec44f499ef61df3f53a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/tracy/zipball/5b302790edd71924dfe4ec44f499ef61df3f53a2", - "reference": "5b302790edd71924dfe4ec44f499ef61df3f53a2", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-session": "*", - "php": ">=5.4.4" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.7" - }, - "suggest": { - "https://nette.org/donate": "Please support Tracy via a donation" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src" - ], - "files": [ - "src/shortcuts.php" - ] - }, - "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": "😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.", - "homepage": "https://tracy.nette.org", - "keywords": [ - "Xdebug", - "debug", - "debugger", - "nette", - "profiler" - ], - "time": "2017-10-04T18:43:42+00:00" - }, { "name": "webmozart/assert", "version": "1.2.0", @@ -3709,11 +3719,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "symplify/easy-coding-standard": 5, - "symplify/coding-standard": 5, - "symplify/package-builder": 5 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/easy-coding-standard.neon b/easy-coding-standard.neon index 9155b10..abf30af 100644 --- a/easy-coding-standard.neon +++ b/easy-coding-standard.neon @@ -1,14 +1,8 @@ includes: - vendor/symplify/easy-coding-standard/config/psr2.neon - - vendor/symplify/easy-coding-standard/config/php70.neon + - vendor/symplify/easy-coding-standard/config/php71.neon - vendor/symplify/easy-coding-standard/config/clean-code.neon - - vendor/symplify/easy-coding-standard/config/common/array.neon - - vendor/symplify/easy-coding-standard/config/common/docblock.neon - - vendor/symplify/easy-coding-standard/config/common/namespaces.neon - - vendor/symplify/easy-coding-standard/config/common/control-structures.neon - - # many errors, need help - #- vendor/symplify/easy-coding-standard/config/common/strict.neon + - vendor/symplify/easy-coding-standard/config/common.neon checkers: # spacing @@ -33,13 +27,16 @@ checkers: - Symplify\CodingStandard\Fixer\Import\ImportNamespacedNameFixer - Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer - Symplify\CodingStandard\Fixer\Property\ArrayPropertyDefaultValueFixer - - Symplify\CodingStandard\Fixer\ClassNotation\PropertyAndConstantSeparationFixer - Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer parameters: exclude_checkers: # from strict.neon - PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer + - PhpCsFixer\Fixer\Strict\StrictComparisonFixer + # personal prefference + - PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer + skip: PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer: # random_int() breaks code @@ -47,6 +44,15 @@ parameters: SlevomatCodingStandard\Sniffs\Classes\UnusedPrivateElementsSniff: # magic calls - src/Phpml/Preprocessing/Normalizer.php + PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer: + # bugged + - src/Phpml/Classification/DecisionTree/DecisionTreeLeaf.php + Symplify\CodingStandard\Fixer\Commenting\RemoveUselessDocBlockFixer: + # bug in fixer + - src/Phpml/Math/LinearAlgebra/LUDecomposition.php + PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer: + # covariant return types + - src/Phpml/Classification/Linear/Perceptron.php skip_codes: # missing typehints @@ -56,3 +62,4 @@ parameters: - SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff.MissingTraversableReturnTypeHintSpecification - SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff.MissingPropertyTypeHint - SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff.MissingTraversablePropertyTypeHintSpecification + - PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff.Found diff --git a/humbug.json.dist b/humbug.json.dist deleted file mode 100644 index 2535633..0000000 --- a/humbug.json.dist +++ /dev/null @@ -1,11 +0,0 @@ -{ - "source": { - "directories": [ - "src" - ] - }, - "timeout": 10, - "logs": { - "text": "humbuglog.txt" - } -} diff --git a/phpstan.neon b/phpstan.neon index 19e3c20..0366c23 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,19 +1,15 @@ parameters: ignoreErrors: - '#Phpml\\Dataset\\FilesDataset::__construct\(\) does not call parent constructor from Phpml\\Dataset\\ArrayDataset#' - - '#Parameter \#2 \$predictedLabels of static method Phpml\\Metric\\Accuracy::score\(\) expects mixed\[\], mixed\[\]\|string given#' - # should be always defined - - '#Undefined variable: \$j#' + # mocks + - '#PHPUnit_Framework_MockObject_MockObject#' - # bugged - - '#expects [a-z\\\|\[\]]*, [a-z\\\|\(\)\[\]]*\[\] given#' - - # mock - - '#Parameter \#1 \$node of class Phpml\\NeuralNetwork\\Node\\Neuron\\Synapse constructor expects Phpml\\NeuralNetwork\\Node, Phpml\\NeuralNetwork\\Node\\Neuron\|PHPUnit_Framework_MockObject_MockObject given#' - - '#Parameter \#1 \$(activationFunction|synapse) of class Phpml\\NeuralNetwork\\Node\\Neuron constructor expects Phpml\\NeuralNetwork\\ActivationFunction|null, Phpml\\NeuralNetwork\\ActivationFunction\\BinaryStep|PHPUnit_Framework_MockObject_MockObject given#' + # wide range cases + - '#Call to function count\(\) with argument type array\|Phpml\\Clustering\\KMeans\\Point will always result in number 1#' + - '#Parameter \#1 \$coordinates of class Phpml\\Clustering\\KMeans\\Point constructor expects array, array\|Phpml\\Clustering\\KMeans\\Point given#' # probably known value + - '#Variable \$j might not be defined#' - '#Method Phpml\\Classification\\DecisionTree::getBestSplit\(\) should return Phpml\\Classification\\DecisionTree\\DecisionTreeLeaf but returns Phpml\\Classification\\DecisionTree\\DecisionTreeLeaf\|null#' - - '#Method Phpml\\Classification\\Linear\\DecisionStump::getBestNumericalSplit\(\) should return mixed\[\] but returns \(float\|int\|mixed\|string\)\[\]\|null#' - - '#Method Phpml\\Classification\\Linear\\DecisionStump::getBestNominalSplit\(\) should return mixed\[\] but returns mixed\[\]\|null#' + - '#Call to an undefined method Phpml\\Helper\\Optimizer\\Optimizer::getCostValues\(\)#' diff --git a/src/Phpml/Classification/DecisionTree.php b/src/Phpml/Classification/DecisionTree.php index d660322..1d5a754 100644 --- a/src/Phpml/Classification/DecisionTree.php +++ b/src/Phpml/Classification/DecisionTree.php @@ -64,9 +64,9 @@ class DecisionTree implements Classifier private $featureImportances; /** - * @var array|null + * @var array */ - private $columnNames; + private $columnNames = []; public function __construct(int $maxDepth = 10) { @@ -89,7 +89,7 @@ class DecisionTree implements Classifier // If column names are given or computed before, then there is no // need to init it and accidentally remove the previous given names - if ($this->columnNames === null) { + if ($this->columnNames === []) { $this->columnNames = range(0, $this->featureCount - 1); } elseif (count($this->columnNames) > $this->featureCount) { $this->columnNames = array_slice($this->columnNames, 0, $this->featureCount); @@ -380,9 +380,9 @@ class DecisionTree implements Classifier $median = Mean::median($values); foreach ($values as &$value) { if ($value <= $median) { - $value = "<= $median"; + $value = "<= ${median}"; } else { - $value = "> $median"; + $value = "> ${median}"; } } } diff --git a/src/Phpml/Classification/DecisionTree/DecisionTreeLeaf.php b/src/Phpml/Classification/DecisionTree/DecisionTreeLeaf.php index 5164472..cc53eea 100644 --- a/src/Phpml/Classification/DecisionTree/DecisionTreeLeaf.php +++ b/src/Phpml/Classification/DecisionTree/DecisionTreeLeaf.php @@ -122,7 +122,7 @@ class DecisionTreeLeaf public function getHTML($columnNames = null): string { if ($this->isTerminal) { - $value = "$this->classValue"; + $value = "${this}->classValue"; } else { $value = $this->value; if ($columnNames !== null) { @@ -132,13 +132,13 @@ class DecisionTreeLeaf } if (!preg_match('/^[<>=]{1,2}/', (string) $value)) { - $value = "=$value"; + $value = "=${value}"; } - $value = "$col $value
Gini: ".number_format($this->giniIndex, 2); + $value = "${col} ${value}
Gini: ".number_format($this->giniIndex, 2); } - $str = ""; + $str = "
$value
"; if ($this->leftLeaf || $this->rightLeaf) { $str .= ''; diff --git a/src/Phpml/Classification/Ensemble/RandomForest.php b/src/Phpml/Classification/Ensemble/RandomForest.php index 59f19c1..1f2d1f5 100644 --- a/src/Phpml/Classification/Ensemble/RandomForest.php +++ b/src/Phpml/Classification/Ensemble/RandomForest.php @@ -148,7 +148,7 @@ class RandomForest extends Bagging } return $classifier - ->setColumnNames($this->columnNames) - ->setNumFeatures($featureCount); + ->setColumnNames($this->columnNames) + ->setNumFeatures($featureCount); } } diff --git a/src/Phpml/Classification/Linear/DecisionStump.php b/src/Phpml/Classification/Linear/DecisionStump.php index 439ea56..b0f7dfa 100644 --- a/src/Phpml/Classification/Linear/DecisionStump.php +++ b/src/Phpml/Classification/Linear/DecisionStump.php @@ -86,7 +86,7 @@ class DecisionStump extends WeightedClassifier public function __toString(): string { - return "IF $this->column $this->operator $this->value ". + return "IF ${this}->column ${this}->operator ${this}->value ". 'THEN '.$this->binaryLabels[0].' '. 'ELSE '.$this->binaryLabels[1]; } @@ -176,14 +176,14 @@ class DecisionStump extends WeightedClassifier $maxValue = max($values); $stepSize = ($maxValue - $minValue) / $this->numSplitCount; - $split = null; + $split = []; foreach (['<=', '>'] as $operator) { // Before trying all possible split points, let's first try // the average value for the cut point $threshold = array_sum($values) / (float) count($values); [$errorRate, $prob] = $this->calculateErrorRate($targets, $threshold, $operator, $values); - if ($split == null || $errorRate < $split['trainingErrorRate']) { + if ($split === [] || $errorRate < $split['trainingErrorRate']) { $split = [ 'value' => $threshold, 'operator' => $operator, @@ -218,13 +218,13 @@ class DecisionStump extends WeightedClassifier $valueCounts = array_count_values($values); $distinctVals = array_keys($valueCounts); - $split = null; + $split = []; foreach (['=', '!='] as $operator) { foreach ($distinctVals as $val) { [$errorRate, $prob] = $this->calculateErrorRate($targets, $val, $operator, $values); - if ($split === null || $split['trainingErrorRate'] < $errorRate) { + if ($split === [] || $split['trainingErrorRate'] < $errorRate) { $split = [ 'value' => $val, 'operator' => $operator, diff --git a/src/Phpml/Classification/Linear/Perceptron.php b/src/Phpml/Classification/Linear/Perceptron.php index 6838227..c78e788 100644 --- a/src/Phpml/Classification/Linear/Perceptron.php +++ b/src/Phpml/Classification/Linear/Perceptron.php @@ -34,7 +34,7 @@ class Perceptron implements Classifier, IncrementalEstimator protected $featureCount = 0; /** - * @var array|null + * @var array */ protected $weights = []; @@ -146,7 +146,7 @@ class Perceptron implements Classifier, IncrementalEstimator $this->labels = []; $this->optimizer = null; $this->featureCount = 0; - $this->weights = null; + $this->weights = []; $this->costValues = []; } @@ -174,7 +174,7 @@ class Perceptron implements Classifier, IncrementalEstimator * Executes a Gradient Descent algorithm for * the given cost function */ - protected function runGradientDescent(array $samples, array $targets, Closure $gradientFunc, bool $isBatch = false): void + protected function runGradientDescent(array $samples, array $targets, Closure $gradientFunc, bool $isBatch = false) { $class = $isBatch ? GD::class : StochasticGD::class; diff --git a/src/Phpml/Classification/NaiveBayes.php b/src/Phpml/Classification/NaiveBayes.php index a470fd4..38c857d 100644 --- a/src/Phpml/Classification/NaiveBayes.php +++ b/src/Phpml/Classification/NaiveBayes.php @@ -147,7 +147,7 @@ class NaiveBayes implements Classifier return $this->discreteProb[$label][$feature][$value]; } - $std = $this->std[$label][$feature] ; + $std = $this->std[$label][$feature]; $mean = $this->mean[$label][$feature]; // Calculate the probability density by use of normal/Gaussian distribution // Ref: https://en.wikipedia.org/wiki/Normal_distribution diff --git a/src/Phpml/Clustering/FuzzyCMeans.php b/src/Phpml/Clustering/FuzzyCMeans.php index d3be101..7e177ed 100644 --- a/src/Phpml/Clustering/FuzzyCMeans.php +++ b/src/Phpml/Clustering/FuzzyCMeans.php @@ -78,7 +78,7 @@ class FuzzyCMeans implements Clusterer } /** - * @param array|Point[] $samples + * @param Point[]|int[][] $samples */ public function cluster(array $samples): array { diff --git a/src/Phpml/DimensionReduction/KernelPCA.php b/src/Phpml/DimensionReduction/KernelPCA.php index 65bb324..5dcc7a0 100644 --- a/src/Phpml/DimensionReduction/KernelPCA.php +++ b/src/Phpml/DimensionReduction/KernelPCA.php @@ -156,9 +156,9 @@ class KernelPCA extends PCA $N_K_N = $N->multiply($K_N); return $K->subtract($N_K) - ->subtract($K_N) - ->add($N_K_N) - ->toArray(); + ->subtract($K_N) + ->add($N_K_N) + ->toArray(); } /** diff --git a/src/Phpml/FeatureExtraction/StopWords.php b/src/Phpml/FeatureExtraction/StopWords.php index fdb985f..f8fc69e 100644 --- a/src/Phpml/FeatureExtraction/StopWords.php +++ b/src/Phpml/FeatureExtraction/StopWords.php @@ -25,7 +25,7 @@ class StopWords public static function factory(string $language = 'English'): self { - $className = __NAMESPACE__."\\StopWords\\$language"; + $className = __NAMESPACE__."\\StopWords\\${language}"; if (!class_exists($className)) { throw InvalidArgumentException::invalidStopWordsLanguage($language); diff --git a/src/Phpml/Helper/OneVsRest.php b/src/Phpml/Helper/OneVsRest.php index 1c0ca93..e68b10d 100644 --- a/src/Phpml/Helper/OneVsRest.php +++ b/src/Phpml/Helper/OneVsRest.php @@ -164,7 +164,7 @@ trait OneVsRest */ private function binarizeTargets(array $targets, $label): array { - $notLabel = "not_$label"; + $notLabel = "not_${label}"; foreach ($targets as $key => $target) { $targets[$key] = $target == $label ? $label : $notLabel; } diff --git a/src/Phpml/Helper/Optimizer/ConjugateGradient.php b/src/Phpml/Helper/Optimizer/ConjugateGradient.php index 153ffcb..a034af0 100644 --- a/src/Phpml/Helper/Optimizer/ConjugateGradient.php +++ b/src/Phpml/Helper/Optimizer/ConjugateGradient.php @@ -171,7 +171,7 @@ class ConjugateGradient extends GD $dNew = array_sum($this->gradient($newTheta)); $dOld = array_sum($this->gradient($this->theta)) + 1e-100; - return $dNew ** 2 / $dOld ** 2; + return $dNew ** 2 / $dOld ** 2; } /** diff --git a/src/Phpml/Helper/Optimizer/Optimizer.php b/src/Phpml/Helper/Optimizer/Optimizer.php index 2b25acd..7ef317c 100644 --- a/src/Phpml/Helper/Optimizer/Optimizer.php +++ b/src/Phpml/Helper/Optimizer/Optimizer.php @@ -47,7 +47,7 @@ abstract class Optimizer public function setInitialTheta(array $theta) { if (count($theta) != $this->dimensions) { - throw new Exception("Number of values in the weights array should be $this->dimensions"); + throw new Exception("Number of values in the weights array should be ${this}->dimensions"); } $this->theta = $theta; diff --git a/src/Phpml/Math/Set.php b/src/Phpml/Math/Set.php index dcb02e6..fab2923 100644 --- a/src/Phpml/Math/Set.php +++ b/src/Phpml/Math/Set.php @@ -10,7 +10,7 @@ use IteratorAggregate; class Set implements IteratorAggregate { /** - * @var string[]|int[]|float[] + * @var string[]|int[]|float[]|bool[] */ private $elements = []; @@ -135,7 +135,7 @@ class Set implements IteratorAggregate } /** - * @return string[]|int[]|float[] + * @return string[]|int[]|float[]|bool[] */ public function toArray(): array { @@ -160,9 +160,9 @@ class Set implements IteratorAggregate /** * Removes duplicates and rewrites index. * - * @param string[]|int[]|float[] $elements + * @param string[]|int[]|float[]|bool[] $elements * - * @return string[]|int[]|float[] + * @return string[]|int[]|float[]|bool[] */ private static function sanitize(array $elements): array { diff --git a/src/Phpml/NeuralNetwork/Training/Backpropagation.php b/src/Phpml/NeuralNetwork/Training/Backpropagation.php index 4144c30..fd09d95 100644 --- a/src/Phpml/NeuralNetwork/Training/Backpropagation.php +++ b/src/Phpml/NeuralNetwork/Training/Backpropagation.php @@ -15,14 +15,14 @@ class Backpropagation private $learningRate; /** - * @var array|null + * @var array */ - private $sigmas; + private $sigmas = []; /** - * @var array|null + * @var array */ - private $prevSigmas; + private $prevSigmas = []; public function __construct(float $learningRate) { @@ -57,8 +57,8 @@ class Backpropagation } // Clean some memory (also it helps make MLP persistency & children more maintainable). - $this->sigmas = null; - $this->prevSigmas = null; + $this->sigmas = []; + $this->prevSigmas = []; } private function getSigma(Neuron $neuron, int $targetClass, int $key, bool $lastLayer): float diff --git a/src/Phpml/Regression/LeastSquares.php b/src/Phpml/Regression/LeastSquares.php index 6ecfafc..d00ebf5 100644 --- a/src/Phpml/Regression/LeastSquares.php +++ b/src/Phpml/Regression/LeastSquares.php @@ -10,6 +10,7 @@ use Phpml\Math\Matrix; class LeastSquares implements Regression { use Predictable; + /** * @var array */ diff --git a/tests/Phpml/Classification/Linear/LogisticRegressionTest.php b/tests/Phpml/Classification/Linear/LogisticRegressionTest.php index 85fc159..f60d308 100644 --- a/tests/Phpml/Classification/Linear/LogisticRegressionTest.php +++ b/tests/Phpml/Classification/Linear/LogisticRegressionTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace tests\Phpml\Classification\Linear; +namespace Phpml\Tests\Classification\Linear; use Phpml\Classification\Linear\LogisticRegression; use PHPUnit\Framework\TestCase; @@ -55,12 +55,12 @@ class LogisticRegressionTest extends TestCase $zero = $method->invoke($predictor, [0.1, 0.1], 0); $one = $method->invoke($predictor, [0.1, 0.1], 1); - $this->assertEquals(1, $zero + $one, null, 1e-6); + $this->assertEquals(1, $zero + $one, '', 1e-6); $this->assertTrue($zero > $one); $zero = $method->invoke($predictor, [0.9, 0.9], 0); $one = $method->invoke($predictor, [0.9, 0.9], 1); - $this->assertEquals(1, $zero + $one, null, 1e-6); + $this->assertEquals(1, $zero + $one, '', 1e-6); $this->assertTrue($zero < $one); } @@ -97,9 +97,9 @@ class LogisticRegressionTest extends TestCase $two = $method->invoke($predictor, [3.0, 9.5], 2); $not_two = $method->invoke($predictor, [3.0, 9.5], 'not_2'); - $this->assertEquals(1, $zero + $not_zero, null, 1e-6); - $this->assertEquals(1, $one + $not_one, null, 1e-6); - $this->assertEquals(1, $two + $not_two, null, 1e-6); + $this->assertEquals(1, $zero + $not_zero, '', 1e-6); + $this->assertEquals(1, $one + $not_one, '', 1e-6); + $this->assertEquals(1, $two + $not_two, '', 1e-6); $this->assertTrue($zero < $two); $this->assertTrue($one < $two); } diff --git a/tests/Phpml/Metric/AccuracyTest.php b/tests/Phpml/Metric/AccuracyTest.php index 08d1c44..e2260c4 100644 --- a/tests/Phpml/Metric/AccuracyTest.php +++ b/tests/Phpml/Metric/AccuracyTest.php @@ -45,7 +45,7 @@ class AccuracyTest extends TestCase $classifier = new SVC(Kernel::RBF); $classifier->train($dataset->getTrainSamples(), $dataset->getTrainLabels()); - $predicted = $classifier->predict($dataset->getTestSamples()); + $predicted = (array) $classifier->predict($dataset->getTestSamples()); $accuracy = Accuracy::score($dataset->getTestLabels(), $predicted); diff --git a/tests/Phpml/NeuralNetwork/Network/MultilayerPerceptronTest.php b/tests/Phpml/NeuralNetwork/Network/MultilayerPerceptronTest.php index c244c27..885c1e1 100644 --- a/tests/Phpml/NeuralNetwork/Network/MultilayerPerceptronTest.php +++ b/tests/Phpml/NeuralNetwork/Network/MultilayerPerceptronTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace tests\Phpml\NeuralNetwork\Network; +namespace Phpml\Tests\NeuralNetwork\Network; use Phpml\NeuralNetwork\Network\MultilayerPerceptron; use PHPUnit\Framework\TestCase; @@ -11,6 +11,7 @@ class MultilayerPerceptronTest extends TestCase { public function testLearningRateSetter(): void { + /** @var MultilayerPerceptron $mlp */ $mlp = $this->getMockForAbstractClass( MultilayerPerceptron::class, [5, [3], [0, 1], 1000, null, 0.42]
${value}