diff --git a/.scrutinizer.yml b/.scrutinizer.yml index f858712f1..73281fd1a 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,7 +1,7 @@ build: environment: php: - version: 7.1.0 + version: 7.1.3 tools: external_code_coverage: diff --git a/.travis.yml b/.travis.yml index d60c19b8b..e4a1e5ca5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,3 +47,8 @@ jobs: env: STATIC_ANALYSIS install: travis_retry composer install --prefer-dist script: vendor/bin/phpstan analyse -l 3 lib + + - stage: Code Quality + env: STATIC_ANALYSIS + install: travis_retry composer install --prefer-dist + script: vendor/bin/psalm diff --git a/composer.json b/composer.json index aa9c30abf..828a7d2f0 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,13 @@ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { - "php": "^7.1" + "php": "^7.1.3" }, "require-dev": { "phpunit/phpunit": "^7.0", "doctrine/coding-standard": "^6.0", - "phpstan/phpstan-shim": "^0.9.2" + "phpstan/phpstan-shim": "^0.9.2", + "vimeo/psalm": "^3.2.2" }, "autoload": { "psr-4": { "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" } diff --git a/composer.lock b/composer.lock index 7a9c341b7..27e6bbaf6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,188 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3110654c561f87d0733ed1cc2af09006", + "content-hash": "9089934b1d5718afcff78cb110ec244a", "packages": [], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "7075ef7d74dbd32626bfd31c976b23055c3ade6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/7075ef7d74dbd32626bfd31c976b23055c3ade6a", + "reference": "7075ef7d74dbd32626bfd31c976b23055c3ade6a", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "amphp/phpunit-util": "^1", + "friendsofphp/php-cs-fixer": "^2.3", + "phpstan/phpstan": "^0.8.5", + "phpunit/phpunit": "^6.0.9", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "time": "2018-12-11T10:31:37+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.5.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "6bbfcb6f47e92577e739586ba0c87e867be70a23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/6bbfcb6f47e92577e739586ba0c87e867be70a23", + "reference": "6bbfcb6f47e92577e739586ba0c87e867be70a23", + "shasum": "" + }, + "require": { + "amphp/amp": "^2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "friendsofphp/php-cs-fixer": "^2.3", + "infection/infection": "^0.9.3", + "phpunit/phpunit": "^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "time": "2018-12-27T18:08:06+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "d17708133b6c276d6e42ef887a877866b909d892" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", + "reference": "d17708133b6c276d6e42ef887a877866b909d892", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "time": "2019-01-28T20:25:53+00:00" + }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.5.0", @@ -188,6 +367,150 @@ ], "time": "2017-07-22T11:58:36+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "241c470695366e7b83672be04ea0e64d8085a551" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/241c470695366e7b83672be04ea0e64d8085a551", + "reference": "241c470695366e7b83672be04ea0e64d8085a551", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0", + "php": ">=7.0", + "phpdocumentor/reflection-docblock": "^4.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "time": "2018-09-10T08:58:41+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "1bdd1bcc95428edf85ec04c7b558d0886c07280f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/1bdd1bcc95428edf85ec04c7b558d0886c07280f", + "reference": "1bdd1bcc95428edf85ec04c7b558d0886c07280f", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpstan/phpstan": "*", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "time": "2018-09-25T11:42:25+00:00" + }, + { + "name": "muglug/package-versions-56", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/muglug/PackageVersions.git", + "reference": "a67bed26deaaf9269a348e53063bc8d4dcc60ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/muglug/PackageVersions/zipball/a67bed26deaaf9269a348e53063bc8d4dcc60ffd", + "reference": "a67bed26deaaf9269a348e53063bc8d4dcc60ffd", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "composer/composer": "^1.3", + "ext-zip": "*", + "phpunit/phpunit": "^5.7.5" + }, + "type": "composer-plugin", + "extra": { + "class": "Muglug\\PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Muglug\\PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Abdul Malik Ikhsan", + "email": "samsonasik@gmail.com" + }, + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "A backport of ocramius/package-versions that supports php ^5.6. Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2018-03-26T03:22:13+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.7.0", @@ -233,6 +556,148 @@ ], "time": "2017-10-19T19:58:43+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "3868fe1128ce1169228acdb623359dca74db5ef3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/3868fe1128ce1169228acdb623359dca74db5ef3", + "reference": "3868fe1128ce1169228acdb623359dca74db5ef3", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "time": "2017-11-28T21:30:01+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.2.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5221f49a608808c1e4d436df32884cbc1b821ac0", + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-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": "2019-02-16T20:54:15+00:00" + }, + { + "name": "openlss/lib-array2xml", + "version": "0.5.1", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "c8b5998a342d7861f2e921403f44e0a2f3ef2be0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/c8b5998a342d7861f2e921403f44e0a2f3ef2be0", + "reference": "c8b5998a342d7861f2e921403f44e0a2f3ef2be0", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "contact@nullivex.com", + "homepage": "http://bryantong.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "http://openlss.org" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "http://openlss.org", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "time": "2016-11-10T19:10:18+00:00" + }, { "name": "phar-io/manifest", "version": "1.0.1", @@ -335,6 +800,57 @@ "description": "Library for handling version information and constraints", "time": "2017-03-05T17:38:23+00:00" }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "time": "2018-02-15T16:58:55+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -487,6 +1003,67 @@ ], "time": "2017-07-14T14:27:02+00:00" }, + { + "name": "phpmyadmin/sql-parser", + "version": "v4.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/sql-parser.git", + "reference": "0eb16ef5e3acacbc792be336754e42d98791a33f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/0eb16ef5e3acacbc792be336754e42d98791a33f", + "reference": "0eb16ef5e3acacbc792be336754e42d98791a33f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/polyfill-mbstring": "^1.3" + }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, + "require-dev": { + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5", + "sami/sami": "^4.0" + }, + "suggest": { + "ext-mbstring": "For best performance", + "phpmyadmin/motranslator": "Translate messages to your favorite locale" + }, + "bin": [ + "bin/highlight-query", + "bin/lint-query" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", + "homepage": "https://github.com/phpmyadmin/sql-parser", + "keywords": [ + "analysis", + "lexer", + "parser", + "sql" + ], + "time": "2019-01-05T13:46:38+00:00" + }, { "name": "phpspec/prophecy", "version": "1.7.5", @@ -1016,7 +1593,55 @@ "mock", "xunit" ], - "time": "2018-02-15T05:27:38+00:00" + "abandoned": true, + "time": "2018-02-15T05:27:38+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1672,6 +2297,263 @@ ], "time": "2018-12-19T23:57:18+00:00" }, + { + "name": "symfony/console", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/9dc2299a016497f9ee620be94524e6c0af0280a9", + "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.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/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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 Console Component", + "homepage": "https://symfony.com", + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.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/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, { "name": "theseer/tokenizer", "version": "1.1.0", @@ -1712,22 +2594,103 @@ "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": "vimeo/psalm", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "f0ddc6f3bc35ba7ecb99232903907a1d5ec1c8e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/f0ddc6f3bc35ba7ecb99232903907a1d5ec1c8e8", + "reference": "f0ddc6f3bc35ba7ecb99232903907a1d5ec1c8e8", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.1", + "amphp/byte-stream": "^1.5", + "composer/xdebug-handler": "^1.1", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.2", + "muglug/package-versions-56": "1.2.4", + "netresearch/jsonmapper": "^1.0", + "nikic/php-parser": "^4.0.2 || ^4.1", + "openlss/lib-array2xml": "^0.0.10||^0.5.1", + "php": "^7.0", + "php-cs-fixer/diff": "^1.2", + "phpmyadmin/sql-parser": "^4.0", + "symfony/console": "^3.0||^4.0", + "webmozart/glob": "^4.1", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "phpunit/phpunit": "^6.0 || ^7.0", + "psalm/plugin-phpunit": "^0.5.1", + "squizlabs/php_codesniffer": "^3.0" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalter", + "psalm-language-server", + "psalm-plugin" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\Plugin\\": "src/Psalm/Plugin", + "Psalm\\": "src/Psalm" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "time": "2019-03-17T22:14:30+00:00" + }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -1760,7 +2723,100 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" + }, + { + "name": "webmozart/glob", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/glob.git", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/path-util": "^2.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1", + "symfony/filesystem": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "time": "2015-12-29T11:14:33+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], @@ -1769,7 +2825,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.1" + "php": "^7.1.3" }, "platform-dev": [] } diff --git a/lib/Doctrine/Common/Collections/AbstractLazyCollection.php b/lib/Doctrine/Common/Collections/AbstractLazyCollection.php index 50fcf93a4..4115df8af 100644 --- a/lib/Doctrine/Common/Collections/AbstractLazyCollection.php +++ b/lib/Doctrine/Common/Collections/AbstractLazyCollection.php @@ -6,12 +6,17 @@ /** * Lazy collection that is backed by a concrete collection + * + * @template TKey of array-key + * @template T + * @template-implements Collection */ abstract class AbstractLazyCollection implements Collection { /** * The backed collection to use * + * @psalm-var Collection * @var Collection */ protected $collection; @@ -327,6 +332,8 @@ public function isInitialized() /** * Initialize the collection + * + * @return void */ protected function initialize() { diff --git a/lib/Doctrine/Common/Collections/ArrayCollection.php b/lib/Doctrine/Common/Collections/ArrayCollection.php index f423c7883..f6f0c50b7 100644 --- a/lib/Doctrine/Common/Collections/ArrayCollection.php +++ b/lib/Doctrine/Common/Collections/ArrayCollection.php @@ -31,12 +31,18 @@ * and may break when we change the internals in the future. If you need to * serialize a collection use {@link toArray()} and reconstruct the collection * manually. + * + * @template TKey of array-key + * @template T + * @template-implements Collection + * @template-implements Selectable */ class ArrayCollection implements Collection, Selectable { /** * An array containing the entries of this collection. * + * @psalm-var array * @var array */ private $elements; @@ -45,27 +51,14 @@ class ArrayCollection implements Collection, Selectable * Initializes a new ArrayCollection. * * @param array $elements + * + * @psalm-param array $elements */ public function __construct(array $elements = []) { $this->elements = $elements; } - /** - * Creates a new instance from the specified elements. - * - * This method is provided for derived classes to specify how a new - * instance should be created when constructor semantics have changed. - * - * @param array $elements Elements. - * - * @return static - */ - protected function createFrom(array $elements) - { - return new static($elements); - } - /** * {@inheritDoc} */ @@ -82,6 +75,24 @@ public function first() return reset($this->elements); } + /** + * Creates a new instance from the specified elements. + * + * This method is provided for derived classes to specify how a new + * instance should be created when constructor semantics have changed. + * + * @param array $elements Elements. + * + * @return static + * + * @psalm-param array $elements + * @psalm-return ArrayCollection + */ + protected function createFrom(array $elements) + { + return new static($elements); + } + /** * {@inheritDoc} */ @@ -311,6 +322,8 @@ public function map(Closure $func) * {@inheritDoc} * * @return static + * + * @psalm-return ArrayCollection */ public function filter(Closure $p) { diff --git a/lib/Doctrine/Common/Collections/Collection.php b/lib/Doctrine/Common/Collections/Collection.php index 25c1e3660..48ec6cef3 100644 --- a/lib/Doctrine/Common/Collections/Collection.php +++ b/lib/Doctrine/Common/Collections/Collection.php @@ -23,6 +23,11 @@ * You can not rely on the internal iterator of the collection being at a certain * position unless you explicitly positioned it before. Prefer iteration with * external iterators. + * + * @template TKey of array-key + * @template T + * @template-extends IteratorAggregate + * @template-extends ArrayAccess */ interface Collection extends Countable, IteratorAggregate, ArrayAccess { @@ -31,7 +36,9 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess * * @param mixed $element The element to add. * - * @return bool Always TRUE. + * @return true Always TRUE. + * + * @psalm-param T $element */ public function add($element); @@ -49,6 +56,8 @@ public function clear(); * @param mixed $element The element to search for. * * @return bool TRUE if the collection contains the element, FALSE otherwise. + * + * @psalm-param T $element */ public function contains($element); @@ -65,6 +74,9 @@ public function isEmpty(); * @param string|int $key The key/index of the element to remove. * * @return mixed The removed element or NULL, if the collection did not contain the element. + * + * @psalm-param TKey $key + * @psalm-return T|null */ public function remove($key); @@ -74,6 +86,8 @@ public function remove($key); * @param mixed $element The element to remove. * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. + * + * @psalm-param T $element */ public function removeElement($element); @@ -84,6 +98,8 @@ public function removeElement($element); * * @return bool TRUE if the collection contains an element with the specified key/index, * FALSE otherwise. + * + * @psalm-param TKey $key */ public function containsKey($key); @@ -93,14 +109,19 @@ public function containsKey($key); * @param string|int $key The key/index of the element to retrieve. * * @return mixed + * + * @psalm-param TKey $key + * @psalm-return T|null */ public function get($key); /** * Gets all keys/indices of the collection. * - * @return array The keys/indices of the collection, in the order of the corresponding + * @return int[]|string[] The keys/indices of the collection, in the order of the corresponding * elements in the collection. + * + * @psalm-return TKey[] */ public function getKeys(); @@ -109,6 +130,8 @@ public function getKeys(); * * @return array The values of all elements in the collection, in the order they * appear in the collection. + * + * @psalm-return T[] */ public function getValues(); @@ -119,6 +142,9 @@ public function getValues(); * @param mixed $value The element to set. * * @return void + * + * @psalm-param TKey $key + * @psalm-param T $value */ public function set($key, $value); @@ -126,6 +152,8 @@ public function set($key, $value); * Gets a native PHP array representation of the collection. * * @return array + * + * @psalm-return array */ public function toArray(); @@ -133,6 +161,8 @@ public function toArray(); * Sets the internal iterator to the first element in the collection and returns this element. * * @return mixed + * + * @psalm-return T|false */ public function first(); @@ -140,6 +170,8 @@ public function first(); * Sets the internal iterator to the last element in the collection and returns this element. * * @return mixed + * + * @psalm-return T|false */ public function last(); @@ -147,6 +179,8 @@ public function last(); * Gets the key/index of the element at the current iterator position. * * @return int|string + * + * @psalm-return TKey */ public function key(); @@ -154,6 +188,8 @@ public function key(); * Gets the element of the collection at the current iterator position. * * @return mixed + * + * @psalm-return T|false */ public function current(); @@ -161,6 +197,8 @@ public function current(); * Moves the internal iterator position to the next element and returns this element. * * @return mixed + * + * @psalm-return T|false */ public function next(); @@ -170,6 +208,8 @@ public function next(); * @param Closure $p The predicate. * * @return bool TRUE if the predicate is TRUE for at least one element, FALSE otherwise. + * + * @psalm-param Closure(TKey=, T=):bool $p */ public function exists(Closure $p); @@ -180,6 +220,9 @@ public function exists(Closure $p); * @param Closure $p The predicate used for filtering. * * @return Collection A collection with the results of the filter operation. + * + * @psalm-param Closure(T=):bool $p + * @psalm-return Collection */ public function filter(Closure $p); @@ -189,6 +232,8 @@ public function filter(Closure $p); * @param Closure $p The predicate. * * @return bool TRUE, if the predicate yields TRUE for all elements, FALSE otherwise. + * + * @psalm-param Closure(TKey=, T=):bool $p */ public function forAll(Closure $p); @@ -197,6 +242,10 @@ public function forAll(Closure $p); * a new collection with the elements returned by the function. * * @return Collection + * + * @template U + * @psalm-param Closure(T=):U $func + * @psalm-return Collection */ public function map(Closure $func); @@ -209,6 +258,9 @@ public function map(Closure $func); * @return Collection[] An array with two elements. The first element contains the collection * of elements where the predicate returned TRUE, the second element * contains the collection of elements where the predicate returned FALSE. + * + * @psalm-param Closure(TKey=, T=):bool $p + * @psalm-return array{0: Collection, 1: Collection} */ public function partition(Closure $p); @@ -220,6 +272,9 @@ public function partition(Closure $p); * @param mixed $element The element to search for. * * @return int|string|bool The key/index of the element or FALSE if the element was not found. + * + * @psalm-param T $element + * @psalm-return TKey|false */ public function indexOf($element); @@ -234,6 +289,8 @@ public function indexOf($element); * @param int|null $length The maximum number of elements to return, or null for no limit. * * @return array + * + * @psalm-return array */ public function slice($offset, $length = null); } diff --git a/lib/Doctrine/Common/Collections/Selectable.php b/lib/Doctrine/Common/Collections/Selectable.php index f31da812d..692037b55 100644 --- a/lib/Doctrine/Common/Collections/Selectable.php +++ b/lib/Doctrine/Common/Collections/Selectable.php @@ -13,6 +13,9 @@ * utilizing the query APIs, for example SQL in the ORM. Applications using * this API can implement efficient database access without having to ask the * EntityManager or Repositories. + * + * @template TKey as array-key + * @template T */ interface Selectable { @@ -21,6 +24,8 @@ interface Selectable * returns a new collection containing these elements. * * @return Collection + * + * @psalm-return Collection */ public function matching(Criteria $criteria); } diff --git a/psalm.xml.dist b/psalm.xml.dist new file mode 100644 index 000000000..8c5b066d5 --- /dev/null +++ b/psalm.xml.dist @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +