diff --git a/.appveyor.yml b/.appveyor.yml index a7fe2f1cb06..352719e2617 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -49,7 +49,7 @@ install: - ps: | # Check if installation is cached if (!(Test-Path c:\tools\php)) { - appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') + appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version 7.3.12 # install sqlite appveyor-retry cinst -y sqlite Get-ChildItem -Path c:\tools\php @@ -68,7 +68,8 @@ install: Add-Content php.ini "`n extension=php_curl.dll" Add-Content php.ini "`n curl.cainfo=C:\tools\cacert\bundle.pem" - $DLLVersion = "5.5.0preview" + # Get and install the latest stable sqlsrv DLL's + $DLLVersion = (Invoke-WebRequest "https://pecl.php.net/rest/r/sqlsrv/stable.txt").Content cd c:\tools\php\ext $source = "https://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip" $destination = "c:\tools\php\ext\php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc15-x64.zip" @@ -117,7 +118,6 @@ install: } # install composer dependencies - cd C:\projects\dbal - - rm composer.lock - appveyor-retry composer self-update - appveyor-retry composer install --no-progress --prefer-dist diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000000..a211af1b3fb --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,33 @@ + +name: "Continuous Integration" + +on: + pull_request: + +jobs: + static-analysis-psalm: + name: Static Analysis with Psalm + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@1.8.1" + with: + coverage: "none" + php-version: "7.4" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "composer-${{ hashFiles('composer.json') }}" + restore-keys: "composer-" + + - name: "Install dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: Psalm + run: "vendor/bin/psalm" diff --git a/.scrutinizer.yml b/.scrutinizer.yml index a3b8a5621ca..cb9872f6761 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,7 +21,7 @@ before_commands: tools: external_code_coverage: timeout: 3600 - runs: 30 # 25x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP + runs: 28 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP filter: excluded_paths: diff --git a/.travis.yml b/.travis.yml index cc516636cda..823fd073e72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php -sudo: false -dist: trusty +dist: xenial cache: directories: @@ -15,11 +14,14 @@ before_install: fi before_script: - - if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi; + - | + if [[ -n "$IMAGE" ]] + then + bash ./tests/travis/docker-run-mysql-or-mariadb.sh + fi install: - - rm composer.lock - - travis_retry composer -n update --prefer-dist + - travis_retry composer -n install --prefer-dist script: - | @@ -55,36 +57,20 @@ jobs: - stage: Test php: 7.2 - env: DB=mysql.docker MYSQL_VERSION=8.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mysql.docker IMAGE=mysql:8.0 - stage: Test php: 7.2 - env: DB=mysqli.docker MYSQL_VERSION=8.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mysqli.docker IMAGE=mysql:8.0 - stage: Test php: 7.2 - env: DB=mariadb MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + env: DB=mariadb.docker IMAGE=mariadb:10.3 - stage: Test php: 7.2 - env: DB=mariadb.mysqli MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 - stage: Test php: 7.2 env: DB=pgsql POSTGRESQL_VERSION=11.0 sudo: required - services: - - docker before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test @@ -94,8 +80,6 @@ jobs: php: 7.2 env: DB=sqlsrv sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-sqlsrv.sh @@ -104,87 +88,48 @@ jobs: php: 7.2 env: DB=pdo_sqlsrv sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test php: 7.3 - env: DB=mysql COVERAGE=yes - - stage: Test - php: 7.3 - env: DB=mysql.docker MYSQL_VERSION=5.7 COVERAGE=yes - sudo: required - before_script: - - bash ./tests/travis/install-mysql-5.7.sh + env: DB=mysql.docker IMAGE=mysql:5.7 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mysql.docker MYSQL_VERSION=8.0 COVERAGE=yes - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mysql.docker IMAGE=mysql:8.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mysqli COVERAGE=yes + env: DB=mysqli.docker IMAGE=mysql:5.7 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mysqli.docker MYSQL_VERSION=5.7 COVERAGE=yes - sudo: required - before_script: - - bash ./tests/travis/install-mysql-5.7.sh + env: DB=mysqli.docker IMAGE=mysql:8.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mysqli.docker MYSQL_VERSION=8.0 COVERAGE=yes - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + env: DB=mariadb.docker IMAGE=mariadb:10.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes - addons: - mariadb: 10.0 + env: DB=mariadb.docker IMAGE=mariadb:10.1 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.1 COVERAGE=yes - addons: - mariadb: 10.1 - - stage: Test - php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.2 COVERAGE=yes - addons: - mariadb: 10.2 + env: DB=mariadb.docker IMAGE=mariadb:10.2 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb MARIADB_VERSION=10.3 COVERAGE=yes - addons: - mariadb: 10.3 + env: DB=mariadb.docker IMAGE=mariadb:10.3 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.0 COVERAGE=yes - addons: - mariadb: 10.0 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.0 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.1 COVERAGE=yes - addons: - mariadb: 10.1 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.1 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes - addons: - mariadb: 10.2 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.2 COVERAGE=yes - stage: Test php: 7.3 - env: DB=mariadb.mysqli MARIADB_VERSION=10.3 COVERAGE=yes - addons: - mariadb: 10.3 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 COVERAGE=yes - stage: Test + dist: trusty php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes services: @@ -192,6 +137,7 @@ jobs: addons: postgresql: "9.2" - stage: Test + dist: trusty php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes services: @@ -201,48 +147,36 @@ jobs: - stage: Test php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes - services: - - postgresql addons: postgresql: "9.4" - stage: Test php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes - services: - - postgresql addons: postgresql: "9.5" - stage: Test php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes - services: - - postgresql addons: postgresql: "9.6" - stage: Test php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes sudo: required - services: - - postgresql addons: - postgresql: "9.6" + postgresql: "10" before_script: - bash ./tests/travis/install-postgres-10.sh - stage: Test php: 7.3 env: DB=pgsql POSTGRESQL_VERSION=11.0 COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test php: 7.3 env: DB=sqlsrv COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-sqlsrv.sh @@ -251,8 +185,6 @@ jobs: php: 7.3 env: DB=pdo_sqlsrv COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh @@ -261,8 +193,6 @@ jobs: php: 7.3 env: DB=ibm_db2 COVERAGE=yes sudo: required - services: - - docker before_script: - bash ./tests/travis/install-db2.sh - bash ./tests/travis/install-db2-ibm_db2.sh @@ -272,58 +202,38 @@ jobs: install: - travis_retry composer update --prefer-dist --prefer-lowest - stage: Test - php: 7.4snapshot - env: DB=mysql.docker MYSQL_VERSION=8.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + php: 7.4 + env: DB=mysql.docker IMAGE=mysql:8.0 - stage: Test - php: 7.4snapshot - env: DB=mysqli.docker MYSQL_VERSION=8.0 - sudo: required - services: - - docker - before_script: - - bash ./tests/travis/install-mysql-8.0.sh + php: 7.4 + env: DB=mysqli.docker IMAGE=mysql:8.0 - stage: Test - php: 7.4snapshot - env: DB=mariadb MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + php: 7.4 + env: DB=mariadb.docker IMAGE=mariadb:10.3 - stage: Test - php: 7.4snapshot - env: DB=mariadb.mysqli MARIADB_VERSION=10.3 - addons: - mariadb: 10.3 + php: 7.4 + env: DB=mariadb.mysqli.docker IMAGE=mariadb:10.3 - stage: Test - php: 7.4snapshot + php: 7.4 env: DB=pgsql POSTGRESQL_VERSION=11.0 sudo: required - services: - - docker before_script: - bash ./tests/travis/install-postgres-11.sh - stage: Test - php: 7.4snapshot + php: 7.4 env: DB=sqlite - stage: Test - php: 7.4snapshot + php: 7.4 env: DB=sqlsrv sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-sqlsrv.sh - bash ./tests/travis/install-mssql.sh - stage: Test - php: 7.4snapshot + php: 7.4 env: DB=pdo_sqlsrv sudo: required - services: - - docker before_script: - bash ./tests/travis/install-sqlsrv-dependencies.sh - bash ./tests/travis/install-mssql-pdo_sqlsrv.sh @@ -336,3 +246,6 @@ jobs: install: - composer config minimum-stability dev - travis_retry composer update --prefer-dist + + allow_failures: + - env: DEPENDENCIES=dev diff --git a/README.md b/README.md index cfd703a316a..5c91bd69ca5 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,13 @@ $table->addUniqueIndex( ## Original README from doctrine/dbal: -| [Master][Master] | [2.9][2.9] | [Develop][develop] -|:----------------:|:----------:|:------------------:| -| [![Build status][Master image]][Master] | [![Build status][2.9 image]][2.9] | [![Build status][develop image]][develop] | -| [![Build Status][ContinuousPHP image]][ContinuousPHP] | [![Build Status][ContinuousPHP 2.9 image]][ContinuousPHP] | [![Build Status][ContinuousPHP develop image]][ContinuousPHP] | -| [![Code Coverage][Coverage image]][Scrutinizer Master] | [![Code Coverage][Coverage 2.9 image]][Scrutinizer 2.9] | [![Code Coverage][Coverage develop image]][Scrutinizer develop] | -| [![Code Quality][Quality image]][Scrutinizer Master] | [![Code Quality][Quality 2.9 image]][Scrutinizer 2.9] | [![Code Quality][Quality develop image]][Scrutinizer develop] | -| [![AppVeyor][AppVeyor master image]][AppVeyor master] | [![AppVeyor][AppVeyor 2.9 image]][AppVeyor 2.9] | [![AppVeyor][AppVeyor develop image]][AppVeyor develop] | +| [Master][Master] | [2.10][2.10] | +|:----------------:|:----------:| +| [![Build status][Master image]][Master] | [![Build status][2.10 image]][2.10] | +| [![Build Status][ContinuousPHP image]][ContinuousPHP] | [![Build Status][ContinuousPHP 2.10 image]][ContinuousPHP] | +| [![Code Coverage][Coverage image]][Scrutinizer Master] | [![Code Coverage][Coverage 2.10 image]][Scrutinizer 2.10] | +| [![Code Quality][Quality image]][Scrutinizer Master] | [![Code Quality][Quality 2.10 image]][Scrutinizer 2.10] | +| [![AppVeyor][AppVeyor master image]][AppVeyor master] | [![AppVeyor][AppVeyor 2.10 image]][AppVeyor 2.10] Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction. @@ -66,21 +66,11 @@ Powerful database abstraction layer with many features for database schema intro [AppVeyor master image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/master?svg=true [ContinuousPHP]: https://continuousphp.com/git-hub/doctrine/dbal - [2.9 image]: https://img.shields.io/travis/doctrine/dbal/2.9.svg?style=flat-square - [Coverage 2.9 image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/2.9.svg?style=flat-square - [Quality 2.9 image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/2.9.svg?style=flat-square - [ContinuousPHP 2.9 image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/2.9.svg?style=flat-square - [2.9]: https://github.com/doctrine/dbal/tree/2.9 - [Scrutinizer 2.9]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=2.9 - [AppVeyor 2.9]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.9 - [AppVeyor 2.9 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.9?svg=true - - [develop]: https://github.com/doctrine/dbal/tree/develop - [develop image]: https://img.shields.io/travis/doctrine/dbal/develop.svg?style=flat-square - [Coverage develop image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/develop.svg?style=flat-square - [Quality develop image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/develop.svg?style=flat-square - [ContinuousPHP develop image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/develop.svg?style=flat-square - [develop]: https://github.com/doctrine/dbal/tree/develop - [Scrutinizer develop]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=develop - [AppVeyor develop]: https://ci.appveyor.com/project/doctrine/dbal/branch/develop - [AppVeyor develop image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/develop?svg=true + [2.10 image]: https://img.shields.io/travis/doctrine/dbal/2.10.x.svg?style=flat-square + [Coverage 2.10 image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/dbal/2.10.x.svg?style=flat-square + [Quality 2.10 image]: https://img.shields.io/scrutinizer/g/doctrine/dbal/2.10.x.svg?style=flat-square + [ContinuousPHP 2.10 image]: https://img.shields.io/continuousphp/git-hub/doctrine/dbal/2.10.x.svg?style=flat-square + [2.10]: https://github.com/doctrine/dbal/tree/2.10.x + [Scrutinizer 2.10]: https://scrutinizer-ci.com/g/doctrine/dbal/?branch=2.10.x + [AppVeyor 2.10]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.10.x + [AppVeyor 2.10 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.10.x?svg=true diff --git a/composer.json b/composer.json index 4a426e4881a..f17794bcec0 100644 --- a/composer.json +++ b/composer.json @@ -40,16 +40,21 @@ "require-dev": { "doctrine/coding-standard": "^6.0", "jetbrains/phpstorm-stubs": "^2019.1", - "phpstan/phpstan": "^0.11.3", + "nikic/php-parser": "^4.4", + "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^8.4.1", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0" + "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", + "vimeo/psalm": "^3.11" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, "bin": ["bin/doctrine-dbal"], "config": { - "sort-packages": true + "sort-packages": true, + "platform": { + "php": "7.2.0" + } }, "autoload": { "psr-4": { "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" } diff --git a/composer.lock b/composer.lock index aa0428c2019..215798b08a1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "120172ae44052999ec9a50b1121414cc", + "content-hash": "b7f970513c9756e5eaaba3974429c23c", "packages": [ { "name": "doctrine/cache", @@ -156,26 +156,230 @@ } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.4.2", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "feca077369a47263b22156b3c6389e55f3809f24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/feca077369a47263b22156b3c6389e55f3809f24", + "reference": "feca077369a47263b22156b3c6389e55f3809f24", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6.0.9 | ^7", + "react/promise": "^2", + "vimeo/psalm": "^3.9@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.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": "2020-04-04T15:05:26+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.7.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/b867505edb79dda8f253ca3c3a2bbadae4b16592", + "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592", + "shasum": "" + }, + "require": { + "amphp/amp": "^2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "vimeo/psalm": "^3.9@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.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": "2020-04-04T16:56:54+00:00" + }, + { + "name": "composer/semver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2020-01-13T12:06:48+00:00" + }, { "name": "composer/xdebug-handler", - "version": "1.3.3", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" }, "type": "library", "autoload": { @@ -193,12 +397,18 @@ "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Restarts a process without xdebug.", + "description": "Restarts a process without Xdebug.", "keywords": [ "Xdebug", "performance" ], - "time": "2019-05-27T17:52:04+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + } + ], + "time": "2020-03-01T12:26:26+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -384,55 +594,92 @@ "time": "2019-03-17T17:37:11+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "1.2", + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.1.1", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40", + "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40", "shasum": "" }, "require": { - "ocramius/package-versions": "^1.2.0", - "php": "^7.0" + "netresearch/jsonmapper": "^1.0 || ^2.0", + "php": ">=7.0", + "phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.0.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" + "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": "2020-03-11T15:21:41+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpstan/phpstan": "*", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.1" }, + "type": "library", "autoload": { "psr-4": { - "Jean85\\": "src/" + "LanguageServerProtocol\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "ISC" ], "authors": [ { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" + "name": "Felix Becker", + "email": "felix.b@outlook.com" } ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "description": "PHP classes for the Language Server Protocol", "keywords": [ - "composer", - "package", - "release", - "versions" + "language", + "microsoft", + "php", + "server" ], - "time": "2018-06-13T13:22:40+00:00" + "time": "2019-06-23T21:03:50+00:00" }, { "name": "jetbrains/phpstorm-stubs", @@ -522,648 +769,221 @@ "time": "2019-08-09T12:45:53+00:00" }, { - "name": "nette/bootstrap", - "version": "v3.0.0", + "name": "netresearch/jsonmapper", + "version": "v2.0.0", "source": { "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3" + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "e245890383c3ed38b6d202ee373c23ccfebc0f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/e1075af05c211915e03e0c86542f3ba5433df4a3", - "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e245890383c3ed38b6d202ee373c23ccfebc0f54", + "reference": "e245890383c3ed38b6d202ee373c23ccfebc0f54", "shasum": "" }, "require": { - "nette/di": "^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.6" }, "require-dev": { - "latte/latte": "^2.2", - "nette/application": "^3.0", - "nette/caching": "^3.0", - "nette/database": "^3.0", - "nette/forms": "^3.0", - "nette/http": "^3.0", - "nette/mail": "^3.0", - "nette/robot-loader": "^3.0", - "nette/safe-stream": "^2.2", - "nette/security": "^3.0", - "nette/tester": "^2.0", - "tracy/tracy": "^2.6" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", + "squizlabs/php_codesniffer": "~3.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "JsonMapper": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" + "OSL-3.0" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" } ], - "description": "๐Ÿ…ฑ Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "time": "2019-03-26T12:59:07+00:00" + "description": "Map nested JSON structures onto PHP classes", + "time": "2020-03-04T17:23:33+00:00" }, { - "name": "nette/di", - "version": "v3.0.1", + "name": "nikic/php-parser", + "version": "v4.4.0", "source": { "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/4aff517a1c6bb5c36fa09733d4cea089f529de6d", - "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", "shasum": "" }, "require": { "ext-tokenizer": "*", - "nette/neon": "^3.0", - "nette/php-generator": "^3.2.2", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "conflict": { - "nette/bootstrap": "<3.0" + "php": ">=7.0" }, "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.3" + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.3-dev" } }, "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/compatibility.php" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" + "BSD-3-Clause" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Nikita Popov" } ], - "description": "๐Ÿ’Ž Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", + "description": "A PHP parser written in PHP", "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "time": "2019-08-07T12:11:33+00:00" + "parser", + "php" + ], + "time": "2020-04-10T16:34:50+00:00" }, { - "name": "nette/finder", - "version": "v2.5.0", + "name": "ocramius/package-versions", + "version": "1.4.2", "source": { "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2" + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/6be1b83ea68ac558aff189d640abe242e0306fe2", - "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", "shasum": "" }, "require": { - "nette/utils": "^2.4 || ~3.0.0", - "php": ">=7.1" - }, - "conflict": { - "nette/nette": "<2.2" + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" }, "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.5.17" }, - "type": "library", + "type": "composer-plugin", "extra": { + "class": "PackageVersions\\Installer", "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" + "MIT" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "description": "๐Ÿ” Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "time": "2019-02-28T18:13:25+00:00" + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-11-15T16:17:10+00:00" }, { - "name": "nette/neon", - "version": "v3.0.0", + "name": "openlss/lib-array2xml", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb" + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", "shasum": "" }, "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=7.0" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" + "php": ">=5.3.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "LSS": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" + "Apache-2.0" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" }, { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" } ], - "description": "๐Ÿธ Nette NEON: encodes and decodes NEON file format.", - "homepage": "http://ne-on.org", + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" + "array", + "array conversion", + "xml", + "xml conversion" ], - "time": "2019-02-05T21:30:40+00:00" + "time": "2019-03-29T20:06:56+00:00" }, { - "name": "nette/php-generator", - "version": "v3.2.3", + "name": "phar-io/manifest", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "aea6e81437bb238e5f0e5b5ce06337433908e63b" + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/aea6e81437bb238e5f0e5b5ce06337433908e63b", - "reference": "aea6e81437bb238e5f0e5b5ce06337433908e63b", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "๐Ÿ˜ Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.3 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2019-07-05T13:01:56+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", - "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.5", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "time": "2019-03-08T21:57:24+00:00" - }, - { - "name": "nette/schema", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", - "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", - "shasum": "" - }, - "require": { - "nette/utils": "^3.0.1", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "๐Ÿ“ Nette Schema: validating data structures against a given Schema.", - "homepage": "https://nette.org", - "keywords": [ - "config", - "nette" - ], - "time": "2019-04-03T15:53:25+00:00" - }, - { - "name": "nette/utils", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "bd961f49b211997202bda1d0fbc410905be370d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/bd961f49b211997202bda1d0fbc410905be370d4", - "reference": "bd961f49b211997202bda1d0fbc410905be370d4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "๐Ÿ›  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "time": "2019-03-22T01:00:30+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.2.3", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e612609022e935f3d0337c1295176505b41188c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", - "reference": "e612609022e935f3d0337c1295176505b41188c8", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.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-08-12T20:17:41+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", - "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0.0", - "php": "^7.1.0" - }, - "require-dev": { - "composer/composer": "^1.6.3", - "doctrine/coding-standard": "^5.0.1", - "ext-zip": "*", - "infection/infection": "^0.7.1", - "phpunit/phpunit": "^7.0.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2019-02-21T12:16:21+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" }, "type": "library", "extra": { @@ -1509,78 +1329,42 @@ }, { "name": "phpstan/phpstan", - "version": "0.11.15", + "version": "0.12.18", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d" + "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1be5b3a706db16ac472a4c40ec03cf4c810b118d", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1ce27fe29c8660a27926127d350d53d80c4d4286", + "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286", "shasum": "" }, "require": { - "composer/xdebug-handler": "^1.3.0", - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/schema": "^1.0", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^4.2.3", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3.5", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" + "php": "^7.1" }, - "conflict": { - "symfony/console": "3.4.16 || 4.1.5" - }, - "require-dev": { - "brianium/paratest": "^2.0 || ^3.0", - "consistence/coding-standard": "^3.5", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "ext-intl": "*", - "ext-mysqli": "*", - "ext-simplexml": "*", - "ext-soap": "*", - "ext-zip": "*", - "jakub-onderka/php-parallel-lint": "^1.0", - "localheinz/composer-normalize": "^1.1.0", - "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-php-parser": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.5.14 || ^8.0", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2" - }, - "bin": [ - "bin/phpstan" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.11-dev" - } + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } }, "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/", - "build/PHPStan" - ] - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2019-08-18T20:51:53+00:00" + "time": "2020-03-22T16:51:47+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1917,18 +1701,67 @@ ], "time": "2019-10-07T12:57:41+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -1937,7 +1770,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1962,7 +1795,7 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2528,8 +2361,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Collection of value objects that represent the types of the PHP type system", @@ -2672,25 +2505,28 @@ }, { "name": "symfony/console", - "version": "v4.2.4", + "version": "v4.4.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9" + "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9dc2299a016497f9ee620be94524e6c0af0280a9", - "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9", + "url": "https://api.github.com/repos/symfony/console/zipball/10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", + "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" }, "conflict": { "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { @@ -2698,11 +2534,12 @@ }, "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" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -2713,7 +2550,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2740,48 +2577,44 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:17:42+00:00" + "time": "2020-03-30T11:41:10+00:00" }, { - "name": "symfony/contracts", - "version": "v1.0.2", + "name": "symfony/debug", + "version": "v4.0.6", "source": { "type": "git", - "url": "https://github.com/symfony/contracts.git", - "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + "url": "https://github.com/symfony/debug.git", + "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", - "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "url": "https://api.github.com/repos/symfony/debug/zipball/1721e4e7effb23480966690cdcdc7d2a4152d489", + "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "psr/log": "~1.0" }, - "require-dev": { - "psr/cache": "^1.0", - "psr/container": "^1.0" + "conflict": { + "symfony/http-kernel": "<3.4" }, - "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": "" + "require-dev": { + "symfony/http-kernel": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\": "" + "Symfony\\Component\\Debug\\": "" }, "exclude-from-classmap": [ - "**/Tests/" + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2790,62 +2623,50 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A set of abstractions extracted out of the Symfony components", + "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2018-12-05T08:06:11+00:00" + "time": "2018-02-28T21:50:02+00:00" }, { - "name": "symfony/debug", - "version": "v4.0.6", + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/1721e4e7effb23480966690cdcdc7d2a4152d489", - "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", "shasum": "" }, "require": { - "php": "^7.1.3", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": "<3.4" + "php": ">=5.3.3" }, - "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2854,47 +2675,56 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "time": "2018-02-28T21:50:02+00:00" + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "symfony/finder", - "version": "v4.3.3", + "name": "symfony/polyfill-mbstring", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2903,50 +2733,57 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", - "time": "2019-06-28T13:16:30+00:00" + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2019-11-27T14:18:11+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "name": "symfony/polyfill-php73", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "suggest": { - "ext-ctype": "For best performance" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2955,57 +2792,55 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", "polyfill", - "portable" + "portable", + "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T16:25:15+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "name": "symfony/service-contracts", + "version": "v1.1.8", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1.3", + "psr/container": "^1.0" }, "suggest": { - "ext-mbstring": "For best performance" + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.1-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3021,16 +2856,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-10-14T12:27:06+00:00" }, { "name": "theseer/tokenizer", @@ -3065,13 +2901,111 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2019-06-13T22:48:21+00:00" }, + { + "name": "vimeo/psalm", + "version": "3.11.2", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d470903722cfcbc1cd04744c5491d3e6d13ec3d9", + "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.1", + "amphp/byte-stream": "^1.5", + "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.4", + "netresearch/jsonmapper": "^1.0 || ^2.0", + "nikic/php-parser": "^4.3", + "ocramius/package-versions": "^1.2", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1.3|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "webmozart/glob": "^4.1", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "amphp/amp": "^2.4.2", + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0.0", + "ext-curl": "*", + "php-coveralls/php-coveralls": "^2.2", + "phpmyadmin/sql-parser": "5.1.0", + "phpspec/prophecy": ">=1.9.0", + "phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0", + "psalm/plugin-phpunit": "^0.10", + "slevomat/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "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" + }, + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ] + }, + "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": "2020-04-13T12:47:11+00:00" + }, { "name": "webmozart/assert", "version": "1.5.0", @@ -3121,6 +3055,99 @@ "validate" ], "time": "2019-08-24T08:43:50+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": [], @@ -3132,5 +3159,9 @@ "php": "^7.2", "ext-pdo": "*" }, - "platform-dev": [] + "platform-dev": [], + "platform-overrides": { + "php": "7.2.0" + }, + "plugin-api-version": "1.1.0" } diff --git a/docs/en/reference/configuration.rst b/docs/en/reference/configuration.rst index 4fa8991ec33..5607c4b32f0 100644 --- a/docs/en/reference/configuration.rst +++ b/docs/en/reference/configuration.rst @@ -10,7 +10,6 @@ You can get a DBAL Connection through the .. code-block:: php 'mydb', @@ -19,19 +18,18 @@ You can get a DBAL Connection through the 'host' => 'localhost', 'driver' => 'pdo_mysql', ); - $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams); Or, using the simpler URL form: .. code-block:: php 'mysql://user:secret@localhost/mydb', ); - $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams); The ``DriverManager`` returns an instance of ``Doctrine\DBAL\Connection`` which is a wrapper around the diff --git a/docs/en/reference/sharding.rst b/docs/en/reference/sharding.rst index dcdd7d8f660..2b2f804da53 100644 --- a/docs/en/reference/sharding.rst +++ b/docs/en/reference/sharding.rst @@ -160,7 +160,7 @@ following code in Doctrine: use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Id\TableGenerator; - $conn = DriverManager::getConnection(/**..**); // connection 1 + $conn = DriverManager::getConnection(/**..**/); // connection 1 // creating the TableGenerator automatically opens a second connection. $tableGenerator = new TableGenerator($conn, "sequences_tbl_name"); diff --git a/lib/Doctrine/DBAL/Cache/ArrayStatement.php b/lib/Doctrine/DBAL/Cache/ArrayStatement.php index 449a220a2af..5b72e599ac3 100644 --- a/lib/Doctrine/DBAL/Cache/ArrayStatement.php +++ b/lib/Doctrine/DBAL/Cache/ArrayStatement.php @@ -46,6 +46,8 @@ public function __construct(array $data) public function closeCursor() { unset($this->data); + + return true; } /** diff --git a/lib/Doctrine/DBAL/Cache/CacheException.php b/lib/Doctrine/DBAL/Cache/CacheException.php index 636c948a616..6bb5d1b5f6b 100644 --- a/lib/Doctrine/DBAL/Cache/CacheException.php +++ b/lib/Doctrine/DBAL/Cache/CacheException.php @@ -4,6 +4,9 @@ use Doctrine\DBAL\DBALException; +/** + * @psalm-immutable + */ class CacheException extends DBALException { /** diff --git a/lib/Doctrine/DBAL/Configuration.php b/lib/Doctrine/DBAL/Configuration.php index 2cc0070d0cb..13260cd08bb 100644 --- a/lib/Doctrine/DBAL/Configuration.php +++ b/lib/Doctrine/DBAL/Configuration.php @@ -140,6 +140,8 @@ public function getSchemaAssetsFilter() : ?callable * @see getAutoCommit * * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void */ public function setAutoCommit($autoCommit) { diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index ee6c08635ce..10da0f98f4d 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -383,7 +383,7 @@ public function connect() * * @throws DBALException If an invalid platform was specified for this connection. */ - private function detectDatabasePlatform() + private function detectDatabasePlatform() : void { $version = $this->getDatabasePlatformVersion(); @@ -504,6 +504,8 @@ public function isAutoCommit() * @see isAutoCommit * * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void */ public function setAutoCommit($autoCommit) { @@ -821,7 +823,7 @@ public function quoteIdentifier($str) /** * {@inheritDoc} */ - public function quote($input, $type = null) + public function quote($input, $type = ParameterType::STRING) { $connection = $this->getWrappedConnection(); @@ -1316,7 +1318,7 @@ public function commit() /** * Commits all current nesting transactions. */ - private function commitAll() + private function commitAll() : void { while ($this->transactionNestingLevel !== 0) { if ($this->autoCommit === false && $this->transactionNestingLevel === 1) { @@ -1334,6 +1336,8 @@ private function commitAll() /** * Cancels any database changes done during the current transaction. * + * @return bool + * * @throws ConnectionException If the rollback operation failed. */ public function rollBack() @@ -1373,6 +1377,8 @@ public function rollBack() $this->isRollbackOnly = true; --$this->transactionNestingLevel; } + + return true; } /** diff --git a/lib/Doctrine/DBAL/ConnectionException.php b/lib/Doctrine/DBAL/ConnectionException.php index d3d11bc6743..47c6ed9a0d4 100644 --- a/lib/Doctrine/DBAL/ConnectionException.php +++ b/lib/Doctrine/DBAL/ConnectionException.php @@ -2,6 +2,9 @@ namespace Doctrine\DBAL; +/** + * @psalm-immutable + */ class ConnectionException extends DBALException { /** diff --git a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php index ff310d9196b..1f8ae27ba51 100644 --- a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php +++ b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php @@ -120,7 +120,9 @@ public function isConnectedToMaster() } /** - * {@inheritDoc} + * @param string|null $connectionName + * + * @return bool */ public function connect($connectionName = null) { diff --git a/lib/Doctrine/DBAL/DBALException.php b/lib/Doctrine/DBAL/DBALException.php index 4961af2f35f..b2852e55182 100644 --- a/lib/Doctrine/DBAL/DBALException.php +++ b/lib/Doctrine/DBAL/DBALException.php @@ -22,6 +22,9 @@ use function spl_object_hash; use function sprintf; +/** + * @psalm-immutable + */ class DBALException extends Exception { /** @@ -157,7 +160,7 @@ public static function driverException(Driver $driver, Throwable $driverEx) /** * @return self */ - private static function wrapException(Driver $driver, Throwable $driverEx, $msg) + private static function wrapException(Driver $driver, Throwable $driverEx, string $msg) { if ($driverEx instanceof DriverException) { return $driverEx; diff --git a/lib/Doctrine/DBAL/Driver/AbstractDriverException.php b/lib/Doctrine/DBAL/Driver/AbstractDriverException.php index d9af92d1744..f57de38f09c 100644 --- a/lib/Doctrine/DBAL/Driver/AbstractDriverException.php +++ b/lib/Doctrine/DBAL/Driver/AbstractDriverException.php @@ -6,6 +6,8 @@ /** * Abstract base implementation of the {@link DriverException} interface. + * + * @psalm-immutable */ abstract class AbstractDriverException extends Exception implements DriverException { diff --git a/lib/Doctrine/DBAL/Driver/DriverException.php b/lib/Doctrine/DBAL/Driver/DriverException.php index 79480ac72be..14cd5186e4d 100644 --- a/lib/Doctrine/DBAL/Driver/DriverException.php +++ b/lib/Doctrine/DBAL/Driver/DriverException.php @@ -9,6 +9,8 @@ * * Driver exceptions provide the SQLSTATE of the driver * and the driver specific error code at the time the error occurred. + * + * @psalm-immutable */ interface DriverException extends Throwable { diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php index cb1e6018f3e..f03fa6a20c3 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php @@ -8,6 +8,7 @@ use stdClass; use const DB2_AUTOCOMMIT_OFF; use const DB2_AUTOCOMMIT_ON; +use function assert; use function db2_autocommit; use function db2_commit; use function db2_conn_error; @@ -23,6 +24,7 @@ use function db2_server_info; use function db2_stmt_errormsg; use function func_get_args; +use function is_bool; class DB2Connection implements Connection, ServerInfoAwareConnection { @@ -140,7 +142,10 @@ public function lastInsertId($name = null) */ public function beginTransaction() { - db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + assert(is_bool($result)); + + return $result; } /** @@ -151,7 +156,11 @@ public function commit() if (! db2_commit($this->conn)) { throw new DB2Exception(db2_conn_errormsg($this->conn)); } - db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; } /** @@ -162,7 +171,11 @@ public function rollBack() if (! db2_rollback($this->conn)) { throw new DB2Exception(db2_conn_errormsg($this->conn)); } - db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; } /** diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php index b01c4552a23..662d8533a8e 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php @@ -4,6 +4,9 @@ use Exception; +/** + * @psalm-immutable + */ class DB2Exception extends Exception { } diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php index 1f1a1d218c3..68096ba80e0 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php @@ -222,7 +222,7 @@ public function errorInfo() * @throws MysqliException When one of of the options is not supported. * @throws MysqliException When applying doesn't work - e.g. due to incorrect value. */ - private function setDriverOptions(array $driverOptions = []) + private function setDriverOptions(array $driverOptions = []) : void { $supportedDriverOptions = [ MYSQLI_OPT_CONNECT_TIMEOUT, @@ -281,7 +281,7 @@ public function ping() * * @throws MysqliException */ - private function setSecureConnection(array $params) + private function setSecureConnection(array $params) : void { if (! isset($params['ssl_key']) && ! isset($params['ssl_cert']) && diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php index 1fa0c900fbd..8e8e697c4a3 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php @@ -6,6 +6,8 @@ /** * Exception thrown in case the mysqli driver errors. + * + * @psalm-immutable */ class MysqliException extends AbstractDriverException { diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 43d70853ef5..b1edcf4eed3 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -207,12 +207,14 @@ public function execute($params = null) /** * Binds parameters with known types previously bound to the statement */ - private function bindTypedParameters() + private function bindTypedParameters() : void { $streams = $values = []; $types = $this->types; foreach ($this->_bindedValues as $parameter => $value) { + assert(is_int($parameter)); + if (! isset($types[$parameter - 1])) { $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING]; } @@ -243,9 +245,11 @@ private function bindTypedParameters() /** * Handle $this->_longData after regular query parameters have been bound * + * @param array $streams + * * @throws MysqliException */ - private function sendLongData($streams) + private function sendLongData(array $streams) : void { foreach ($streams as $paramNr => $stream) { while (! feof($stream)) { diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php index af3a9d1a7a9..42283e08a57 100644 --- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php +++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php @@ -4,6 +4,9 @@ use Doctrine\DBAL\Driver\AbstractDriverException; +/** + * @psalm-immutable + */ class OCI8Exception extends AbstractDriverException { /** diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php index c974bf8fc7f..2f8b9323817 100644 --- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php +++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php @@ -276,9 +276,15 @@ public function bindValue($param, $value, $type = ParameterType::STRING) /** * {@inheritdoc} */ - public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null) + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) { - $column = $this->_paramMap[$column]; + if (is_int($param)) { + if (! isset($this->_paramMap[$param])) { + throw new OCI8Exception(sprintf('Could not find variable mapping with index %d, in the SQL statement', $param)); + } + + $param = $this->_paramMap[$param]; + } if ($type === ParameterType::LARGE_OBJECT) { $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB); @@ -291,11 +297,11 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l $variable =& $lob; } - $this->boundValues[$column] =& $variable; + $this->boundValues[$param] =& $variable; return oci_bind_by_name( $this->_sth, - $column, + $param, $variable, $length ?? -1, $this->convertParameterType($type) diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 336542ea50a..ffd80d7423c 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -53,7 +53,10 @@ public function getServerVersion() } /** - * {@inheritdoc} + * @param string $prepareString + * @param array $driverOptions + * + * @return Statement */ public function prepare($prepareString, $driverOptions = []) { diff --git a/lib/Doctrine/DBAL/Driver/PDOException.php b/lib/Doctrine/DBAL/Driver/PDOException.php index 277d7a62500..c2571032b80 100644 --- a/lib/Doctrine/DBAL/Driver/PDOException.php +++ b/lib/Doctrine/DBAL/Driver/PDOException.php @@ -4,6 +4,8 @@ /** * Tiny wrapper for PDOException instances to implement the {@link DriverException} interface. + * + * @psalm-immutable */ class PDOException extends \PDOException implements DriverException { diff --git a/lib/Doctrine/DBAL/Driver/PDOStatement.php b/lib/Doctrine/DBAL/Driver/PDOStatement.php index 5be4f2c046d..26f0f2e7819 100644 --- a/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ b/lib/Doctrine/DBAL/Driver/PDOStatement.php @@ -85,7 +85,13 @@ public function bindValue($param, $value, $type = ParameterType::STRING) } /** - * {@inheritdoc} + * @param mixed $column + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions + * + * @return bool */ public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) { @@ -195,7 +201,7 @@ private function convertParamType(int $type) : int if (! isset(self::PARAM_TYPE_MAP[$type])) { // TODO: next major: throw an exception @trigger_error(sprintf( - 'Using a PDO parameter type (%d given) is deprecated and will cause an error in Doctrine 3.0', + 'Using a PDO parameter type (%d given) is deprecated and will cause an error in Doctrine DBAL 3.0', $type ), E_USER_DEPRECATED); @@ -216,7 +222,7 @@ private function convertFetchMode(int $fetchMode) : int // TODO: next major: throw an exception @trigger_error(sprintf( 'Using a PDO fetch mode or their combination (%d given)' . - ' is deprecated and will cause an error in Doctrine 3.0', + ' is deprecated and will cause an error in Doctrine DBAL 3.0', $fetchMode ), E_USER_DEPRECATED); diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php index 0f8bc3e57e6..022cfe2dfa7 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php @@ -12,6 +12,8 @@ /** * SAP Sybase SQL Anywhere driver exception. + * + * @psalm-immutable */ class SQLAnywhereException extends AbstractDriverException { diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php index 886bb245873..ff1759aba26 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php @@ -313,6 +313,8 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null) $this->defaultFetchMode = $fetchMode; $this->defaultFetchClass = $arg2 ?: $this->defaultFetchClass; $this->defaultFetchClassCtorArgs = $arg3 ? (array) $arg3 : $this->defaultFetchClassCtorArgs; + + return true; } /** diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php b/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php index 363b260950e..94c19f6effc 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php @@ -12,6 +12,8 @@ class LastInsertId /** * @param int $id + * + * @return void */ public function setId($id) { diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php index 35ad913ff5b..71b450d98e0 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php @@ -152,6 +152,8 @@ public function beginTransaction() if (! sqlsrv_begin_transaction($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** @@ -162,6 +164,8 @@ public function commit() if (! sqlsrv_commit($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** @@ -172,6 +176,8 @@ public function rollBack() if (! sqlsrv_rollback($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php index 1c1e8c472d7..5618ed73560 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php @@ -7,6 +7,9 @@ use function rtrim; use function sqlsrv_errors; +/** + * @psalm-immutable + */ class SQLSrvException extends AbstractDriverException { /** diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php index 5e7016c5a74..1e1c0a2a7f2 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php @@ -158,6 +158,8 @@ public function bindValue($param, $value, $type = ParameterType::STRING) $this->variables[$param] = $value; $this->types[$param] = $type; + + return true; } /** @@ -174,6 +176,8 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l // unset the statement resource if it exists as the new one will need to be bound to the new variable $this->stmt = null; + + return true; } /** @@ -263,6 +267,8 @@ public function execute($params = null) } $this->result = true; + + return true; } /** diff --git a/lib/Doctrine/DBAL/DriverManager.php b/lib/Doctrine/DBAL/DriverManager.php index 6888d73b0c4..31fc8ea12f9 100644 --- a/lib/Doctrine/DBAL/DriverManager.php +++ b/lib/Doctrine/DBAL/DriverManager.php @@ -88,20 +88,7 @@ private function __construct() * * $params must contain at least one of the following. * - * Either 'driver' with one of the following values: - * - * pdo_mysql - * pdo_sqlite - * pdo_pgsql - * pdo_oci (unstable) - * pdo_sqlsrv - * pdo_sqlsrv - * mysqli - * sqlanywhere - * sqlsrv - * ibm_db2 (unstable) - * drizzle_pdo_mysql - * + * Either 'driver' with one of the array keys of {@link $_driverMap}, * OR 'driverClass' that contains the full class name (with namespace) of the * driver class to instantiate. * diff --git a/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php b/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php index 19f2b3fd335..9e374856078 100644 --- a/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php +++ b/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php @@ -49,9 +49,8 @@ public function postConnect(ConnectionEventArgs $args) return; } - array_change_key_case($this->_defaultSessionVars, CASE_UPPER); $vars = []; - foreach ($this->_defaultSessionVars as $option => $value) { + foreach (array_change_key_case($this->_defaultSessionVars, CASE_UPPER) as $option => $value) { if ($option === 'CURRENT_SCHEMA') { $vars[] = $option . ' = ' . $value; } else { diff --git a/lib/Doctrine/DBAL/Exception/ConnectionException.php b/lib/Doctrine/DBAL/Exception/ConnectionException.php index e96a29191e4..6b7c901a345 100644 --- a/lib/Doctrine/DBAL/Exception/ConnectionException.php +++ b/lib/Doctrine/DBAL/Exception/ConnectionException.php @@ -4,6 +4,8 @@ /** * Base class for all connection related errors detected in the driver. + * + * @psalm-immutable */ class ConnectionException extends DriverException { diff --git a/lib/Doctrine/DBAL/Exception/ConstraintViolationException.php b/lib/Doctrine/DBAL/Exception/ConstraintViolationException.php index 3959f39af95..435e8b19f16 100644 --- a/lib/Doctrine/DBAL/Exception/ConstraintViolationException.php +++ b/lib/Doctrine/DBAL/Exception/ConstraintViolationException.php @@ -4,6 +4,8 @@ /** * Base class for all constraint violation related errors detected in the driver. + * + * @psalm-immutable */ class ConstraintViolationException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/DatabaseObjectExistsException.php b/lib/Doctrine/DBAL/Exception/DatabaseObjectExistsException.php index 7e0ba0299e9..fb19f5baed5 100644 --- a/lib/Doctrine/DBAL/Exception/DatabaseObjectExistsException.php +++ b/lib/Doctrine/DBAL/Exception/DatabaseObjectExistsException.php @@ -8,6 +8,8 @@ * A database object is considered any asset that can be created in a database * such as schemas, tables, views, sequences, triggers, constraints, indexes, * functions, stored procedures etc. + * + * @psalm-immutable */ class DatabaseObjectExistsException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/DatabaseObjectNotFoundException.php b/lib/Doctrine/DBAL/Exception/DatabaseObjectNotFoundException.php index 3342bce8d58..2d3d78d9930 100644 --- a/lib/Doctrine/DBAL/Exception/DatabaseObjectNotFoundException.php +++ b/lib/Doctrine/DBAL/Exception/DatabaseObjectNotFoundException.php @@ -8,6 +8,8 @@ * A database object is considered any asset that can be created in a database * such as schemas, tables, views, sequences, triggers, constraints, indexes, * functions, stored procedures etc. + * + * @psalm-immutable */ class DatabaseObjectNotFoundException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/DeadlockException.php b/lib/Doctrine/DBAL/Exception/DeadlockException.php index fd0550a56b0..f36be908a4a 100644 --- a/lib/Doctrine/DBAL/Exception/DeadlockException.php +++ b/lib/Doctrine/DBAL/Exception/DeadlockException.php @@ -4,6 +4,8 @@ /** * Exception for a deadlock error of a transaction detected in the driver. + * + * @psalm-immutable */ class DeadlockException extends ServerException implements RetryableException { diff --git a/lib/Doctrine/DBAL/Exception/DriverException.php b/lib/Doctrine/DBAL/Exception/DriverException.php index d3753329882..2a3338733db 100644 --- a/lib/Doctrine/DBAL/Exception/DriverException.php +++ b/lib/Doctrine/DBAL/Exception/DriverException.php @@ -7,6 +7,8 @@ /** * Base class for all errors detected in the driver. + * + * @psalm-immutable */ class DriverException extends DBALException { diff --git a/lib/Doctrine/DBAL/Exception/ForeignKeyConstraintViolationException.php b/lib/Doctrine/DBAL/Exception/ForeignKeyConstraintViolationException.php index 48d736f9e28..f1a612b2184 100644 --- a/lib/Doctrine/DBAL/Exception/ForeignKeyConstraintViolationException.php +++ b/lib/Doctrine/DBAL/Exception/ForeignKeyConstraintViolationException.php @@ -4,6 +4,8 @@ /** * Exception for a foreign key constraint violation detected in the driver. + * + * @psalm-immutable */ class ForeignKeyConstraintViolationException extends ConstraintViolationException { diff --git a/lib/Doctrine/DBAL/Exception/InvalidArgumentException.php b/lib/Doctrine/DBAL/Exception/InvalidArgumentException.php index 5d431e6031d..5d20332af09 100644 --- a/lib/Doctrine/DBAL/Exception/InvalidArgumentException.php +++ b/lib/Doctrine/DBAL/Exception/InvalidArgumentException.php @@ -6,6 +6,8 @@ /** * Exception to be thrown when invalid arguments are passed to any DBAL API + * + * @psalm-immutable */ class InvalidArgumentException extends DBALException { diff --git a/lib/Doctrine/DBAL/Exception/InvalidFieldNameException.php b/lib/Doctrine/DBAL/Exception/InvalidFieldNameException.php index d960feaf869..234941bf64a 100644 --- a/lib/Doctrine/DBAL/Exception/InvalidFieldNameException.php +++ b/lib/Doctrine/DBAL/Exception/InvalidFieldNameException.php @@ -4,6 +4,8 @@ /** * Exception for an invalid specified field name in a statement detected in the driver. + * + * @psalm-immutable */ class InvalidFieldNameException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/LockWaitTimeoutException.php b/lib/Doctrine/DBAL/Exception/LockWaitTimeoutException.php index bfc3a498a3c..62aa10fca87 100644 --- a/lib/Doctrine/DBAL/Exception/LockWaitTimeoutException.php +++ b/lib/Doctrine/DBAL/Exception/LockWaitTimeoutException.php @@ -4,6 +4,8 @@ /** * Exception for a lock wait timeout error of a transaction detected in the driver. + * + * @psalm-immutable */ class LockWaitTimeoutException extends ServerException implements RetryableException { diff --git a/lib/Doctrine/DBAL/Exception/NonUniqueFieldNameException.php b/lib/Doctrine/DBAL/Exception/NonUniqueFieldNameException.php index fd56f89691f..9ff66273395 100644 --- a/lib/Doctrine/DBAL/Exception/NonUniqueFieldNameException.php +++ b/lib/Doctrine/DBAL/Exception/NonUniqueFieldNameException.php @@ -4,6 +4,8 @@ /** * Exception for a non-unique/ambiguous specified field name in a statement detected in the driver. + * + * @psalm-immutable */ class NonUniqueFieldNameException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/NotNullConstraintViolationException.php b/lib/Doctrine/DBAL/Exception/NotNullConstraintViolationException.php index e327bc94d4d..113b737bb22 100644 --- a/lib/Doctrine/DBAL/Exception/NotNullConstraintViolationException.php +++ b/lib/Doctrine/DBAL/Exception/NotNullConstraintViolationException.php @@ -4,6 +4,8 @@ /** * Exception for a NOT NULL constraint violation detected in the driver. + * + * @psalm-immutable */ class NotNullConstraintViolationException extends ConstraintViolationException { diff --git a/lib/Doctrine/DBAL/Exception/ReadOnlyException.php b/lib/Doctrine/DBAL/Exception/ReadOnlyException.php index a846f2501c8..621363af9b8 100644 --- a/lib/Doctrine/DBAL/Exception/ReadOnlyException.php +++ b/lib/Doctrine/DBAL/Exception/ReadOnlyException.php @@ -4,6 +4,8 @@ /** * Exception for a write operation attempt on a read-only database element detected in the driver. + * + * @psalm-immutable */ class ReadOnlyException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/ServerException.php b/lib/Doctrine/DBAL/Exception/ServerException.php index c88c3863b62..194bc9cdd34 100644 --- a/lib/Doctrine/DBAL/Exception/ServerException.php +++ b/lib/Doctrine/DBAL/Exception/ServerException.php @@ -4,6 +4,8 @@ /** * Base class for all server related errors detected in the driver. + * + * @psalm-immutable */ class ServerException extends DriverException { diff --git a/lib/Doctrine/DBAL/Exception/SyntaxErrorException.php b/lib/Doctrine/DBAL/Exception/SyntaxErrorException.php index 0b413b71971..2603ac27435 100644 --- a/lib/Doctrine/DBAL/Exception/SyntaxErrorException.php +++ b/lib/Doctrine/DBAL/Exception/SyntaxErrorException.php @@ -4,6 +4,8 @@ /** * Exception for a syntax error in a statement detected in the driver. + * + * @psalm-immutable */ class SyntaxErrorException extends ServerException { diff --git a/lib/Doctrine/DBAL/Exception/TableExistsException.php b/lib/Doctrine/DBAL/Exception/TableExistsException.php index ff0df89afac..b6575a25d00 100644 --- a/lib/Doctrine/DBAL/Exception/TableExistsException.php +++ b/lib/Doctrine/DBAL/Exception/TableExistsException.php @@ -4,6 +4,8 @@ /** * Exception for an already existing table referenced in a statement detected in the driver. + * + * @psalm-immutable */ class TableExistsException extends DatabaseObjectExistsException { diff --git a/lib/Doctrine/DBAL/Exception/TableNotFoundException.php b/lib/Doctrine/DBAL/Exception/TableNotFoundException.php index aeaa0057d49..445a38b5ab1 100644 --- a/lib/Doctrine/DBAL/Exception/TableNotFoundException.php +++ b/lib/Doctrine/DBAL/Exception/TableNotFoundException.php @@ -4,6 +4,8 @@ /** * Exception for an unknown table referenced in a statement detected in the driver. + * + * @psalm-immutable */ class TableNotFoundException extends DatabaseObjectNotFoundException { diff --git a/lib/Doctrine/DBAL/Exception/UniqueConstraintViolationException.php b/lib/Doctrine/DBAL/Exception/UniqueConstraintViolationException.php index c762ad3c78a..f38045a3d0b 100644 --- a/lib/Doctrine/DBAL/Exception/UniqueConstraintViolationException.php +++ b/lib/Doctrine/DBAL/Exception/UniqueConstraintViolationException.php @@ -4,6 +4,8 @@ /** * Exception for a unique constraint violation detected in the driver. + * + * @psalm-immutable */ class UniqueConstraintViolationException extends ConstraintViolationException { diff --git a/lib/Doctrine/DBAL/Id/TableGenerator.php b/lib/Doctrine/DBAL/Id/TableGenerator.php index cb34dcd5c4b..62ad0d35c48 100644 --- a/lib/Doctrine/DBAL/Id/TableGenerator.php +++ b/lib/Doctrine/DBAL/Id/TableGenerator.php @@ -10,6 +10,8 @@ use Throwable; use const CASE_LOWER; use function array_change_key_case; +use function assert; +use function is_int; /** * Table ID Generator for those poor languages that are missing sequences. @@ -111,6 +113,8 @@ public function nextValue($sequenceName) $value = $row['sequence_value']; $value++; + assert(is_int($value)); + if ($row['sequence_increment_by'] > 1) { $this->sequences[$sequenceName] = [ 'value' => $value, diff --git a/lib/Doctrine/DBAL/Logging/DebugStack.php b/lib/Doctrine/DBAL/Logging/DebugStack.php index e1ccaad6ba0..1895dde5381 100644 --- a/lib/Doctrine/DBAL/Logging/DebugStack.php +++ b/lib/Doctrine/DBAL/Logging/DebugStack.php @@ -12,7 +12,7 @@ class DebugStack implements SQLLogger /** * Executed SQL queries. * - * @var mixed[][] + * @var array> */ public $queries = []; diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 3d833dfaaeb..f805b3d8c52 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -156,6 +156,8 @@ public function __construct() /** * Sets the EventManager used by the Platform. + * + * @return void */ public function setEventManager(EventManager $eventManager) { @@ -391,6 +393,8 @@ abstract public function getName(); * @param string $dbType * @param string $doctrineType * + * @return void + * * @throws DBALException If the type is not found. */ public function registerDoctrineTypeMapping($dbType, $doctrineType) @@ -3291,6 +3295,8 @@ public function hasNativeJsonType() /** * @deprecated * + * @return string + * * @todo Remove in 3.0 */ public function getIdentityColumnNullInsertSQL() diff --git a/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/lib/Doctrine/DBAL/Platforms/DB2Platform.php index 25d4163b6ec..2dbf7f5df86 100644 --- a/lib/Doctrine/DBAL/Platforms/DB2Platform.php +++ b/lib/Doctrine/DBAL/Platforms/DB2Platform.php @@ -628,7 +628,7 @@ public function getAlterTableSQL(TableDiff $diff) * @param string[] $sql The sequence of table alteration statements to fill. * @param mixed[] $queryParts The sequence of column alteration clauses to fill. */ - private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) + private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) : void { $alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff); diff --git a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php index 8f6f0966323..60aef82cebe 100644 --- a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php @@ -335,7 +335,10 @@ public function getListTableColumnsSQL($table, $database = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { @@ -435,7 +438,9 @@ public function getDropIndexSQL($index, $table = null) } /** - * {@inheritDoc} + * @param string $table + * + * @return string */ protected function getDropPrimaryKeySQL($table) { diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 57c448ce93e..409f6eef86a 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -175,7 +175,10 @@ public function getListViewsSQL($database) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index 21b13a2d691..a4bf28c9670 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -37,6 +37,8 @@ class OraclePlatform extends AbstractPlatform * * @param string $identifier * + * @return void + * * @throws DBALException */ public static function assertValidIdentifier($identifier) @@ -59,7 +61,9 @@ public function getSubstringExpression($value, $position, $length = null) } /** - * {@inheritDoc} + * @param string $type + * + * @return string */ public function getNowExpression($type = 'timestamp') { diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index e570dc04ab0..6237898e2e8 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -69,6 +69,8 @@ class PostgreSqlPlatform extends AbstractPlatform * Enables use of 'true'/'false' or otherwise 1 and 0 instead. * * @param bool $flag + * + * @return void */ public function setUseBooleanTrueFalseStrings($flag) { @@ -277,7 +279,10 @@ public function getListViewsSQL($database) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { @@ -367,7 +372,7 @@ private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias [$schema, $table] = explode('.', $table); $schema = $this->quoteStringLiteral($schema); } else { - $schema = "ANY(string_to_array((select replace(replace(setting,'\"\$user\"',user),' ','') from pg_catalog.pg_settings where name = 'search_path'),','))"; + $schema = 'ANY(current_schemas(false))'; } $table = new Identifier($table); diff --git a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php index 6e3b2fcb958..21850d2ba45 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php @@ -628,15 +628,12 @@ public function getForeignKeyMatchClauseSQL($type) case self::FOREIGN_KEY_MATCH_SIMPLE: return 'SIMPLE'; - break; case self::FOREIGN_KEY_MATCH_FULL: return 'FULL'; - break; case self::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE: return 'UNIQUE SIMPLE'; - break; case self::FOREIGN_KEY_MATCH_FULL_UNIQUE: return 'UNIQUE FULL'; default: @@ -1296,13 +1293,13 @@ protected function _getTransactionIsolationLevelSQL($level) { switch ($level) { case TransactionIsolationLevel::READ_UNCOMMITTED: - return 0; + return '0'; case TransactionIsolationLevel::READ_COMMITTED: - return 1; + return '1'; case TransactionIsolationLevel::REPEATABLE_READ: - return 2; + return '2'; case TransactionIsolationLevel::SERIALIZABLE: - return 3; + return '3'; default: throw new InvalidArgumentException('Invalid isolation level:' . $level); } diff --git a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php index a37f7c9394a..6a7130bd674 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php @@ -933,7 +933,10 @@ public function getListTableColumnsSQL($table, $database = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 02d2482c86e..4eff83e8dcf 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -55,7 +55,9 @@ public function getGuidExpression() } /** - * {@inheritDoc} + * @param string $type + * + * @return string */ public function getNowExpression($type = 'timestamp') { @@ -166,11 +168,11 @@ protected function _getTransactionIsolationLevelSQL($level) { switch ($level) { case TransactionIsolationLevel::READ_UNCOMMITTED: - return 0; + return '0'; case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::SERIALIZABLE: - return 1; + return '1'; default: return parent::_getTransactionIsolationLevelSQL($level); } @@ -222,7 +224,9 @@ public function getBigIntTypeDeclarationSQL(array $field) } /** - * {@inheritDoc} + * @param array $field + * + * @return string */ public function getTinyIntTypeDeclarationSql(array $field) { @@ -248,7 +252,9 @@ public function getSmallIntTypeDeclarationSQL(array $field) } /** - * {@inheritDoc} + * @param array $field + * + * @return string */ public function getMediumIntTypeDeclarationSql(array $field) { @@ -600,7 +606,7 @@ public static function udfLocate($str, $substr, $offset = 0) /** * {@inheritDoc} */ - public function getForUpdateSql() + public function getForUpdateSQL() { return ''; } @@ -801,6 +807,8 @@ public function getCreateConstraintSQL(Constraint $constraint, $table) /** * {@inheritDoc} + * + * @param int|null $createFlags */ public function getCreateTableSQL(Table $table, $createFlags = null) { @@ -810,7 +818,10 @@ public function getCreateTableSQL(Table $table, $createFlags = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Query/QueryBuilder.php b/lib/Doctrine/DBAL/Query/QueryBuilder.php index 587e26656ab..e76ca0e0758 100644 --- a/lib/Doctrine/DBAL/Query/QueryBuilder.php +++ b/lib/Doctrine/DBAL/Query/QueryBuilder.php @@ -3,7 +3,7 @@ namespace Doctrine\DBAL\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\Statement; +use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Query\Expression\CompositeExpression; use Doctrine\DBAL\Query\Expression\ExpressionBuilder; @@ -118,9 +118,9 @@ class QueryBuilder private $firstResult = null; /** - * The maximum number of results to retrieve. + * The maximum number of results to retrieve or NULL to retrieve all results. * - * @var int + * @var int|null */ private $maxResults = null; @@ -198,7 +198,7 @@ public function getState() * Uses {@see Connection::executeQuery} for select statements and {@see Connection::executeUpdate} * for insert, update and delete statements. * - * @return Statement|int + * @return ResultStatement|int */ public function execute() { @@ -367,7 +367,6 @@ public function setFirstResult($firstResult) /** * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. * * @return int The position of the first result. */ @@ -379,7 +378,7 @@ public function getFirstResult() /** * Sets the maximum number of results to retrieve (the "limit"). * - * @param int $maxResults The maximum number of results to retrieve. + * @param int|null $maxResults The maximum number of results to retrieve or NULL to retrieve all results. * * @return $this This QueryBuilder instance. */ @@ -393,7 +392,7 @@ public function setMaxResults($maxResults) /** * Gets the maximum number of results the query object was set to retrieve (the "limit"). - * Returns NULL if {@link setMaxResults} was not applied to this query builder. + * Returns NULL if all results will be returned. * * @return int The maximum number of results. */ @@ -1175,7 +1174,7 @@ private function getFromClauses() * * @throws QueryException */ - private function verifyAllAliasesAreKnown(array $knownAliases) + private function verifyAllAliasesAreKnown(array $knownAliases) : void { foreach ($this->sqlParts['join'] as $fromAlias => $joins) { if (! isset($knownAliases[$fromAlias])) { @@ -1327,9 +1326,11 @@ private function getSQLForJoins($fromAlias, array &$knownAliases) if (array_key_exists($join['joinAlias'], $knownAliases)) { throw QueryException::nonUniqueAlias($join['joinAlias'], array_keys($knownAliases)); } - $sql .= ' ' . strtoupper($join['joinType']) - . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias'] - . ' ON ' . ((string) $join['joinCondition']); + $sql .= ' ' . strtoupper($join['joinType']) + . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']; + if ($join['joinCondition'] !== null) { + $sql .= ' ON ' . $join['joinCondition']; + } $knownAliases[$join['joinAlias']] = true; } diff --git a/lib/Doctrine/DBAL/Query/QueryException.php b/lib/Doctrine/DBAL/Query/QueryException.php index 3fcb3b480ec..604bcb7565c 100644 --- a/lib/Doctrine/DBAL/Query/QueryException.php +++ b/lib/Doctrine/DBAL/Query/QueryException.php @@ -5,6 +5,9 @@ use Doctrine\DBAL\DBALException; use function implode; +/** + * @psalm-immutable + */ class QueryException extends DBALException { /** diff --git a/lib/Doctrine/DBAL/SQLParserUtils.php b/lib/Doctrine/DBAL/SQLParserUtils.php index 9768883846e..6329a84e20d 100644 --- a/lib/Doctrine/DBAL/SQLParserUtils.php +++ b/lib/Doctrine/DBAL/SQLParserUtils.php @@ -4,7 +4,9 @@ use const PREG_OFFSET_CAPTURE; use function array_fill; +use function array_fill_keys; use function array_key_exists; +use function array_keys; use function array_merge; use function array_slice; use function array_values; @@ -31,9 +33,9 @@ class SQLParserUtils public const POSITIONAL_TOKEN = '\?'; public const NAMED_TOKEN = '(?getListTableCommentsSQL($tableName); $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['REMARKS']); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['REMARKS']); + } return $table; } diff --git a/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php b/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php index 3c6585e4600..3611b77dccd 100644 --- a/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php +++ b/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php @@ -233,7 +233,7 @@ public function getUnqualifiedForeignTableName() $position = strrpos($name, '.'); if ($position !== false) { - $name = substr($name, $position); + $name = substr($name, $position + 1); } return strtolower($name); @@ -365,7 +365,7 @@ private function onEvent($event) } } - return false; + return null; } /** diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index af5a231a4a8..a671829adbe 100644 --- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -287,6 +287,8 @@ protected function _getPortableDatabaseDefinition($database) /** * {@inheritdoc} * + * @param string|null $database + * * Calling this method without an argument or by passing NULL is deprecated. */ public function createDatabase($database = null) @@ -399,7 +401,10 @@ public function listTableDetails($tableName) : Table $sql = $platform->getListTableCommentsSQL($tableName); $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['COMMENTS']); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['COMMENTS']); + } return $table; } diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index e9608e7c193..ffc7c87d453 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -500,7 +500,9 @@ public function listTableDetails($tableName) : Table $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['table_comment']); + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['table_comment']); + } return $table; } diff --git a/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php b/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php index c169a6e0708..13cdcb0952d 100644 --- a/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php @@ -47,6 +47,8 @@ public function dropDatabase($database) * Starts a database. * * @param string $database The name of the database to start. + * + * @return void */ public function startDatabase($database) { @@ -58,6 +60,8 @@ public function startDatabase($database) * Stops a database. * * @param string $database The name of the database to stop. + * + * @return void */ public function stopDatabase($database) { diff --git a/lib/Doctrine/DBAL/Schema/SchemaException.php b/lib/Doctrine/DBAL/Schema/SchemaException.php index 213d218475b..68d778f53fd 100644 --- a/lib/Doctrine/DBAL/Schema/SchemaException.php +++ b/lib/Doctrine/DBAL/Schema/SchemaException.php @@ -6,6 +6,9 @@ use function implode; use function sprintf; +/** + * @psalm-immutable + */ class SchemaException extends DBALException { public const TABLE_DOESNT_EXIST = 10; diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index ac758015a0f..3de11178c9c 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -223,9 +223,11 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} - * * @deprecated + * + * @param array $tableIndex + * + * @return array */ protected function _getPortableTableIndexDefinition($tableIndex) { @@ -494,7 +496,7 @@ private function parseTableCommentFromSQL(string $table, string $sql) : ?string private function parseColumnCommentFromSQL(string $column, string $sql) : ?string { $pattern = '{[\s(,](?:\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) . '\W|\W' . preg_quote($column) - . '\W)(?:\(.*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i'; + . '\W)(?:\([^)]*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i'; if (preg_match($pattern, $sql, $match) !== 1) { return null; diff --git a/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php b/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php index b597b8db9b2..9b1974747e7 100644 --- a/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php +++ b/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php @@ -20,6 +20,8 @@ public function __construct(Connection $conn) /** * @param string[] $sql + * + * @return void */ protected function processSqlSafely(array $sql) { @@ -33,6 +35,8 @@ protected function processSqlSafely(array $sql) /** * @param string[] $sql + * + * @return void */ protected function processSql(array $sql) { diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php index 8e613320f79..842d1fccf67 100644 --- a/lib/Doctrine/DBAL/Schema/Table.php +++ b/lib/Doctrine/DBAL/Schema/Table.php @@ -300,6 +300,8 @@ public function addColumn($columnName, $typeName, array $options = []) * @param string $oldColumnName * @param string $newColumnName * + * @return void + * * @throws DBALException */ public function renameColumn($oldColumnName, $newColumnName) diff --git a/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php b/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php index 186fe1b4213..b0548d6064a 100644 --- a/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php +++ b/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php @@ -11,6 +11,8 @@ interface NamespaceVisitor * Accepts a schema namespace name. * * @param string $namespaceName The schema namespace name to accept. + * + * @return void */ public function acceptNamespace($namespaceName); } diff --git a/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php b/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php index 5ec843d9be6..040b59f5549 100644 --- a/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php +++ b/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php @@ -14,26 +14,37 @@ interface SchemaDiffVisitor { /** * Visit an orphaned foreign key whose table was deleted. + * + * @return void */ public function visitOrphanedForeignKey(ForeignKeyConstraint $foreignKey); /** * Visit a sequence that has changed. + * + * @return void */ public function visitChangedSequence(Sequence $sequence); /** * Visit a sequence that has been removed. + * + * @return void */ public function visitRemovedSequence(Sequence $sequence); + /** @return void */ public function visitNewSequence(Sequence $sequence); + /** @return void */ public function visitNewTable(Table $table); + /** @return void */ public function visitNewTableForeignKey(Table $table, ForeignKeyConstraint $foreignKey); + /** @return void */ public function visitRemovedTable(Table $table); + /** @return void */ public function visitChangedTable(TableDiff $tableDiff); } diff --git a/lib/Doctrine/DBAL/Sharding/ShardingException.php b/lib/Doctrine/DBAL/Sharding/ShardingException.php index b46bda2ff0d..4d9f41a30e3 100644 --- a/lib/Doctrine/DBAL/Sharding/ShardingException.php +++ b/lib/Doctrine/DBAL/Sharding/ShardingException.php @@ -6,6 +6,8 @@ /** * Sharding related Exceptions + * + * @psalm-immutable */ class ShardingException extends DBALException { diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index 09913bb56ae..13140a6a600 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -249,11 +249,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { - if ($fetchArgument) { - return $this->stmt->fetchAll($fetchMode, $fetchArgument); - } - - return $this->stmt->fetchAll($fetchMode); + return $this->stmt->fetchAll($fetchMode, $fetchArgument, $ctorArgs); } /** diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php index 0cd2999c97a..c142accfd77 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php @@ -28,9 +28,7 @@ */ class ImportCommand extends Command { - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php index 2e0c48a815b..6de3345b128 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php @@ -66,9 +66,7 @@ public function setKeywordListClass($name, $class) $this->keywordListClasses[$name] = $class; } - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php index b479baec2ee..5111a6505db 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php @@ -21,9 +21,7 @@ */ class RunSqlCommand extends Command { - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php b/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php index 520a9af80aa..e028c807c01 100644 --- a/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php +++ b/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php @@ -63,6 +63,8 @@ public static function addCommands(Application $cli) /** * Prints the instructions to create a configuration file + * + * @return void */ public static function printCliConfigTemplate() { diff --git a/lib/Doctrine/DBAL/Tools/Dumper.php b/lib/Doctrine/DBAL/Tools/Dumper.php index 3668efbe4d1..8cb8f4b8689 100644 --- a/lib/Doctrine/DBAL/Tools/Dumper.php +++ b/lib/Doctrine/DBAL/Tools/Dumper.php @@ -17,7 +17,6 @@ use function extension_loaded; use function get_class; use function html_entity_decode; -use function ini_get; use function ini_set; use function is_array; use function is_object; @@ -55,14 +54,11 @@ private function __construct() */ public static function dump($var, int $maxDepth = 2) : string { - $html = ini_get('html_errors'); - - if ($html !== true) { - ini_set('html_errors', true); - } + $html = ini_set('html_errors', '1'); + assert(is_string($html)); if (extension_loaded('xdebug')) { - ini_set('xdebug.var_display_max_depth', $maxDepth); + ini_set('xdebug.var_display_max_depth', (string) $maxDepth); } $var = self::export($var, $maxDepth); diff --git a/lib/Doctrine/DBAL/Types/ConversionException.php b/lib/Doctrine/DBAL/Types/ConversionException.php index b9f8a82e7ec..ba8c2a9192e 100644 --- a/lib/Doctrine/DBAL/Types/ConversionException.php +++ b/lib/Doctrine/DBAL/Types/ConversionException.php @@ -15,6 +15,8 @@ /** * Conversion Exception is thrown when the database to PHP conversion fails. + * + * @psalm-immutable */ class ConversionException extends DBALException { @@ -26,11 +28,11 @@ class ConversionException extends DBALException * * @return \Doctrine\DBAL\Types\ConversionException */ - public static function conversionFailed($value, $toType) + public static function conversionFailed($value, $toType, ?Throwable $previous = null) { $value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value; - return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType); + return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType, 0, $previous); } /** @@ -64,8 +66,12 @@ public static function conversionFailedFormat($value, $toType, $expectedFormat, * * @return \Doctrine\DBAL\Types\ConversionException */ - public static function conversionFailedInvalidType($value, $toType, array $possibleTypes) - { + public static function conversionFailedInvalidType( + $value, + $toType, + array $possibleTypes, + ?Throwable $previous = null + ) { $actualType = is_object($value) ? get_class($value) : gettype($value); if (is_scalar($value)) { @@ -75,7 +81,7 @@ public static function conversionFailedInvalidType($value, $toType, array $possi $actualType, $toType, implode(', ', $possibleTypes) - )); + ), 0, $previous); } return new self(sprintf( @@ -83,9 +89,16 @@ public static function conversionFailedInvalidType($value, $toType, array $possi $actualType, $toType, implode(', ', $possibleTypes) - )); + ), 0, $previous); } + /** + * @param mixed $value + * @param string $format + * @param string $error + * + * @return ConversionException + */ public static function conversionFailedSerialization($value, $format, $error) { $actualType = is_object($value) ? get_class($value) : gettype($value); diff --git a/lib/Doctrine/DBAL/Types/Type.php b/lib/Doctrine/DBAL/Types/Type.php index ac7ab7bec13..d39ac2bd300 100644 --- a/lib/Doctrine/DBAL/Types/Type.php +++ b/lib/Doctrine/DBAL/Types/Type.php @@ -18,79 +18,79 @@ */ abstract class Type { - /** @deprecated Use {@see DefaultTypes::BIGINT} instead. */ + /** @deprecated Use {@see Types::BIGINT} instead. */ public const BIGINT = Types::BIGINT; - /** @deprecated Use {@see DefaultTypes::BINARY} instead. */ + /** @deprecated Use {@see Types::BINARY} instead. */ public const BINARY = Types::BINARY; - /** @deprecated Use {@see DefaultTypes::BLOB} instead. */ + /** @deprecated Use {@see Types::BLOB} instead. */ public const BLOB = Types::BLOB; - /** @deprecated Use {@see DefaultTypes::BOOLEAN} instead. */ + /** @deprecated Use {@see Types::BOOLEAN} instead. */ public const BOOLEAN = Types::BOOLEAN; - /** @deprecated Use {@see DefaultTypes::DATE_MUTABLE} instead. */ + /** @deprecated Use {@see Types::DATE_MUTABLE} instead. */ public const DATE = Types::DATE_MUTABLE; - /** @deprecated Use {@see DefaultTypes::DATE_IMMUTABLE} instead. */ + /** @deprecated Use {@see Types::DATE_IMMUTABLE} instead. */ public const DATE_IMMUTABLE = Types::DATE_IMMUTABLE; - /** @deprecated Use {@see DefaultTypes::DATEINTERVAL} instead. */ + /** @deprecated Use {@see Types::DATEINTERVAL} instead. */ public const DATEINTERVAL = Types::DATEINTERVAL; - /** @deprecated Use {@see DefaultTypes::DATETIME_MUTABLE} instead. */ + /** @deprecated Use {@see Types::DATETIME_MUTABLE} instead. */ public const DATETIME = Types::DATETIME_MUTABLE; - /** @deprecated Use {@see DefaultTypes::DATETIME_IMMUTABLE} instead. */ + /** @deprecated Use {@see Types::DATETIME_IMMUTABLE} instead. */ public const DATETIME_IMMUTABLE = Types::DATETIME_IMMUTABLE; - /** @deprecated Use {@see DefaultTypes::DATETIMETZ_MUTABLE} instead. */ + /** @deprecated Use {@see Types::DATETIMETZ_MUTABLE} instead. */ public const DATETIMETZ = Types::DATETIMETZ_MUTABLE; - /** @deprecated Use {@see DefaultTypes::DATETIMETZ_IMMUTABLE} instead. */ + /** @deprecated Use {@see Types::DATETIMETZ_IMMUTABLE} instead. */ public const DATETIMETZ_IMMUTABLE = Types::DATETIMETZ_IMMUTABLE; - /** @deprecated Use {@see DefaultTypes::DECIMAL} instead. */ + /** @deprecated Use {@see Types::DECIMAL} instead. */ public const DECIMAL = Types::DECIMAL; - /** @deprecated Use {@see DefaultTypes::FLOAT} instead. */ + /** @deprecated Use {@see Types::FLOAT} instead. */ public const FLOAT = Types::FLOAT; - /** @deprecated Use {@see DefaultTypes::GUID} instead. */ + /** @deprecated Use {@see Types::GUID} instead. */ public const GUID = Types::GUID; - /** @deprecated Use {@see DefaultTypes::INTEGER} instead. */ + /** @deprecated Use {@see Types::INTEGER} instead. */ public const INTEGER = Types::INTEGER; - /** @deprecated Use {@see DefaultTypes::JSON} instead. */ + /** @deprecated Use {@see Types::JSON} instead. */ public const JSON = Types::JSON; - /** @deprecated Use {@see DefaultTypes::JSON_ARRAY} instead. */ + /** @deprecated Use {@see Types::JSON_ARRAY} instead. */ public const JSON_ARRAY = Types::JSON_ARRAY; - /** @deprecated Use {@see DefaultTypes::OBJECT} instead. */ + /** @deprecated Use {@see Types::OBJECT} instead. */ public const OBJECT = Types::OBJECT; - /** @deprecated Use {@see DefaultTypes::SIMPLE_ARRAY} instead. */ + /** @deprecated Use {@see Types::SIMPLE_ARRAY} instead. */ public const SIMPLE_ARRAY = Types::SIMPLE_ARRAY; - /** @deprecated Use {@see DefaultTypes::SMALLINT} instead. */ + /** @deprecated Use {@see Types::SMALLINT} instead. */ public const SMALLINT = Types::SMALLINT; - /** @deprecated Use {@see DefaultTypes::STRING} instead. */ + /** @deprecated Use {@see Types::STRING} instead. */ public const STRING = Types::STRING; - /** @deprecated Use {@see DefaultTypes::ARRAY} instead. */ + /** @deprecated Use {@see Types::ARRAY} instead. */ public const TARRAY = Types::ARRAY; - /** @deprecated Use {@see DefaultTypes::TEXT} instead. */ + /** @deprecated Use {@see Types::TEXT} instead. */ public const TEXT = Types::TEXT; - /** @deprecated Use {@see DefaultTypes::TIME_MUTABLE} instead. */ + /** @deprecated Use {@see Types::TIME_MUTABLE} instead. */ public const TIME = Types::TIME_MUTABLE; - /** @deprecated Use {@see DefaultTypes::TIME_IMMUTABLE} instead. */ + /** @deprecated Use {@see Types::TIME_IMMUTABLE} instead. */ public const TIME_IMMUTABLE = Types::TIME_IMMUTABLE; /** diff --git a/lib/Doctrine/DBAL/Types/Types.php b/lib/Doctrine/DBAL/Types/Types.php index f8d0cf913c3..2ffd1061f62 100644 --- a/lib/Doctrine/DBAL/Types/Types.php +++ b/lib/Doctrine/DBAL/Types/Types.php @@ -34,7 +34,7 @@ final class Types public const TIME_MUTABLE = 'time'; public const TIME_IMMUTABLE = 'time_immutable'; - /** @deprecated json_array type is deprecated, use {@see DefaultTypes::JSON} instead. */ + /** @deprecated json_array type is deprecated, use {@see self::JSON} instead. */ public const JSON_ARRAY = 'json_array'; private function __construct() diff --git a/lib/Doctrine/DBAL/Version.php b/lib/Doctrine/DBAL/Version.php index 2b1c0f23b79..93fd502741a 100644 --- a/lib/Doctrine/DBAL/Version.php +++ b/lib/Doctrine/DBAL/Version.php @@ -14,7 +14,7 @@ class Version /** * Current Doctrine Version. */ - public const VERSION = '2.10.0'; + public const VERSION = '2.10.2'; /** * Compares a Doctrine version with the current one. diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4ae1fda3f8a..85bc4ce351c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,6 +5,8 @@ parameters: autoload_files: - %currentWorkingDirectory%/tests/phpstan-polyfill.php reportUnmatchedIgnoredErrors: false + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false ignoreErrors: # extension not available - '~^(Used )?(Function|Constant) sasql_\S+ not found\.\z~i' @@ -19,12 +21,10 @@ parameters: - "~^Casting to bool something that's already bool.~" - "~^Casting to int something that's already int.~" - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\DB2Connection::exec\(\) should return int but returns bool\.\z~' - - '~^Method Doctrine\\DBAL\\Query\\QueryBuilder::execute\(\) should return Doctrine\\DBAL\\Driver\\Statement\|int but returns Doctrine\\DBAL\\Driver\\ResultStatement\.\z~' - '~^Property Doctrine\\DBAL\\Schema\\Table::\$_primaryKeyName \(string\) does not accept (default value of type )?false\.\z~' - '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\ForeignKeyConstraint::onEvent\(\) should return string\|null but returns false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\(Oracle|PostgreSql|SQLServer)SchemaManager::_getPortableTableDefinition\(\) should return array but returns string\.\z~' - - '~^Method Doctrine\\DBAL\\Platforms\\(|SQLAnywhere|Sqlite)Platform::_getTransactionIsolationLevelSQL\(\) should return string but returns int\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection::lastInsertId\(\) should return string but returns (int|false)\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\SQLSrv\\SQLSrvConnection::errorCode\(\) should return string\|null but returns false\.\z~' @@ -32,11 +32,11 @@ parameters: - '~^Call to an undefined method Doctrine\\DBAL\\Driver\\PDOConnection::sqliteCreateFunction\(\)\.\z~' # https://github.com/phpstan/phpstan/issues/1847 - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::unknownAlias\(\) expects array, array given\.\z~' - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' + - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::unknownAlias\(\) expects array, array given\.\z~' + - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' # PHPStan is too strict about preg_replace(): https://phpstan.org/r/993dc99f-0d43-4b51-868b-d01f982c1463 - - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string|null\.\z~' + - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string\|null\.\z~' # legacy variadic-like signature - '~^Method Doctrine\\DBAL(\\.*)?Connection::query\(\) invoked with \d+ parameters?, 0 required\.\z~' @@ -56,3 +56,19 @@ parameters: # weird class name, represented in stubs as OCI_(Lob|Collection) - '~unknown class OCI-(Lob|Collection)~' + + # https://github.com/JetBrains/phpstorm-stubs/pull/766 + - '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement::_fetch\(\) never returns null so it can be removed from the return typehint\.$~' + + # The ReflectionException in the case when the class does not exist is acceptable and does not need to be handled + - '~^Parameter #1 \$argument of class ReflectionClass constructor expects class-string\|T of object, string given\.$~' + + # https://github.com/phpstan/phpstan/issues/3132 + - + message: '~^Call to function in_array\(\) with arguments Doctrine\\DBAL\\Schema\\Column, array and true will always evaluate to false\.$~' + path: %currentWorkingDirectory%/lib/Doctrine/DBAL/Schema/Table.php + + # https://github.com/phpstan/phpstan/issues/3133 + - + message: '~^Cannot cast array\|bool\|string\|null to int\.$~' + path: %currentWorkingDirectory%/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 00000000000..3db108eb2ac --- /dev/null +++ b/psalm.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Doctrine/Tests/DBAL/Connection/LoggingTest.php b/tests/Doctrine/Tests/DBAL/Connection/LoggingTest.php new file mode 100644 index 00000000000..a7b04f94994 --- /dev/null +++ b/tests/Doctrine/Tests/DBAL/Connection/LoggingTest.php @@ -0,0 +1,65 @@ +createStub(DriverConnection::class); + $driverConnection->method('query') + ->willReturn($this->createStub(Statement::class)); + + $this->createConnection($driverConnection, 'SELECT * FROM table') + ->executeQuery('SELECT * FROM table'); + } + + public function testLogExecuteUpdate() : void + { + $this->createConnection( + $this->createStub(DriverConnection::class), + 'UPDATE table SET foo = ?' + ) + ->executeUpdate('UPDATE table SET foo = ?'); + } + + public function testLogPrepareExecute() : void + { + $driverConnection = $this->createStub(DriverConnection::class); + $driverConnection->method('prepare') + ->willReturn($this->createStub(Statement::class)); + + $this->createConnection($driverConnection, 'UPDATE table SET foo = ?') + ->prepare('UPDATE table SET foo = ?') + ->execute(); + } + + private function createConnection(DriverConnection $driverConnection, string $expectedSQL) : Connection + { + $driver = $this->createStub(Driver::class); + $driver->method('connect') + ->willReturn($driverConnection); + $driver->method('getDatabasePlatform') + ->willReturn($this->createMock(AbstractPlatform::class)); + + $logger = $this->createMock(SQLLogger::class); + $logger->expects($this->once()) + ->method('startQuery') + ->with($this->equalTo($expectedSQL), $this->equalTo([])); + $logger->expects($this->at(1)) + ->method('stopQuery'); + + $connection = new Connection([], $driver); + $connection->getConfiguration()->setSQLLogger($logger); + + return $connection; + } +} diff --git a/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php index f9b067ad4a4..655b5897c72 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php @@ -15,7 +15,9 @@ use PDO; use RuntimeException; use Throwable; +use function file_exists; use function in_array; +use function unlink; class ConnectionTest extends DbalFunctionalTestCase { @@ -27,6 +29,10 @@ protected function setUp() : void protected function tearDown() : void { + if (file_exists('/tmp/test_nesting.sqlite')) { + unlink('/tmp/test_nesting.sqlite'); + } + parent::tearDown(); $this->resetSharedConn(); } diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php index 8ecbed68082..70f829e7b71 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php @@ -37,17 +37,41 @@ public function testQueryConversion(string $query, array $params, array $expecte ); } + /** + * Low-level approach to working with parameter binding + * + * @param mixed[] $params + * @param mixed[] $expected + * + * @dataProvider queryConversionProvider + */ + public function testStatementBindParameters(string $query, array $params, array $expected) : void + { + $stmt = $this->connection->prepare($query); + $stmt->execute($params); + + self::assertEquals( + $expected, + $stmt->fetch() + ); + } + /** * @return array> */ public static function queryConversionProvider() : iterable { return [ - 'simple' => [ + 'positional' => [ 'SELECT ? COL1 FROM DUAL', [1], ['COL1' => 1], ], + 'named' => [ + 'SELECT :COL COL1 FROM DUAL', + [':COL' => 1], + ['COL1' => 1], + ], 'literal-with-placeholder' => [ "SELECT '?' COL1, ? COL2 FROM DUAL", [2], diff --git a/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php b/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php deleted file mode 100644 index aa63af708df..00000000000 --- a/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php +++ /dev/null @@ -1,55 +0,0 @@ -connection->getDatabasePlatform()->getDummySelectSQL(); - - $logMock = $this->createMock(SQLLogger::class); - $logMock->expects($this->at(0)) - ->method('startQuery') - ->with($this->equalTo($sql), $this->equalTo([]), $this->equalTo([])); - $logMock->expects($this->at(1)) - ->method('stopQuery'); - $this->connection->getConfiguration()->setSQLLogger($logMock); - $this->connection->executeQuery($sql, []); - } - - public function testLogExecuteUpdate() : void - { - $this->markTestSkipped('Test breaks MySQL but works on all other platforms (Unbuffered Queries stuff).'); - - $sql = $this->connection->getDatabasePlatform()->getDummySelectSQL(); - - $logMock = $this->createMock(SQLLogger::class); - $logMock->expects($this->at(0)) - ->method('startQuery') - ->with($this->equalTo($sql), $this->equalTo([]), $this->equalTo([])); - $logMock->expects($this->at(1)) - ->method('stopQuery'); - $this->connection->getConfiguration()->setSQLLogger($logMock); - $this->connection->executeUpdate($sql, []); - } - - public function testLogPrepareExecute() : void - { - $sql = $this->connection->getDatabasePlatform()->getDummySelectSQL(); - - $logMock = $this->createMock(SQLLogger::class); - $logMock->expects($this->once()) - ->method('startQuery') - ->with($this->equalTo($sql), $this->equalTo([])); - $logMock->expects($this->at(1)) - ->method('stopQuery'); - $this->connection->getConfiguration()->setSQLLogger($logMock); - - $stmt = $this->connection->prepare($sql); - $stmt->execute(); - } -} diff --git a/tests/Doctrine/Tests/DBAL/Functional/PDOStatementTest.php b/tests/Doctrine/Tests/DBAL/Functional/PDOStatementTest.php index 42b8104a9e7..2ea5fa49284 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/PDOStatementTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/PDOStatementTest.php @@ -30,7 +30,7 @@ protected function setUp() : void /** * @group legacy - * @expectedDeprecation Using a PDO fetch mode or their combination (%d given) is deprecated and will cause an error in Doctrine 3.0 + * @expectedDeprecation Using a PDO fetch mode or their combination (%d given) is deprecated and will cause an error in Doctrine DBAL 3.0 */ public function testPDOSpecificModeIsAccepted() : void { diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php index 35326968798..b8a26af3c65 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php @@ -335,6 +335,18 @@ public function testListQuotedTable() : void self::assertFalse($comparator->diffTable($offlineTable, $onlineTable)); } + public function testListTableDetailsWhenCurrentSchemaNameQuoted() : void + { + $this->connection->exec('CREATE SCHEMA "001_test"'); + $this->connection->exec('SET search_path TO "001_test"'); + + try { + $this->testListQuotedTable(); + } finally { + $this->connection->close(); + } + } + public function testListTablesExcludesViews() : void { $this->createTestTable('list_tables_excludes_views'); diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php index cce8f92f72d..166b0d08d5b 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php @@ -278,4 +278,19 @@ public function testPrimaryKeyNoAutoIncrement() : void // with an empty table, non autoincrement rowid is always 1 $this->assertEquals(1, $lastUsedIdAfterDelete); } + + public function testOnlyOwnCommentIsParsed() : void + { + $table = new Table('own_column_comment'); + $table->addColumn('col1', 'string', ['length' => 16]); + $table->addColumn('col2', 'string', ['length' => 16, 'comment' => 'Column #2']); + $table->addColumn('col3', 'string', ['length' => 16]); + + $sm = $this->connection->getSchemaManager(); + $sm->createTable($table); + + $this->assertNull($sm->listTableDetails('own_column_comment') + ->getColumn('col1') + ->getComment()); + } } diff --git a/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php b/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php index bbae08c5b2c..9bd0ae62f85 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php @@ -3,6 +3,7 @@ namespace Doctrine\Tests\DBAL\Platforms; use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\Index; diff --git a/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php b/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php index a210ef2fe73..a16a516579b 100644 --- a/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php +++ b/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php @@ -92,11 +92,22 @@ public function testSelectWithJoin() : void $qb->select('u.*', 'p.*') ->from('users', 'u') - ->Join('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); + ->join('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); self::assertEquals('SELECT u.*, p.* FROM users u INNER JOIN phones p ON p.user_id = u.id', (string) $qb); } + public function testSelectWithJoinNoCondition() : void + { + $qb = new QueryBuilder($this->conn); + + $qb->select('u.*', 'p.*') + ->from('users', 'u') + ->join('u', 'phones', 'p'); + + self::assertEquals('SELECT u.*, p.* FROM users u INNER JOIN phones p', (string) $qb); + } + public function testSelectWithInnerJoin() : void { $qb = new QueryBuilder($this->conn); @@ -569,13 +580,27 @@ public function testGetState() : void self::assertEquals($sql1, $qb->getSQL()); } - public function testSetMaxResults() : void + /** + * @dataProvider maxResultsProvider + */ + public function testSetMaxResults(?int $maxResults) : void { $qb = new QueryBuilder($this->conn); - $qb->setMaxResults(10); + $qb->setMaxResults($maxResults); self::assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState()); - self::assertEquals(10, $qb->getMaxResults()); + self::assertEquals($maxResults, $qb->getMaxResults()); + } + + /** + * @return mixed[][] + */ + public static function maxResultsProvider() : iterable + { + return [ + 'non-null' => [10], + 'null' => [null], + ]; } public function testSetFirstResult() : void diff --git a/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php b/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php index ea8d4dc0752..a582a272dd1 100644 --- a/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php +++ b/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php @@ -89,7 +89,7 @@ public static function dataGetPlaceholderPositions() : iterable ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE "\\\\") AND (data.description LIKE :condition_1 ESCAPE \'\\\\\') ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE `\\\\`) AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE \'\\\\\') AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], - + ["SELECT * FROM Foo WHERE (foo.bar LIKE :condition_0 ESCAPE '\') AND (foo.baz = :condition_1) AND (foo.bak LIKE :condition_2 ESCAPE '\')", false, [38 => 'condition_0', 78 => 'condition_1', 110 => 'condition_2']], ]; } @@ -110,8 +110,7 @@ public function testGetPlaceholderPositions(string $query, bool $isPositional, a public static function dataExpandListParameters() : iterable { return [ - // Positional: Very simple with one needle - [ + 'Positional: Very simple with one needle' => [ 'SELECT * FROM Foo WHERE foo IN (?)', [[1, 2, 3]], [Connection::PARAM_INT_ARRAY], @@ -119,8 +118,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 3], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Positional: One non-list before d one after list-needle - [ + 'Positional: One non-list before d one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?)', ['string', [1, 2, 3]], [ParameterType::STRING, Connection::PARAM_INT_ARRAY], @@ -128,8 +126,7 @@ public static function dataExpandListParameters() : iterable ['string', 1, 2, 3], [ParameterType::STRING, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Positional: One non-list after list-needle - [ + 'Positional: One non-list after list-needle' => [ 'SELECT * FROM Foo WHERE bar IN (?) AND baz = ?', [[1, 2, 3], 'foo'], [Connection::PARAM_INT_ARRAY, ParameterType::STRING], @@ -137,8 +134,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 3, 'foo'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // Positional: One non-list before and one after list-needle - [ + 'Positional: One non-list before and one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?) AND baz = ?', [1, [1, 2, 3], 4], [ParameterType::INTEGER, Connection::PARAM_INT_ARRAY, ParameterType::INTEGER], @@ -152,8 +148,7 @@ public static function dataExpandListParameters() : iterable ParameterType::INTEGER, ], ], - // Positional: Two lists - [ + 'Positional: Two lists' => [ 'SELECT * FROM Foo WHERE foo IN (?, ?)', [[1, 2, 3], [4, 5]], [Connection::PARAM_INT_ARRAY, Connection::PARAM_INT_ARRAY], @@ -167,8 +162,7 @@ public static function dataExpandListParameters() : iterable ParameterType::INTEGER, ], ], - // Positional: Empty "integer" array DDC-1978 - [ + 'Positional: Empty "integer" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (?)', [[]], [Connection::PARAM_INT_ARRAY], @@ -176,8 +170,7 @@ public static function dataExpandListParameters() : iterable [], [], ], - // Positional: Empty "str" array DDC-1978 - [ + 'Positional: Empty "str" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (?)', [[]], [Connection::PARAM_STR_ARRAY], @@ -185,17 +178,15 @@ public static function dataExpandListParameters() : iterable [], [], ], - // Positional: explicit keys for params and types - [ + 'Positional: explicit keys for params and types' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar = ? AND baz = ?', [1 => 'bar', 2 => 'baz', 0 => 1], [2 => ParameterType::STRING, 1 => ParameterType::STRING], 'SELECT * FROM Foo WHERE foo = ? AND bar = ? AND baz = ?', [1 => 'bar', 0 => 1, 2 => 'baz'], - [1 => ParameterType::STRING, 2 => ParameterType::STRING], + [1 => ParameterType::STRING, 2 => ParameterType::STRING, 0 => null], ], - // Positional: explicit keys for array params and array types - [ + 'Positional: explicit keys for array params and array types' => [ 'SELECT * FROM Foo WHERE foo IN (?) AND bar IN (?) AND baz = ?', [1 => ['bar1', 'bar2'], 2 => true, 0 => [1, 2, 3]], [2 => ParameterType::BOOLEAN, 1 => Connection::PARAM_STR_ARRAY, 0 => Connection::PARAM_INT_ARRAY], @@ -210,8 +201,7 @@ public static function dataExpandListParameters() : iterable ParameterType::BOOLEAN, ], ], - // Positional starts from 1: One non-list before and one after list-needle - [ + 'Positional starts from 1: One non-list before and one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?) AND baz = ? AND foo IN (?)', [1 => 1, 2 => [1, 2, 3], 3 => 4, 4 => [5, 6]], [ @@ -232,8 +222,7 @@ public static function dataExpandListParameters() : iterable ParameterType::INTEGER, ], ], - // Named parameters : Very simple with param int - [ + 'Named: Very simple with param int' => [ 'SELECT * FROM Foo WHERE foo = :foo', ['foo' => 1], ['foo' => ParameterType::INTEGER], @@ -241,9 +230,7 @@ public static function dataExpandListParameters() : iterable [1], [ParameterType::INTEGER], ], - - // Named parameters : Very simple with param int and string - [ + 'Named: Very simple with param int and string' => [ 'SELECT * FROM Foo WHERE foo = :foo AND bar = :bar', ['bar' => 'Some String','foo' => 1], ['foo' => ParameterType::INTEGER, 'bar' => ParameterType::STRING], @@ -251,8 +238,7 @@ public static function dataExpandListParameters() : iterable [1,'Some String'], [ParameterType::INTEGER, ParameterType::STRING], ], - // Named parameters : Very simple with one needle - [ + 'Named: Very simple with one needle' => [ 'SELECT * FROM Foo WHERE foo IN (:foo)', ['foo' => [1, 2, 3]], ['foo' => Connection::PARAM_INT_ARRAY], @@ -260,8 +246,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 3], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Named parameters: One non-list before d one after list-needle - [ + 'Named: One non-list before d one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = :foo AND bar IN (:bar)', ['foo' => 'string', 'bar' => [1, 2, 3]], ['foo' => ParameterType::STRING, 'bar' => Connection::PARAM_INT_ARRAY], @@ -269,8 +254,7 @@ public static function dataExpandListParameters() : iterable ['string', 1, 2, 3], [ParameterType::STRING, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Named parameters: One non-list after list-needle - [ + 'Named: One non-list after list-needle' => [ 'SELECT * FROM Foo WHERE bar IN (:bar) AND baz = :baz', ['bar' => [1, 2, 3], 'baz' => 'foo'], ['bar' => Connection::PARAM_INT_ARRAY, 'baz' => ParameterType::STRING], @@ -278,26 +262,39 @@ public static function dataExpandListParameters() : iterable [1, 2, 3, 'foo'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // Named parameters: One non-list before and one after list-needle - [ + 'Named: One non-list before and one after list-needle' => [ 'SELECT * FROM Foo WHERE foo = :foo AND bar IN (:bar) AND baz = :baz', ['bar' => [1, 2, 3],'foo' => 1, 'baz' => 4], - ['bar' => Connection::PARAM_INT_ARRAY, 'foo' => ParameterType::INTEGER, 'baz' => ParameterType::INTEGER], + [ + 'bar' => Connection::PARAM_INT_ARRAY, + 'foo' => ParameterType::INTEGER, + 'baz' => ParameterType::INTEGER, + ], 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?, ?, ?) AND baz = ?', [1, 1, 2, 3, 4], - [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], + [ + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ], ], - // Named parameters: Two lists - [ + 'Named: Two lists' => [ 'SELECT * FROM Foo WHERE foo IN (:a, :b)', ['b' => [4, 5],'a' => [1, 2, 3]], ['a' => Connection::PARAM_INT_ARRAY, 'b' => Connection::PARAM_INT_ARRAY], 'SELECT * FROM Foo WHERE foo IN (?, ?, ?, ?, ?)', [1, 2, 3, 4, 5], - [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], + [ + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ], ], - // Named parameters : With the same name arg type string - [ + 'Named: With the same name arg type string' => [ 'SELECT * FROM Foo WHERE foo <> :arg AND bar = :arg', ['arg' => 'Some String'], ['arg' => ParameterType::STRING], @@ -305,18 +302,22 @@ public static function dataExpandListParameters() : iterable ['Some String','Some String'], [ParameterType::STRING,ParameterType::STRING], ], - // Named parameters : With the same name arg - [ + 'Named: With the same name arg' => [ 'SELECT * FROM Foo WHERE foo IN (:arg) AND NOT bar IN (:arg)', ['arg' => [1, 2, 3]], ['arg' => Connection::PARAM_INT_ARRAY], 'SELECT * FROM Foo WHERE foo IN (?, ?, ?) AND NOT bar IN (?, ?, ?)', [1, 2, 3, 1, 2, 3], - [ParameterType::INTEGER,ParameterType::INTEGER, ParameterType::INTEGER,ParameterType::INTEGER,ParameterType::INTEGER, ParameterType::INTEGER], + [ + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ParameterType::INTEGER, + ], ], - - // Named parameters : Same name, other name in between DBAL-299 - [ + 'Named: Same name, other name in between (DBAL-299)' => [ 'SELECT * FROM Foo WHERE (:foo = 2) AND (:bar = 3) AND (:foo = 2)', ['foo' => 2,'bar' => 3], ['foo' => ParameterType::INTEGER,'bar' => ParameterType::INTEGER], @@ -324,8 +325,7 @@ public static function dataExpandListParameters() : iterable [2, 3, 2], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER], ], - // Named parameters : Empty "integer" array DDC-1978 - [ + 'Named: Empty "integer" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (:foo)', ['foo' => []], ['foo' => Connection::PARAM_INT_ARRAY], @@ -333,8 +333,7 @@ public static function dataExpandListParameters() : iterable [], [], ], - // Named parameters : Two empty "str" array DDC-1978 - [ + 'Named: Two empty "str" array (DDC-1978)' => [ 'SELECT * FROM Foo WHERE foo IN (:foo) OR bar IN (:bar)', ['foo' => [], 'bar' => []], ['foo' => Connection::PARAM_STR_ARRAY, 'bar' => Connection::PARAM_STR_ARRAY], @@ -358,8 +357,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 'bar'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // Params/types with colons - [ + 'Params/types with colons' => [ 'SELECT * FROM Foo WHERE foo = :foo OR bar = :bar', [':foo' => 'foo', ':bar' => 'bar'], [':foo' => ParameterType::INTEGER], @@ -391,8 +389,7 @@ public static function dataExpandListParameters() : iterable [1, 2, 'bar'], [ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::STRING], ], - // DBAL-522 - null valued parameters are not considered - [ + 'Null valued parameters (DBAL-522)' => [ 'INSERT INTO Foo (foo, bar) values (:foo, :bar)', ['foo' => 1, 'bar' => null], [':foo' => ParameterType::INTEGER, ':bar' => ParameterType::NULL], @@ -408,8 +405,7 @@ public static function dataExpandListParameters() : iterable [1, null], [ParameterType::INTEGER, ParameterType::NULL], ], - // DBAL-1205 - Escaped single quotes SQL- and C-Style - [ + 'Escaped single quotes SQL- and C-Style (DBAL-1205)' => [ "SELECT * FROM Foo WHERE foo = :foo||''':not_a_param''\\'' OR bar = ''':not_a_param''\\'':bar", [':foo' => 1, ':bar' => 2], [':foo' => ParameterType::INTEGER, 'bar' => ParameterType::INTEGER], @@ -417,6 +413,14 @@ public static function dataExpandListParameters() : iterable [1, 2], [ParameterType::INTEGER, ParameterType::INTEGER], ], + [ + 'SELECT NULL FROM dummy WHERE ? IN (?)', + ['foo', ['bar', 'baz']], + [1 => Connection::PARAM_STR_ARRAY], + 'SELECT NULL FROM dummy WHERE ? IN (?, ?)', + ['foo', 'bar', 'baz'], + [null, ParameterType::STRING, ParameterType::STRING], + ], ]; } diff --git a/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php b/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php index 32e4568ed03..269df62de32 100644 --- a/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php +++ b/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php @@ -62,7 +62,7 @@ public function testToArray() : void /** * @group legacy - * @expectedDeprecation The "unknown_option" column option is not supported, setting it is deprecated and will cause an error in Doctrine 3.0 + * @expectedDeprecation The "unknown_option" column option is not supported, setting it is deprecated and will cause an error in Doctrine DBAL 3.0 */ public function testSettingUnknownOptionIsStillSupported() : void { @@ -73,7 +73,7 @@ public function testSettingUnknownOptionIsStillSupported() : void /** * @group legacy - * @expectedDeprecation The "unknown_option" column option is not supported, setting it is deprecated and will cause an error in Doctrine 3.0 + * @expectedDeprecation The "unknown_option" column option is not supported, setting it is deprecated and will cause an error in Doctrine DBAL 3.0 */ public function testOptionsShouldNotBeIgnored() : void { diff --git a/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php b/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php index f0b115ddc4f..5a59088e42a 100644 --- a/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php +++ b/tests/Doctrine/Tests/DBAL/Schema/ForeignKeyConstraintTest.php @@ -4,6 +4,7 @@ use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\Index; +use Doctrine\DBAL\Schema\Table; use PHPUnit\Framework\TestCase; class ForeignKeyConstraintTest extends TestCase @@ -56,4 +57,30 @@ public static function getIntersectsIndexColumnsData() : iterable [['FOO'], true], ]; } + + /** + * @param string|Table $foreignTableName + * + * @group DBAL-1062 + * @dataProvider getUnqualifiedForeignTableNameData + */ + public function testGetUnqualifiedForeignTableName($foreignTableName, string $expectedUnqualifiedTableName) : void + { + $foreignKey = new ForeignKeyConstraint(['foo', 'bar'], $foreignTableName, ['fk_foo', 'fk_bar']); + + self::assertSame($expectedUnqualifiedTableName, $foreignKey->getUnqualifiedForeignTableName()); + } + + /** + * @return mixed[][] + */ + public static function getUnqualifiedForeignTableNameData() : iterable + { + return [ + ['schema.foreign_table', 'foreign_table'], + ['foreign_table', 'foreign_table'], + [new Table('schema.foreign_table'), 'foreign_table'], + [new Table('foreign_table'), 'foreign_table'], + ]; + } } diff --git a/tests/Doctrine/Tests/DBAL/StatementTest.php b/tests/Doctrine/Tests/DBAL/StatementTest.php index bb86e9cab3c..1c0794ac4cc 100644 --- a/tests/Doctrine/Tests/DBAL/StatementTest.php +++ b/tests/Doctrine/Tests/DBAL/StatementTest.php @@ -7,6 +7,7 @@ use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver\Connection as DriverConnection; +use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\Logging\SQLLogger; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Statement; @@ -28,7 +29,7 @@ class StatementTest extends DbalTestCase protected function setUp() : void { $this->pdoStatement = $this->getMockBuilder(PDOStatement::class) - ->onlyMethods(['execute', 'bindParam', 'bindValue']) + ->onlyMethods(['execute', 'bindParam', 'bindValue', 'fetchAll']) ->getMock(); $driverConnection = $this->createMock(DriverConnection::class); @@ -150,4 +151,15 @@ public function testExecuteCallsLoggerStopQueryOnException() : void $statement->execute(); } + + public function testPDOCustomClassConstructorArgs() : void + { + $statement = new Statement('', $this->conn); + + $this->pdoStatement->expects($this->once()) + ->method('fetchAll') + ->with(self::equalTo(FetchMode::CUSTOM_OBJECT), self::equalTo('Example'), self::equalTo(['arg1'])); + + $statement->fetchAll(FetchMode::CUSTOM_OBJECT, 'Example', ['arg1']); + } } diff --git a/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php b/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php index e7fa8a4be03..f8003c5c617 100644 --- a/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php @@ -3,13 +3,23 @@ namespace Doctrine\Tests\DBAL\Types; use Doctrine\DBAL\Types\ConversionException; -use Exception; use PHPUnit\Framework\TestCase; use stdClass; +use Throwable; use function tmpfile; class ConversionExceptionTest extends TestCase { + public function testConversionFailedPreviousException() : void + { + $previous = $this->createMock(Throwable::class); + + $exception = ConversionException::conversionFailed('foo', 'foo', $previous); + + self::assertInstanceOf(ConversionException::class, $exception); + self::assertSame($previous, $exception->getPrevious()); + } + /** * @param mixed $scalarValue * @@ -44,9 +54,19 @@ public function testConversionFailedInvalidTypeWithNonScalar($nonScalar) : void ); } + public function testConversionFailedInvalidTypePreviousException() : void + { + $previous = $this->createMock(Throwable::class); + + $exception = ConversionException::conversionFailedInvalidType('foo', 'foo', ['bar', 'baz'], $previous); + + self::assertInstanceOf(ConversionException::class, $exception); + self::assertSame($previous, $exception->getPrevious()); + } + public function testConversionFailedFormatPreservesPreviousException() : void { - $previous = new Exception(); + $previous = $this->createMock(Throwable::class); $exception = ConversionException::conversionFailedFormat('foo', 'bar', 'baz', $previous); diff --git a/tests/continuousphp/install-pdo-oci.sh b/tests/continuousphp/install-pdo-oci.sh index 00d105ff531..7db42f31f83 100755 --- a/tests/continuousphp/install-pdo-oci.sh +++ b/tests/continuousphp/install-pdo-oci.sh @@ -2,4 +2,5 @@ set -euo pipefail -phpbrew ext install pdo_oci -- --with-pdo-oci=instantclient,/usr/local/instantclient +docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr/local/instantclient +sudo -E env PHP_INI_DIR=/usr/local/etc/php docker-php-ext-install pdo_oci diff --git a/tests/travis/create-mysql-schema.sql b/tests/travis/create-mysql-schema.sql deleted file mode 100644 index 4e331838cfd..00000000000 --- a/tests/travis/create-mysql-schema.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE SCHEMA doctrine_tests; -CREATE SCHEMA test_create_database; -CREATE SCHEMA test_drop_database; - -GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'; -GRANT ALL PRIVILEGES ON test_create_database.* to travis@'%'; -GRANT ALL PRIVILEGES ON test_drop_database.* to travis@'%'; diff --git a/tests/travis/docker-run-mysql-or-mariadb.sh b/tests/travis/docker-run-mysql-or-mariadb.sh new file mode 100644 index 00000000000..a78ce4adb6e --- /dev/null +++ b/tests/travis/docker-run-mysql-or-mariadb.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +set -ex + +echo "Starting RDBMSโ€ฆ">&2 + +if [[ "$IMAGE" == "mysql:8.0" ]] +then + CMD_OPTIONS="--default-authentication-plugin=mysql_native_password" +else + CMD_OPTIONS="" +fi + +docker run \ + --health-cmd='mysqladmin ping --silent' \ + --detach \ + --env MYSQL_ALLOW_EMPTY_PASSWORD=yes \ + --env MYSQL_DATABASE=doctrine_tests \ + --publish 33306:3306 \ + --name rdbms \ + "$IMAGE" $CMD_OPTIONS + +while true; do + healthStatus=$(docker inspect --format "{{json .State.Health.Status }}" rdbms) + case $healthStatus in + '"starting"') + echo "Waiting for RDBMS to become readyโ€ฆ">&2 + sleep 1 + ;; + '"healthy"') + echo "Container is healthy">&2 + break + ;; + '"unhealthy"') + echo "Container is unhealthy">&2 + exit 1 + ;; + *) + echo "Unexpected health status $healthStatus">&2 + ;; + esac +done diff --git a/tests/travis/install-mysql-5.7.sh b/tests/travis/install-mysql-5.7.sh deleted file mode 100644 index 25459382c6f..00000000000 --- a/tests/travis/install-mysql-5.7.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Starting MySQL 5.7..." - -sudo docker run \ - -d \ - -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ - -e MYSQL_DATABASE=doctrine_tests \ - -p 33306:3306 \ - --name mysql57 \ - mysql:5.7 - -sudo docker exec -i mysql57 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done' diff --git a/tests/travis/install-mysql-8.0.sh b/tests/travis/install-mysql-8.0.sh deleted file mode 100644 index 952a4300ba7..00000000000 --- a/tests/travis/install-mysql-8.0.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Starting MySQL 8.0..." - -sudo docker pull mysql:8.0 -sudo docker run \ - -d \ - -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ - -e MYSQL_DATABASE=doctrine_tests \ - -p 33306:3306 \ - --name mysql80 \ - mysql:8.0 \ - --default-authentication-plugin=mysql_native_password - -sudo docker exec -i mysql80 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done' diff --git a/tests/travis/install-sqlsrv-dependencies.sh b/tests/travis/install-sqlsrv-dependencies.sh index 137b2a95705..ff91bfdfaf0 100644 --- a/tests/travis/install-sqlsrv-dependencies.sh +++ b/tests/travis/install-sqlsrv-dependencies.sh @@ -5,6 +5,6 @@ set -ex echo Installing driver dependencies curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - -curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql.list +curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql.list sudo apt-get update ACCEPT_EULA=Y sudo apt-get install -qy msodbcsql17 unixodbc unixodbc-dev libssl1.0.0 diff --git a/tests/travis/mariadb.travis.xml b/tests/travis/mariadb.docker.travis.xml similarity index 79% rename from tests/travis/mariadb.travis.xml rename to tests/travis/mariadb.docker.travis.xml index 0d4e2c43c9e..fa6617c0948 100644 --- a/tests/travis/mariadb.travis.xml +++ b/tests/travis/mariadb.docker.travis.xml @@ -11,17 +11,17 @@ - - + + - + - - + + - + diff --git a/tests/travis/mysqli.travis.xml b/tests/travis/mariadb.mysqli.docker.travis.xml similarity index 79% rename from tests/travis/mysqli.travis.xml rename to tests/travis/mariadb.mysqli.docker.travis.xml index b8bd9be01cd..679415d7a18 100644 --- a/tests/travis/mysqli.travis.xml +++ b/tests/travis/mariadb.mysqli.docker.travis.xml @@ -11,17 +11,17 @@ - - + + - + - - + + - + diff --git a/tests/travis/mariadb.mysqli.travis.xml b/tests/travis/mariadb.mysqli.travis.xml deleted file mode 100644 index dfc62d307c5..00000000000 --- a/tests/travis/mariadb.mysqli.travis.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - - - - performance - locking_functional - - - - diff --git a/tests/travis/mysql.travis.xml b/tests/travis/mysql.travis.xml deleted file mode 100644 index 0d4e2c43c9e..00000000000 --- a/tests/travis/mysql.travis.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ../Doctrine/Tests/DBAL - - - - - - ../../lib/Doctrine - - - - - - performance - locking_functional - - -