diff --git a/.drone.yml b/.drone.yml
index 5834f30e3..ace722632 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -6,21 +6,22 @@ clone:
steps:
- name: integration-tests-master
- image: nextcloudci/user_saml_shibboleth-php7.3:user_saml_shibboleth_php7.3-2
+ image: ghcr.io/nextcloud/continuous-integration-user_saml_shibboleth-php8.0:latest
environment:
CORE_BRANCH: master
commands:
- - /start.sh &
- - sleep 7
+ - /start.sh
+ - /wait-for-services.sh
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
- cd /var/www/html && git submodule update --init
# use local clone
- cp -r /drone/src /var/www/html/apps/user_saml
- - scl enable rh-php73 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'"
+ - php /var/www/html/occ maintenance:install --database sqlite --admin-pass password
+ - php /var/www/html/occ app:enable user_saml
- chown -R apache:apache /var/www/html/
- - scl enable rh-php73 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
+ - cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat
trigger:
branch:
@@ -40,13 +41,13 @@ clone:
depth: 1
steps:
- - name: integration-tests-master
- image: nextcloudci/user_saml_shibboleth-php7.3:user_saml_shibboleth_php7.3-2
+ - name: integration-tests-stable23
+ image: ghcr.io/nextcloud/continuous-integration-user_saml_shibboleth-php7.3:latest
environment:
CORE_BRANCH: stable23
commands:
- /start.sh &
- - sleep 7
+ - /wait-for-services.sh
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
@@ -75,13 +76,13 @@ clone:
depth: 1
steps:
- - name: integration-tests-master
- image: nextcloudci/user_saml_shibboleth-php7.3:user_saml_shibboleth_php7.3-2
+ - name: integration-tests-stable22
+ image: ghcr.io/nextcloud/continuous-integration-user_saml_shibboleth-php7.3:latest
environment:
CORE_BRANCH: stable22
commands:
- /start.sh &
- - sleep 7
+ - /wait-for-services.sh
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
@@ -110,13 +111,13 @@ clone:
depth: 1
steps:
- - name: integration-tests-master
- image: nextcloudci/user_saml_shibboleth-php7.3:user_saml_shibboleth_php7.3-2
+ - name: integration-tests-stable21
+ image: ghcr.io/nextcloud/continuous-integration-user_saml_shibboleth-php7.3:latest
environment:
CORE_BRANCH: stable21
commands:
- /start.sh &
- - sleep 7
+ - /wait-for-services.sh
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
diff --git a/.gitignore b/.gitignore
index f351a568f..64e0b0064 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,5 +7,7 @@
3rdparty/vendor/onelogin/php-saml/endpoints/
build
-vendor
+/vendor/
.php_cs.cache
+
+!/tests/integration/
diff --git a/tests/integration/composer.json b/tests/integration/composer.json
index bb2be516c..7836cce7f 100644
--- a/tests/integration/composer.json
+++ b/tests/integration/composer.json
@@ -1,6 +1,12 @@
{
+ "require": {
+ "php": ">=7.3"
+ },
"require-dev": {
"behat/behat": "^3.3",
"guzzlehttp/guzzle": "^7.0"
+ },
+ "conflict": {
+ "psr/container": ">=1.1"
}
}
diff --git a/tests/integration/composer.lock b/tests/integration/composer.lock
index 0d86ddb97..81b6c67a3 100644
--- a/tests/integration/composer.lock
+++ b/tests/integration/composer.lock
@@ -4,41 +4,42 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "342c9ad15194753594ee6d6b8e1bb2fc",
+ "content-hash": "9ff9f72d6a7cf43bebb439d1db2825a4",
"packages": [],
"packages-dev": [
{
"name": "behat/behat",
- "version": "v3.8.1",
+ "version": "v3.10.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/Behat.git",
- "reference": "fbb065457d523d9856d4b50775b4151a7598b510"
+ "reference": "a55661154079cf881ef643b303bfaf67bae3a09f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/Behat/zipball/fbb065457d523d9856d4b50775b4151a7598b510",
- "reference": "fbb065457d523d9856d4b50775b4151a7598b510",
+ "url": "https://api.github.com/repos/Behat/Behat/zipball/a55661154079cf881ef643b303bfaf67bae3a09f",
+ "reference": "a55661154079cf881ef643b303bfaf67bae3a09f",
"shasum": ""
},
"require": {
- "behat/gherkin": "^4.6.0",
+ "behat/gherkin": "^4.9.0",
"behat/transliterator": "^1.2",
"ext-mbstring": "*",
"php": "^7.2 || ^8.0",
"psr/container": "^1.0",
- "symfony/config": "^4.4 || ^5.0",
- "symfony/console": "^4.4 || ^5.0",
- "symfony/dependency-injection": "^4.4 || ^5.0",
- "symfony/event-dispatcher": "^4.4 || ^5.0",
- "symfony/translation": "^4.4 || ^5.0",
- "symfony/yaml": "^4.4 || ^5.0"
+ "symfony/config": "^4.4 || ^5.0 || ^6.0",
+ "symfony/console": "^4.4 || ^5.0 || ^6.0",
+ "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
+ "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
+ "symfony/translation": "^4.4 || ^5.0 || ^6.0",
+ "symfony/yaml": "^4.4 || ^5.0 || ^6.0"
},
"require-dev": {
"container-interop/container-interop": "^1.2",
"herrera-io/box": "~1.6.1",
"phpunit/phpunit": "^8.5 || ^9.0",
- "symfony/process": "^4.4 || ^5.0"
+ "symfony/process": "^4.4 || ^5.0 || ^6.0",
+ "vimeo/psalm": "^4.8"
},
"suggest": {
"ext-dom": "Needed to output test results in JUnit format."
@@ -49,11 +50,13 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.8.x-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
+ "Behat\\Hook\\": "src/Behat/Hook/",
+ "Behat\\Step\\": "src/Behat/Step/",
"Behat\\Behat\\": "src/Behat/Behat/",
"Behat\\Testwork\\": "src/Behat/Testwork/"
}
@@ -85,29 +88,33 @@
"symfony",
"testing"
],
- "time": "2020-11-07T15:55:18+00:00"
+ "support": {
+ "issues": "https://github.com/Behat/Behat/issues",
+ "source": "https://github.com/Behat/Behat/tree/v3.10.0"
+ },
+ "time": "2021-11-02T20:09:40+00:00"
},
{
"name": "behat/gherkin",
- "version": "v4.6.2",
+ "version": "v4.9.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/Gherkin.git",
- "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31"
+ "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/Gherkin/zipball/51ac4500c4dc30cbaaabcd2f25694299df666a31",
- "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31",
+ "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4",
+ "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4",
"shasum": ""
},
"require": {
- "php": ">=5.3.1"
+ "php": "~7.2|~8.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.5|~5",
- "symfony/phpunit-bridge": "~2.7|~3|~4",
- "symfony/yaml": "~2.3|~3|~4"
+ "cucumber/cucumber": "dev-gherkin-22.0.0",
+ "phpunit/phpunit": "~8|~9",
+ "symfony/yaml": "~3|~4|~5"
},
"suggest": {
"symfony/yaml": "If you want to parse features, represented in YAML files"
@@ -115,7 +122,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "4.x-dev"
}
},
"autoload": {
@@ -134,7 +141,7 @@
"homepage": "http://everzet.com"
}
],
- "description": "Gherkin DSL parser for PHP 5.3",
+ "description": "Gherkin DSL parser for PHP",
"homepage": "http://behat.org/",
"keywords": [
"BDD",
@@ -144,7 +151,11 @@
"gherkin",
"parser"
],
- "time": "2020-03-17T14:03:26+00:00"
+ "support": {
+ "issues": "https://github.com/Behat/Gherkin/issues",
+ "source": "https://github.com/Behat/Gherkin/tree/v4.9.0"
+ },
+ "time": "2021-10-12T13:05:09+00:00"
},
{
"name": "behat/transliterator",
@@ -189,28 +200,33 @@
"slug",
"transliterator"
],
+ "support": {
+ "issues": "https://github.com/Behat/Transliterator/issues",
+ "source": "https://github.com/Behat/Transliterator/tree/v1.3.0"
+ },
"time": "2020-01-14T16:39:13+00:00"
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.3.0",
+ "version": "7.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "7008573787b430c1c1f650e3722d9bba59967628"
+ "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628",
- "reference": "7008573787b430c1c1f650e3722d9bba59967628",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
+ "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^1.4",
- "guzzlehttp/psr7": "^1.7 || ^2.0",
+ "guzzlehttp/promises": "^1.5",
+ "guzzlehttp/psr7": "^1.8.3 || ^2.1",
"php": "^7.2.5 || ^8.0",
- "psr/http-client": "^1.0"
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
},
"provide": {
"psr/http-client-implementation": "1.0"
@@ -220,7 +236,7 @@
"ext-curl": "*",
"php-http/client-integration-tests": "^3.0",
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
- "psr/log": "^1.1"
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
"ext-curl": "Required for CURL handler support",
@@ -230,35 +246,59 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "7.3-dev"
+ "dev-master": "7.4-dev"
}
},
"autoload": {
- "psr-4": {
- "GuzzleHttp\\": "src/"
- },
"files": [
"src/functions_include.php"
- ]
+ ],
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle is a PHP HTTP client library",
- "homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
@@ -270,6 +310,10 @@
"rest",
"web service"
],
+ "support": {
+ "issues": "https://github.com/guzzle/guzzle/issues",
+ "source": "https://github.com/guzzle/guzzle/tree/7.4.1"
+ },
"funding": [
{
"url": "https://github.com/GrahamCampbell",
@@ -280,28 +324,24 @@
"type": "github"
},
{
- "url": "https://github.com/alexeyshockov",
- "type": "github"
- },
- {
- "url": "https://github.com/gmponos",
- "type": "github"
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
+ "type": "tidelift"
}
],
- "time": "2021-03-23T11:33:13+00:00"
+ "time": "2021-12-06T18:43:05+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "1.4.1",
+ "version": "1.5.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
+ "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
- "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
+ "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
"shasum": ""
},
"require": {
@@ -313,59 +353,95 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.4-dev"
+ "dev-master": "1.5-dev"
}
},
"autoload": {
- "psr-4": {
- "GuzzleHttp\\Promise\\": "src/"
- },
"files": [
"src/functions_include.php"
- ]
+ ],
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
- "time": "2021-03-07T09:25:29+00:00"
+ "support": {
+ "issues": "https://github.com/guzzle/promises/issues",
+ "source": "https://github.com/guzzle/promises/tree/1.5.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-10-22T20:56:57+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "1.8.1",
+ "version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1"
+ "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1",
- "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
+ "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
"shasum": ""
},
"require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.0",
+ "ralouphie/getallheaders": "^3.0"
},
"provide": {
+ "psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "ext-zlib": "*",
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "http-interop/http-factory-tests": "^0.9",
+ "phpunit/phpunit": "^8.5.8 || ^9.3.10"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
@@ -373,30 +449,53 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "2.1-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
- },
- "files": [
- "src/functions_include.php"
- ]
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
{
"name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
@@ -410,7 +509,25 @@
"uri",
"url"
],
- "time": "2021-03-21T16:25:00+00:00"
+ "support": {
+ "issues": "https://github.com/guzzle/psr7/issues",
+ "source": "https://github.com/guzzle/psr7/tree/2.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-10-06T17:43:30+00:00"
},
{
"name": "psr/container",
@@ -459,6 +576,10 @@
"container-interop",
"psr"
],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/master"
+ },
"time": "2017-02-14T16:28:37+00:00"
},
{
@@ -505,6 +626,10 @@
"psr",
"psr-14"
],
+ "support": {
+ "issues": "https://github.com/php-fig/event-dispatcher/issues",
+ "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
+ },
"time": "2019-01-08T18:20:26+00:00"
},
{
@@ -554,8 +679,66 @@
"psr",
"psr-18"
],
+ "support": {
+ "source": "https://github.com/php-fig/http-client/tree/master"
+ },
"time": "2020-06-29T06:28:15+00:00"
},
+ {
+ "name": "psr/http-factory",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
+ "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.0.0",
+ "psr/http-message": "^1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory/tree/master"
+ },
+ "time": "2019-04-30T12:38:16+00:00"
+ },
{
"name": "psr/http-message",
"version": "1.0.1",
@@ -604,6 +787,9 @@
"request",
"response"
],
+ "support": {
+ "source": "https://github.com/php-fig/http-message/tree/master"
+ },
"time": "2016-08-06T14:39:51+00:00"
},
{
@@ -644,38 +830,43 @@
}
],
"description": "A polyfill for getallheaders.",
+ "support": {
+ "issues": "https://github.com/ralouphie/getallheaders/issues",
+ "source": "https://github.com/ralouphie/getallheaders/tree/develop"
+ },
"time": "2019-03-08T08:55:37+00:00"
},
{
"name": "symfony/config",
- "version": "v5.1.8",
+ "version": "v5.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "11baeefa4c179d6908655a7b6be728f62367c193"
+ "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/11baeefa4c179d6908655a7b6be728f62367c193",
- "reference": "11baeefa4c179d6908655a7b6be728f62367c193",
+ "url": "https://api.github.com/repos/symfony/config/zipball/d65e1bd990c740e31feb07d2b0927b8d4df9956f",
+ "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/filesystem": "^4.4|^5.0",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/filesystem": "^4.4|^5.0|^6.0",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-php80": "^1.15"
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/polyfill-php81": "^1.22"
},
"conflict": {
"symfony/finder": "<4.4"
},
"require-dev": {
- "symfony/event-dispatcher": "^4.4|^5.0",
- "symfony/finder": "^4.4|^5.0",
- "symfony/messenger": "^4.4|^5.0",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/yaml": "^4.4|^5.0"
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/messenger": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/yaml": "^4.4|^5.0|^6.0"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
@@ -703,8 +894,11 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Config Component",
+ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/config/tree/v5.4.3"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -719,31 +913,33 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2022-01-03T09:50:52+00:00"
},
{
"name": "symfony/console",
- "version": "v5.1.8",
+ "version": "v5.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e"
+ "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e",
- "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e",
+ "url": "https://api.github.com/repos/symfony/console/zipball/d8111acc99876953f52fe16d4c50eb60940d49ad",
+ "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php73": "^1.8",
- "symfony/polyfill-php80": "^1.15",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/string": "^5.1"
+ "symfony/polyfill-php73": "^1.9",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/string": "^5.1|^6.0"
},
"conflict": {
+ "psr/log": ">=3",
"symfony/dependency-injection": "<4.4",
"symfony/dotenv": "<5.1",
"symfony/event-dispatcher": "<4.4",
@@ -751,16 +947,16 @@
"symfony/process": "<4.4"
},
"provide": {
- "psr/log-implementation": "1.0"
+ "psr/log-implementation": "1.0|2.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "^4.4|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0",
- "symfony/event-dispatcher": "^4.4|^5.0",
- "symfony/lock": "^4.4|^5.0",
- "symfony/process": "^4.4|^5.0",
- "symfony/var-dumper": "^4.4|^5.0"
+ "psr/log": "^1|^2",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/lock": "^4.4|^5.0|^6.0",
+ "symfony/process": "^4.4|^5.0|^6.0",
+ "symfony/var-dumper": "^4.4|^5.0|^6.0"
},
"suggest": {
"psr/log": "For using the console logger",
@@ -791,8 +987,17 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Console Component",
+ "description": "Eases the creation of beautiful and testable command line interfaces",
"homepage": "https://symfony.com",
+ "keywords": [
+ "cli",
+ "command line",
+ "console",
+ "terminal"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v5.4.5"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -807,27 +1012,27 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2022-02-24T12:45:35+00:00"
},
{
"name": "symfony/dependency-injection",
- "version": "v5.1.8",
+ "version": "v5.2.12",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "829ca6bceaf68036a123a13a979f3c89289eae78"
+ "reference": "2f0326ab0e142a3600b1b435cb3e852bc96264b6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/829ca6bceaf68036a123a13a979f3c89289eae78",
- "reference": "829ca6bceaf68036a123a13a979f3c89289eae78",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2f0326ab0e142a3600b1b435cb3e852bc96264b6",
+ "reference": "2f0326ab0e142a3600b1b435cb3e852bc96264b6",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"psr/container": "^1.0",
"symfony/deprecation-contracts": "^2.1",
- "symfony/polyfill-php80": "^1.15",
+ "symfony/polyfill-php80": "^1.16",
"symfony/service-contracts": "^1.1.6|^2"
},
"conflict": {
@@ -838,7 +1043,7 @@
},
"provide": {
"psr/container-implementation": "1.0",
- "symfony/service-implementation": "1.0"
+ "symfony/service-implementation": "1.0|2.0"
},
"require-dev": {
"symfony/config": "^5.1",
@@ -875,8 +1080,11 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony DependencyInjection Component",
+ "description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/dependency-injection/tree/v5.2.12"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -891,20 +1099,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-27T10:11:13+00:00"
+ "time": "2021-07-23T15:54:19+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v2.2.0",
+ "version": "v2.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
+ "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
- "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
+ "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"shasum": ""
},
"require": {
@@ -913,7 +1121,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -941,6 +1149,9 @@
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -955,27 +1166,27 @@
"type": "tidelift"
}
],
- "time": "2020-09-07T11:33:47+00:00"
+ "time": "2021-07-12T14:48:14+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v5.1.8",
+ "version": "v5.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a"
+ "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/26f4edae48c913fc183a3da0553fe63bdfbd361a",
- "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d",
+ "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/event-dispatcher-contracts": "^2",
- "symfony/polyfill-php80": "^1.15"
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/event-dispatcher-contracts": "^2|^3",
+ "symfony/polyfill-php80": "^1.16"
},
"conflict": {
"symfony/dependency-injection": "<4.4"
@@ -985,14 +1196,14 @@
"symfony/event-dispatcher-implementation": "2.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "^4.4|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0",
- "symfony/error-handler": "^4.4|^5.0",
- "symfony/expression-language": "^4.4|^5.0",
- "symfony/http-foundation": "^4.4|^5.0",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/stopwatch": "^4.4|^5.0"
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/expression-language": "^4.4|^5.0|^6.0",
+ "symfony/http-foundation": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/stopwatch": "^4.4|^5.0|^6.0"
},
"suggest": {
"symfony/dependency-injection": "",
@@ -1021,8 +1232,11 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony EventDispatcher Component",
+ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1037,20 +1251,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2022-01-02T09:53:40+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
- "version": "v2.2.0",
+ "version": "v2.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
- "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2"
+ "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2",
- "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a",
+ "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a",
"shasum": ""
},
"require": {
@@ -1063,7 +1277,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -1099,6 +1313,9 @@
"interoperability",
"standards"
],
+ "support": {
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1113,25 +1330,27 @@
"type": "tidelift"
}
],
- "time": "2020-09-07T11:33:47+00:00"
+ "time": "2021-07-12T14:48:14+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v5.1.8",
+ "version": "v5.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "df08650ea7aee2d925380069c131a66124d79177"
+ "reference": "d53a45039974952af7f7ebc461ccdd4295e29440"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/df08650ea7aee2d925380069c131a66124d79177",
- "reference": "df08650ea7aee2d925380069c131a66124d79177",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/d53a45039974952af7f7ebc461ccdd4295e29440",
+ "reference": "d53a45039974952af7f7ebc461ccdd4295e29440",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/polyfill-ctype": "~1.8"
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8",
+ "symfony/polyfill-php80": "^1.16"
},
"type": "library",
"autoload": {
@@ -1156,8 +1375,11 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Filesystem Component",
+ "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v5.4.6"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1172,32 +1394,35 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2022-03-02T12:42:23+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.20.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
- "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-ctype": "*"
+ },
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1205,12 +1430,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1234,6 +1459,9 @@
"polyfill",
"portable"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1248,20 +1476,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-10-20T20:35:02+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.20.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c"
+ "reference": "81b86b50cf841a64252b439e738e97f4a34e2783"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c",
- "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783",
+ "reference": "81b86b50cf841a64252b439e738e97f4a34e2783",
"shasum": ""
},
"require": {
@@ -1273,7 +1501,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1281,12 +1509,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1312,6 +1540,9 @@
"portable",
"shim"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1326,20 +1557,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-11-23T21:10:46+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.20.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "727d1096295d807c309fb01a851577302394c897"
+ "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897",
- "reference": "727d1096295d807c309fb01a851577302394c897",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
+ "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
"shasum": ""
},
"require": {
@@ -1351,7 +1582,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1359,12 +1590,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -1393,6 +1624,9 @@
"portable",
"shim"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1407,32 +1641,35 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-02-19T12:13:01+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.20.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
- "reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1440,12 +1677,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1470,6 +1707,9 @@
"portable",
"shim"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1484,20 +1724,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-11-30T18:21:41+00:00"
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.20.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed"
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed",
- "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
"shasum": ""
},
"require": {
@@ -1506,7 +1746,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1514,12 +1754,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php73\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -1546,6 +1786,9 @@
"portable",
"shim"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1560,20 +1803,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-06-05T21:20:04+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.20.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de"
+ "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
- "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
+ "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
"shasum": ""
},
"require": {
@@ -1582,7 +1825,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1590,12 +1833,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -1626,6 +1869,88 @@
"portable",
"shim"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-03-04T08:16:47+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php81",
+ "version": "v1.25.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php81\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1640,7 +1965,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-09-13T13:58:11+00:00"
},
{
"name": "symfony/service-contracts",
@@ -1702,6 +2027,9 @@
"interoperability",
"standards"
],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/master"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1720,16 +2048,16 @@
},
{
"name": "symfony/string",
- "version": "v5.1.8",
+ "version": "v5.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea"
+ "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea",
- "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea",
+ "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10",
+ "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10",
"shasum": ""
},
"require": {
@@ -1740,20 +2068,23 @@
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php80": "~1.15"
},
+ "conflict": {
+ "symfony/translation-contracts": ">=3.0"
+ },
"require-dev": {
- "symfony/error-handler": "^4.4|^5.0",
- "symfony/http-client": "^4.4|^5.0",
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/http-client": "^4.4|^5.0|^6.0",
"symfony/translation-contracts": "^1.1|^2",
- "symfony/var-exporter": "^4.4|^5.0"
+ "symfony/var-exporter": "^4.4|^5.0|^6.0"
},
"type": "library",
"autoload": {
- "psr-4": {
- "Symfony\\Component\\String\\": ""
- },
"files": [
"Resources/functions.php"
],
+ "psr-4": {
+ "Symfony\\Component\\String\\": ""
+ },
"exclude-from-classmap": [
"/Tests/"
]
@@ -1772,7 +2103,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony String component",
+ "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
"homepage": "https://symfony.com",
"keywords": [
"grapheme",
@@ -1782,6 +2113,9 @@
"utf-8",
"utf8"
],
+ "support": {
+ "source": "https://github.com/symfony/string/tree/v5.4.3"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1796,48 +2130,52 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2022-01-02T09:53:40+00:00"
},
{
"name": "symfony/translation",
- "version": "v5.1.8",
+ "version": "v5.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6"
+ "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/27980838fd261e04379fa91e94e81e662fe5a1b6",
- "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/a7ca9fdfffb0174209440c2ffa1dee228e15d95b",
+ "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "^1.15",
- "symfony/translation-contracts": "^2"
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/translation-contracts": "^2.3"
},
"conflict": {
"symfony/config": "<4.4",
+ "symfony/console": "<5.3",
"symfony/dependency-injection": "<5.0",
"symfony/http-kernel": "<5.0",
"symfony/twig-bundle": "<5.0",
"symfony/yaml": "<4.4"
},
"provide": {
- "symfony/translation-implementation": "2.0"
+ "symfony/translation-implementation": "2.3"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "^4.4|^5.0",
- "symfony/console": "^4.4|^5.0",
- "symfony/dependency-injection": "^5.0",
- "symfony/finder": "^4.4|^5.0",
- "symfony/http-kernel": "^5.0",
- "symfony/intl": "^4.4|^5.0",
- "symfony/service-contracts": "^1.1.2|^2",
- "symfony/yaml": "^4.4|^5.0"
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/console": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.0|^6.0",
+ "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/http-client-contracts": "^1.1|^2.0|^3.0",
+ "symfony/http-kernel": "^5.0|^6.0",
+ "symfony/intl": "^4.4|^5.0|^6.0",
+ "symfony/polyfill-intl-icu": "^1.21",
+ "symfony/service-contracts": "^1.1.2|^2|^3",
+ "symfony/yaml": "^4.4|^5.0|^6.0"
},
"suggest": {
"psr/log-implementation": "To use logging capability in translator",
@@ -1846,6 +2184,9 @@
},
"type": "library",
"autoload": {
+ "files": [
+ "Resources/functions.php"
+ ],
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
@@ -1867,8 +2208,11 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Translation Component",
+ "description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/translation/tree/v5.4.6"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1883,20 +2227,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2022-03-02T12:56:28+00:00"
},
{
"name": "symfony/translation-contracts",
- "version": "v2.3.0",
+ "version": "v2.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
- "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105"
+ "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105",
- "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105",
+ "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e",
+ "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e",
"shasum": ""
},
"require": {
@@ -1908,7 +2252,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -1944,6 +2288,9 @@
"interoperability",
"standards"
],
+ "support": {
+ "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1958,32 +2305,32 @@
"type": "tidelift"
}
],
- "time": "2020-09-28T13:05:58+00:00"
+ "time": "2021-08-17T14:20:01+00:00"
},
{
"name": "symfony/yaml",
- "version": "v5.1.8",
+ "version": "v5.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "f284e032c3cefefb9943792132251b79a6127ca6"
+ "reference": "e80f87d2c9495966768310fc531b487ce64237a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6",
- "reference": "f284e032c3cefefb9943792132251b79a6127ca6",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2",
+ "reference": "e80f87d2c9495966768310fc531b487ce64237a2",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/polyfill-ctype": "~1.8"
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-ctype": "^1.8"
},
"conflict": {
- "symfony/console": "<4.4"
+ "symfony/console": "<5.3"
},
"require-dev": {
- "symfony/console": "^4.4|^5.0"
+ "symfony/console": "^5.3|^6.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
@@ -2014,8 +2361,11 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Yaml Component",
+ "description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/yaml/tree/v5.4.3"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -2030,7 +2380,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:03:25+00:00"
+ "time": "2022-01-26T16:32:32+00:00"
}
],
"aliases": [],
@@ -2038,7 +2388,9 @@
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
- "platform": [],
+ "platform": {
+ "php": ">=7.3"
+ },
"platform-dev": [],
- "plugin-api-version": "1.1.0"
+ "plugin-api-version": "2.2.0"
}
diff --git a/tests/integration/vendor/behat/behat/CHANGELOG.md b/tests/integration/vendor/behat/behat/CHANGELOG.md
index 19ae19f88..167b643e1 100644
--- a/tests/integration/vendor/behat/behat/CHANGELOG.md
+++ b/tests/integration/vendor/behat/behat/CHANGELOG.md
@@ -4,58 +4,246 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
-## [Unreleased]
+## 3.10.0 - 2021-11-02
+
+## What's Changed
+* PHP8 Hook attributes by @rpkamp in https://github.com/Behat/Behat/pull/1372
+
+**Full Changelog**: https://github.com/Behat/Behat/compare/v3.9.1...v3.10.0
+
+## 3.9.1 - 2021-11-02
+
+## What's Changed
+* Fix issue 1363 (Symfony 6 compatibility) by @dmaicher in https://github.com/Behat/Behat/pull/1368
+* update branch alias for dev-master by @dmaicher in https://github.com/Behat/Behat/pull/1369
+* Fix SYMFONY_REQUIRE for github action by @dmaicher in https://github.com/Behat/Behat/pull/1370
+* Issue #1373 - Replace %1% with %count% in hu translations by @Sweetchuck in https://github.com/Behat/Behat/pull/1374
+
+## New Contributors
+* @dmaicher made their first contribution in https://github.com/Behat/Behat/pull/1368
+* @Sweetchuck made their first contribution in https://github.com/Behat/Behat/pull/1374
+
+**Full Changelog**: https://github.com/Behat/Behat/compare/v3.9.0...v3.9.1
+
+## [3.9.0] - 2021-10-18
+
+### What's Changed
+* Fix syntax help test and bump gherkin dependency by @ciaranmcnulty in https://github.com/Behat/Behat/pull/1336
+* Remove legacy Symfony compatibility layers (#1305, #1347) by @simonhammes in https://github.com/Behat/Behat/pull/1349
+* Add PHP 8.1 support by @javer in https://github.com/Behat/Behat/pull/1355
+* Introduce reading PHP8 Attributes for Given, When and Then steps by @rpkamp in https://github.com/Behat/Behat/pull/1342
+* Allow Symfony 6 by @Kocal in https://github.com/Behat/Behat/pull/1346
+* Remove minimum-stability dev from composer.json & require Gherkin ^4.9.0 by @pamil in https://github.com/Behat/Behat/pull/1365
+* Allow to manually run GitHub Actions by @pamil in https://github.com/Behat/Behat/pull/1361
+* Add vimeo/psalm (#1307) by @simonhammes in https://github.com/Behat/Behat/pull/1348
+
+### New Contributors
+* @simonhammes made their first contribution in https://github.com/Behat/Behat/pull/1349
+* @javer made their first contribution in https://github.com/Behat/Behat/pull/1355
+* @Kocal made their first contribution in https://github.com/Behat/Behat/pull/1346
+
+## [3.8.1] - 2020-11-07
+
+### Fixed
+
+ * [1329](https://github.com/Behat/Behat/pull/1329): Regression when using scalar type hints ([@ciaranmcnulty](https://github.com/ciaranmcnulty))
+
+## [3.8.0] - 2020-11-01
+
+### Added
+ * [1198](https://github.com/Behat/Behat/pull/1198): Korean language translations ([@getsolaris](https://github.com/getsolaris))
+ * [1252](https://github.com/Behat/Behat/pull/1252): Hungarian language translations ([@kolesar-andras](https://github.com/kolesar-andras))
+ * [1217](https://github.com/Behat/Behat/pull/1217): Bulgarian language translations ([@toni-kolev](https://github.com/toni-kolev))
+ * [1322](https://github.com/Behat/Behat/pull/1322): Feature title as classname in JUnit output ([@steefmin](https://github.com/steefmin))
+ * [1313](https://github.com/Behat/Behat/pull/1313): PHP 8 support ([@ciaranmcnulty](https://github.com/ciaranmcnulty))
+ * [1313](https://github.com/Behat/Behat/pull/1323): Further PHP 8 support ([@dgafka](https://github.com/dgafka))
+
+### Fixed
+
+ * [#1303](https://github.com/Behat/Behat/pull/1303): Error when running `--debug` with recent Symfony versions ([@jawira](https://github.com/jawira))
+ * [#1311](https://github.com/Behat/Behat/pull/1311): Remove symfony deprecation messages about transChoice ([@guilliamxavier](https://github.com/guilliamxavier))
+ * [#1318](https://github.com/Behat/Behat/pull/1318): Allow negated filters on scenario hoooks ([@andrewnicols ](https://github.com/andrewnicols))
+
+### Changed
+ * [#1299](https://github.com/Behat/Behat/pull/1299): Removed support for PHP <7.2, Symfony <4.4 ([@upamil](https://github.com/pamil))
+ * [#1310](https://github.com/Behat/Behat/pull/1310): Refactoring to use newer language features ([@rpkamp](https://github.com/rpkamp))
+ * [#1315](https://github.com/Behat/Behat/pull/1315): Remove BC layer for unsuppored symfony dispatcher ([@rpkamp](https://github.com/rpkamp))
+ * [#1314](https://github.com/Behat/Behat/pull/1314): Remove BC layer for unsuppored symfony translator ([@rpkamp](https://github.com/rpkamp))
+ * [#1212](https://github.com/Behat/Behat/pull/1212): Updated composer description ([@tkotosz](https://github.com/tkotosz))
+ * [#1317](https://github.com/Behat/Behat/pull/1317): Use PHPUnit8 for unit testing ([@phil-davis](https://github.com/phil-davis))
+
+## [3.7.0] - 2020-06-03
+
+### Added
+ * [#1236](https://github.com/Behat/Behat/pull/1236): Add support for php 7.4 ([@snapshotpl](https://github.com/snapshotpl))
+
+### Fixed
+ * [#1270](https://github.com/Behat/Behat/pull/1270): Fix issues with PHP version handling in build ([@Sam-Burns](https://github.com/Sam-Burns))
+ * [#1282](https://github.com/Behat/Behat/pull/1282): Updated the year on Changelog dates ([@choult](https://github.com/choult))
+ * [#1284](https://github.com/Behat/Behat/pull/1284): Restore PHP 5.3/5.4 compat ([@dvdoug](https://github.com/dvdoug), [@Sam-Burns](https://github.com/Sam-Burns), [@pamil](https://github.com/pamil))
+
+### Changed
+ * [#1281](https://github.com/Behat/Behat/pull/1281): Make container-interop/container-interop optional dependency ([@upyx](https://github.com/upyx))
+
+## [3.6.1] - 2020-02-06
+### Fixed
+ * [#1275](https://github.com/Behat/Behat/pull/1275): fix php 7.1 deprecation for ReflectionType::__toString
+ * [#1278](https://github.com/Behat/Behat/pull/1278): Fix fatal when unexpected symfony/event-dispatcher version is installed
+
+## [3.6.0] - 2020-02-04
+### Added
+ * [#1244](https://github.com/Behat/Behat/pull/1244): Hide internal steps from stack traces in very verbose mode
+### Fixed
+ * [#1238](https://github.com/Behat/Behat/pull/1238): Don't run Junit output if ext-dom is not present (and suggest in composer)
+### Changed
+ * [#1256](https://github.com/Behat/Behat/pull/1256): Update dependencies to support Symfony 5.x
+ * [#1171](https://github.com/Behat/Behat/pull/1171): Remove symfony/class-loader dependency
+ * [#1170](https://github.com/Behat/Behat/pull/1170): Switch to PSR-4 autoloading
+ * [#1230](https://github.com/Behat/Behat/pull/1230): PHP 7.3 support
+ * [#1230](https://github.com/Behat/Behat/pull/1230): Suggest ext-dom for JUnit support
+
+## [3.5.0] - 2018-08-10
+### Added
+ * [#1144](https://github.com/Behat/Behat/pull/1144): Allow to use arrays as context parameters
+ * [#1081](https://github.com/Behat/Behat/pull/1081): Allow passing null as a named context parameter
+ * [#1083](https://github.com/Behat/Behat/pull/1083): Time attribute in JUnit output
+
+### Changed
+ * [#1153](https://github.com/Behat/Behat/pull/1153): Cache pattern to regex transformations
+ * [#1155](https://github.com/Behat/Behat/pull/1155): Remove composer suggestions
+
+### Fixed
+ * Custom container must be public for symfony 4
+ * [#1160](https://github.com/Behat/Behat/pull/1160): Register CLI services as synthetic
+ * [#1163](https://github.com/Behat/Behat/pull/1163): Allow for new-style symfony serialisation
+ * [#1130](https://github.com/Behat/Behat/pull/1130): Fix quoteless definition arguments matching with unicode characters
+
+## [3.4.3] - 2017-11-27
+### Fixed
+ * BC break due to parameters resolution in Dependency Injection Container
+
+## [3.4.2] - 2017-11-20
+### Added
+ * [#1095](https://github.com/Behat/Behat/pull/1095): Support for Symfony 4.x
+ * [#1096](https://github.com/Behat/Behat/pull/1096): Allow to use latest PHPUnit
+
+## [3.4.1] - 2017-09-18
+### Fixed
+ * PHP 5.3 style cleanup.
+
+## [3.4.0] - 2017-09-10
+### Added
+ * [#1071](https://github.com/Behat/Behat/pull/1071): Services auto-wiring
+ * [#1054](https://github.com/Behat/Behat/pull/1054): [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md)
+ support for helper containers.
+ * Support for modern PHPUnit.
+
+### Fixed
+ * [#1056](https://github.com/Behat/Behat/pull/1056): Make Gherkin aware of the
+ base path so it can filter correctly
+
+### Changed
+ * [#1069](https://github.com/Behat/Behat/pull/1069): Rework argument validators
+
+### Deprecated
+ * [#1054](https://github.com/Behat/Behat/pull/1054): Deprecated usage
+ of `Interop\Container`. Versions prior to `1.2` are not supported, but `1.2`
+ is a non-breaking change. If you depend heavily on `Interop`, upgrade to
+ `1.2`, which is still supported by helper containers. Aim to migrate to
+ `Psr` before Behat 4.0 shows up on horizon
+ * PHP versions prior to 5.6 and HHVM were dropped from CI build matrix. It
+ doesn't mean that we'll start using features of 5.6 yet, it just means we
+ don't get out of our way to support 5.3 and 5.4 anymore. In 4.0 support will
+ be completely dropped.
+
+## [3.3.1] - 2017-05-15
+### Added
+ * [#976](https://github.com/Behat/Behat/pull/1001): Add tests to check that
+ snippets treat words containing apostrophes as a single word
+
+### Fixed
+ * [#993](https://github.com/Behat/Behat/pull/993) Fix mixed arguments
+ organizer not marking typehinted arguments as "defined"
+ * [#992](https://github.com/Behat/Behat/pull/993) Do not misinterpret first
+ argument as a numbered argument if it is in fact typehinted
+ * [#1028](https://github.com/Behat/Behat/pull/1028) Parent / Child class
+ argument ambiguity issue with `MixedArgumentResolver`
## [3.3.0] - 2016-12-25
### Added
* [#973](https://github.com/Behat/Behat/pull/974): Added helper containers
- * [#973](https://github.com/Behat/Behat/pull/974): Added `SuiteScopedResolverFactory` extension point
+ * [#973](https://github.com/Behat/Behat/pull/974): Added
+ `SuiteScopedResolverFactory` extension point
+
+### Removed
+ * Removed php 5.3 from the Travis build matrix. You can consider it official
+ end of support. 5.4 and 5.5 will follow shortly.
## [3.2.3] - 2016-12-25
### Fixed
- * [#971](https://github.com/Behat/Behat/pull/971): Added support for suite names with hyphens
+ * [#971](https://github.com/Behat/Behat/pull/971): Added support for suite
+ names with hyphens
## [3.2.2] - 2016-11-05
### Fixed
- * [#959](https://github.com/Behat/Behat/issues/959): Fix transformations not sorted properly on different php version
+ * [#959](https://github.com/Behat/Behat/issues/959): Fix transformations not
+ sorted properly on different php version
## [3.2.1] - 2016-09-25
### Changed
- * [#955](https://github.com/Behat/Behat/pull/955): `--snippets-for` is not required now as interactive mode is the new default
- * [#954](https://github.com/Behat/Behat/pull/954): Stop execution on missing steps when running with `--stop-on-failure` and `--strict` options
+ * [#955](https://github.com/Behat/Behat/pull/955): `--snippets-for` is not
+ required now as interactive mode is the new default
+ * [#954](https://github.com/Behat/Behat/pull/954): Stop execution on missing
+ steps when running with `--stop-on-failure` and `--strict` options
## [3.2.0] - 2016-09-20
### Added
- * [#910](https://github.com/Behat/Behat/pull/910): Return type based transformations
- * [#903](https://github.com/Behat/Behat/pull/903): Multiline step definitions support
+ * [#910](https://github.com/Behat/Behat/pull/910): Return type based
+ transformations
+ * [#903](https://github.com/Behat/Behat/pull/903): Multiline step definitions
+ support
* [#930](https://github.com/Behat/Behat/pull/930): Whole table transformation
* [#935](https://github.com/Behat/Behat/pull/935): Narrative filters in suites
* [#936](https://github.com/Behat/Behat/pull/936): Debug command
- * [#931](https://github.com/Behat/Behat/pull/931): Exception handlers extension point
- * [#870](https://github.com/Behat/Behat/pull/870): Added build-related files and folders to .gitattributes
- * [#946](https://github.com/Behat/Behat/pull/946): Official full Windows support with CI ([AppVeyor](http://appveyor.com)) on every build
+ * [#931](https://github.com/Behat/Behat/pull/931): Exception handlers
+ extension point
+ * [#870](https://github.com/Behat/Behat/pull/870): Added build-related files
+ and folders to .gitattributes
+ * [#946](https://github.com/Behat/Behat/pull/946): Official full Windows
+ support with CI ([AppVeyor](http://appveyor.com)) on every build
### Changed
* [#922](https://github.com/Behat/Behat/pull/922): Snippets generation revamp
- * [#920](https://github.com/Behat/Behat/pull/920): More context for pending/failed steps with progress formatter
+ * [#920](https://github.com/Behat/Behat/pull/920): More context for
+ pending/failed steps with progress formatter
* [#905](https://github.com/Behat/Behat/pull/905): Transformations refactoring
- * [#864](https://github.com/Behat/Behat/pull/864): Use only one autoloader if possible
- * [#920](https://github.com/Behat/Behat/pull/920): Improve "No specifications found" error message
+ * [#864](https://github.com/Behat/Behat/pull/864): Use only one autoloader if
+ possible
+ * [#920](https://github.com/Behat/Behat/pull/920): Improve "No specifications
+ found" error message
* Refactor changelog to follow [Keep a Changelog](http://keepachangelog.com/)
* Refreshed [CONTRIBUTING.md](CONTRIBUTING.md)
* Refreshed Scrutinizer config
### Fixed
- * [#911](https://github.com/Behat/Behat/pull/911): Fix context isolation for Scenario Outlines
- * [#860](https://github.com/Behat/Behat/pull/860): Include basepath in `generateKey`
- * [#857](https://github.com/Behat/Behat/pull/857): Only cache failed scenario's for rerun
- * [#933](https://github.com/Behat/Behat/pull/933): Save failed runs with suite information
- * [#833](https://github.com/Behat/Behat/pull/833): Properly handle interupts on PHP7
- * [#904](https://github.com/Behat/Behat/pull/904): Provide clearer exception message when long token names used
- * [#941](https://github.com/Behat/Behat/pull/941): Transformation should be allowed if printable chars are used
+ * [#911](https://github.com/Behat/Behat/pull/911): Fix context isolation for
+ Scenario Outlines
+ * [#860](https://github.com/Behat/Behat/pull/860): Include basepath in
+ `generateKey`
+ * [#857](https://github.com/Behat/Behat/pull/857): Only cache failed
+ scenario's for rerun
+ * [#933](https://github.com/Behat/Behat/pull/933): Save failed runs with suite
+ information
+ * [#833](https://github.com/Behat/Behat/pull/833): Properly handle interupts
+ on PHP7
+ * [#904](https://github.com/Behat/Behat/pull/904): Provide clearer exception
+ message when long token names used
+ * [#941](https://github.com/Behat/Behat/pull/941): Transformation should be
+ allowed if printable chars are used
### Deprecated
- * [#922](https://github.com/Behat/Behat/pull/922): `*SnippetAcceptingContext` interfaces
+ * [#922](https://github.com/Behat/Behat/pull/922): `*SnippetAcceptingContext`
+ interfaces
* [#905](https://github.com/Behat/Behat/pull/905): `RuntimeTransformation`
* [#905](https://github.com/Behat/Behat/pull/905): `Transformation::getPattern`
* [#920](https://github.com/Behat/Behat/pull/920): `StepStat`
@@ -74,7 +262,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Add Japanese translation (thanks @SNakano)
* Add romanian translation for formatters (thanks @Chriton)
* Add table row transformations (thanks @ciaranmcnulty)
- * Add support for negative numbers without surrounding quotes (thanks @ryancookdev)
+ * Add support for negative numbers without surrounding quotes (thanks
+ @ryancookdev)
* Handle case when non-existent config file is used (thanks @watermanio)
* Handle non-default `error_reporting()`
* Handle PHP7 errors implementing `Throwable`
@@ -88,7 +277,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Allow suite settings with null values to exist (thanks @docteurklein)
* Improve "can not generate snippets" message
* Improve performance of Turnip parsing (thanks @Sam-Burns)
- * Improve the snippet generation by auto-importing needed classes (thanks @stof)
+ * Improve the snippet generation by auto-importing needed classes (thanks
+ @stof)
## [3.0.15] - 2015-02-22
### Changed
@@ -793,7 +983,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
* Initial release
-[Unreleased]: https://github.com/Behat/Behat/compare/v3.3.0...HEAD
+[Unreleased]: https://github.com/Behat/Behat/compare/v3.9.0...master
+[3.9.0]: https://github.com/Behat/Behat/compare/v3.8.1...v3.9.0
+[3.8.1]: https://github.com/Behat/Behat/compare/v3.8.0...v3.8.1
+[3.8.0]: https://github.com/Behat/Behat/compare/v3.7.0...v3.8.0
+[3.7.0]: https://github.com/Behat/Behat/compare/v3.6.1...v3.7.0
+[3.6.1]: https://github.com/Behat/Behat/compare/v3.6.0...v3.6.1
+[3.6.0]: https://github.com/Behat/Behat/compare/v3.5.0...v3.6.0
+[3.5.0]: https://github.com/Behat/Behat/compare/v3.4.3...v3.5.0
+[3.4.3]: https://github.com/Behat/Behat/compare/v3.4.2...v3.4.3
+[3.4.2]: https://github.com/Behat/Behat/compare/v3.4.1...v3.4.2
+[3.4.1]: https://github.com/Behat/Behat/compare/v3.4.0...v3.4.1
+[3.4.0]: https://github.com/Behat/Behat/compare/v3.3.1...v3.4.0
+[3.3.1]: https://github.com/Behat/Behat/compare/v3.3.0...v3.3.1
[3.3.0]: https://github.com/Behat/Behat/compare/v3.2.3...v3.3.0
[3.2.3]: https://github.com/Behat/Behat/compare/v3.2.2...v3.2.3
[3.2.2]: https://github.com/Behat/Behat/compare/v3.2.1...v3.2.2
diff --git a/tests/integration/vendor/behat/behat/README.md b/tests/integration/vendor/behat/behat/README.md
index e71a77b4e..a666ce704 100644
--- a/tests/integration/vendor/behat/behat/README.md
+++ b/tests/integration/vendor/behat/behat/README.md
@@ -1,12 +1,11 @@
-
+
Behat is a BDD framework for PHP to help you test business expectations.
[](https://gitter.im/Behat/Behat)
[](https://packagist.org/packages/behat/behat)
-[](https://travis-ci.org/Behat/Behat)
+[](https://github.com/Behat/Behat/actions?query=workflow%3ABuild)
[](https://ci.appveyor.com/project/everzet/behat/branch/master)
-[](http://hhvm.h4cc.de/package/behat/behat)
[](https://scrutinizer-ci.com/g/Behat/Behat/)
Installing Behat
@@ -15,8 +14,7 @@ Installing Behat
The easiest way to install Behat is by using [Composer](https://getcomposer.org):
```bash
-$> curl -sS https://getcomposer.org/installer | php
-$> php composer.phar require behat/behat
+$> composer require --dev behat/behat
```
After that you'll be able to run Behat via:
@@ -31,8 +29,7 @@ Installing Development Version
Clone the repository and install dependencies via [Composer](https://getcomposer.org):
```bash
-$> curl -sS https://getcomposer.org/installer | php
-$> php composer.phar install
+$> composer install
```
After that you will be able to run development version of Behat via:
diff --git a/tests/integration/vendor/behat/behat/behat.yml.dist b/tests/integration/vendor/behat/behat/behat.yml.dist
new file mode 100644
index 000000000..b2c042fa1
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/behat.yml.dist
@@ -0,0 +1,4 @@
+default:
+ gherkin:
+ filters:
+ tags: ~@php8
diff --git a/tests/integration/vendor/behat/behat/composer.json b/tests/integration/vendor/behat/behat/composer.json
index 95eb16ba9..f4103d188 100644
--- a/tests/integration/vendor/behat/behat/composer.json
+++ b/tests/integration/vendor/behat/behat/composer.json
@@ -1,6 +1,6 @@
{
"name": "behat/behat",
- "description": "Scenario-oriented BDD framework for PHP 5.3",
+ "description": "Scenario-oriented BDD framework for PHP",
"keywords": ["BDD", "ScenarioBDD", "StoryBDD", "Examples", "Scrum", "Agile", "User story", "Symfony", "business", "development", "testing", "documentation"],
"homepage": "http://behat.org/",
"type": "library",
@@ -14,42 +14,49 @@
],
"require": {
- "php": ">=5.3.3",
+ "php": "^7.2 || ^8.0",
"ext-mbstring": "*",
- "behat/gherkin": "^4.4.4",
- "behat/transliterator": "~1.0",
- "symfony/console": "~2.5||~3.0",
- "symfony/config": "~2.3||~3.0",
- "symfony/dependency-injection": "~2.1||~3.0",
- "symfony/event-dispatcher": "~2.1||~3.0",
- "symfony/translation": "~2.3||~3.0",
- "symfony/yaml": "~2.1||~3.0",
- "symfony/class-loader": "~2.1||~3.0",
- "container-interop/container-interop": "^1.1"
+ "behat/gherkin": "^4.9.0",
+ "behat/transliterator": "^1.2",
+ "symfony/console": "^4.4 || ^5.0 || ^6.0",
+ "symfony/config": "^4.4 || ^5.0 || ^6.0",
+ "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
+ "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
+ "symfony/translation": "^4.4 || ^5.0 || ^6.0",
+ "symfony/yaml": "^4.4 || ^5.0 || ^6.0",
+ "psr/container": "^1.0"
},
"require-dev": {
- "symfony/process": "~2.5|~3.0",
- "phpunit/phpunit": "~4.5",
- "herrera-io/box": "~1.6.1"
+ "symfony/process": "^4.4 || ^5.0 || ^6.0",
+ "phpunit/phpunit": "^8.5 || ^9.0",
+ "herrera-io/box": "~1.6.1",
+ "container-interop/container-interop": "^1.2",
+ "vimeo/psalm": "^4.8"
},
"suggest": {
- "behat/symfony2-extension": "for integration with Symfony2 web framework",
- "behat/yii-extension": "for integration with Yii web framework",
- "behat/mink-extension": "for integration with Mink testing framework"
+ "ext-dom": "Needed to output test results in JUnit format."
},
"autoload": {
- "psr-0": {
- "Behat\\Behat": "src/",
- "Behat\\Testwork": "src/"
+ "psr-4": {
+ "Behat\\Behat\\": "src/Behat/Behat/",
+ "Behat\\Testwork\\": "src/Behat/Testwork/",
+ "Behat\\Step\\": "src/Behat/Step/",
+ "Behat\\Hook\\": "src/Behat/Hook/"
+ }
+ },
+
+ "autoload-dev": {
+ "psr-4": {
+ "Behat\\Tests\\": "tests/"
}
},
"extra": {
"branch-alias": {
- "dev-master": "3.2.x-dev"
+ "dev-master": "3.x-dev"
}
},
diff --git a/tests/integration/vendor/behat/behat/i18n.php b/tests/integration/vendor/behat/behat/i18n.php
index 44eda3c91..4cb059fbc 100644
--- a/tests/integration/vendor/behat/behat/i18n.php
+++ b/tests/integration/vendor/behat/behat/i18n.php
@@ -1,217 +1,267 @@
array(
- 'snippet_context_choice' => '%1% suite has undefined steps. Please choose the context to generate snippets:',
- 'snippet_proposal_title' => '%1% has missing steps. Define them with these snippets:',
- 'snippet_missing_title' => 'Use --snippets-for CLI option to generate snippets for following %1% suite steps:',
+ 'snippet_context_choice' => '%count% suite has undefined steps. Please choose the context to generate snippets:',
+ 'snippet_proposal_title' => '%count% has missing steps. Define them with these snippets:',
+ 'snippet_missing_title' => 'Use --snippets-for CLI option to generate snippets for following %count% suite steps:',
'skipped_scenarios_title' => 'Skipped scenarios:',
'failed_scenarios_title' => 'Failed scenarios:',
'failed_hooks_title' => 'Failed hooks:',
'failed_steps_title' => 'Failed steps:',
'pending_steps_title' => 'Pending steps:',
- 'scenarios_count' => '{0} No scenarios|{1} 1 scenario|]1,Inf] %1% scenarios',
- 'steps_count' => '{0} No steps|{1} 1 step|]1,Inf] %1% steps',
- 'passed_count' => '[1,Inf] %1% passed',
- 'failed_count' => '[1,Inf] %1% failed',
- 'pending_count' => '[1,Inf] %1% pending',
- 'undefined_count' => '[1,Inf] %1% undefined',
- 'skipped_count' => '[1,Inf] %1% skipped',
+ 'scenarios_count' => '{0} No scenarios|{1} 1 scenario|]1,Inf] %count% scenarios',
+ 'steps_count' => '{0} No steps|{1} 1 step|]1,Inf] %count% steps',
+ 'passed_count' => '[1,Inf] %count% passed',
+ 'failed_count' => '[1,Inf] %count% failed',
+ 'pending_count' => '[1,Inf] %count% pending',
+ 'undefined_count' => '[1,Inf] %count% undefined',
+ 'skipped_count' => '[1,Inf] %count% skipped',
+ ),
+ 'bg' => array(
+ 'snippet_context_choice' => 'В сет %1% има недекларирани стъпки. Изберете в кой Context да бъдат създадени:',
+ 'snippet_proposal_title' => '%1% има липсващи стъпки. Можете да ги създадете чрез:',
+ 'snippet_missing_title' => 'Използвайте този снипет --snippets-for за да генерирате кода за следните стъпки %1% през конзолата:',
+ 'skipped_scenarios_title' => 'Пропуснати сценарии:',
+ 'failed_scenarios_title' => 'Провалени сценарии:',
+ 'failed_hooks_title' => 'Провалени хукове:',
+ 'failed_steps_title' => 'Провалени стъпки:',
+ 'pending_steps_title' => 'Изчакващи стъпки:',
+ 'scenarios_count' => '{0} Няма сценарий|{1} 1 сценарий|]1,Inf] %1% сценарии',
+ 'steps_count' => '{0} Няма стъпки|{1} 1 стъпка|]1,Inf] %1% стъпки',
+ 'passed_count' => '[1,Inf] %1% успешни',
+ 'failed_count' => '[1,Inf] %1% провалени',
+ 'pending_count' => '[1,Inf] %1% изчакващи',
+ 'undefined_count' => '[1,Inf] %1% неопределени',
+ 'skipped_count' => '[1,Inf] %1% пропуснати',
),
'cs' => array(
- 'snippet_proposal_title' => '%1% obsahuje chybné kroky. Definujte je za použití následujícího kódu:',
- 'snippet_missing_title' => 'Snippety pro následující kroky v sadě %1% nebyly vygenerovány (zkontrolujte správnost konfigurace):',
+ 'snippet_proposal_title' => '%count% obsahuje chybné kroky. Definujte je za použití následujícího kódu:',
+ 'snippet_missing_title' => 'Snippety pro následující kroky v sadě %count% nebyly vygenerovány (zkontrolujte správnost konfigurace):',
'failed_scenarios_title' => 'Chybné scénáře:',
'failed_hooks_title' => 'Chybné hooky:',
'failed_steps_title' => 'Chybné kroky:',
'pending_steps_title' => 'Čekající kroky:',
- 'scenarios_count' => '{0} Žádný scénář|{1} 1 scénář|{2,3,4} %1% scénáře|]4,Inf] %1% scénářů',
- 'steps_count' => '{0} Žádné kroky|{1} 1 krok|{2,3,4} %1% kroky|]4,Inf] %1% kroků',
- 'passed_count' => '{1} %1% prošel|{2,3,4} %1% prošly|]4,Inf] %1% prošlo',
- 'failed_count' => '{1} %1% selhal|{2,3,4} %1% selhaly|]4,Inf] %1% selhalo',
- 'pending_count' => '{1} %1% čeká|{2,3,4} %1% čekají|]4,Inf] %1% čeká',
- 'undefined_count' => '{1} %1% nedefinován|{2,3,4} %1% nedefinovány|]4,Inf] %1% nedefinováno',
- 'skipped_count' => '{1} %1% přeskočen|{2,3,4} %1% přeskočeny|]4,Inf] %1% přeskočeno',
+ 'scenarios_count' => '{0} Žádný scénář|{1} 1 scénář|{2,3,4} %count% scénáře|]4,Inf] %count% scénářů',
+ 'steps_count' => '{0} Žádné kroky|{1} 1 krok|{2,3,4} %count% kroky|]4,Inf] %count% kroků',
+ 'passed_count' => '{1} %count% prošel|{2,3,4} %count% prošly|]4,Inf] %count% prošlo',
+ 'failed_count' => '{1} %count% selhal|{2,3,4} %count% selhaly|]4,Inf] %count% selhalo',
+ 'pending_count' => '{1} %count% čeká|{2,3,4} %count% čekají|]4,Inf] %count% čeká',
+ 'undefined_count' => '{1} %count% nedefinován|{2,3,4} %count% nedefinovány|]4,Inf] %count% nedefinováno',
+ 'skipped_count' => '{1} %count% přeskočen|{2,3,4} %count% přeskočeny|]4,Inf] %count% přeskočeno',
),
'de' => array(
- 'snippet_proposal_title' => '%1% hat fehlende Schritte. Definiere diese mit den folgenden Snippets:',
- 'snippet_missing_title' => 'Snippets für die folgenden Schritte in der %1% Suite wurden nicht generiert (Konfiguration überprüfen):',
+ 'snippet_proposal_title' => '%count% hat fehlende Schritte. Definiere diese mit den folgenden Snippets:',
+ 'snippet_missing_title' => 'Snippets für die folgenden Schritte in der %count% Suite wurden nicht generiert (Konfiguration überprüfen):',
'failed_scenarios_title' => 'Fehlgeschlagene Szenarien:',
'failed_hooks_title' => 'Fehlgeschlagene Hooks:',
'failed_steps_title' => 'Fehlgeschlagene Schritte:',
'pending_steps_title' => 'Ausstehende Schritte:',
- 'scenarios_count' => '{0} Kein Szenario|{1} 1 Szenario|]1,Inf] %1% Szenarien',
- 'steps_count' => '{0} Kein Schritt|{1} 1 Schritt|]1,Inf] %1% Schritte',
- 'passed_count' => '[1,Inf] %1% bestanden',
- 'failed_count' => '[1,Inf] %1% fehlgeschlagen',
- 'pending_count' => '[1,Inf] %1% ausstehend',
- 'undefined_count' => '[1,Inf] %1% nicht definiert',
- 'skipped_count' => '[1,Inf] %1% übersprungen',
+ 'scenarios_count' => '{0} Kein Szenario|{1} 1 Szenario|]1,Inf] %count% Szenarien',
+ 'steps_count' => '{0} Kein Schritt|{1} 1 Schritt|]1,Inf] %count% Schritte',
+ 'passed_count' => '[1,Inf] %count% bestanden',
+ 'failed_count' => '[1,Inf] %count% fehlgeschlagen',
+ 'pending_count' => '[1,Inf] %count% ausstehend',
+ 'undefined_count' => '[1,Inf] %count% nicht definiert',
+ 'skipped_count' => '[1,Inf] %count% übersprungen',
),
'es' => array(
- 'snippet_proposal_title' => 'A %1% le faltan pasos. Defínelos con estos pasos:',
- 'snippet_missing_title' => 'Las plantillas para los siguientes pasos en %1% no fueron generadas (revisa tu configuración):',
+ 'snippet_proposal_title' => 'A %count% le faltan pasos. Defínelos con estos pasos:',
+ 'snippet_missing_title' => 'Las plantillas para los siguientes pasos en %count% no fueron generadas (revisa tu configuración):',
'failed_scenarios_title' => 'Escenarios fallidos:',
'failed_hooks_title' => 'Hooks fallidos:',
'failed_steps_title' => 'Pasos fallidos:',
'pending_steps_title' => 'Pasos pendientes:',
- 'scenarios_count' => '{0} Ningún escenario|{1} 1 escenario|]1,Inf] %1% escenarios',
- 'steps_count' => '{0} Ningún paso|{1} 1 paso|]1,Inf] %1% pasos',
- 'passed_count' => '[1,Inf] %1% pasaron',
- 'failed_count' => '[1,Inf] %1% fallaron',
- 'pending_count' => '[1,Inf] %1% pendientes',
- 'undefined_count' => '[1,Inf] %1% por definir',
- 'skipped_count' => '[1,Inf] %1% saltadas',
+ 'scenarios_count' => '{0} Ningún escenario|{1} 1 escenario|]1,Inf] %count% escenarios',
+ 'steps_count' => '{0} Ningún paso|{1} 1 paso|]1,Inf] %count% pasos',
+ 'passed_count' => '[1,Inf] %count% pasaron',
+ 'failed_count' => '[1,Inf] %count% fallaron',
+ 'pending_count' => '[1,Inf] %count% pendientes',
+ 'undefined_count' => '[1,Inf] %count% por definir',
+ 'skipped_count' => '[1,Inf] %count% saltadas',
),
'fr' => array(
- 'snippet_proposal_title' => '%1% a des étapes manquantes. Définissez-les avec les modèles suivants :',
- 'snippet_missing_title' => 'Les modèles des étapes de la suite %1% n\'ont pas été générés (vérifiez votre configuration):',
+ 'snippet_proposal_title' => '%count% a des étapes manquantes. Définissez-les avec les modèles suivants :',
+ 'snippet_missing_title' => 'Les modèles des étapes de la suite %count% n\'ont pas été générés (vérifiez votre configuration):',
'failed_scenarios_title' => 'Scénarios échoués:',
'failed_hooks_title' => 'Hooks échoués:',
'failed_steps_title' => 'Etapes échouées:',
'pending_steps_title' => 'Etapes en attente:',
- 'scenarios_count' => '{0} Pas de scénario|{1} 1 scénario|]1,Inf] %1% scénarios',
- 'steps_count' => '{0} Pas d\'étape|{1} 1 étape|]1,Inf] %1% étapes',
- 'passed_count' => '[1,Inf] %1% succès',
- 'failed_count' => '[1,Inf] %1% échecs',
- 'pending_count' => '[1,Inf] %1% en attente',
- 'undefined_count' => '[1,Inf] %1% indéfinis',
- 'skipped_count' => '[1,Inf] %1% ignorés',
+ 'scenarios_count' => '{0} Pas de scénario|{1} 1 scénario|]1,Inf] %count% scénarios',
+ 'steps_count' => '{0} Pas d\'étape|{1} 1 étape|]1,Inf] %count% étapes',
+ 'passed_count' => '[1,Inf] %count% succès',
+ 'failed_count' => '[1,Inf] %count% échecs',
+ 'pending_count' => '[1,Inf] %count% en attente',
+ 'undefined_count' => '[1,Inf] %count% indéfinis',
+ 'skipped_count' => '[1,Inf] %count% ignorés',
+ ),
+ 'hu' => array(
+ 'snippet_context_choice' => '%count% sorozat meghatározatlan lépéseket tartalmaz. Válaszd ki a környezetet kódrészlet készítéséhez:',
+ 'snippet_proposal_title' => '%count% lépései hiányosak. Hozd létre az alábbi kódrészletekkel:',
+ 'snippet_missing_title' => 'Használd a --snippets-for parancssori kapcsolót kódrészletek készítéséhez a %count% sorozat lépéseihez:',
+ 'skipped_scenarios_title' => 'Kihagyott forgatókönyvek:',
+ 'failed_scenarios_title' => 'Sikertelen forgatókönyvek:',
+ 'failed_hooks_title' => 'Sikertelen kampók:',
+ 'failed_steps_title' => 'Sikertelen lépések:',
+ 'pending_steps_title' => 'Elintézendő lépések:',
+ 'scenarios_count' => '{0} Nem volt forgatókönyv|{1} 1 forgatókönyv|]1,Inf] %count% forgatókönyv',
+ 'steps_count' => '{0} Nem volt lépés|{1} 1 lépés|]1,Inf] %count% lépés',
+ 'passed_count' => '[1,Inf] %count% sikeres',
+ 'failed_count' => '[1,Inf] %count% sikertelen',
+ 'pending_count' => '[1,Inf] %count% elintézendő',
+ 'undefined_count' => '[1,Inf] %count% meghatározatlan',
+ 'skipped_count' => '[1,Inf] %count% kihagyott',
),
'it' => array(
- 'snippet_proposal_title' => '%1% ha dei passaggi mancanti. Definiscili con questi snippet:',
- 'snippet_missing_title' => 'Gli snippet per i seguenti passaggi della suite %1% non sono stati generati (verifica la configurazione):',
+ 'snippet_proposal_title' => '%count% ha dei passaggi mancanti. Definiscili con questi snippet:',
+ 'snippet_missing_title' => 'Gli snippet per i seguenti passaggi della suite %count% non sono stati generati (verifica la configurazione):',
'failed_scenarios_title' => 'Scenari falliti:',
'failed_hooks_title' => 'Hook falliti:',
'failed_steps_title' => 'Passaggi falliti:',
'pending_steps_title' => 'Passaggi in sospeso:',
- 'scenarios_count' => '{0} Nessuno scenario|{1} 1 scenario|]1,Inf] %1% scenari',
- 'steps_count' => '{0} Nessun passaggio|{1} 1 passaggio|]1,Inf] %1% passaggi',
- 'passed_count' => '{1} 1 superato|]1,Inf] %1% superati',
- 'failed_count' => '{1} 1 fallito|]1,Inf] %1% falliti',
- 'pending_count' => '[1,Inf] %1% in sospeso',
- 'undefined_count' => '{1} 1 non definito|]1,Inf] %1% non definiti',
- 'skipped_count' => '{1} 1 ignorato|]1,Inf] %1% ignorati',
+ 'scenarios_count' => '{0} Nessuno scenario|{1} 1 scenario|]1,Inf] %count% scenari',
+ 'steps_count' => '{0} Nessun passaggio|{1} 1 passaggio|]1,Inf] %count% passaggi',
+ 'passed_count' => '{1} 1 superato|]1,Inf] %count% superati',
+ 'failed_count' => '{1} 1 fallito|]1,Inf] %count% falliti',
+ 'pending_count' => '[1,Inf] %count% in sospeso',
+ 'undefined_count' => '{1} 1 non definito|]1,Inf] %count% non definiti',
+ 'skipped_count' => '{1} 1 ignorato|]1,Inf] %count% ignorati',
),
'ja' => array(
- 'snippet_proposal_title' => '%1% のステップが見つかりません。 次のスニペットで定義できます:',
- 'snippet_missing_title' => '以下のステップのスニペットは%1%スイートに生成されませんでした(設定を確認してください):',
+ 'snippet_proposal_title' => '%count% のステップが見つかりません。 次のスニペットで定義できます:',
+ 'snippet_missing_title' => '以下のステップのスニペットは%count%スイートに生成されませんでした(設定を確認してください):',
'skipped_scenarios_title' => 'スキップした シナリオ:',
'failed_scenarios_title' => '失敗した シナリオ:',
'failed_hooks_title' => '失敗した フック:',
'failed_steps_title' => '失敗した ステップ:',
'pending_steps_title' => '保留中のステップ:',
- 'scenarios_count' => '{0} No scenarios|{1} 1 個のシナリオ|]1,Inf] %1% 個のシナリオ',
- 'steps_count' => '{0} ステップがありません|{1} 1 個のステップ|]1,Inf] %1% 個のステップ',
- 'passed_count' => '[1,Inf] %1% 個成功',
- 'failed_count' => '[1,Inf] %1% 個失敗',
- 'pending_count' => '[1,Inf] %1% 個保留',
- 'undefined_count' => '[1,Inf] %1% 個未定義',
- 'skipped_count' => '[1,Inf] %1% 個スキップ',
+ 'scenarios_count' => '{0} No scenarios|{1} 1 個のシナリオ|]1,Inf] %count% 個のシナリオ',
+ 'steps_count' => '{0} ステップがありません|{1} 1 個のステップ|]1,Inf] %count% 個のステップ',
+ 'passed_count' => '[1,Inf] %count% 個成功',
+ 'failed_count' => '[1,Inf] %count% 個失敗',
+ 'pending_count' => '[1,Inf] %count% 個保留',
+ 'undefined_count' => '[1,Inf] %count% 個未定義',
+ 'skipped_count' => '[1,Inf] %count% 個スキップ',
+ ),
+ 'ko' => array(
+ 'snippet_proposal_title' => '%1% 정의가 되지 않았습니다. 스니펫을 생성할 컨텍스트를 선택하십시오:',
+ 'snippet_missing_title' => '%1% 단계가 누락되었습니다. 스니펫을 정의해주세요:',
+ 'skipped_scenarios_title' => '건너뛴 시나리오:',
+ 'failed_scenarios_title' => '실패한 시나리오:',
+ 'failed_hooks_title' => '실패한 훅 연결:',
+ 'failed_steps_title' => '실패한 단계:',
+ 'pending_steps_title' => '준비중인 단계:',
+ 'scenarios_count' => '{0} 없는 시나리오들|{1} 1 시나리오|]1,Inf] %1% 시나리오들',
+ 'steps_count' => '{0} 없는 단계들|{1} 1 단계|]1,Inf] %1% 단계들',
+ 'passed_count' => '[1,Inf] %1% 통과',
+ 'failed_count' => '[1,Inf] %1% 실패',
+ 'pending_count' => '[1,Inf] %1% 준비중',
+ 'undefined_count' => '[1,Inf] %1% 정의되지 않았습니다.',
+ 'skipped_count' => '[1,Inf] %1% 건너뜀',
),
'nl' => array(
- 'snippet_proposal_title' => 'Ontbrekende stappen in %1%. Definieer ze met de volgende fragmenten:',
- 'snippet_missing_title' => 'Fragmenten voor de volgende stappen in de %1% suite werden niet gegenereerd (controleer de configuratie):',
+ 'snippet_proposal_title' => 'Ontbrekende stappen in %count%. Definieer ze met de volgende fragmenten:',
+ 'snippet_missing_title' => 'Fragmenten voor de volgende stappen in de %count% suite werden niet gegenereerd (controleer de configuratie):',
'failed_scenarios_title' => 'Gefaalde scenario\'s:',
'failed_hooks_title' => 'Gefaalde hooks:',
'failed_steps_title' => 'Gefaalde stappen:',
'pending_steps_title' => 'Onafgewerkte stappen:',
- 'scenarios_count' => '{0} Geen scenario\'s|{1} 1 scenario|]1,Inf] %1% scenario\'s',
- 'steps_count' => '{0} Geen stappen|{1} 1 stap|]1,Inf] %1% stappen',
- 'passed_count' => '[1,Inf] %1% geslaagd',
- 'failed_count' => '[1,Inf] %1% gefaald',
- 'pending_count' => '[1,Inf] %1% wachtende',
- 'undefined_count' => '[1,Inf] %1% niet gedefinieerd',
- 'skipped_count' => '[1,Inf] %1% overgeslagen',
+ 'scenarios_count' => '{0} Geen scenario\'s|{1} 1 scenario|]1,Inf] %count% scenario\'s',
+ 'steps_count' => '{0} Geen stappen|{1} 1 stap|]1,Inf] %count% stappen',
+ 'passed_count' => '[1,Inf] %count% geslaagd',
+ 'failed_count' => '[1,Inf] %count% gefaald',
+ 'pending_count' => '[1,Inf] %count% wachtende',
+ 'undefined_count' => '[1,Inf] %count% niet gedefinieerd',
+ 'skipped_count' => '[1,Inf] %count% overgeslagen',
),
'no' => array(
- 'snippet_proposal_title' => '%1% mangler steg. Definer dem med disse snuttene:',
- 'snippet_missing_title' => 'Snutter for de følgende stegene i %1%-samlingen ble ikke laget. (Sjekk konfigurasjonen din.):',
+ 'snippet_proposal_title' => '%count% mangler steg. Definer dem med disse snuttene:',
+ 'snippet_missing_title' => 'Snutter for de følgende stegene i %count%-samlingen ble ikke laget. (Sjekk konfigurasjonen din.):',
'failed_scenarios_title' => 'Feilende scenarier:',
'failed_hooks_title' => 'Feilende hooks:',
'failed_steps_title' => 'Feilende steg:',
'pending_steps_title' => 'Ikke implementerte steg:',
- 'scenarios_count' => '{0} Ingen scenarier|{1} 1 scenario|]1,Inf] %1% scenarier',
- 'steps_count' => '{0} Ingen steg|{1} 1 steg|]1,Inf] %1% steg',
- 'passed_count' => '[1,Inf] %1% ok',
- 'failed_count' => '[1,Inf] %1% feilet',
- 'pending_count' => '[1,Inf] %1% ikke implementert',
- 'undefined_count' => '[1,Inf] %1% ikke definert',
- 'skipped_count' => '[1,Inf] %1% hoppet over',
+ 'scenarios_count' => '{0} Ingen scenarier|{1} 1 scenario|]1,Inf] %count% scenarier',
+ 'steps_count' => '{0} Ingen steg|{1} 1 steg|]1,Inf] %count% steg',
+ 'passed_count' => '[1,Inf] %count% ok',
+ 'failed_count' => '[1,Inf] %count% feilet',
+ 'pending_count' => '[1,Inf] %count% ikke implementert',
+ 'undefined_count' => '[1,Inf] %count% ikke definert',
+ 'skipped_count' => '[1,Inf] %count% hoppet over',
),
'pl' => array(
- 'snippet_proposal_title' => '%1% zawiera brakujące kroki. Utwórz je korzystając z tych fragmentów kodu:',
- 'snippet_missing_title' => 'Fragmenty kodu dla następujących kroków %1% nie zostały wygenerowane (sprawdź swoją konfigurację):',
+ 'snippet_proposal_title' => '%count% zawiera brakujące kroki. Utwórz je korzystając z tych fragmentów kodu:',
+ 'snippet_missing_title' => 'Fragmenty kodu dla następujących kroków %count% nie zostały wygenerowane (sprawdź swoją konfigurację):',
'failed_scenarios_title' => 'Nieudane scenariusze:',
'failed_hooks_title' => 'Nieudane hooki:',
'failed_steps_title' => 'Nieudane kroki',
'pending_steps_title' => 'Oczekujące kroki',
- 'scenarios_count' => '{0} Brak scenariuszy|{1} 1 scenariusz|{2,3,4,22,23,24,32,33,34,42,43,44} %1% scenariusze|]4,Inf] %1% scenariuszy',
- 'steps_count' => '{0} Brak kroków|{1} 1 krok|{2,3,4,22,23,24,32,33,34,42,43,44} %1% kroki|]4,Inf] %1% kroków',
- 'passed_count' => '{1} %1% udany|{2,3,4,22,23,24,32,33,34,42,43,44} %1% udane|]4,Inf] %1% udanych',
- 'failed_count' => '{1} %1% nieudany|{2,3,4,22,23,24,32,33,34,42,43,44} %1% nieudane|]4,Inf] %1% nieudanych',
- 'pending_count' => '{1} %1% oczekujący|{2,3,4,22,23,24,32,33,34,42,43,44} %1% oczekujące|]4,Inf] %1% oczekujących',
- 'undefined_count' => '{1} %1% niezdefiniowany|{2,3,4,22,23,24,32,33,34,42,43,44} %1% niezdefiniowane|]4,Inf] %1% niezdefiniowanych',
- 'skipped_count' => '{1} %1% pominięty|{2,3,4,22,23,24,32,33,34,42,43,44} %1% pominięte|]4,Inf] %1% pominiętych',
+ 'scenarios_count' => '{0} Brak scenariuszy|{1} 1 scenariusz|{2,3,4,22,23,24,32,33,34,42,43,44} %count% scenariusze|]4,Inf] %count% scenariuszy',
+ 'steps_count' => '{0} Brak kroków|{1} 1 krok|{2,3,4,22,23,24,32,33,34,42,43,44} %count% kroki|]4,Inf] %count% kroków',
+ 'passed_count' => '{1} %count% udany|{2,3,4,22,23,24,32,33,34,42,43,44} %count% udane|]4,Inf] %count% udanych',
+ 'failed_count' => '{1} %count% nieudany|{2,3,4,22,23,24,32,33,34,42,43,44} %count% nieudane|]4,Inf] %count% nieudanych',
+ 'pending_count' => '{1} %count% oczekujący|{2,3,4,22,23,24,32,33,34,42,43,44} %count% oczekujące|]4,Inf] %count% oczekujących',
+ 'undefined_count' => '{1} %count% niezdefiniowany|{2,3,4,22,23,24,32,33,34,42,43,44} %count% niezdefiniowane|]4,Inf] %count% niezdefiniowanych',
+ 'skipped_count' => '{1} %count% pominięty|{2,3,4,22,23,24,32,33,34,42,43,44} %count% pominięte|]4,Inf] %count% pominiętych',
),
'pt' => array(
- 'snippet_proposal_title' => '%1% contém definições em falta. Defina-as com estes exemplos:',
- 'snippet_missing_title' => 'Os exemplos para as seguintes definições da suite %1% não foram gerados (verifique a configuração):',
+ 'snippet_proposal_title' => '%count% contém definições em falta. Defina-as com estes exemplos:',
+ 'snippet_missing_title' => 'Os exemplos para as seguintes definições da suite %count% não foram gerados (verifique a configuração):',
'failed_scenarios_title' => 'Cenários que falharam:',
'failed_hooks_title' => 'Hooks que falharam:',
'failed_steps_title' => 'Definições que falharam:',
'pending_steps_title' => 'Definições por definir:',
- 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %1% cenários',
- 'steps_count' => '{0} Nenhuma definição|{1} 1 definição|]1,Inf] %1% definições',
- 'passed_count' => '{1} passou|]1,Inf] %1% passaram',
- 'failed_count' => '{1} falhou|]1,Inf] %1% falharam',
- 'pending_count' => '[1,Inf] %1% por definir',
- 'undefined_count' => '{1} indefinido|]1,Inf] %1% indefinidos',
- 'skipped_count' => '{1} omitido|]1,Inf] %1% omitidos',
+ 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %count% cenários',
+ 'steps_count' => '{0} Nenhuma definição|{1} 1 definição|]1,Inf] %count% definições',
+ 'passed_count' => '{1} passou|]1,Inf] %count% passaram',
+ 'failed_count' => '{1} falhou|]1,Inf] %count% falharam',
+ 'pending_count' => '[1,Inf] %count% por definir',
+ 'undefined_count' => '{1} indefinido|]1,Inf] %count% indefinidos',
+ 'skipped_count' => '{1} omitido|]1,Inf] %count% omitidos',
),
'pt-BR' => array(
- 'snippet_proposal_title' => '%1% possue etapas faltando. Defina elas com esse(s) trecho(s) de código:',
- 'snippet_missing_title' => 'Trecho de códigos para as seguintes etapas em %1% suite não foram geradas (verique sua configuração):',
+ 'snippet_proposal_title' => '%count% possue etapas faltando. Defina elas com esse(s) trecho(s) de código:',
+ 'snippet_missing_title' => 'Trecho de códigos para as seguintes etapas em %count% suite não foram geradas (verique sua configuração):',
'failed_scenarios_title' => 'Cenários falhados:',
'failed_hooks_title' => 'Hooks falhados:',
'failed_steps_title' => 'Etapas falhadas:',
'pending_steps_title' => 'Etapas pendentes:',
- 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %1% cenários',
- 'steps_count' => '{0} Nenhuma etapa|{1} 1 etapa|]1,Inf] %1% etapas',
- 'passed_count' => '[1,Inf] %1% passou',
- 'failed_count' => '[1,Inf] %1% falhou',
- 'pending_count' => '[1,Inf] %1% pendente',
- 'undefined_count' => '[1,Inf] %1% indefinido',
- 'skipped_count' => '[1,Inf] %1% pulado',
+ 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %count% cenários',
+ 'steps_count' => '{0} Nenhuma etapa|{1} 1 etapa|]1,Inf] %count% etapas',
+ 'passed_count' => '[1,Inf] %count% passou',
+ 'failed_count' => '[1,Inf] %count% falhou',
+ 'pending_count' => '[1,Inf] %count% pendente',
+ 'undefined_count' => '[1,Inf] %count% indefinido',
+ 'skipped_count' => '[1,Inf] %count% pulado',
),
'ro' => array(
- 'snippet_proposal_title' => '%1% are pași lipsa. Puteți implementa pașii cu ajutorul acestor fragmente de cod:',
- 'snippet_missing_title' => 'Fragmentele de cod pentru urmatorii pași din suita %1% nu au fost generate (contextul tau implementeaza interfata SnippetAcceptingContext?):',
+ 'snippet_proposal_title' => '%count% are pași lipsa. Puteți implementa pașii cu ajutorul acestor fragmente de cod:',
+ 'snippet_missing_title' => 'Fragmentele de cod pentru urmatorii pași din suita %count% nu au fost generate (contextul tau implementeaza interfata SnippetAcceptingContext?):',
'skipped_scenarios_title' => 'Scenarii omise:',
'failed_scenarios_title' => 'Scenarii eșuate:',
'failed_hooks_title' => 'Hook-uri eșuate:',
'failed_steps_title' => 'Pași esuați:',
'pending_steps_title' => 'Pași in așteptare:',
- 'scenarios_count' => '{0} Niciun scenariu|{1} 1 scenariu|]1,Inf] %1% scenarii',
- 'steps_count' => '{0} Niciun pas|{1} 1 pas|]1,Inf] %1% pasi',
- 'passed_count' => '[1,Inf] %1% cu succes',
- 'failed_count' => '[1,Inf] %1% fara success',
- 'pending_count' => '[1,Inf] %1% in așteptare',
- 'undefined_count' => '[1,Inf] %1% fara implementare',
- 'skipped_count' => '{1} %1% omis|]1,Inf] %1% omiși',
+ 'scenarios_count' => '{0} Niciun scenariu|{1} 1 scenariu|]1,Inf] %count% scenarii',
+ 'steps_count' => '{0} Niciun pas|{1} 1 pas|]1,Inf] %count% pasi',
+ 'passed_count' => '[1,Inf] %count% cu succes',
+ 'failed_count' => '[1,Inf] %count% fara success',
+ 'pending_count' => '[1,Inf] %count% in așteptare',
+ 'undefined_count' => '[1,Inf] %count% fara implementare',
+ 'skipped_count' => '{1} %count% omis|]1,Inf] %count% omiși',
),
'ru' => array(
- 'snippet_proposal_title' => '%1% не содержит необходимых определений. Вы можете добавить их используя шаблоны:',
- 'snippet_missing_title' => 'Шаблоны для следующих шагов в среде %1% не были сгенерированы (проверьте ваши настройки):',
+ 'snippet_proposal_title' => '%count% не содержит необходимых определений. Вы можете добавить их используя шаблоны:',
+ 'snippet_missing_title' => 'Шаблоны для следующих шагов в среде %count% не были сгенерированы (проверьте ваши настройки):',
'skipped_scenarios_title' => 'Пропущенные сценарии:',
'failed_scenarios_title' => 'Проваленные сценарии:',
'failed_hooks_title' => 'Проваленные хуки:',
'failed_steps_title' => 'Проваленные шаги:',
'pending_steps_title' => 'Шаги в ожидании:',
- 'scenarios_count' => '{0} Нет сценариев|{1,21,31} %1% сценарий|{2,3,4,22,23,24} %1% сценария|]4,Inf] %1% сценариев',
- 'steps_count' => '{0} Нет шагов|{1,21,31} %1% шаг|{2,3,4,22,23,24} %1% шага|]4,Inf] %1% шагов',
- 'passed_count' => '{1,21,31} %1% пройден|]1,Inf] %1% пройдено',
- 'failed_count' => '{1,21,31} %1% провален|]1,Inf] %1% провалено',
- 'pending_count' => '[1,Inf] %1% в ожидании',
- 'undefined_count' => '{1,21,31} %1% не определен|]1,Inf] %1% не определено',
- 'skipped_count' => '{1,21,31} %1% пропущен|]1,Inf] %1% пропущено',
+ 'scenarios_count' => '{0} Нет сценариев|{1,21,31} %count% сценарий|{2,3,4,22,23,24} %count% сценария|]4,Inf] %count% сценариев',
+ 'steps_count' => '{0} Нет шагов|{1,21,31} %count% шаг|{2,3,4,22,23,24} %count% шага|]4,Inf] %count% шагов',
+ 'passed_count' => '{1,21,31} %count% пройден|]1,Inf] %count% пройдено',
+ 'failed_count' => '{1,21,31} %count% провален|]1,Inf] %count% провалено',
+ 'pending_count' => '[1,Inf] %count% в ожидании',
+ 'undefined_count' => '{1,21,31} %count% не определен|]1,Inf] %count% не определено',
+ 'skipped_count' => '{1,21,31} %count% пропущен|]1,Inf] %count% пропущено',
),
);
diff --git a/tests/integration/vendor/behat/behat/psalm.xml b/tests/integration/vendor/behat/behat/psalm.xml
new file mode 100644
index 000000000..99f6bdb8d
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/psalm.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php
index 22bf764ce..df699077e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php
@@ -46,7 +46,7 @@
*/
final class ApplicationFactory extends BaseFactory
{
- const VERSION = '3.3.0';
+ public const VERSION = '3.8.1';
/**
* {@inheritdoc}
@@ -110,19 +110,23 @@ protected function getEnvironmentVariableName()
*/
protected function getConfigPath()
{
- $cwd = rtrim(getcwd(), DIRECTORY_SEPARATOR);
- $paths = array_filter(
- array(
- $cwd . DIRECTORY_SEPARATOR . 'behat.yml',
- $cwd . DIRECTORY_SEPARATOR . 'behat.yml.dist',
- $cwd . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'behat.yml',
- $cwd . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'behat.yml.dist',
- ),
- 'is_file'
+ $cwd = rtrim(getcwd(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
+ $configDir = $cwd . 'config' . DIRECTORY_SEPARATOR;
+ $paths = array(
+ $cwd . 'behat.yaml',
+ $cwd . 'behat.yml',
+ $cwd . 'behat.yaml.dist',
+ $cwd . 'behat.yml.dist',
+ $configDir . 'behat.yaml',
+ $configDir . 'behat.yml',
+ $configDir . 'behat.yaml.dist',
+ $configDir . 'behat.yml.dist',
);
- if (count($paths)) {
- return current($paths);
+ foreach ($paths as $path) {
+ if (is_file($path)) {
+ return $path;
+ }
}
return null;
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Annotation/DocBlockHelper.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Annotation/DocBlockHelper.php
new file mode 100644
index 000000000..6b4d4ae53
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Annotation/DocBlockHelper.php
@@ -0,0 +1,42 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Context\Annotation;
+
+/**
+ * Helper class for DocBlock parsing
+ */
+class DocBlockHelper
+{
+ /**
+ * Extracts a description from the provided docblock,
+ * with support for multiline descriptions.
+ */
+ public function extractDescription(string $docBlock): string
+ {
+ // Remove indentation
+ $description = preg_replace('/^[\s\t]*/m', '', $docBlock);
+
+ // Remove block comment syntax
+ $description = preg_replace('/^\/\*\*\s*|^\s*\*\s|^\s*\*\/$/m', '', $description);
+
+ // Remove annotations
+ $description = preg_replace('/^@.*$/m', '', $description);
+
+ // Ignore docs after a "--" separator
+ if (preg_match('/^--.*$/m', $description)) {
+ $descriptionParts = preg_split('/^--.*$/m', $description);
+ $description = array_shift($descriptionParts);
+ }
+
+ // Trim leading and trailing newlines
+ return trim($description, "\r\n");
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/ArgumentResolverFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/ArgumentResolverFactory.php
new file mode 100644
index 000000000..708c38bc7
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/ArgumentResolverFactory.php
@@ -0,0 +1,32 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Context\Argument;
+
+use Behat\Testwork\Environment\Environment;
+
+/**
+ * Creates argument resolvers for provided environment.
+ *
+ * @see ContextEnvironmentHandler
+ *
+ * @author Konstantin Kudryashov
+ */
+interface ArgumentResolverFactory
+{
+ /**
+ * Builds argument resolvers for provided suite.
+ *
+ * @param Environment $environment
+ *
+ * @return ArgumentResolver[]
+ */
+ public function createArgumentResolvers(Environment $environment);
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeArgumentResolverFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeArgumentResolverFactory.php
new file mode 100644
index 000000000..fbfd69c83
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeArgumentResolverFactory.php
@@ -0,0 +1,52 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Context\Argument;
+
+use Behat\Testwork\Environment\Environment;
+
+/**
+ * Composite factory. Delegates to other (registered) factories to do the job.
+ *
+ * @see ContextEnvironmentHandler
+ *
+ * @author Konstantin Kudryashov
+ */
+final class CompositeArgumentResolverFactory implements ArgumentResolverFactory
+{
+ /**
+ * @var ArgumentResolverFactory[]
+ */
+ private $factories = array();
+
+ /**
+ * Registers factory.
+ *
+ * @param ArgumentResolverFactory $factory
+ */
+ public function registerFactory(ArgumentResolverFactory $factory)
+ {
+ $this->factories[] = $factory;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function createArgumentResolvers(Environment $environment)
+ {
+ return array_reduce(
+ $this->factories,
+ function (array $resolvers, ArgumentResolverFactory $factory) use ($environment) {
+ return array_merge($resolvers, $factory->createArgumentResolvers($environment));
+ },
+ array()
+ );
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeFactory.php
index 822896c8a..5b3d93f84 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/CompositeFactory.php
@@ -18,6 +18,8 @@
* @see ContextEnvironmentHandler
*
* @author Konstantin Kudryashov
+ *
+ * @deprecated and will be removed in 4.0. Use CompositeArgumentResolverFactory instead
*/
final class CompositeFactory implements SuiteScopedResolverFactory
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/NullFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/NullFactory.php
index 6265cc4c2..c2e070c40 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/NullFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/NullFactory.php
@@ -10,6 +10,7 @@
namespace Behat\Behat\Context\Argument;
+use Behat\Testwork\Environment\Environment;
use Behat\Testwork\Suite\Suite;
/**
@@ -19,7 +20,7 @@
*
* @author Konstantin Kudryashov
*/
-final class NullFactory implements SuiteScopedResolverFactory
+final class NullFactory implements ArgumentResolverFactory, SuiteScopedResolverFactory
{
/**
* {@inheritdoc}
@@ -28,4 +29,12 @@ public function generateArgumentResolvers(Suite $suite)
{
return array();
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function createArgumentResolvers(Environment $environment)
+ {
+ return array();
+ }
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactory.php
index 60d858826..9f953fc2d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactory.php
@@ -18,6 +18,8 @@
* @see ContextEnvironmentHandler
*
* @author Konstantin Kudryashov
+ *
+ * @deprecated since 3.4. Use `ArgumentResolverFactory` instead
*/
interface SuiteScopedResolverFactory
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactoryAdapter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactoryAdapter.php
new file mode 100644
index 000000000..2317c8eb6
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Argument/SuiteScopedResolverFactoryAdapter.php
@@ -0,0 +1,48 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Context\Argument;
+
+use Behat\Testwork\Environment\Environment;
+
+/**
+ * Adapts SuiteScopedResolverFactory to new ArgumentResolverFactory interface.
+ *
+ * @see ContextEnvironmentHandler
+ *
+ * @author Konstantin Kudryashov
+ *
+ * @deprecated since 3.4. Use `ArgumentResolverFactory` instead
+ */
+final class SuiteScopedResolverFactoryAdapter implements ArgumentResolverFactory
+{
+ /**
+ * @var SuiteScopedResolverFactory
+ */
+ private $factory;
+
+ /**
+ * Initialises adapter.
+ *
+ * @param SuiteScopedResolverFactory $factory
+ */
+ public function __construct(SuiteScopedResolverFactory $factory)
+ {
+ $this->factory = $factory;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function createArgumentResolvers(Environment $environment)
+ {
+ return $this->factory->generateArgumentResolvers($environment->getSuite());
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Attribute/AttributeReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Attribute/AttributeReader.php
new file mode 100644
index 000000000..bd15dff7a
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Attribute/AttributeReader.php
@@ -0,0 +1,33 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Context\Attribute;
+
+use ReflectionMethod;
+
+/**
+ * Reads Attributes of a provided context method into a Callee.
+ *
+ * @see AttributeContextReader
+ *
+ * @author Konstantin Kudryashov
+ */
+interface AttributeReader
+{
+ /**
+ * Reads all callees associated with a provided method.
+ *
+ * @param string $contextClass
+ * @param ReflectionMethod $method
+ *
+ * @return array
+ */
+ public function readCallees(string $contextClass, ReflectionMethod $method);
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/ContextSnippetsController.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/ContextSnippetsController.php
index 3a6edf63c..3bfbc40bd 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/ContextSnippetsController.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/ContextSnippetsController.php
@@ -17,12 +17,12 @@
use Behat\Behat\Context\Snippet\Generator\FixedContextIdentifier;
use Behat\Behat\Context\Snippet\Generator\FixedPatternIdentifier;
use Behat\Behat\Context\Snippet\Generator\AggregateContextIdentifier;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Testwork\Cli\Controller;
use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Configures which context snippets are generated for.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/InteractiveContextIdentifier.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/InteractiveContextIdentifier.php
index c39488ae6..78be23b6d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/InteractiveContextIdentifier.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Cli/InteractiveContextIdentifier.php
@@ -12,11 +12,11 @@
use Behat\Behat\Context\Environment\ContextEnvironment;
use Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Interactive identifier that asks user for input.
@@ -51,13 +51,13 @@ public function __construct(TranslatorInterface $translator, InputInterface $inp
$this->input = $input;
$this->output = $output;
}
-
+
/**
* {@inheritdoc}
*/
public function guessTargetContextClass(ContextEnvironment $environment)
{
- if ($this->interactionIsNotSupported()) {
+ if (!$this->input->isInteractive()) {
return null;
}
@@ -68,9 +68,9 @@ public function guessTargetContextClass(ContextEnvironment $environment)
return null;
}
- $message = $this->translator->trans('snippet_context_choice', array('%1%' => $suiteName), 'output');
+ $message = $this->translator->trans('snippet_context_choice', array('%count%' => $suiteName), 'output');
$choices = array_values(array_merge(array('None'), $contextClasses));
- $default = current($contextClasses);
+ $default = 1;
$answer = $this->askQuestion('>> ' . $message, $choices, $default);
@@ -94,21 +94,4 @@ private function askQuestion($message, $choices, $default)
return $helper->ask($this->input, $this->output, $question);
}
-
- /**
- * Checks if interactive mode is supported.
- *
- * @return Boolean
- *
- * @deprecated there is a better way to do it - `InputInterface::isInteractive()` method.
- * Sadly, this doesn't work properly prior Symfony\Console 2.7 and as we need
- * to support 2.5+ until the next major, we are forced to do a more explicit
- * check for the CLI option. This should be reverted back to proper a
- * `InputInterface::isInteractive()` call as soon as we bump dependencies
- * to Symfony\Console 3.x in Behat 4.x.
- */
- private function interactionIsNotSupported()
- {
- return $this->input->hasParameterOption('--no-interaction');
- }
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassGenerator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassGenerator.php
index d2a740926..0a7cb5e19 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassGenerator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassGenerator.php
@@ -28,7 +28,7 @@ interface ClassGenerator
* @param Suite $suite
* @param string $contextClass
*
- * @return Boolean
+ * @return bool
*/
public function supportsSuiteAndClass(Suite $suite, $contextClass);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassResolver.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassResolver.php
index 464f68f41..dce0f8049 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassResolver.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextClass/ClassResolver.php
@@ -26,7 +26,7 @@ interface ClassResolver
*
* @param string $contextString
*
- * @return Boolean
+ * @return bool
*/
public function supportsClass($contextString);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextFactory.php
index ff255d19c..0d226504d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ContextFactory.php
@@ -10,6 +10,7 @@
namespace Behat\Behat\Context;
+use Behat\Testwork\Argument\Validator;
use Behat\Behat\Context\Argument\ArgumentResolver;
use Behat\Behat\Context\Initializer\ContextInitializer;
use Behat\Testwork\Argument\ArgumentOrganiser;
@@ -34,6 +35,10 @@ final class ContextFactory
* @var ContextInitializer[]
*/
private $contextInitializers = array();
+ /**
+ * @var Validator
+ */
+ private $validator;
/**
* Initialises factory.
@@ -43,6 +48,7 @@ final class ContextFactory
public function __construct(ArgumentOrganiser $argumentOrganiser)
{
$this->argumentOrganiser = $argumentOrganiser;
+ $this->validator = new Validator();
}
/**
@@ -96,17 +102,21 @@ public function createContext($class, array $arguments = array(), array $singleU
*/
private function resolveArguments(ReflectionClass $reflection, array $arguments, array $resolvers)
{
+ $newArguments = $arguments;
+
foreach ($resolvers as $resolver) {
- $arguments = $resolver->resolveArguments($reflection, $arguments);
+ $newArguments = $resolver->resolveArguments($reflection, $newArguments);
}
- if (!$reflection->hasMethod('__construct') || !count($arguments)) {
- return $arguments;
+ if (!$reflection->hasMethod('__construct')) {
+ return $newArguments;
}
$constructor = $reflection->getConstructor();
+ $newArguments = $this->argumentOrganiser->organiseArguments($constructor, $newArguments);
+ $this->validator->validateArguments($constructor, $newArguments);
- return $this->argumentOrganiser->organiseArguments($constructor, $arguments);
+ return $newArguments;
}
/**
@@ -120,7 +130,7 @@ private function resolveArguments(ReflectionClass $reflection, array $arguments,
private function createInstance(ReflectionClass $reflection, array $arguments)
{
if (count($arguments)) {
- return $reflection->newInstanceArgs($arguments);
+ return $reflection->newInstanceArgs(array_values($arguments));
}
return $reflection->newInstance();
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php
index 690eebb28..44bcf29b8 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php
@@ -25,7 +25,7 @@ interface ContextEnvironment extends Environment
/**
* Checks if environment has any contexts registered.
*
- * @return Boolean
+ * @return bool
*/
public function hasContexts();
@@ -41,7 +41,7 @@ public function getContextClasses();
*
* @param string $class
*
- * @return Boolean
+ * @return bool
*/
public function hasContextClass($class);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/Handler/ContextEnvironmentHandler.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/Handler/ContextEnvironmentHandler.php
index d5c3a0fce..d686400dd 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/Handler/ContextEnvironmentHandler.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/Handler/ContextEnvironmentHandler.php
@@ -11,6 +11,8 @@
namespace Behat\Behat\Context\Environment\Handler;
use Behat\Behat\Context\Argument\SuiteScopedResolverFactory;
+use Behat\Behat\Context\Argument\SuiteScopedResolverFactoryAdapter;
+use Behat\Behat\Context\Argument\ArgumentResolverFactory;
use Behat\Behat\Context\Argument\NullFactory;
use Behat\Behat\Context\ContextClass\ClassResolver;
use Behat\Behat\Context\ContextFactory;
@@ -36,7 +38,7 @@ final class ContextEnvironmentHandler implements EnvironmentHandler
*/
private $contextFactory;
/**
- * @var SuiteScopedResolverFactory
+ * @var ArgumentResolverFactory
*/
private $resolverFactory;
/**
@@ -47,12 +49,17 @@ final class ContextEnvironmentHandler implements EnvironmentHandler
/**
* Initializes handler.
*
- * @param ContextFactory $factory
- * @param SuiteScopedResolverFactory $resolverFactory
+ * @param ContextFactory $factory
+ * @param ArgumentResolverFactory|SuiteScopedResolverFactory $resolverFactory
*/
- public function __construct(ContextFactory $factory, SuiteScopedResolverFactory $resolverFactory = null)
+ public function __construct(ContextFactory $factory, $resolverFactory = null)
{
$this->contextFactory = $factory;
+
+ if ($resolverFactory && !$resolverFactory instanceof ArgumentResolverFactory) {
+ $resolverFactory = new SuiteScopedResolverFactoryAdapter($resolverFactory);
+ }
+
$this->resolverFactory = $resolverFactory ?: new NullFactory();
}
@@ -108,7 +115,7 @@ public function isolateEnvironment(Environment $uninitializedEnvironment, $testS
}
$environment = new InitializedContextEnvironment($uninitializedEnvironment->getSuite());
- $resolvers = $this->resolverFactory->generateArgumentResolvers($uninitializedEnvironment->getSuite());
+ $resolvers = $this->resolverFactory->createArgumentResolvers($environment);
foreach ($uninitializedEnvironment->getContextClassesWithArguments() as $class => $arguments) {
$context = $this->contextFactory->createContext($class, $arguments, $resolvers);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php
index c26826ecf..053354963 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php
@@ -13,8 +13,10 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Context\Environment\Handler\ContextEnvironmentHandler;
use Behat\Behat\Context\Exception\ContextNotFoundException;
+use Behat\Behat\HelperContainer\Environment\ServiceContainerEnvironment;
use Behat\Testwork\Call\Callee;
use Behat\Testwork\Suite\Suite;
+use Psr\Container\ContainerInterface;
/**
* Context environment based on a list of instantiated context objects.
@@ -23,12 +25,16 @@
*
* @author Konstantin Kudryashov
*/
-final class InitializedContextEnvironment implements ContextEnvironment
+final class InitializedContextEnvironment implements ContextEnvironment, ServiceContainerEnvironment
{
/**
* @var string
*/
private $suite;
+ /**
+ * @var ContainerInterface
+ */
+ private $serviceContainer;
/**
* @var Context[]
*/
@@ -54,6 +60,14 @@ public function registerContext(Context $context)
$this->contexts[get_class($context)] = $context;
}
+ /**
+ * {@inheritdoc}
+ */
+ public function setServiceContainer(ContainerInterface $container = null)
+ {
+ $this->serviceContainer = $container;
+ }
+
/**
* {@inheritdoc}
*/
@@ -117,6 +131,14 @@ public function getContext($class)
return $this->contexts[$class];
}
+ /**
+ * {@inheritdoc}
+ */
+ public function getServiceContainer()
+ {
+ return $this->serviceContainer;
+ }
+
/**
* {@inheritdoc}
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AnnotatedContextReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AnnotatedContextReader.php
index a3144740e..6fe0b0751 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AnnotatedContextReader.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AnnotatedContextReader.php
@@ -11,6 +11,7 @@
namespace Behat\Behat\Context\Reader;
use Behat\Behat\Context\Annotation\AnnotationReader;
+use Behat\Behat\Context\Annotation\DocBlockHelper;
use Behat\Behat\Context\Environment\ContextEnvironment;
use Behat\Testwork\Call\Callee;
use ReflectionClass;
@@ -24,7 +25,7 @@
*/
final class AnnotatedContextReader implements ContextReader
{
- const DOCLINE_TRIMMER_REGEX = '/^\/\*\*\s*|^\s*\*\s*|\s*\*\/$|\s*$/';
+ public const DOCLINE_TRIMMER_REGEX = '/^\/\*\*\s*|^\s*\*\s*|\s*\*\/$|\s*$/';
/**
* @var string[]
@@ -42,6 +43,21 @@ final class AnnotatedContextReader implements ContextReader
*/
private $readers = array();
+ /**
+ * @var DocBlockHelper
+ */
+ private $docBlockHelper;
+
+ /**
+ * Initializes reader.
+ *
+ * @param DocBlockHelper $docBlockHelper
+ */
+ public function __construct(DocBlockHelper $docBlockHelper)
+ {
+ $this->docBlockHelper = $docBlockHelper;
+ }
+
/**
* Registers annotation reader.
*
@@ -110,7 +126,7 @@ private function readMethodCallees($class, ReflectionMethod $method)
private function readDocBlockCallees($class, ReflectionMethod $method, $docBlock)
{
$callees = array();
- $description = $this->readDescription($docBlock);
+ $description = $this->docBlockHelper->extractDescription($docBlock);
$docBlock = $this->mergeMultilines($docBlock);
foreach (explode("\n", $docBlock) as $docLine) {
@@ -144,43 +160,12 @@ private function mergeMultilines($docBlock)
return preg_replace("#\\\\$\s*+\*\s*+([^\\\\$]++)#m", '$1', $docBlock);
}
- /**
- * Extracts a description from the provided docblock,
- * with support for multiline descriptions.
- *
- * @param string $docBlock
- *
- * @return string
- */
- private function readDescription($docBlock)
- {
- // Remove indentation
- $description = preg_replace('/^[\s\t]*/m', '', $docBlock);
-
- // Remove block comment syntax
- $description = preg_replace('/^\/\*\*\s*|^\s*\*\s|^\s*\*\/$/m', '', $description);
-
- // Remove annotations
- $description = preg_replace('/^@.*$/m', '', $description);
-
- // Ignore docs after a "--" separator
- if (preg_match('/^--.*$/m', $description)) {
- $descriptionParts = preg_split('/^--.*$/m', $description);
- $description = array_shift($descriptionParts);
- }
-
- // Trim leading and trailing newlines
- $description = trim($description, "\r\n");
-
- return $description;
- }
-
/**
* Checks if provided doc lien is empty.
*
* @param string $docLine
*
- * @return Boolean
+ * @return bool
*/
private function isEmpty($docLine)
{
@@ -192,7 +177,7 @@ private function isEmpty($docLine)
*
* @param string $docLine
*
- * @return Boolean
+ * @return bool
*/
private function isNotAnnotation($docLine)
{
@@ -229,7 +214,7 @@ private function readDocLineCallee($class, ReflectionMethod $method, $docLine, $
*
* @param string $docLine
*
- * @return Boolean
+ * @return bool
*/
private function isIgnoredAnnotation($docLine)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AttributeContextReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AttributeContextReader.php
new file mode 100644
index 000000000..0db164319
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Reader/AttributeContextReader.php
@@ -0,0 +1,70 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Context\Reader;
+
+use Behat\Behat\Context\Attribute\AttributeReader;
+use Behat\Behat\Context\Environment\ContextEnvironment;
+use ReflectionClass;
+use ReflectionMethod;
+
+/**
+ * Reads context callees by Attributes using registered Attribute readers.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class AttributeContextReader implements ContextReader
+{
+ /**
+ * @var AttributeReader[]
+ */
+ private $readers = array();
+
+ /**
+ * Registers attribute reader.
+ *
+ * @param AttributeReader $reader
+ */
+ public function registerAttributeReader(AttributeReader $reader)
+ {
+ $this->readers[] = $reader;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function readContextCallees(ContextEnvironment $environment, $contextClass)
+ {
+ if (\PHP_MAJOR_VERSION < 8) {
+ return [];
+ }
+
+ $reflection = new ReflectionClass($contextClass);
+
+ $callees = array();
+ foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
+ foreach ($this->readMethodCallees($reflection->getName(), $method) as $callee) {
+ $callees[] = $callee;
+ }
+ }
+
+ return $callees;
+ }
+
+ private function readMethodCallees(string $contextClass, ReflectionMethod $method)
+ {
+ $callees = [];
+ foreach ($this->readers as $reader) {
+ $callees = array_merge($callees, $reader->readCallees($contextClass, $method));
+ }
+
+ return $callees;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ServiceContainer/ContextExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ServiceContainer/ContextExtension.php
index de3f35248..1ae669fac 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ServiceContainer/ContextExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/ServiceContainer/ContextExtension.php
@@ -39,20 +39,27 @@ final class ContextExtension implements Extension
/**
* Available services
*/
- const FACTORY_ID = 'context.factory';
- const CONTEXT_SNIPPET_GENERATOR_ID = 'snippet.generator.context';
- const AGGREGATE_RESOLVER_FACTORY_ID = 'context.argument.aggregate_resolver_factory';
+ public const FACTORY_ID = 'context.factory';
+ public const CONTEXT_SNIPPET_GENERATOR_ID = 'snippet.generator.context';
+ public const AGGREGATE_RESOLVER_FACTORY_ID = 'context.argument.aggregate_resolver_factory';
+ private const ENVIRONMENT_HANDLER_ID = EnvironmentExtension::HANDLER_TAG . '.context';
+ private const ENVIRONMENT_READER_ID = EnvironmentExtension::READER_TAG . '.context';
+ private const SUITE_SETUP_ID = SuiteExtension::SETUP_TAG . '.suite_with_contexts';
+ private const ANNOTATED_CONTEXT_READER_ID = self::READER_TAG . '.annotated';
+ private const ATTRIBUTED_CONTEXT_READER_ID = self::READER_TAG . '.attributed';
/*
* Available extension points
*/
- const CLASS_RESOLVER_TAG = 'context.class_resolver';
- const ARGUMENT_RESOLVER_TAG = 'context.argument_resolver';
- const INITIALIZER_TAG = 'context.initializer';
- const READER_TAG = 'context.reader';
- const ANNOTATION_READER_TAG = 'context.annotation_reader';
- const CLASS_GENERATOR_TAG = 'context.class_generator';
- const SUITE_SCOPED_RESOLVER_FACTORY_TAG = 'context.argument.suite_resolver_factory';
+ public const CLASS_RESOLVER_TAG = 'context.class_resolver';
+ public const ARGUMENT_RESOLVER_TAG = 'context.argument_resolver';
+ public const INITIALIZER_TAG = 'context.initializer';
+ public const READER_TAG = 'context.reader';
+ public const ANNOTATION_READER_TAG = 'context.annotation_reader';
+ public const ATTRIBUTE_READER_TAG = 'context.attribute_reader';
+ public const CLASS_GENERATOR_TAG = 'context.class_generator';
+ public const SUITE_SCOPED_RESOLVER_FACTORY_TAG = 'context.argument.suite_resolver_factory';
+ public const DOC_BLOCK_HELPER_ID = 'context.docblock_helper';
/**
* @var ServiceProcessor
@@ -106,6 +113,7 @@ public function load(ContainerBuilder $container, array $config)
$this->loadSnippetsController($container);
$this->loadDefaultClassGenerators($container);
$this->loadDefaultContextReaders($container);
+ $this->loadDocblockHelper($container);
}
/**
@@ -120,6 +128,7 @@ public function process(ContainerBuilder $container)
$this->processContextReaders($container);
$this->processClassGenerators($container);
$this->processAnnotationReaders($container);
+ $this->processAttributeReaders($container);
}
/**
@@ -142,7 +151,7 @@ private function loadFactory(ContainerBuilder $container)
*/
private function loadArgumentResolverFactory(ContainerBuilder $container)
{
- $definition = new Definition('Behat\Behat\Context\Argument\CompositeFactory');
+ $definition = new Definition('Behat\Behat\Context\Argument\CompositeArgumentResolverFactory');
$container->setDefinition(self::AGGREGATE_RESOLVER_FACTORY_ID, $definition);
}
@@ -158,7 +167,7 @@ private function loadEnvironmentHandler(ContainerBuilder $container)
new Reference(self::AGGREGATE_RESOLVER_FACTORY_ID)
));
$definition->addTag(EnvironmentExtension::HANDLER_TAG, array('priority' => 50));
- $container->setDefinition(self::getEnvironmentHandlerId(), $definition);
+ $container->setDefinition(self::ENVIRONMENT_HANDLER_ID, $definition);
}
/**
@@ -170,7 +179,7 @@ private function loadEnvironmentReader(ContainerBuilder $container)
{
$definition = new Definition('Behat\Behat\Context\Environment\Reader\ContextEnvironmentReader');
$definition->addTag(EnvironmentExtension::READER_TAG, array('priority' => 50));
- $container->setDefinition(self::getEnvironmentReaderId(), $definition);
+ $container->setDefinition(self::ENVIRONMENT_READER_ID, $definition);
}
/**
@@ -185,7 +194,7 @@ private function loadSuiteSetup(ContainerBuilder $container)
new Reference(FilesystemExtension::LOGGER_ID)
));
$definition->addTag(SuiteExtension::SETUP_TAG, array('priority' => 20));
- $container->setDefinition(self::getSuiteSetupId(), $definition);
+ $container->setDefinition(self::SUITE_SETUP_ID, $definition);
}
/**
@@ -248,15 +257,57 @@ private function loadDefaultClassGenerators(ContainerBuilder $container)
*/
private function loadDefaultContextReaders(ContainerBuilder $container)
{
- $definition = new Definition('Behat\Behat\Context\Reader\AnnotatedContextReader');
- $container->setDefinition(self::getAnnotatedContextReaderId(), $definition);
+ $this->loadAnnotatedContextReader($container);
+
+ $this->loadAttributedContextReader($container);
+
+ $this->loadTranslatableContextReader($container);
+ }
+
+ /**
+ * Loads AnnotatedContextReader
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadAnnotatedContextReader(ContainerBuilder $container)
+ {
+ $definition = new Definition('Behat\Behat\Context\Reader\AnnotatedContextReader', array(
+ new Reference(self::DOC_BLOCK_HELPER_ID)
+ ));
+ $container->setDefinition(self::ANNOTATED_CONTEXT_READER_ID, $definition);
+
+ $definition = new Definition('Behat\Behat\Context\Reader\ContextReaderCachedPerContext', array(
+ new Reference(self::ANNOTATED_CONTEXT_READER_ID)
+ ));
+ $definition->addTag(self::READER_TAG, array('priority' => 50));
+ $container->setDefinition(self::ANNOTATED_CONTEXT_READER_ID . '.cached', $definition);
+ }
+
+ /**
+ * Loads AttributedContextReader
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadAttributedContextReader(ContainerBuilder $container)
+ {
+ $definition = new Definition('Behat\Behat\Context\Reader\AttributeContextReader');
+ $container->setDefinition(self::ATTRIBUTED_CONTEXT_READER_ID, $definition);
$definition = new Definition('Behat\Behat\Context\Reader\ContextReaderCachedPerContext', array(
- new Reference(self::getAnnotatedContextReaderId())
+ new Reference(self::ATTRIBUTED_CONTEXT_READER_ID)
));
$definition->addTag(self::READER_TAG, array('priority' => 50));
- $container->setDefinition(self::getAnnotatedContextReaderId() . '.cached', $definition);
+ $container->setDefinition(self::ATTRIBUTED_CONTEXT_READER_ID . '.cached', $definition);
+ return $definition;
+ }
+ /**
+ * Loads TranslatableContextReader
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadTranslatableContextReader(ContainerBuilder $container)
+ {
$definition = new Definition('Behat\Behat\Context\Reader\TranslatableContextReader', array(
new Reference(TranslatorExtension::TRANSLATOR_ID)
));
@@ -269,6 +320,18 @@ private function loadDefaultContextReaders(ContainerBuilder $container)
$container->setDefinition(self::READER_TAG . '.translatable.cached', $definition);
}
+ /**
+ * Loads DocBlockHelper
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadDocblockHelper(ContainerBuilder $container)
+ {
+ $definition = new Definition('Behat\Behat\Context\Annotation\DocBlockHelper');
+
+ $container->setDefinition(self::DOC_BLOCK_HELPER_ID, $definition);
+ }
+
/**
* Processes all class resolvers.
*
@@ -277,7 +340,7 @@ private function loadDefaultContextReaders(ContainerBuilder $container)
private function processClassResolvers(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::CLASS_RESOLVER_TAG);
- $definition = $container->getDefinition(self::getEnvironmentHandlerId());
+ $definition = $container->getDefinition(self::ENVIRONMENT_HANDLER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerClassResolver', array($reference));
@@ -337,7 +400,7 @@ private function processContextInitializers(ContainerBuilder $container)
private function processContextReaders(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::READER_TAG);
- $definition = $container->getDefinition(self::getEnvironmentReaderId());
+ $definition = $container->getDefinition(self::ENVIRONMENT_READER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerContextReader', array($reference));
@@ -352,7 +415,7 @@ private function processContextReaders(ContainerBuilder $container)
private function processClassGenerators(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::CLASS_GENERATOR_TAG);
- $definition = $container->getDefinition(self::getSuiteSetupId());
+ $definition = $container->getDefinition(self::SUITE_SETUP_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerClassGenerator', array($reference));
@@ -367,7 +430,7 @@ private function processClassGenerators(ContainerBuilder $container)
private function processAnnotationReaders(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::ANNOTATION_READER_TAG);
- $definition = $container->getDefinition(self::getAnnotatedContextReaderId());
+ $definition = $container->getDefinition(self::ANNOTATED_CONTEXT_READER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerAnnotationReader', array($reference));
@@ -375,42 +438,17 @@ private function processAnnotationReaders(ContainerBuilder $container)
}
/**
- * Returns context environment handler service id.
+ * Processes all attribute readers.
*
- * @return string
- */
- private static function getEnvironmentHandlerId()
- {
- return EnvironmentExtension::HANDLER_TAG . '.context';
- }
-
- /**
- * Returns context environment reader id.
- *
- * @return string
- */
- private static function getEnvironmentReaderId()
- {
- return EnvironmentExtension::READER_TAG . '.context';
- }
-
- /**
- * Returns context suite setup id.
- *
- * @return string
+ * @param ContainerBuilder $container
*/
- private static function getSuiteSetupId()
+ private function processAttributeReaders(ContainerBuilder $container)
{
- return SuiteExtension::SETUP_TAG . '.suite_with_contexts';
- }
+ $references = $this->processor->findAndSortTaggedServices($container, self::ATTRIBUTE_READER_TAG);
+ $definition = $container->getDefinition(self::ATTRIBUTED_CONTEXT_READER_ID);
- /**
- * Returns annotated context reader id.
- *
- * @return string
- */
- private static function getAnnotatedContextReaderId()
- {
- return self::READER_TAG . '.annotated';
+ foreach ($references as $reference) {
+ $definition->addMethodCall('registerAttributeReader', array($reference));
+ }
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Appender/ContextSnippetAppender.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Appender/ContextSnippetAppender.php
index 5a881f94b..456809bc2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Appender/ContextSnippetAppender.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Appender/ContextSnippetAppender.php
@@ -25,7 +25,7 @@ final class ContextSnippetAppender implements SnippetAppender
/**
* @const PendingException class
*/
- const PENDING_EXCEPTION_CLASS = 'Behat\Behat\Tester\Exception\PendingException';
+ public const PENDING_EXCEPTION_CLASS = 'Behat\Behat\Tester\Exception\PendingException';
/**
* @var FilesystemLogger
@@ -81,7 +81,7 @@ public function appendSnippet(AggregateSnippet $snippet)
* @param string $class
* @param string $contextFileContent
*
- * @return Boolean
+ * @return bool
*/
private function isClassImported($class, $contextFileContent)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/ContextSnippetGenerator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/ContextSnippetGenerator.php
index edb2227f5..2373220a7 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/ContextSnippetGenerator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/ContextSnippetGenerator.php
@@ -324,7 +324,7 @@ private function getMethodNameNotProposedEarlier($contextClass, $stepPattern, $n
*/
private function getAlreadyProposedMethods($contextClass)
{
- return isset(self::$proposedMethods[$contextClass]) ? self::$proposedMethods[$contextClass] : array();
+ return self::$proposedMethods[$contextClass] ?? array();
}
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Suite/Setup/SuiteWithContextsSetup.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Suite/Setup/SuiteWithContextsSetup.php
index 0bc41db7a..9fc219d3a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Suite/Setup/SuiteWithContextsSetup.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Suite/Setup/SuiteWithContextsSetup.php
@@ -16,7 +16,7 @@
use Behat\Testwork\Suite\Exception\SuiteConfigurationException;
use Behat\Testwork\Suite\Setup\SuiteSetup;
use Behat\Testwork\Suite\Suite;
-use Symfony\Component\ClassLoader\ClassLoader;
+use Composer\Autoload\ClassLoader;
/**
* Generates classes for all contexts in the suite using autoloader.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php
new file mode 100644
index 000000000..c37300f77
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php
@@ -0,0 +1,77 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Definition\Context\Attribute;
+
+use Behat\Behat\Context\Annotation\DocBlockHelper;
+use Behat\Behat\Context\Attribute\AttributeReader;
+use Behat\Step\Definition;
+use Behat\Step\Given;
+use Behat\Step\Then;
+use Behat\Step\When;
+use ReflectionMethod;
+
+/**
+ * Reads definition Attributes from the context class.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class DefinitionAttributeReader implements AttributeReader
+{
+ /**
+ * @var string[]
+ */
+ private static $classes = array(
+ Given::class => 'Behat\Behat\Definition\Call\Given',
+ When::class => 'Behat\Behat\Definition\Call\When',
+ Then::class => 'Behat\Behat\Definition\Call\Then',
+ );
+
+ /**
+ * @var DocBlockHelper
+ */
+ private $docBlockHelper;
+
+ /**
+ * Initializes reader.
+ *
+ * @param DocBlockHelper $docBlockHelper
+ */
+ public function __construct(DocBlockHelper $docBlockHelper)
+ {
+ $this->docBlockHelper = $docBlockHelper;
+ }
+
+ /**
+ * @{inheritdoc}
+ */
+ public function readCallees(string $contextClass, ReflectionMethod $method)
+ {
+ if (\PHP_MAJOR_VERSION < 8) {
+ return [];
+ }
+
+ $attributes = $method->getAttributes(Definition::class, \ReflectionAttribute::IS_INSTANCEOF);
+
+ $callees = [];
+ foreach ($attributes as $attribute) {
+ $class = self::$classes[$attribute->getName()];
+ $callable = array($contextClass, $method->getName());
+ $description = null;
+ if ($docBlock = $method->getDocComment()) {
+ $description = $this->docBlockHelper->extractDescription($docBlock);
+ }
+
+ $callees[] = new $class($attribute->newInstance()->pattern, $callable, $description);
+ }
+
+ return $callees;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/PatternTransformer.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/PatternTransformer.php
index 6af5bacd6..adda52b66 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/PatternTransformer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/PatternTransformer.php
@@ -26,6 +26,11 @@ final class PatternTransformer
*/
private $policies = array();
+ /**
+ * @var string[]
+ */
+ private $patternToRegexpCache = array();
+
/**
* Registers pattern policy.
*
@@ -34,6 +39,7 @@ final class PatternTransformer
public function registerPatternPolicy(PatternPolicy $policy)
{
$this->policies[] = $policy;
+ $this->patternToRegexpCache = array();
}
/**
@@ -67,6 +73,22 @@ public function generatePattern($type, $stepText)
* @throws UnknownPatternException
*/
public function transformPatternToRegex($pattern)
+ {
+ if (!isset($this->patternToRegexpCache[$pattern])) {
+ $this->patternToRegexpCache[$pattern] = $this->transformPatternToRegexWithSupportedPolicy($pattern);
+ }
+
+ return $this->patternToRegexpCache[$pattern];
+ }
+
+ /**
+ * @param string $pattern
+ *
+ * @return string
+ *
+ * @throws UnknownPatternException
+ */
+ private function transformPatternToRegexWithSupportedPolicy($pattern)
{
foreach ($this->policies as $policy) {
if ($policy->supportsPattern($pattern)) {
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/PatternPolicy.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/PatternPolicy.php
index 247624170..cd3daac5c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/PatternPolicy.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/PatternPolicy.php
@@ -27,7 +27,7 @@ interface PatternPolicy
*
* @param string $type
*
- * @return Boolean
+ * @return bool
*/
public function supportsPatternType($type);
@@ -45,7 +45,7 @@ public function generatePattern($stepText);
*
* @param string $pattern
*
- * @return Boolean
+ * @return bool
*/
public function supportsPattern($pattern);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/RegexPatternPolicy.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/RegexPatternPolicy.php
index 6ea50a277..76498b91b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/RegexPatternPolicy.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/RegexPatternPolicy.php
@@ -65,7 +65,7 @@ public function transformPatternToRegex($pattern)
{
if (false === @preg_match($pattern, 'anything')) {
$error = error_get_last();
- $errorMessage = isset($error['message']) ? $error['message'] : '';
+ $errorMessage = $error['message'] ?? '';
throw new InvalidPatternException(sprintf('The regex `%s` is invalid: %s', $pattern, $errorMessage));
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/TurnipPatternPolicy.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/TurnipPatternPolicy.php
index c0732680f..aa37f9e62 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/TurnipPatternPolicy.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Pattern/Policy/TurnipPatternPolicy.php
@@ -21,11 +21,11 @@
*/
final class TurnipPatternPolicy implements PatternPolicy
{
- const TOKEN_REGEX = "[\"']?(?P<%s>(?<=\")[^\"]*(?=\")|(?<=')[^']*(?=')|\-?[\w\.\,]+)['\"]?";
+ public const TOKEN_REGEX = "[\"']?(?P<%s>(?<=\")[^\"]*(?=\")|(?<=')[^']*(?=')|\-?[\w\.\,]+)['\"]?";
- const PLACEHOLDER_REGEXP = "/\\\:(\w+)/";
- const OPTIONAL_WORD_REGEXP = '/(\s)?\\\\\(([^\\\]+)\\\\\)(\s)?/';
- const ALTERNATIVE_WORD_REGEXP = '/(\w+)\\\\\/(\w+)/';
+ public const PLACEHOLDER_REGEXP = "/\\\:(\w+)/";
+ public const OPTIONAL_WORD_REGEXP = '/(\s)?\\\\\(([^\\\]+)\\\\\)(\s)?/';
+ public const ALTERNATIVE_WORD_REGEXP = '/(\w+)\\\\\/(\w+)/';
/**
* @var string[]
@@ -100,7 +100,7 @@ private function createTransformedRegex($pattern)
$regex = $this->replaceTurnipOptionalEndingWithRegex($regex);
$regex = $this->replaceTurnipAlternativeWordsWithRegex($regex);
- return '/^' . $regex . '$/i';
+ return '/^' . $regex . '$/iu';
}
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionInformationPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionInformationPrinter.php
index 4c074ea45..d690982ee 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionInformationPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionInformationPrinter.php
@@ -131,6 +131,17 @@ private function extractFooter(Suite $suite, Definition $definition)
)
);
+ if ($this->isVerbose()) {
+ $lines[] = strtr(
+ '{space}| on `{filepath}[{start}:{end}]`', array(
+ '{space}' => str_pad('', mb_strlen($suite->getName(), 'utf8') + 1),
+ '{filepath}' => $definition->getReflection()->getFileName(),
+ '{start}' => $definition->getReflection()->getStartLine(),
+ '{end}' => $definition->getReflection()->getEndLine()
+ )
+ );
+ }
+
return $lines;
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionPrinter.php
index 08b8f92ac..bd0546f41 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Printer/ConsoleDefinitionPrinter.php
@@ -110,4 +110,14 @@ final protected function translateDefinition(Suite $suite, Definition $definitio
{
return $this->translator->translateDefinition($suite, $definition);
}
+
+ /**
+ * Returns whether verbosity is verbose (-v).
+ *
+ * @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
+ */
+ final protected function isVerbose()
+ {
+ return $this->output->isVerbose();
+ }
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/SearchResult.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/SearchResult.php
index 158f63557..cdb4191ad 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/SearchResult.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/SearchResult.php
@@ -47,7 +47,7 @@ public function __construct(Definition $definition = null, $matchedText = null,
/**
* Checks if result contains a match.
*
- * @return Boolean
+ * @return bool
*/
public function hasMatch()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/ServiceContainer/DefinitionExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/ServiceContainer/DefinitionExtension.php
index cce43415b..e408f5358 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/ServiceContainer/DefinitionExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/ServiceContainer/DefinitionExtension.php
@@ -35,17 +35,18 @@ final class DefinitionExtension implements Extension
/*
* Available services
*/
- const FINDER_ID = 'definition.finder';
- const REPOSITORY_ID = 'definition.repository';
- const PATTERN_TRANSFORMER_ID = 'definition.pattern_transformer';
- const WRITER_ID = 'definition.writer';
- const DEFINITION_TRANSLATOR_ID = 'definition.translator';
+ public const FINDER_ID = 'definition.finder';
+ public const REPOSITORY_ID = 'definition.repository';
+ public const PATTERN_TRANSFORMER_ID = 'definition.pattern_transformer';
+ public const WRITER_ID = 'definition.writer';
+ public const DEFINITION_TRANSLATOR_ID = 'definition.translator';
/*
* Available extension points
*/
- const SEARCH_ENGINE_TAG = 'definition.search_engine';
- const PATTERN_POLICY_TAG = 'definition.pattern_policy';
+ public const SEARCH_ENGINE_TAG = 'definition.search_engine';
+ public const PATTERN_POLICY_TAG = 'definition.pattern_policy';
+ public const DOC_BLOCK_HELPER_ID = 'definition.doc_block_helper';
/**
* @var ServiceProcessor
@@ -97,8 +98,10 @@ public function load(ContainerBuilder $container, array $config)
$this->loadDefaultSearchEngines($container);
$this->loadDefaultPatternPolicies($container);
$this->loadAnnotationReader($container);
+ $this->loadAttributeReader($container);
$this->loadDefinitionPrinters($container);
$this->loadController($container);
+ $this->loadDocblockHelper($container);
}
/**
@@ -217,6 +220,20 @@ private function loadAnnotationReader(ContainerBuilder $container)
$container->setDefinition(ContextExtension::ANNOTATION_READER_TAG . '.definition', $definition);
}
+ /**
+ * Loads definition Attribute reader.
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadAttributeReader(ContainerBuilder $container)
+ {
+ $definition = new Definition('\Behat\Behat\Definition\Context\Attribute\DefinitionAttributeReader', array(
+ new Reference(self::DOC_BLOCK_HELPER_ID)
+ ));
+ $definition->addTag(ContextExtension::ATTRIBUTE_READER_TAG, array('priority' => 50));
+ $container->setDefinition(ContextExtension::ATTRIBUTE_READER_TAG . '.definition', $definition);
+ }
+
/**
* Loads definition printers.
*
@@ -258,6 +275,18 @@ private function loadController(ContainerBuilder $container)
$container->setDefinition(CliExtension::CONTROLLER_TAG . '.available_definitions', $definition);
}
+ /**
+ * Loads DocBlockHelper
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadDocblockHelper(ContainerBuilder $container)
+ {
+ $definition = new Definition('Behat\Behat\Context\Annotation\DocBlockHelper');
+
+ $container->setDefinition(self::DOC_BLOCK_HELPER_ID, $definition);
+ }
+
/**
* Processes all search engines in the container.
*
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/DefinitionTranslator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/DefinitionTranslator.php
index 3192a3d8e..105d61c50 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/DefinitionTranslator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/DefinitionTranslator.php
@@ -12,7 +12,6 @@
use Behat\Behat\Definition\Definition;
use Behat\Testwork\Suite\Suite;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Translates definitions using translator component.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/Translator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/Translator.php
new file mode 100644
index 000000000..97cdb4071
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Translator/Translator.php
@@ -0,0 +1,7 @@
+eventDispatcher->dispatch(SuiteTested::AFTER, new AfterSuiteAborted($event->getEnvironment()));
- $this->eventDispatcher->dispatch(ExerciseCompleted::AFTER, new AfterExerciseAborted());
+ $this->eventDispatcher->dispatch(new AfterSuiteAborted($event->getEnvironment()), SuiteTested::AFTER);
+ $this->eventDispatcher->dispatch(new AfterExerciseAborted(), ExerciseCompleted::AFTER);
exit(1);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepSetup.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepSetup.php
index cf9b6c5f5..a2256f0c1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepSetup.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepSetup.php
@@ -86,7 +86,7 @@ public function getSetup()
/**
* Checks if step call, setup or teardown produced any output (stdOut or exception).
*
- * @return Boolean
+ * @return bool
*/
public function hasOutput()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepTested.php
index 37b497bfa..d5829b77a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepTested.php
@@ -111,7 +111,7 @@ public function getTeardown()
/**
* Checks if step call, setup or teardown produced any output (stdOut or exception).
*
- * @return Boolean
+ * @return bool
*/
public function hasOutput()
{
@@ -121,7 +121,7 @@ public function hasOutput()
/**
* Checks if step teardown has output.
*
- * @return Boolean
+ * @return bool
*/
private function teardownHasOutput()
{
@@ -131,7 +131,7 @@ private function teardownHasOutput()
/**
* Checks if result has produced exception.
*
- * @return Boolean
+ * @return bool
*/
private function resultHasException()
{
@@ -141,7 +141,7 @@ private function resultHasException()
/**
* Checks if result is executed and call result has produced exception or stdOut.
*
- * @return Boolean
+ * @return bool
*/
private function resultCallHasOutput()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BackgroundTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BackgroundTested.php
index f67f855c2..dd43ae066 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BackgroundTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BackgroundTested.php
@@ -21,10 +21,10 @@
*/
abstract class BackgroundTested extends LifecycleEvent implements ScenarioLikeTested
{
- const BEFORE = 'tester.background_tested.before';
- const AFTER_SETUP = 'tester.background_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.background_tested.before_teardown';
- const AFTER = 'tester.background_tested.after';
+ public const BEFORE = 'tester.background_tested.before';
+ public const AFTER_SETUP = 'tester.background_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.background_tested.before_teardown';
+ public const AFTER = 'tester.background_tested.after';
/**
* Returns background node.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BeforeStepTeardown.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BeforeStepTeardown.php
index 6d9b9c6e9..89f626fc5 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BeforeStepTeardown.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/BeforeStepTeardown.php
@@ -93,7 +93,7 @@ public function getTestResult()
/**
* Checks if step call produced any output (stdOut or exception).
*
- * @return Boolean
+ * @return bool
*/
public function hasOutput()
{
@@ -103,7 +103,7 @@ public function hasOutput()
/**
* Checks if result has produced exception.
*
- * @return Boolean
+ * @return bool
*/
private function resultHasException()
{
@@ -113,7 +113,7 @@ private function resultHasException()
/**
* Checks if result is executed and call result has produced exception or stdOut.
*
- * @return Boolean
+ * @return bool
*/
private function resultCallHasOutput()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ExampleTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ExampleTested.php
index 1bb1a4206..9a107670e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ExampleTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ExampleTested.php
@@ -17,8 +17,8 @@
*/
interface ExampleTested
{
- const BEFORE = 'tester.example_tested.before';
- const AFTER_SETUP = 'tester.example_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.example_tested.before_teardown';
- const AFTER = 'tester.example_tested.after';
+ public const BEFORE = 'tester.example_tested.before';
+ public const AFTER_SETUP = 'tester.example_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.example_tested.before_teardown';
+ public const AFTER = 'tester.example_tested.after';
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/FeatureTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/FeatureTested.php
index f29c31c1a..a75d81ff2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/FeatureTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/FeatureTested.php
@@ -21,10 +21,10 @@
*/
abstract class FeatureTested extends LifecycleEvent implements GherkinNodeTested
{
- const BEFORE = 'tester.feature_tested.before';
- const AFTER_SETUP = 'tester.feature_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.feature_tested.before_teardown';
- const AFTER = 'tester.feature_tested.after';
+ public const BEFORE = 'tester.feature_tested.before';
+ public const AFTER_SETUP = 'tester.feature_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.feature_tested.before_teardown';
+ public const AFTER = 'tester.feature_tested.after';
/**
* Returns feature.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/OutlineTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/OutlineTested.php
index 149fc4ff7..557e429d2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/OutlineTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/OutlineTested.php
@@ -22,10 +22,10 @@
*/
abstract class OutlineTested extends LifecycleEvent implements GherkinNodeTested
{
- const BEFORE = 'tester.outline_tested.before';
- const AFTER_SETUP = 'tester.outline_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.outline_tested.before_teardown';
- const AFTER = 'tester.outline_tested.after';
+ public const BEFORE = 'tester.outline_tested.before';
+ public const AFTER_SETUP = 'tester.outline_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.outline_tested.before_teardown';
+ public const AFTER = 'tester.outline_tested.after';
/**
* Returns feature.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ScenarioTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ScenarioTested.php
index 2251b4a27..6a27ae5d6 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ScenarioTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/ScenarioTested.php
@@ -19,10 +19,10 @@
*/
abstract class ScenarioTested extends LifecycleEvent implements ScenarioLikeTested
{
- const BEFORE = 'tester.scenario_tested.before';
- const AFTER_SETUP = 'tester.scenario_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.scenario_tested.before_teardown';
- const AFTER = 'tester.scenario_tested.after';
+ public const BEFORE = 'tester.scenario_tested.before';
+ public const AFTER_SETUP = 'tester.scenario_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.scenario_tested.before_teardown';
+ public const AFTER = 'tester.scenario_tested.after';
/**
* {@inheritdoc}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/StepTested.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/StepTested.php
index 7053d0d55..9df91fbb1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/StepTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/StepTested.php
@@ -21,10 +21,10 @@
*/
abstract class StepTested extends LifecycleEvent implements GherkinNodeTested
{
- const BEFORE = 'tester.step_tested.before';
- const AFTER_SETUP = 'tester.step_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.step_tested.before_teardown';
- const AFTER = 'tester.step_tested.after';
+ public const BEFORE = 'tester.step_tested.before';
+ public const AFTER_SETUP = 'tester.step_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.step_tested.before_teardown';
+ public const AFTER = 'tester.step_tested.after';
/**
* Returns feature.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/ServiceContainer/EventDispatcherExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/ServiceContainer/EventDispatcherExtension.php
index 252cd03f5..0aa06952c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/ServiceContainer/EventDispatcherExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/ServiceContainer/EventDispatcherExtension.php
@@ -156,20 +156,18 @@ protected function loadEventDispatchingStepTester(ContainerBuilder $container)
}
/**
- * Loads ticking step tester.
+ * This method used in the past to load the TickingStepTester to work around
+ * a bug with the scope of declare(ticks) in PHP < 7.1. Since we don't
+ * support those PHP versions anymore loading the TickingStepTester is
+ * no longer needed. This method is left here to prevent breaking BC.
+ *
+ * @todo Remove this method in next major
+ *
+ * @deprecated
*
* @param ContainerBuilder $container
*/
protected function loadTickingStepTester(ContainerBuilder $container)
{
- if (!function_exists('pcntl_signal')) {
- return;
- }
-
- $definition = new Definition('Behat\Behat\EventDispatcher\Tester\TickingStepTester', array(
- new Reference(TesterExtension::STEP_TESTER_ID)
- ));
- $definition->addTag(TesterExtension::STEP_TESTER_WRAPPER_TAG, array('priority' => 9999));
- $container->setDefinition(TesterExtension::STEP_TESTER_WRAPPER_TAG . '.ticking', $definition);
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingBackgroundTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingBackgroundTester.php
index d947df55d..cb5d32d32 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingBackgroundTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingBackgroundTester.php
@@ -18,6 +18,7 @@
use Behat\Behat\Tester\BackgroundTester;
use Behat\Gherkin\Node\FeatureNode;
use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -55,12 +56,14 @@ public function __construct(BackgroundTester $baseTester, EventDispatcherInterfa
public function setUp(Environment $env, FeatureNode $feature, $skip)
{
$event = new BeforeBackgroundTested($env, $feature, $feature->getBackground());
- $this->eventDispatcher->dispatch($event::BEFORE, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $skip);
$event = new AfterBackgroundSetup($env, $feature, $feature->getBackground(), $setup);
- $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@@ -79,12 +82,14 @@ public function test(Environment $env, FeatureNode $feature, $skip)
public function tearDown(Environment $env, FeatureNode $feature, $skip, TestResult $result)
{
$event = new BeforeBackgroundTeardown($env, $feature, $feature->getBackground(), $result);
- $this->eventDispatcher->dispatch(BackgroundTested::BEFORE_TEARDOWN, $event);
+
+ $this->eventDispatcher->dispatch($event, BackgroundTested::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $skip, $result);
$event = new AfterBackgroundTested($env, $feature, $feature->getBackground(), $result, $teardown);
- $this->eventDispatcher->dispatch(BackgroundTested::AFTER, $event);
+
+ $this->eventDispatcher->dispatch($event, BackgroundTested::AFTER);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php
index 2bd0ad5dd..a0ce588f6 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php
@@ -15,6 +15,7 @@
use Behat\Behat\EventDispatcher\Event\BeforeFeatureTeardown;
use Behat\Behat\EventDispatcher\Event\BeforeFeatureTested;
use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Behat\Testwork\Tester\SpecificationTester;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -53,12 +54,14 @@ public function __construct(SpecificationTester $baseTester, EventDispatcherInte
public function setUp(Environment $env, $feature, $skip)
{
$event = new BeforeFeatureTested($env, $feature);
- $this->eventDispatcher->dispatch($event::BEFORE, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $skip);
$event = new AfterFeatureSetup($env, $feature, $setup);
- $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@@ -77,12 +80,14 @@ public function test(Environment $env, $feature, $skip)
public function tearDown(Environment $env, $feature, $skip, TestResult $result)
{
$event = new BeforeFeatureTeardown($env, $feature, $result);
- $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $skip, $result);
$event = new AfterFeatureTested($env, $feature, $result, $teardown);
- $this->eventDispatcher->dispatch($event::AFTER, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingOutlineTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingOutlineTester.php
index 13d257cef..132f584fb 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingOutlineTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingOutlineTester.php
@@ -18,6 +18,7 @@
use Behat\Gherkin\Node\FeatureNode;
use Behat\Gherkin\Node\OutlineNode;
use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -55,12 +56,14 @@ public function __construct(OutlineTester $baseTester, EventDispatcherInterface
public function setUp(Environment $env, FeatureNode $feature, OutlineNode $outline, $skip)
{
$event = new BeforeOutlineTested($env, $feature, $outline);
- $this->eventDispatcher->dispatch($event::BEFORE, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $outline, $skip);
$event = new AfterOutlineSetup($env, $feature, $outline, $setup);
- $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@@ -79,12 +82,14 @@ public function test(Environment $env, FeatureNode $feature, OutlineNode $outlin
public function tearDown(Environment $env, FeatureNode $feature, OutlineNode $outline, $skip, TestResult $result)
{
$event = new BeforeOutlineTeardown($env, $feature, $outline, $result);
- $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
+
+ $this->eventDispatcher->dispatch( $event,$event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $outline, $skip, $result);
$event = new AfterOutlineTested($env, $feature, $outline, $result, $teardown);
- $this->eventDispatcher->dispatch($event::AFTER, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php
index 44eb13120..882be52ed 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php
@@ -18,6 +18,7 @@
use Behat\Gherkin\Node\FeatureNode;
use Behat\Gherkin\Node\ScenarioInterface as Scenario;
use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -85,12 +86,14 @@ public function __construct(
public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario, $skip)
{
$event = new BeforeScenarioTested($env, $feature, $scenario);
- $this->eventDispatcher->dispatch($this->beforeEventName, $event);
+
+ $this->eventDispatcher->dispatch($event, $this->beforeEventName);
$setup = $this->baseTester->setUp($env, $feature, $scenario, $skip);
$event = new AfterScenarioSetup($env, $feature, $scenario, $setup);
- $this->eventDispatcher->dispatch($this->afterSetupEventName, $event);
+
+ $this->eventDispatcher->dispatch($event, $this->afterSetupEventName);
return $setup;
}
@@ -109,12 +112,14 @@ public function test(Environment $env, FeatureNode $feature, Scenario $scenario,
public function tearDown(Environment $env, FeatureNode $feature, Scenario $scenario, $skip, TestResult $result)
{
$event = new BeforeScenarioTeardown($env, $feature, $scenario, $result);
- $this->eventDispatcher->dispatch($this->beforeTeardownEventName, $event);
+
+ $this->eventDispatcher->dispatch($event, $this->beforeTeardownEventName);
$teardown = $this->baseTester->tearDown($env, $feature, $scenario, $skip, $result);
$event = new AfterScenarioTested($env, $feature, $scenario, $result, $teardown);
- $this->eventDispatcher->dispatch($this->afterEventName, $event);
+
+ $this->eventDispatcher->dispatch($event, $this->afterEventName);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php
index 6bf3c46b2..1daafadce 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php
@@ -19,6 +19,7 @@
use Behat\Gherkin\Node\FeatureNode;
use Behat\Gherkin\Node\StepNode;
use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
@@ -55,12 +56,14 @@ public function __construct(StepTester $baseTester, EventDispatcherInterface $ev
public function setUp(Environment $env, FeatureNode $feature, StepNode $step, $skip)
{
$event = new BeforeStepTested($env, $feature, $step);
- $this->eventDispatcher->dispatch($event::BEFORE, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $feature, $step, $skip);
$event = new AfterStepSetup($env, $feature, $step, $setup);
- $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@@ -79,12 +82,14 @@ public function test(Environment $env, FeatureNode $feature, StepNode $step, $sk
public function tearDown(Environment $env, FeatureNode $feature, StepNode $step, $skip, StepResult $result)
{
$event = new BeforeStepTeardown($env, $feature, $step, $result);
- $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $feature, $step, $skip, $result);
$event = new AfterStepTested($env, $feature, $step, $result, $teardown);
- $this->eventDispatcher->dispatch($event::AFTER, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/TickingStepTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/TickingStepTester.php
index 401725495..dcbdf4c24 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/TickingStepTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/TickingStepTester.php
@@ -21,6 +21,11 @@
* to handle an interupt (on PHP7)
*
* @see Behat\Testwork\EventDispatcher\Cli\SigintController
+ *
+ * @deprecated Since the way signals are handled changed to use pcntl_signal_dispatch
+ * this class is no longer needed.
+ *
+ * @todo Remove this class in the next major version
*
* @author Peter Mitchell
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php
index a3e3f6cfc..62acc12a6 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php
@@ -10,6 +10,7 @@
namespace Behat\Behat\Gherkin\Cli;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Gherkin\Keywords\KeywordsDumper;
use Behat\Testwork\Cli\Controller;
use Symfony\Component\Console\Command\Command;
@@ -17,7 +18,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Prints example of the feature to present all available syntax keywords.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/ServiceContainer/GherkinExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/ServiceContainer/GherkinExtension.php
index 2b33cd569..60aef8e60 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/ServiceContainer/GherkinExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/ServiceContainer/GherkinExtension.php
@@ -35,14 +35,14 @@ final class GherkinExtension implements Extension
/*
* Available services
*/
- const MANAGER_ID = 'gherkin';
- const KEYWORDS_DUMPER_ID = 'gherkin.keywords_dumper';
- const KEYWORDS_ID = 'gherkin.keywords';
+ public const MANAGER_ID = 'gherkin';
+ public const KEYWORDS_DUMPER_ID = 'gherkin.keywords_dumper';
+ public const KEYWORDS_ID = 'gherkin.keywords';
/*
* Available extension points
*/
- const LOADER_TAG = 'gherkin.loader';
+ public const LOADER_TAG = 'gherkin.loader';
/**
* @var ServiceProcessor
@@ -225,6 +225,7 @@ private function loadDefaultLoaders(ContainerBuilder $container, $cachePath)
}
$definition->addMethodCall('setCache', array($cacheDefinition));
+ $definition->addMethodCall('setBasePath', array('%paths.base%'));
$definition->addTag(self::LOADER_TAG, array('priority' => 50));
$container->setDefinition('gherkin.loader.gherkin_file', $definition);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/LazyFeatureIterator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/LazyFeatureIterator.php
index 61dd9bdb2..1883a0c6b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/LazyFeatureIterator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/LazyFeatureIterator.php
@@ -84,7 +84,7 @@ public function getSuite()
/**
* {@inheritdoc}
*/
- public function rewind()
+ public function rewind(): void
{
$this->position = 0;
$this->moveToNextAvailableFeature();
@@ -93,7 +93,7 @@ public function rewind()
/**
* {@inheritdoc}
*/
- public function next()
+ public function next(): void
{
$this->moveToNextAvailableFeature();
}
@@ -101,7 +101,7 @@ public function next()
/**
* {@inheritdoc}
*/
- public function valid()
+ public function valid(): bool
{
return null !== $this->currentFeature;
}
@@ -109,7 +109,7 @@ public function valid()
/**
* {@inheritdoc}
*/
- public function key()
+ public function key(): int
{
return $this->position;
}
@@ -117,7 +117,7 @@ public function key()
/**
* {@inheritdoc}
*/
- public function current()
+ public function current(): FeatureNode
{
return $this->currentFeature;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemRerunScenariosListLocator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemRerunScenariosListLocator.php
index d5ac5b3a3..8636d3279 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemRerunScenariosListLocator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemRerunScenariosListLocator.php
@@ -51,7 +51,7 @@ public function getLocatorExamples()
*/
public function locateSpecifications(Suite $suite, $locator)
{
- if (!is_file($locator) || 'rerun' !== pathinfo($locator, PATHINFO_EXTENSION)) {
+ if (null === $locator || !is_file($locator) || 'rerun' !== pathinfo($locator, PATHINFO_EXTENSION)) {
return new NoSpecificationsIterator($suite);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemScenariosListLocator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemScenariosListLocator.php
index 59141df80..ccacedd0f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemScenariosListLocator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Specification/Locator/FilesystemScenariosListLocator.php
@@ -51,7 +51,7 @@ public function getLocatorExamples()
*/
public function locateSpecifications(Suite $suite, $locator)
{
- if (!is_file($locator) || 'scenarios' !== pathinfo($locator, PATHINFO_EXTENSION)) {
+ if (null === $locator || !is_file($locator) || 'scenarios' !== pathinfo($locator, PATHINFO_EXTENSION)) {
return new NoSpecificationsIterator($suite);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Suite/Setup/SuiteWithPathsSetup.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Suite/Setup/SuiteWithPathsSetup.php
index 65c7c8f73..f50249f6e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Suite/Setup/SuiteWithPathsSetup.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Gherkin/Suite/Setup/SuiteWithPathsSetup.php
@@ -97,7 +97,7 @@ private function locatePath($path)
*
* @param string $file A file path
*
- * @return Boolean
+ * @return bool
*/
private function isAbsolutePath($file)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/AutowiringResolver.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/AutowiringResolver.php
new file mode 100644
index 000000000..11dde13b9
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/AutowiringResolver.php
@@ -0,0 +1,53 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer\Argument;
+
+use Behat\Behat\Context\Argument\ArgumentResolver;
+use Behat\Behat\HelperContainer\ArgumentAutowirer;
+use Psr\Container\ContainerInterface;
+use ReflectionClass;
+
+/**
+ * Resolves arguments that weren't resolved before by autowiring.
+ *
+ * @see ContextFactory
+ *
+ * @author Konstantin Kudryashov
+ */
+final class AutowiringResolver implements ArgumentResolver
+{
+ /**
+ * @var ArgumentAutowirer
+ */
+ private $autowirer;
+
+ /**
+ * Initialises resolver.
+ *
+ * @param ContainerInterface $container
+ */
+ public function __construct(ContainerInterface $container)
+ {
+ $this->autowirer = new ArgumentAutowirer($container);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function resolveArguments(ReflectionClass $classReflection, array $arguments)
+ {
+ if ($constructor = $classReflection->getConstructor()) {
+ return $this->autowirer->autowireArguments($constructor, $arguments);
+ }
+
+ return $arguments;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolver.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolver.php
index e8d23474d..7e2191a0f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolver.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolver.php
@@ -11,7 +11,8 @@
namespace Behat\Behat\HelperContainer\Argument;
use Behat\Behat\Context\Argument\ArgumentResolver;
-use Interop\Container\ContainerInterface;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\ContainerInterface;
use ReflectionClass;
/**
@@ -40,6 +41,8 @@ public function __construct(ContainerInterface $container)
/**
* {@inheritdoc}
+ *
+ * @throws ContainerExceptionInterface
*/
public function resolveArguments(ReflectionClass $classReflection, array $arguments)
{
@@ -55,10 +58,12 @@ public function resolveArguments(ReflectionClass $classReflection, array $argume
* @param mixed $value
*
* @return mixed
+ *
+ * @throws ContainerExceptionInterface
*/
private function resolveArgument($value)
{
- if ('@' === mb_substr($value, 0, 1)) {
+ if (is_string($value) && 0 === mb_strpos($value, '@')) {
return $this->container->get(mb_substr($value, 1));
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolverFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolverFactory.php
index e5dbfadc5..8820288c5 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolverFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Argument/ServicesResolverFactory.php
@@ -10,13 +10,17 @@
namespace Behat\Behat\HelperContainer\Argument;
+use Behat\Behat\Context\Argument\ArgumentResolver;
+use Behat\Behat\HelperContainer\Environment\ServiceContainerEnvironment;
+use Behat\Behat\Context\Argument\ArgumentResolverFactory;
use Behat\Behat\Context\Argument\SuiteScopedResolverFactory;
use Behat\Behat\HelperContainer\BuiltInServiceContainer;
use Behat\Behat\HelperContainer\Exception\WrongContainerClassException;
use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException;
use Behat\Behat\HelperContainer\ServiceContainer\HelperContainerExtension;
+use Behat\Testwork\Environment\Environment;
use Behat\Testwork\Suite\Suite;
-use Interop\Container\ContainerInterface;
+use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\TaggedContainerInterface;
/**
@@ -26,7 +30,7 @@
*
* @author Konstantin Kudryashov
*/
-final class ServicesResolverFactory implements SuiteScopedResolverFactory
+final class ServicesResolverFactory implements SuiteScopedResolverFactory, ArgumentResolverFactory
{
/**
* @var TaggedContainerInterface
@@ -45,16 +49,50 @@ public function __construct(TaggedContainerInterface $container)
/**
* {@inheritdoc}
+ *
+ * @deprecated as part of SuiteScopedResolverFactory deprecation. Would be removed in 4.0
+ *
+ * @throws WrongServicesConfigurationException
+ * @throws WrongContainerClassException
*/
public function generateArgumentResolvers(Suite $suite)
{
+ @trigger_error(
+ 'SuiteScopedResolverFactory::generateArgumentResolvers() was deprecated and will be removed in 4.0',
+ E_USER_DEPRECATED
+ );
+
+ if (!$suite->hasSetting('services')) {
+ return array();
+ }
+
+ $container = $this->createContainer($suite->getSetting('services'));
+
+ return $this->createResolvers($container, false);
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @throws WrongServicesConfigurationException
+ * @throws WrongContainerClassException
+ */
+ public function createArgumentResolvers(Environment $environment)
+ {
+ $suite = $environment->getSuite();
+
if (!$suite->hasSetting('services')) {
return array();
}
$container = $this->createContainer($suite->getSetting('services'));
+ $autowire = $suite->hasSetting('autowire') && $suite->getSetting('autowire');
+
+ if ($environment instanceof ServiceContainerEnvironment) {
+ $environment->setServiceContainer($container);
+ }
- return array($this->createArgumentResolver($container));
+ return $this->createResolvers($container, $autowire);
}
/**
@@ -63,6 +101,8 @@ public function generateArgumentResolvers(Suite $suite)
* @param string $settings
*
* @return mixed
+ *
+ * @throws WrongServicesConfigurationException
*/
private function createContainer($settings)
{
@@ -85,10 +125,12 @@ private function createContainer($settings)
* @param string $settings
*
* @return mixed
+ *
+ * @throws WrongServicesConfigurationException
*/
private function createContainerFromString($settings)
{
- if ('@' === mb_substr($settings, 0, 1)) {
+ if (0 === mb_strpos($settings, '@')) {
return $this->loadContainerFromContainer(mb_substr($settings, 1));
}
@@ -113,12 +155,14 @@ private function createContainerFromArray(array $settings)
* @param string $name
*
* @return mixed
+ *
+ * @throws WrongServicesConfigurationException
*/
private function loadContainerFromContainer($name)
{
$services = $this->container->findTaggedServiceIds(HelperContainerExtension::HELPER_CONTAINER_TAG);
- if (!in_array($name, array_keys($services))) {
+ if (!array_key_exists($name, $services)) {
throw new WrongServicesConfigurationException(
sprintf('Service container `@%s` was not found.', $name)
);
@@ -138,7 +182,7 @@ private function createContainerFromClassSpec($classSpec)
{
$constructor = explode('::', $classSpec);
- if (2 == count($constructor)) {
+ if (2 === count($constructor)) {
return call_user_func($constructor);
}
@@ -149,21 +193,28 @@ private function createContainerFromClassSpec($classSpec)
* Checks if container implements the correct interface and creates resolver using it.
*
* @param mixed $container
+ * @param bool $autowire
*
- * @return ServicesResolver
+ * @return ArgumentResolver[]
+ *
+ * @throws WrongContainerClassException
*/
- private function createArgumentResolver($container)
+ private function createResolvers($container, $autowire)
{
if (!$container instanceof ContainerInterface) {
throw new WrongContainerClassException(
sprintf(
- 'Service container is expected to implement `Interop\Container\ContainerInterface`, but `%s` does not.',
+ 'Service container is expected to implement `Psr\Container\ContainerInterface`, but `%s` does not.',
get_class($container)
),
get_class($container)
);
}
- return new ServicesResolver($container);
+ if ($autowire) {
+ return array(new ServicesResolver($container), new AutowiringResolver($container));
+ }
+
+ return array(new ServicesResolver($container));
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ArgumentAutowirer.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ArgumentAutowirer.php
new file mode 100644
index 000000000..0fbbe210c
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ArgumentAutowirer.php
@@ -0,0 +1,114 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer;
+
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\ContainerInterface as PsrContainerInterface;
+use ReflectionClass;
+use ReflectionFunctionAbstract;
+use ReflectionNamedType;
+use ReflectionParameter;
+use ReflectionException;
+
+/**
+ * Automatically wires arguments of a given function from inside the container by using type-hints.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class ArgumentAutowirer
+{
+ /**
+ * @var PsrContainerInterface
+ */
+ private $container;
+
+ /**
+ * Initialises wirer.
+ *
+ * @param PsrContainerInterface $container
+ */
+ public function __construct(PsrContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Autowires given arguments using provided container.
+ *
+ * @param ReflectionFunctionAbstract $reflection
+ * @param array $arguments
+ *
+ * @return array
+ *
+ * @throws ContainerExceptionInterface if unset argument typehint can not be resolved from container
+ */
+ public function autowireArguments(ReflectionFunctionAbstract $reflection, array $arguments)
+ {
+ $newArguments = $arguments;
+ foreach ($reflection->getParameters() as $index => $parameter) {
+ if ($this->isArgumentWireable($newArguments, $index, $parameter)) {
+ $newArguments[$index] = $this->container->get($this->getClassFromParameter($parameter));
+ }
+ }
+
+ return $newArguments;
+ }
+
+ /**
+ * Checks if given argument is wireable.
+ *
+ * Argument is wireable if it was not previously set and it has a class type-hint.
+ *
+ * @param array $arguments
+ * @param integer $index
+ * @param ReflectionParameter $parameter
+ *
+ * @return bool
+ */
+ private function isArgumentWireable(array $arguments, $index, ReflectionParameter $parameter)
+ {
+ if (isset($arguments[$index]) || array_key_exists($index, $arguments)) {
+ return false;
+ }
+
+ if (isset($arguments[$parameter->getName()]) || array_key_exists($parameter->getName(), $arguments)) {
+ return false;
+ }
+
+ return (bool) $this->getClassFromParameter($parameter);
+ }
+
+ private function getClassFromParameter(ReflectionParameter $parameter) : ?string
+ {
+ if (!($type = $parameter->getType()) || !($type instanceof ReflectionNamedType)) {
+ return null;
+ }
+
+ try {
+ $typeString = $type->getName();
+
+ if ($typeString == 'self') {
+ return $parameter->getDeclaringClass()->getName();
+ }
+ elseif ($typeString == 'parent') {
+ return $parameter->getDeclaringClass()->getParentClass()->getName();
+ }
+
+ // will throw if not valid class
+ new ReflectionClass($typeString);
+
+ return $typeString;
+
+ } catch (ReflectionException $e) {
+ return null;
+ }
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php
index 71795ee84..0f131cbc0 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php
@@ -12,7 +12,6 @@
use Behat\Behat\HelperContainer\Exception\ServiceNotFoundException;
use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException;
-use Interop\Container\ContainerInterface;
use ReflectionClass;
use ReflectionMethod;
@@ -47,7 +46,7 @@ public function __construct(array $schema)
*/
public function has($id)
{
- return isset($this->schema[$id]);
+ return array_key_exists($id, $this->schema);
}
/**
@@ -62,7 +61,7 @@ public function get($id)
);
}
- return $this->instances[$id] = isset($this->instances[$id]) ? $this->instances[$id] : $this->createInstance($id);
+ return $this->instances[$id] = $this->instances[$id] ?? $this->createInstance($id);
}
/**
@@ -99,6 +98,10 @@ private function getAndValidateServiceSchema($id)
{
$schema = $this->schema[$id];
+ if (null === $schema) {
+ $schema = array('class' => $id);
+ }
+
if (is_string($schema)) {
$schema = array('class' => $schema);
}
@@ -120,10 +123,7 @@ private function getAndValidateServiceSchema($id)
private function getAndValidateClass($id, array $schema)
{
if (!isset($schema['class'])) {
- throw new WrongServicesConfigurationException(sprintf(
- 'All services of the built-in `services` must have `class` option set, but `%s` does not.',
- $id
- ));
+ $schema['class'] = $id;
}
return $schema['class'];
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Call/Filter/ServicesResolver.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Call/Filter/ServicesResolver.php
new file mode 100644
index 000000000..0c70fef71
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Call/Filter/ServicesResolver.php
@@ -0,0 +1,204 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer\Call\Filter;
+
+use Behat\Behat\Definition\Definition;
+use Behat\Behat\HelperContainer\Environment\ServiceContainerEnvironment;
+use Behat\Behat\Definition\Call\DefinitionCall;
+use Behat\Behat\HelperContainer\ArgumentAutowirer;
+use Behat\Behat\HelperContainer\Exception\UnsupportedCallException;
+use Behat\Behat\Transformation\Call\TransformationCall;
+use Behat\Behat\Transformation\Transformation;
+use Behat\Testwork\Call\Call;
+use Behat\Testwork\Call\Filter\CallFilter;
+use Behat\Testwork\Environment\Call\EnvironmentCall;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\ContainerInterface;
+
+/**
+ * Dynamically resolves call arguments using the service container.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class ServicesResolver implements CallFilter
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function supportsCall(Call $call)
+ {
+ return ($call instanceof DefinitionCall || $call instanceof TransformationCall)
+ && $call->getEnvironment() instanceof ServiceContainerEnvironment;
+ }
+
+ /**
+ * Filters a call and returns a new one.
+ *
+ * @param Call $call
+ *
+ * @return Call
+ *
+ * @throws UnsupportedCallException
+ * @throws ContainerExceptionInterface
+ */
+ public function filterCall(Call $call)
+ {
+ if ($container = $this->getContainer($call)) {
+ $autowirer = new ArgumentAutowirer($container);
+ $newArguments = $autowirer->autowireArguments($call->getCallee()->getReflection(), $call->getArguments());
+
+ return $this->repackageCallIfNewArguments($call, $newArguments);
+ }
+
+ return $call;
+ }
+
+ /**
+ * Gets container from the call.
+ *
+ * @param Call $call
+ *
+ * @return null|ContainerInterface
+ *
+ * @throws UnsupportedCallException if given call is not EnvironmentCall or environment is not ServiceContainerEnvironment
+ */
+ private function getContainer(Call $call)
+ {
+ if (!$call instanceof EnvironmentCall) {
+ throw new UnsupportedCallException(sprintf(
+ 'ServicesResolver can not filter `%s` call.',
+ get_class($call)
+ ), $call);
+ }
+
+ $environment = $call->getEnvironment();
+
+ if (!$environment instanceof ServiceContainerEnvironment) {
+ throw new UnsupportedCallException(sprintf(
+ 'ServicesResolver can not filter `%s` call.',
+ get_class($call)
+ ), $call);
+ }
+
+ return $environment->getServiceContainer();
+ }
+
+ /**
+ * Repackages old calls with new arguments, but only if two differ.
+ *
+ * @param Call $call
+ * @param array $arguments
+ *
+ * @return Call
+ *
+ * @throws UnsupportedCallException if given call is not DefinitionCall or TransformationCall
+ */
+ private function repackageCallIfNewArguments(Call $call, array $arguments)
+ {
+ if ($arguments === $call->getArguments()) {
+ return $call;
+ }
+
+ return $this->repackageCallWithNewArguments($call, $arguments);
+ }
+
+ /**
+ * Repackages old calls with new arguments.
+ *
+ * @param Call $call
+ * @param array $newArguments
+ *
+ * @return DefinitionCall|TransformationCall
+ *
+ * @throws UnsupportedCallException
+ */
+ private function repackageCallWithNewArguments(Call $call, array $newArguments)
+ {
+ if ($call instanceof DefinitionCall) {
+ return $this->repackageDefinitionCall($call, $newArguments);
+ }
+
+ if ($call instanceof TransformationCall) {
+ return $this->repackageTransformationCall($call, $newArguments);
+ }
+
+ throw new UnsupportedCallException(
+ sprintf(
+ 'ServicesResolver can not filter `%s` call.',
+ get_class($call)
+ ), $call
+ );
+ }
+
+ /**
+ * Repackages definition call with new arguments.
+ *
+ * @param DefinitionCall $call
+ * @param array $newArguments
+ *
+ * @return DefinitionCall
+ *
+ * @throws UnsupportedCallException
+ */
+ private function repackageDefinitionCall(DefinitionCall $call, array $newArguments)
+ {
+ $definition = $call->getCallee();
+
+ if (!$definition instanceof Definition) {
+ throw new UnsupportedCallException(
+ sprintf(
+ 'Something is wrong in callee associated with `%s` call.',
+ get_class($call)
+ ), $call
+ );
+ }
+
+ return new DefinitionCall(
+ $call->getEnvironment(),
+ $call->getFeature(),
+ $call->getStep(),
+ $definition,
+ $newArguments,
+ $call->getErrorReportingLevel()
+ );
+ }
+
+ /**
+ * Repackages transformation call with new arguments.
+ *
+ * @param TransformationCall $call
+ * @param array $newArguments
+ *
+ * @return TransformationCall
+ *
+ * @throws UnsupportedCallException
+ */
+ private function repackageTransformationCall(TransformationCall $call, array $newArguments)
+ {
+ $transformation = $call->getCallee();
+
+ if (!$transformation instanceof Transformation) {
+ throw new UnsupportedCallException(
+ sprintf(
+ 'Something is wrong in callee associated with `%s` call.',
+ get_class($call)
+ ), $call
+ );
+ }
+
+ return new TransformationCall(
+ $call->getEnvironment(),
+ $call->getDefinition(),
+ $transformation,
+ $newArguments
+ );
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php
new file mode 100644
index 000000000..75fb43fa8
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer;
+
+class_alias(
+ interface_exists('Interop\\Container\\ContainerInterface')
+ ? 'Interop\\Container\\ContainerInterface'
+ : 'Psr\\Container\\ContainerInterface',
+ 'Behat\\Behat\\HelperContainer\\ContainerInterface'
+);
+
+if (false) {
+ /**
+ * @internal
+ */
+ interface ContainerInterface
+ {
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Environment/ServiceContainerEnvironment.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Environment/ServiceContainerEnvironment.php
new file mode 100644
index 000000000..8f58ba623
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Environment/ServiceContainerEnvironment.php
@@ -0,0 +1,38 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer\Environment;
+
+use Behat\Testwork\Environment\Environment;
+use Psr\Container\ContainerInterface;
+
+/**
+ * Represents test environment based on a service locator pattern.
+ *
+ * @see ContextEnvironmentHandler
+ *
+ * @author Konstantin Kudryashov
+ */
+interface ServiceContainerEnvironment extends Environment
+{
+ /**
+ * Sets/unsets service container for the environment.
+ *
+ * @param ContainerInterface|null $container
+ */
+ public function setServiceContainer(ContainerInterface $container = null);
+
+ /**
+ * Returns environment service container if set.
+ *
+ * @return null|ContainerInterface
+ */
+ public function getServiceContainer();
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ContainerException.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ContainerException.php
new file mode 100644
index 000000000..fd5543ad0
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ContainerException.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer\Exception;
+
+class_alias(
+ interface_exists('Interop\\Container\\Exception\\ContainerException')
+ ? 'Interop\\Container\\Exception\\ContainerException'
+ : 'Psr\\Container\\ContainerExceptionInterface',
+ 'Behat\\Behat\\HelperContainer\\Exception\\ContainerException'
+);
+
+if (false) {
+ /**
+ * @internal
+ */
+ interface ContainerException
+ {
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/HelperContainerException.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/HelperContainerException.php
index 04ab35f96..d61919225 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/HelperContainerException.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/HelperContainerException.php
@@ -11,7 +11,6 @@
namespace Behat\Behat\HelperContainer\Exception;
use Behat\Testwork\Environment\Exception\EnvironmentException;
-use Interop\Container\Exception\ContainerException;
/**
* All HelperContainer exceptions implement this interface.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/NotFoundException.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/NotFoundException.php
new file mode 100644
index 000000000..739e5181f
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/NotFoundException.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer\Exception;
+
+class_alias(
+ interface_exists('Interop\\Container\\Exception\\NotFoundException')
+ ? 'Interop\\Container\\Exception\\NotFoundException'
+ : 'Psr\\Container\\NotFoundExceptionInterface',
+ 'Behat\\Behat\\HelperContainer\\Exception\\NotFoundException'
+);
+
+if (false) {
+ /**
+ * @internal
+ */
+ interface NotFoundException
+ {
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ServiceNotFoundException.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ServiceNotFoundException.php
index 02bd601b7..a82b63ed0 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ServiceNotFoundException.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/ServiceNotFoundException.php
@@ -10,7 +10,6 @@
namespace Behat\Behat\HelperContainer\Exception;
-use Interop\Container\Exception\NotFoundException;
use InvalidArgumentException;
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/UnsupportedCallException.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/UnsupportedCallException.php
new file mode 100644
index 000000000..7f16ca82f
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/Exception/UnsupportedCallException.php
@@ -0,0 +1,50 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\HelperContainer\Exception;
+
+use Behat\Testwork\Call\Call;
+use InvalidArgumentException;
+
+/**
+ * Represents an exception caused by an attempt to filter an unsupported call.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class UnsupportedCallException extends InvalidArgumentException implements HelperContainerException
+{
+ /**
+ * @var Call
+ */
+ private $call;
+
+ /**
+ * Initializes exception.
+ *
+ * @param string $message
+ * @param Call $call
+ */
+ public function __construct($message, Call $call)
+ {
+ parent::__construct($message);
+
+ $this->call = $call;
+ }
+
+ /**
+ * Returns a call that caused exception.
+ *
+ * @return Call
+ */
+ public function getCall()
+ {
+ return $this->call;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php
index 09ff59400..399ffff09 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php
@@ -12,12 +12,14 @@
use Behat\Behat\Context\ServiceContainer\ContextExtension;
use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException;
+use Behat\Testwork\Call\ServiceContainer\CallExtension;
use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use Behat\Testwork\ServiceContainer\ServiceProcessor;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Reference;
/**
* Behat helper container extension.
@@ -31,7 +33,7 @@ final class HelperContainerExtension implements Extension
/*
* Available extension points
*/
- const HELPER_CONTAINER_TAG = 'helper_container.container';
+ public const HELPER_CONTAINER_TAG = 'helper_container.container';
/**
* @var ServiceProcessor
@@ -75,9 +77,15 @@ public function configure(ArrayNodeDefinition $builder)
*/
public function load(ContainerBuilder $container, array $config)
{
- $definition = new Definition('Behat\Behat\HelperContainer\Argument\ServicesResolverFactory', array($container));
+ $definition = new Definition('Behat\Behat\HelperContainer\Argument\ServicesResolverFactory', array(
+ new Reference('service_container')
+ ));
$definition->addTag(ContextExtension::SUITE_SCOPED_RESOLVER_FACTORY_TAG, array('priority' => 0));
$container->setDefinition(ContextExtension::SUITE_SCOPED_RESOLVER_FACTORY_TAG . '.helper_container', $definition);
+
+ $definition = new Definition('Behat\Behat\HelperContainer\Call\Filter\ServicesResolver');
+ $definition->addTag(CallExtension::CALL_FILTER_TAG, array('priority' => 0));
+ $container->setDefinition(CallExtension::CALL_FILTER_TAG . '.helper_container', $definition);
}
/**
@@ -88,31 +96,11 @@ public function process(ContainerBuilder $container)
$references = $this->processor->findAndSortTaggedServices($container, self::HELPER_CONTAINER_TAG);
foreach ($references as $reference) {
- if ($this->isDefinitionShared($container->getDefinition((string) $reference))) {
+ if ($container->getDefinition((string) $reference)->isShared()) {
throw new WrongServicesConfigurationException(sprintf(
'Container services must not be configured as shared, but `@%s` is.', $reference
));
}
}
}
-
- /**
- * Checks if provided definition is shared.
- *
- * @param Definition $definition
- *
- * @return bool
- *
- * @todo Remove after upgrading to Symfony 2.8+
- */
- private function isDefinitionShared(Definition $definition)
- {
- if (method_exists($definition, 'isShared')) {
- return $definition->isShared();
- } else if (method_exists($definition, 'getScope')) {
- return $definition->getScope() !== ContainerBuilder::SCOPE_PROTOTYPE;
- }
-
- return false;
- }
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeFeatureHook.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeFeatureHook.php
index b3d4fb24b..9bc9a554f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeFeatureHook.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeFeatureHook.php
@@ -68,7 +68,7 @@ public function filterMatches(HookScope $scope)
* @param FeatureNode $feature
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
private function isMatch(FeatureNode $feature, $filterString)
{
@@ -89,7 +89,7 @@ private function isMatch(FeatureNode $feature, $filterString)
* @param FeatureNode $feature
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
private function isMatchTagFilter(FeatureNode $feature, $filterString)
{
@@ -104,7 +104,7 @@ private function isMatchTagFilter(FeatureNode $feature, $filterString)
* @param FeatureNode $feature
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
private function isMatchNameFilter(FeatureNode $feature, $filterString)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeScenarioHook.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeScenarioHook.php
index 56e25f999..429fafef2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeScenarioHook.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeScenarioHook.php
@@ -48,7 +48,7 @@ public function filterMatches(HookScope $scope)
* @param ScenarioInterface $scenario
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
protected function isMatch(FeatureNode $feature, ScenarioInterface $scenario, $filterString)
{
@@ -70,16 +70,12 @@ protected function isMatch(FeatureNode $feature, ScenarioInterface $scenario, $f
* @param ScenarioInterface $scenario
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
protected function isMatchTagFilter(FeatureNode $feature, ScenarioInterface $scenario, $filterString)
{
$filter = new TagFilter($filterString);
- if ($filter->isFeatureMatch($feature)) {
- return true;
- }
-
return $filter->isScenarioMatch($feature, $scenario);
}
@@ -89,7 +85,7 @@ protected function isMatchTagFilter(FeatureNode $feature, ScenarioInterface $sce
* @param ScenarioInterface $scenario
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
protected function isMatchNameFilter(ScenarioInterface $scenario, $filterString)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php
index a1326c3cf..401e3ccdf 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php
@@ -55,7 +55,7 @@ public function filterMatches(HookScope $scope)
* @param StepNode $step
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
private function isStepMatch(StepNode $step, $filterString)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Annotation/HookAnnotationReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Annotation/HookAnnotationReader.php
index 86a95cca5..663245ee0 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Annotation/HookAnnotationReader.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Annotation/HookAnnotationReader.php
@@ -57,7 +57,7 @@ public function readCallee($contextClass, ReflectionMethod $method, $docLine, $d
$type = strtolower($match[1]);
$class = self::$classes[$type];
- $pattern = isset($match[2]) ? $match[2] : null;
+ $pattern = $match[2] ?? null;
$callable = array($contextClass, $method->getName());
return new $class($pattern, $callable, $description);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php
new file mode 100644
index 000000000..f49dd93dc
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php
@@ -0,0 +1,78 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Behat\Hook\Context\Attribute;
+
+use Behat\Behat\Context\Annotation\DocBlockHelper;
+use Behat\Behat\Context\Attribute\AttributeReader;
+use Behat\Hook\AfterFeature;
+use Behat\Hook\AfterScenario;
+use Behat\Hook\AfterStep;
+use Behat\Hook\BeforeFeature;
+use Behat\Hook\BeforeScenario;
+use Behat\Hook\BeforeStep;
+use Behat\Hook\Hook;
+use ReflectionMethod;
+
+final class HookAttributeReader implements AttributeReader
+{
+ /**
+ * @var string[]
+ */
+ private const KNOWN_ATTRIBUTES = array(
+ AfterFeature::class => 'Behat\Behat\Hook\Call\AfterFeature',
+ AfterScenario::class => 'Behat\Behat\Hook\Call\AfterScenario',
+ AfterStep::class => 'Behat\Behat\Hook\Call\AfterStep',
+ BeforeFeature::class => 'Behat\Behat\Hook\Call\BeforeFeature',
+ BeforeScenario::class => 'Behat\Behat\Hook\Call\BeforeScenario',
+ BeforeStep::class => 'Behat\Behat\Hook\Call\BeforeStep',
+ );
+
+ /**
+ * @var DocBlockHelper
+ */
+ private $docBlockHelper;
+
+ /**
+ * Initializes reader.
+ *
+ * @param DocBlockHelper $docBlockHelper
+ */
+ public function __construct(DocBlockHelper $docBlockHelper)
+ {
+ $this->docBlockHelper = $docBlockHelper;
+ }
+
+ /**
+ * @{inheritdoc}
+ */
+ public function readCallees(string $contextClass, ReflectionMethod $method)
+ {
+ if (\PHP_MAJOR_VERSION < 8) {
+ return [];
+ }
+
+ $attributes = $method->getAttributes(Hook::class, \ReflectionAttribute::IS_INSTANCEOF);
+
+ $callees = [];
+ foreach ($attributes as $attribute) {
+ $class = self::KNOWN_ATTRIBUTES[$attribute->getName()];
+ $callable = array($contextClass, $method->getName());
+ $description = null;
+ if ($docBlock = $method->getDocComment()) {
+ $description = $this->docBlockHelper->extractDescription($docBlock);
+ }
+
+ $callees[] = new $class($attribute->newInstance()->filterString, $callable, $description);
+ }
+
+ return $callees;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/FeatureScope.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/FeatureScope.php
index fe87469de..6b27b8271 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/FeatureScope.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/FeatureScope.php
@@ -20,8 +20,8 @@
*/
interface FeatureScope extends HookScope
{
- const BEFORE = 'feature.before';
- const AFTER = 'feature.after';
+ public const BEFORE = 'feature.before';
+ public const AFTER = 'feature.after';
/**
* Returns scope feature.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/ScenarioScope.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/ScenarioScope.php
index c5238bc79..c7dbe513a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/ScenarioScope.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/ScenarioScope.php
@@ -21,8 +21,8 @@
*/
interface ScenarioScope extends HookScope
{
- const BEFORE = 'scenario.before';
- const AFTER = 'scenario.after';
+ public const BEFORE = 'scenario.before';
+ public const AFTER = 'scenario.after';
/**
* Returns scope feature.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/StepScope.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/StepScope.php
index c07a79b02..449154dd0 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/StepScope.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Scope/StepScope.php
@@ -21,8 +21,8 @@
*/
interface StepScope extends HookScope
{
- const BEFORE = 'step.before';
- const AFTER = 'step.after';
+ public const BEFORE = 'step.before';
+ public const AFTER = 'step.after';
/**
* Returns scope feature.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/ServiceContainer/HookExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/ServiceContainer/HookExtension.php
index 76d4be9be..97742c392 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/ServiceContainer/HookExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/ServiceContainer/HookExtension.php
@@ -11,6 +11,7 @@
namespace Behat\Behat\Hook\ServiceContainer;
use Behat\Behat\Context\ServiceContainer\ContextExtension;
+use Behat\Behat\Definition\ServiceContainer\DefinitionExtension;
use Behat\Behat\Tester\ServiceContainer\TesterExtension;
use Behat\Testwork\Hook\ServiceContainer\HookExtension as BaseExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -32,6 +33,7 @@ public function load(ContainerBuilder $container, array $config)
parent::load($container, $config);
$this->loadAnnotationReader($container);
+ $this->loadAttributeReader($container);
}
/**
@@ -85,4 +87,18 @@ private function loadAnnotationReader(ContainerBuilder $container)
$definition->addTag(ContextExtension::ANNOTATION_READER_TAG, array('priority' => 50));
$container->setDefinition(ContextExtension::ANNOTATION_READER_TAG . '.hook', $definition);
}
+
+ /**
+ * Loads hook attribute reader.
+ *
+ * @param ContainerBuilder $container
+ */
+ private function loadAttributeReader(ContainerBuilder $container)
+ {
+ $definition = new Definition('\Behat\Behat\Hook\Context\Attribute\HookAttributeReader', array(
+ new Reference(DefinitionExtension::DOC_BLOCK_HELPER_ID)
+ ));
+ $definition->addTag(ContextExtension::ATTRIBUTE_READER_TAG, array('priority' => 50));
+ $container->setDefinition(ContextExtension::ATTRIBUTE_READER_TAG . '.hook', $definition);
+ }
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/FeatureListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/FeatureListener.php
index 13bc0a415..9487ecde2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/FeatureListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/FeatureListener.php
@@ -15,9 +15,9 @@
use Behat\Behat\EventDispatcher\Event\FeatureTested;
use Behat\Behat\Output\Node\Printer\FeaturePrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens to feature events and calls appropriate printers.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineListener.php
index bacb12f3a..85b602b7b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineListener.php
@@ -22,9 +22,9 @@
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Gherkin\Node\ExampleNode;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens to expanded outline events and calls appropriate printers.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineTableListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineTableListener.php
index fa77da454..09a179bc1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineTableListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/OutlineTableListener.php
@@ -24,10 +24,10 @@
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Tester\Result\StepResult;
use Behat\Gherkin\Node\OutlineNode;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Behat\Testwork\Tester\Setup\Setup;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens to outline table events and calls appropriate printers.
@@ -61,7 +61,7 @@ final class OutlineTableListener implements EventListener
*/
private $exampleSetup;
/**
- * @var Boolean
+ * @var bool
*/
private $headerPrinted = false;
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/ScenarioNodeListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/ScenarioNodeListener.php
index 77ac28e70..bcc9f206a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/ScenarioNodeListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/ScenarioNodeListener.php
@@ -13,11 +13,11 @@
use Behat\Behat\EventDispatcher\Event\ScenarioLikeTested;
use Behat\Behat\Output\Node\Printer\ScenarioPrinter;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSetup;
use Behat\Testwork\EventDispatcher\Event\AfterTested;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens to scenario events and calls appropriate printers (header/footer).
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/StepListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/StepListener.php
index 0d62a56ef..dda597b72 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/StepListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/StepListener.php
@@ -18,9 +18,9 @@
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Gherkin\Node\ScenarioLikeInterface;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens to step events and call appropriate printers.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/SuiteListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/SuiteListener.php
index 8e116e06d..71ee608fe 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/SuiteListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/AST/SuiteListener.php
@@ -11,11 +11,11 @@
namespace Behat\Behat\Output\Node\EventListener\AST;
use Behat\Behat\Output\Node\Printer\SetupPrinter;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteSetup;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteTested;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Behat suite listener.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php
index 7e5788554..243b200d8 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php
@@ -10,9 +10,9 @@
namespace Behat\Behat\Output\Node\EventListener\Flow;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Behat fire only siblings listener.
@@ -37,7 +37,7 @@ class FireOnlySiblingsListener implements EventListener
*/
private $descendant;
/**
- * @var Boolean
+ * @var bool
*/
private $inContext = false;
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FirstBackgroundFiresFirstListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FirstBackgroundFiresFirstListener.php
index f9bb95f64..78983627a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FirstBackgroundFiresFirstListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FirstBackgroundFiresFirstListener.php
@@ -15,9 +15,9 @@
use Behat\Behat\EventDispatcher\Event\FeatureTested;
use Behat\Behat\EventDispatcher\Event\OutlineTested;
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Behat first background fires first listener.
@@ -34,7 +34,7 @@ class FirstBackgroundFiresFirstListener implements EventListener
*/
private $descendant;
/**
- * @var Boolean
+ * @var bool
*/
private $firstBackgroundEnded = false;
/**
@@ -103,7 +103,7 @@ private function markFirstBackgroundPrintedAfterBackground($eventName)
*
* @param Event $event
*
- * @return Boolean
+ * @return bool
*/
private function isEventDelayedUntilFirstBackgroundPrinted(Event $event)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/OnlyFirstBackgroundFiresListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/OnlyFirstBackgroundFiresListener.php
index ad3679c8f..9bb73822e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/OnlyFirstBackgroundFiresListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/OnlyFirstBackgroundFiresListener.php
@@ -14,9 +14,9 @@
use Behat\Behat\EventDispatcher\Event\AfterStepTested;
use Behat\Behat\EventDispatcher\Event\BackgroundTested;
use Behat\Behat\EventDispatcher\Event\FeatureTested;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Behat only first background fires listener.
@@ -36,15 +36,15 @@ class OnlyFirstBackgroundFiresListener implements EventListener
*/
private $descendant;
/**
- * @var Boolean
+ * @var bool
*/
private $firstBackgroundEnded = false;
/**
- * @var Boolean
+ * @var bool
*/
private $inBackground = false;
/**
- * @var Boolean
+ * @var bool
*/
private $stepSetupHadOutput = false;
@@ -125,7 +125,7 @@ private function markFirstBackgroundPrintedAfterBackground($eventName)
*
* @param Event $event
*
- * @return Boolean
+ * @return bool
*/
private function isSkippableEvent(Event $event)
{
@@ -141,7 +141,7 @@ private function isSkippableEvent(Event $event)
*
* @param Event $event
*
- * @return Boolean
+ * @return bool
*/
private function isNonFailingConsequentBackgroundStep(Event $event)
{
@@ -157,7 +157,7 @@ private function isNonFailingConsequentBackgroundStep(Event $event)
*
* @param Event $event
*
- * @return Boolean
+ * @return bool
*/
private function isStepEventWithOutput(Event $event)
{
@@ -169,7 +169,7 @@ private function isStepEventWithOutput(Event $event)
*
* @param Event $event
*
- * @return Boolean
+ * @return bool
*/
private function isBeforeStepEventWithOutput(Event $event)
{
@@ -187,7 +187,7 @@ private function isBeforeStepEventWithOutput(Event $event)
*
* @param Event $event
*
- * @return Boolean
+ * @return bool
*/
private function isAfterStepWithOutput(Event $event)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitDurationListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitDurationListener.php
new file mode 100644
index 000000000..12604d5b7
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitDurationListener.php
@@ -0,0 +1,103 @@
+captureBeforeScenarioEvent($event);
+ $this->captureBeforeFeatureTested($event);
+ $this->captureAfterScenarioEvent($event);
+ $this->captureAfterFeatureEvent($event);
+ }
+
+ public function getDuration(ScenarioLikeInterface $scenario)
+ {
+ $key = $this->getHash($scenario);
+ return array_key_exists($key, $this->resultStore) ? $this->resultStore[$key] : '';
+ }
+
+ public function getFeatureDuration(FeatureNode $feature)
+ {
+ $key = $this->getHash($feature);
+ return array_key_exists($key, $this->featureResultStore) ? $this->featureResultStore[$key] : '';
+ }
+
+ private function captureBeforeFeatureTested(Event $event)
+ {
+ if (!$event instanceof BeforeFeatureTested) {
+ return;
+ }
+
+ $this->featureTimerStore[$this->getHash($event->getFeature())] = $this->startTimer();
+ }
+
+ private function captureBeforeScenarioEvent(Event $event)
+ {
+ if (!$event instanceof BeforeScenarioTested) {
+ return;
+ }
+
+ $this->scenarioTimerStore[$this->getHash($event->getScenario())] = $this->startTimer();
+ }
+
+ private function captureAfterScenarioEvent(Event $event)
+ {
+ if (!$event instanceof AfterScenarioTested) {
+ return;
+ }
+
+ $key = $this->getHash($event->getScenario());
+ $timer = $this->scenarioTimerStore[$key];
+ if ($timer instanceof Timer) {
+ $timer->stop();
+ $this->resultStore[$key] = round($timer->getTime());
+ }
+ }
+
+ private function captureAfterFeatureEvent(Event $event)
+ {
+ if (!$event instanceof AfterFeatureTested) {
+ return;
+ }
+
+ $key = $this->getHash($event->getFeature());
+ $timer = $this->featureTimerStore[$key];
+ if ($timer instanceof Timer) {
+ $timer->stop();
+ $this->featureResultStore[$key] = round($timer->getTime());
+ }
+ }
+
+ private function getHash(KeywordNodeInterface $node)
+ {
+ return spl_object_hash($node);
+ }
+
+ /** @return Timer */
+ private function startTimer()
+ {
+ $timer = new Timer();
+ $timer->start();
+
+ return $timer;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php
index 465efb6ab..031accdaa 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php
@@ -22,10 +22,10 @@
use Behat\Behat\Output\Node\Printer\SetupPrinter;
use Behat\Behat\Output\Node\Printer\StepPrinter;
use Behat\Gherkin\Node\FeatureNode;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSetup;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens to feature, scenario and step events and calls appropriate printers.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitOutlineStoreListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitOutlineStoreListener.php
index 4458ebb73..530a6ca18 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitOutlineStoreListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitOutlineStoreListener.php
@@ -14,11 +14,11 @@
use Behat\Behat\Output\Node\Printer\SuitePrinter;
use Behat\Gherkin\Node\ExampleNode;
use Behat\Gherkin\Node\OutlineNode;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSuiteTested;
use Behat\Testwork\EventDispatcher\Event\BeforeSuiteTested;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens for Outline events store the current one
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/HookStatsListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/HookStatsListener.php
index a8d6007b9..a4c9b779b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/HookStatsListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/HookStatsListener.php
@@ -13,6 +13,7 @@
use Behat\Behat\Output\Statistics\HookStat;
use Behat\Behat\Output\Statistics\Statistics;
use Behat\Testwork\Call\CallResult;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\AfterSetup;
use Behat\Testwork\EventDispatcher\Event\AfterTested;
use Behat\Testwork\Exception\ExceptionPresenter;
@@ -20,7 +21,6 @@
use Behat\Testwork\Hook\Tester\Setup\HookedTeardown;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens and records hook stats.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/ScenarioStatsListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/ScenarioStatsListener.php
index f83a38f78..ce94b2b2f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/ScenarioStatsListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/ScenarioStatsListener.php
@@ -15,9 +15,9 @@
use Behat\Behat\EventDispatcher\Event\BeforeFeatureTested;
use Behat\Behat\Output\Statistics\ScenarioStat;
use Behat\Behat\Output\Statistics\Statistics;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens and records scenario events to the statistics.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StatisticsListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StatisticsListener.php
index 1845e1b64..763eb76ad 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StatisticsListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StatisticsListener.php
@@ -12,10 +12,10 @@
use Behat\Behat\Output\Node\Printer\StatisticsPrinter;
use Behat\Behat\Output\Statistics\Statistics;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\Event\ExerciseCompleted;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Collects general suite stats such as time and memory during its execution and prints it afterwards.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StepStatsListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StepStatsListener.php
index 2f84d052b..2e4a2f7ba 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StepStatsListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Statistics/StepStatsListener.php
@@ -17,16 +17,15 @@
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
use Behat\Behat\Output\Statistics\StepStatV2;
use Behat\Behat\Output\Statistics\Statistics;
-use Behat\Behat\Output\Statistics\StepStat;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Tester\Result\ExecutedStepResult;
use Behat\Behat\Tester\Result\StepResult;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Exception\ExceptionPresenter;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Behat\Testwork\Tester\Result\ExceptionResult;
use Exception;
-use Symfony\Component\EventDispatcher\Event;
/**
* Listens and records step events to statistics.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/CounterPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/CounterPrinter.php
index ff567dba3..92954c342 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/CounterPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/CounterPrinter.php
@@ -10,9 +10,9 @@
namespace Behat\Behat\Output\Node\Printer;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Testwork\Output\Printer\OutputPrinter;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Behat counter printer.
@@ -64,12 +64,12 @@ public function printCounters(OutputPrinter $printer, $intro, array $stats)
$style = $this->resultConverter->convertResultCodeToString($resultCode);
$transId = $style . '_count';
- $message = $this->translator->transChoice($transId, $count, array('%1%' => $count), 'output');
+ $message = $this->translator->trans($transId, array('%count%' => $count), 'output');
$detailedStats[] = sprintf('{+%s}%s{-%s}', $style, $message, $style);
}
- $message = $this->translator->transChoice($intro, $totalCount, array('%1%' => $totalCount), 'output');
+ $message = $this->translator->trans($intro, array('%count%' => $totalCount), 'output');
$printer->write($message);
if (count($detailedStats)) {
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Helper/WidthCalculator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Helper/WidthCalculator.php
index bef188128..c7a1fa96d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Helper/WidthCalculator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Helper/WidthCalculator.php
@@ -79,7 +79,7 @@ public function calculateScenarioHeaderWidth(Scenario $scenario, $indentation)
$header = sprintf('%s%s', $indentText, $scenario->getTitle());
} else {
$title = $scenario->getTitle();
- $lines = explode("\n", $title);
+ $lines = explode("\n", $title ?? '');
$header = sprintf('%s%s: %s', $indentText, $scenario->getKeyword(), array_shift($lines));
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitFeaturePrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitFeaturePrinter.php
index 6b6e87184..651c4a650 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitFeaturePrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitFeaturePrinter.php
@@ -10,6 +10,7 @@
namespace Behat\Behat\Output\Node\Printer\JUnit;
+use Behat\Behat\Output\Node\EventListener\JUnit\JUnitDurationListener;
use Behat\Behat\Output\Node\Printer\FeaturePrinter;
use Behat\Behat\Output\Statistics\PhaseStatistics;
use Behat\Behat\Tester\Result\StepResult;
@@ -30,9 +31,15 @@ final class JUnitFeaturePrinter implements FeaturePrinter
*/
private $statistics;
- public function __construct(PhaseStatistics $statistics)
+ /**
+ * @var JUnitDurationListener|null
+ */
+ private $durationListener;
+
+ public function __construct(PhaseStatistics $statistics, JUnitDurationListener $durationListener = null)
{
$this->statistics = $statistics;
+ $this->durationListener = $durationListener;
}
/**
@@ -57,6 +64,7 @@ public function printHeader(Formatter $formatter, FeatureNode $feature)
'skipped' => $stats[TestResult::SKIPPED],
'failures' => $stats[TestResult::FAILED],
'errors' => $stats[TestResult::PENDING] + $stats[StepResult::UNDEFINED],
+ 'time' => $this->durationListener ? $this->durationListener->getFeatureDuration($feature) : '',
));
$this->statistics->reset();
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
index cf61eaab9..0ca46e987 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
@@ -11,6 +11,7 @@
namespace Behat\Behat\Output\Node\Printer\JUnit;
use Behat\Behat\Output\Node\EventListener\JUnit\JUnitOutlineStoreListener;
+use Behat\Behat\Output\Node\EventListener\JUnit\JUnitDurationListener;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Gherkin\Node\ExampleNode;
use Behat\Gherkin\Node\FeatureNode;
@@ -47,10 +48,16 @@ final class JUnitScenarioPrinter
*/
private $outlineStepCount;
- public function __construct(ResultToStringConverter $resultConverter, JUnitOutlineStoreListener $outlineListener)
+ /**
+ * @var JUnitDurationListener|null
+ */
+ private $durationListener;
+
+ public function __construct(ResultToStringConverter $resultConverter, JUnitOutlineStoreListener $outlineListener, JUnitDurationListener $durationListener = null)
{
$this->resultConverter = $resultConverter;
$this->outlineStoreListener = $outlineListener;
+ $this->durationListener = $durationListener;
}
/**
@@ -71,7 +78,9 @@ public function printOpenTag(Formatter $formatter, FeatureNode $feature, Scenari
$outputPrinter->addTestcase(array(
'name' => $name,
- 'status' => $this->resultConverter->convertResultToString($result)
+ 'classname' => $feature->getTitle(),
+ 'status' => $this->resultConverter->convertResultToString($result),
+ 'time' => $this->durationListener ? $this->durationListener->getDuration($scenario) : ''
));
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/ListPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/ListPrinter.php
index 31e8388ee..8f7193649 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/ListPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/ListPrinter.php
@@ -10,6 +10,7 @@
namespace Behat\Behat\Output\Node\Printer;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter;
use Behat\Behat\Output\Statistics\HookStat;
use Behat\Behat\Output\Statistics\ScenarioStat;
@@ -18,7 +19,6 @@
use Behat\Testwork\Exception\ExceptionPresenter;
use Behat\Testwork\Output\Printer\OutputPrinter;
use Behat\Testwork\Tester\Result\TestResult;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Behat list printer.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyScenarioPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyScenarioPrinter.php
index 378a99118..28f3adccc 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyScenarioPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyScenarioPrinter.php
@@ -110,7 +110,7 @@ private function printKeyword(OutputPrinter $printer, $keyword)
*/
private function printTitle(OutputPrinter $printer, $longTitle)
{
- $description = explode("\n", $longTitle);
+ $description = explode("\n", $longTitle ?? '');
$title = array_shift($description);
if ('' !== $title) {
@@ -126,7 +126,7 @@ private function printTitle(OutputPrinter $printer, $longTitle)
*/
private function printDescription(OutputPrinter $printer, $longTitle)
{
- $lines = explode("\n", $longTitle);
+ $lines = explode("\n", $longTitle ?? '');
array_shift($lines);
foreach ($lines as $line) {
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySetupPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySetupPrinter.php
index 46bcba3a3..5475f51fe 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySetupPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySetupPrinter.php
@@ -56,8 +56,8 @@ final class PrettySetupPrinter implements SetupPrinter
* @param ResultToStringConverter $resultConverter
* @param ExceptionPresenter $exceptionPresenter
* @param integer $indentation
- * @param Boolean $newlineBefore
- * @param Boolean $newlineAfter
+ * @param bool $newlineBefore
+ * @param bool $newlineAfter
*/
public function __construct(
ResultToStringConverter $resultConverter,
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySkippedStepPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySkippedStepPrinter.php
index 718afd3b9..b8c8d464a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySkippedStepPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettySkippedStepPrinter.php
@@ -129,7 +129,7 @@ private function printArguments(Formatter $formatter, array $arguments)
* Returns argument string for provided argument.
*
* @param ArgumentInterface $argument
- * @param Boolean $collapse
+ * @param bool $collapse
*
* @return string
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyStepPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyStepPrinter.php
index 8d47da1ec..ee2e5d09e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyStepPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyStepPrinter.php
@@ -180,7 +180,7 @@ private function printException(OutputPrinter $printer, StepResult $result)
* Returns argument string for provided argument.
*
* @param ArgumentInterface $argument
- * @param Boolean $collapse
+ * @param bool $collapse
*
* @return string
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Printer/Formatter/ConsoleFormatter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Printer/Formatter/ConsoleFormatter.php
index 9b403a68e..57d3ef38b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Printer/Formatter/ConsoleFormatter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Printer/Formatter/ConsoleFormatter.php
@@ -19,7 +19,7 @@
*/
final class ConsoleFormatter extends BaseOutputFormatter
{
- const CUSTOM_PATTERN = '/{\+([a-z-_]+)}(.*?){\-\\1}/si';
+ public const CUSTOM_PATTERN = '/{\+([a-z-_]+)}(.*?){\-\\1}/si';
/**
* Formats a message according to the given styles.
@@ -28,7 +28,7 @@ final class ConsoleFormatter extends BaseOutputFormatter
*
* @return string The styled message
*/
- public function format($message)
+ public function format($message): string
{
return preg_replace_callback(self::CUSTOM_PATTERN, array($this, 'replaceStyle'), $message);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/JUnitFormatterFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/JUnitFormatterFactory.php
index a9d289516..c28d2cda5 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/JUnitFormatterFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/JUnitFormatterFactory.php
@@ -27,8 +27,8 @@ final class JUnitFormatterFactory implements FormatterFactory
/*
* Available services
*/
- const ROOT_LISTENER_ID = 'output.node.listener.junit';
- const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
+ public const ROOT_LISTENER_ID = 'output.node.listener.junit';
+ public const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
/**
* {@inheritdoc}
@@ -73,12 +73,14 @@ private function loadCorePrinters(ContainerBuilder $container)
$definition = new Definition('Behat\Behat\Output\Node\Printer\JUnit\JUnitFeaturePrinter', array(
new Reference('output.junit.statistics'),
+ new Reference('output.node.listener.junit.duration')
));
$container->setDefinition('output.node.printer.junit.feature', $definition);
$definition = new Definition('Behat\Behat\Output\Node\Printer\JUnit\JUnitScenarioPrinter', array(
new Reference(self::RESULT_TO_STRING_CONVERTER_ID),
new Reference('output.node.listener.junit.outline'),
+ new Reference('output.node.listener.junit.duration')
));
$container->setDefinition('output.node.printer.junit.scenario', $definition);
@@ -109,9 +111,15 @@ private function loadRootNodeListener(ContainerBuilder $container)
);
$container->setDefinition('output.node.listener.junit.outline', $definition);
+ $definition = new Definition(
+ 'Behat\Behat\Output\Node\EventListener\JUnit\JUnitDurationListener'
+ );
+
+ $container->setDefinition('output.node.listener.junit.duration', $definition);
$definition = new Definition('Behat\Testwork\Output\Node\EventListener\ChainEventListener', array(
array(
+ new Reference('output.node.listener.junit.duration'),
new Reference('output.node.listener.junit.outline'),
new Definition('Behat\Behat\Output\Node\EventListener\JUnit\JUnitFeatureElementListener', array(
new Reference('output.node.printer.junit.feature'),
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php
index 261b509a8..b2d266025 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php
@@ -38,13 +38,13 @@ class PrettyFormatterFactory implements FormatterFactory
/*
* Available services
*/
- const ROOT_LISTENER_ID = 'output.node.listener.pretty';
- const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
+ public const ROOT_LISTENER_ID = 'output.node.listener.pretty';
+ public const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
/*
* Available extension points
*/
- const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.pretty.wrapper';
+ public const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.pretty.wrapper';
/**
* Initializes extension.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/ProgressFormatterFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/ProgressFormatterFactory.php
index e19acdc05..3e02154da 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/ProgressFormatterFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/ProgressFormatterFactory.php
@@ -34,13 +34,13 @@ class ProgressFormatterFactory implements FormatterFactory
/*
* Available services
*/
- const ROOT_LISTENER_ID = 'output.node.listener.progress';
- const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
+ public const ROOT_LISTENER_ID = 'output.node.listener.progress';
+ public const RESULT_TO_STRING_CONVERTER_ID = 'output.node.printer.result_to_string';
/*
* Available extension points
*/
- const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.progress.wrapper';
+ public const ROOT_LISTENER_WRAPPER_TAG = 'output.node.listener.progress.wrapper';
/**
* Initializes extension.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/AggregateSnippet.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/AggregateSnippet.php
index cbadc0566..c63e8f1d7 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/AggregateSnippet.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/AggregateSnippet.php
@@ -112,9 +112,8 @@ public function getUsedClasses()
}
return array_unique(
- call_user_func_array(
- 'array_merge',
- array_map(
+ array_merge(
+ ...array_map(
function (Snippet $snippet) {
if (!$snippet instanceof ContextSnippet) {
return array();
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Appender/SnippetAppender.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Appender/SnippetAppender.php
index 041b8e6e5..863d88fb3 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Appender/SnippetAppender.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Appender/SnippetAppender.php
@@ -27,7 +27,7 @@ interface SnippetAppender
*
* @param AggregateSnippet $snippet
*
- * @return Boolean
+ * @return bool
*/
public function supportsSnippet(AggregateSnippet $snippet);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Generator/SnippetGenerator.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Generator/SnippetGenerator.php
index ca7d73937..09bbd1164 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Generator/SnippetGenerator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Generator/SnippetGenerator.php
@@ -30,7 +30,7 @@ interface SnippetGenerator
* @param Environment $environment
* @param StepNode $step
*
- * @return Boolean
+ * @return bool
*/
public function supportsEnvironmentAndStep(Environment $environment, StepNode $step);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php
index 7a5b36e74..4112b695d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php
@@ -10,11 +10,11 @@
namespace Behat\Behat\Snippet\Printer;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Snippet\AggregateSnippet;
use Behat\Gherkin\Node\StepNode;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Behat console-based snippet printer.
@@ -57,7 +57,7 @@ public function __construct(OutputInterface $output, TranslatorInterface $transl
*/
public function printSnippets($targetName, array $snippets)
{
- $message = $this->translator->trans('snippet_proposal_title', array('%1%' => $targetName), 'output');
+ $message = $this->translator->trans('snippet_proposal_title', array('%count%' => $targetName), 'output');
$this->output->writeln('--- ' . $message . PHP_EOL);
@@ -74,7 +74,7 @@ public function printSnippets($targetName, array $snippets)
*/
public function printUndefinedSteps($suiteName, array $steps)
{
- $message = $this->translator->trans('snippet_missing_title', array('%1%' => $suiteName), 'output');
+ $message = $this->translator->trans('snippet_missing_title', array('%count%' => $suiteName), 'output');
$this->output->writeln('--- ' . $message . PHP_EOL);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/ServiceContainer/SnippetExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/ServiceContainer/SnippetExtension.php
index 992c3716d..6c68821af 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/ServiceContainer/SnippetExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/ServiceContainer/SnippetExtension.php
@@ -31,14 +31,14 @@ class SnippetExtension implements Extension
/*
* Available services
*/
- const REGISTRY_ID = 'snippet.registry';
- const WRITER_ID = 'snippet.writer';
+ public const REGISTRY_ID = 'snippet.registry';
+ public const WRITER_ID = 'snippet.writer';
/*
* Available extension points
*/
- const GENERATOR_TAG = 'snippet.generator';
- const APPENDER_TAG = 'snippet.appender';
+ public const GENERATOR_TAG = 'snippet.generator';
+ public const APPENDER_TAG = 'snippet.appender';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/SnippetRegistry.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/SnippetRegistry.php
index 0724c3e40..7b9257263 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/SnippetRegistry.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Snippet/SnippetRegistry.php
@@ -34,7 +34,7 @@ final class SnippetRegistry implements SnippetRepository
*/
private $snippets = array();
/**
- * @var Boolean
+ * @var bool
*/
private $snippetsGenerated = false;
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php
index 8d70b57d8..10086c76c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/BackgroundTester.php
@@ -28,7 +28,7 @@ interface BackgroundTester
*
* @param Environment $env
* @param FeatureNode $feature
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -39,7 +39,7 @@ public function setUp(Environment $env, FeatureNode $feature, $skip);
*
* @param Environment $env
* @param FeatureNode $feature
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -50,7 +50,7 @@ public function test(Environment $env, FeatureNode $feature, $skip);
*
* @param Environment $env
* @param FeatureNode $feature
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php
index 863aba38c..43b45e62f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/OutlineTester.php
@@ -30,7 +30,7 @@ interface OutlineTester
* @param Environment $env
* @param FeatureNode $feature
* @param OutlineNode $outline
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -42,7 +42,7 @@ public function setUp(Environment $env, FeatureNode $feature, OutlineNode $outli
* @param Environment $env
* @param FeatureNode $feature
* @param OutlineNode $outline
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -54,7 +54,7 @@ public function test(Environment $env, FeatureNode $feature, OutlineNode $outlin
* @param Environment $env
* @param FeatureNode $feature
* @param OutlineNode $outline
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Result/StepResult.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Result/StepResult.php
index 0a898c996..87cec353d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Result/StepResult.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Result/StepResult.php
@@ -19,5 +19,5 @@
*/
interface StepResult extends TestResult
{
- const UNDEFINED = 30;
+ public const UNDEFINED = 30;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php
index 7ab11a0be..08b8ca951 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php
@@ -91,7 +91,7 @@ public function tearDown(Environment $env, FeatureNode $feature, Scenario $scena
*
* @param Environment $env
* @param FeatureNode $feature
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php
index 7031eeca7..46959f6de 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php
@@ -107,7 +107,7 @@ private function searchDefinition(Environment $env, FeatureNode $feature, StepNo
* @param FeatureNode $feature
* @param StepNode $step
* @param SearchResult $search
- * @param Boolean $skip
+ * @param bool $skip
*
* @return StepResult
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php
index 2fd249489..601e4f67a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php
@@ -30,7 +30,7 @@ interface ScenarioTester
* @param Environment $env
* @param FeatureNode $feature
* @param Scenario $scenario
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -42,7 +42,7 @@ public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario
* @param Environment $env
* @param FeatureNode $feature
* @param Scenario $scenario
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -54,7 +54,7 @@ public function test(Environment $env, FeatureNode $feature, Scenario $scenario,
* @param Environment $env
* @param FeatureNode $feature
* @param Scenario $scenario
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ServiceContainer/TesterExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ServiceContainer/TesterExtension.php
index 394ee9317..e8ba129d1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ServiceContainer/TesterExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/ServiceContainer/TesterExtension.php
@@ -33,20 +33,20 @@ class TesterExtension extends BaseExtension
/*
* Available services
*/
- const SCENARIO_TESTER_ID = 'tester.scenario';
- const OUTLINE_TESTER_ID = 'tester.outline';
- const EXAMPLE_TESTER_ID = 'tester.example';
- const BACKGROUND_TESTER_ID = 'tester.background';
- const STEP_TESTER_ID = 'tester.step';
+ public const SCENARIO_TESTER_ID = 'tester.scenario';
+ public const OUTLINE_TESTER_ID = 'tester.outline';
+ public const EXAMPLE_TESTER_ID = 'tester.example';
+ public const BACKGROUND_TESTER_ID = 'tester.background';
+ public const STEP_TESTER_ID = 'tester.step';
/**
* Available extension points
*/
- const SCENARIO_TESTER_WRAPPER_TAG = 'tester.scenario.wrapper';
- const OUTLINE_TESTER_WRAPPER_TAG = 'tester.outline.wrapper';
- const EXAMPLE_TESTER_WRAPPER_TAG = 'tester.example.wrapper';
- const BACKGROUND_TESTER_WRAPPER_TAG = 'tester.background.wrapper';
- const STEP_TESTER_WRAPPER_TAG = 'tester.step.wrapper';
+ public const SCENARIO_TESTER_WRAPPER_TAG = 'tester.scenario.wrapper';
+ public const OUTLINE_TESTER_WRAPPER_TAG = 'tester.outline.wrapper';
+ public const EXAMPLE_TESTER_WRAPPER_TAG = 'tester.example.wrapper';
+ public const BACKGROUND_TESTER_WRAPPER_TAG = 'tester.background.wrapper';
+ public const STEP_TESTER_WRAPPER_TAG = 'tester.step.wrapper';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php
index 543e133d2..d7364a9bc 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php
@@ -45,7 +45,7 @@ public function __construct(StepTester $stepTester)
* @param Environment $env
* @param FeatureNode $feature
* @param StepContainerInterface $container
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult[]
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php
index d5c995ceb..94d735778 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php
@@ -30,7 +30,7 @@ interface StepTester
* @param Environment $env
* @param FeatureNode $feature
* @param StepNode $step
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -42,7 +42,7 @@ public function setUp(Environment $env, FeatureNode $feature, StepNode $step, $s
* @param Environment $env
* @param FeatureNode $feature
* @param StepNode $step
- * @param Boolean $skip
+ * @param bool $skip
*
* @return StepResult
*/
@@ -54,7 +54,7 @@ public function test(Environment $env, FeatureNode $feature, StepNode $step, $sk
* @param Environment $env
* @param FeatureNode $feature
* @param StepNode $step
- * @param Boolean $skip
+ * @param bool $skip
* @param StepResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php
index a32ac5cca..680d19685 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php
@@ -64,18 +64,13 @@ public function readCallee($contextClass, ReflectionMethod $method, $docLine, $d
*/
private function simpleTransformations()
{
- $transformations = array();
- $transformations[] = 'Behat\Behat\Transformation\Transformation\RowBasedTableTransformation';
- $transformations[] = 'Behat\Behat\Transformation\Transformation\ColumnBasedTableTransformation';
- $transformations[] = 'Behat\Behat\Transformation\Transformation\TableRowTransformation';
-
- if (PHP_VERSION_ID >= 70000) {
- $transformations[] = 'Behat\Behat\Transformation\Transformation\TokenNameAndReturnTypeTransformation';
- $transformations[] = 'Behat\Behat\Transformation\Transformation\ReturnTypeTransformation';
- }
-
- $transformations[] = 'Behat\Behat\Transformation\Transformation\TokenNameTransformation';
-
- return $transformations;
+ return array(
+ 'Behat\Behat\Transformation\Transformation\RowBasedTableTransformation',
+ 'Behat\Behat\Transformation\Transformation\ColumnBasedTableTransformation',
+ 'Behat\Behat\Transformation\Transformation\TableRowTransformation',
+ 'Behat\Behat\Transformation\Transformation\TokenNameAndReturnTypeTransformation',
+ 'Behat\Behat\Transformation\Transformation\ReturnTypeTransformation',
+ 'Behat\Behat\Transformation\Transformation\TokenNameTransformation'
+ );
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/ServiceContainer/TransformationExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/ServiceContainer/TransformationExtension.php
index f322ee926..9c767b90e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/ServiceContainer/TransformationExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/ServiceContainer/TransformationExtension.php
@@ -33,12 +33,14 @@ class TransformationExtension implements Extension
/*
* Available services
*/
- const REPOSITORY_ID = 'transformation.repository';
+ public const REPOSITORY_ID = 'transformation.repository';
/*
* Available extension points
*/
- const ARGUMENT_TRANSFORMER_TAG = 'transformation.argument_transformer';
+ public const ARGUMENT_TRANSFORMER_TAG = 'transformation.argument_transformer';
+
+ protected const DEFINITION_ARGUMENT_TRANSFORMER_ID = CallExtension::CALL_FILTER_TAG . '.definition_argument_transformer';
/**
* @var ServiceProcessor
@@ -105,7 +107,7 @@ protected function loadDefinitionArgumentsTransformer(ContainerBuilder $containe
{
$definition = new Definition('Behat\Behat\Transformation\Call\Filter\DefinitionArgumentsTransformer');
$definition->addTag(CallExtension::CALL_FILTER_TAG, array('priority' => 200));
- $container->setDefinition($this->getDefinitionArgumentTransformerId(), $definition);
+ $container->setDefinition(self::DEFINITION_ARGUMENT_TRANSFORMER_ID, $definition);
}
/**
@@ -158,7 +160,7 @@ protected function loadRepository(ContainerBuilder $container)
protected function processArgumentsTransformers(ContainerBuilder $container)
{
$references = $this->processor->findAndSortTaggedServices($container, self::ARGUMENT_TRANSFORMER_TAG);
- $definition = $container->getDefinition($this->getDefinitionArgumentTransformerId());
+ $definition = $container->getDefinition(self::DEFINITION_ARGUMENT_TRANSFORMER_ID);
foreach ($references as $reference) {
$definition->addMethodCall('registerArgumentTransformer', array($reference));
@@ -169,9 +171,13 @@ protected function processArgumentsTransformers(ContainerBuilder $container)
* Returns definition argument transformer service id.
*
* @return string
+ *
+ * @deprecated Use DEFINITION_ARGUMENT_TRANSFORMER_ID constant instead
+ *
+ * @todo Remove method in next major version
*/
protected function getDefinitionArgumentTransformerId()
{
- return CallExtension::CALL_FILTER_TAG . '.definition_argument_transformer';
+ return self::DEFINITION_ARGUMENT_TRANSFORMER_ID;
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/SimpleArgumentTransformation.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/SimpleArgumentTransformation.php
index 77cdeefb2..16530c3f7 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/SimpleArgumentTransformation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/SimpleArgumentTransformation.php
@@ -45,7 +45,7 @@ public function getPriority();
* @param integer|string $argumentIndex
* @param mixed $argumentValue
*
- * @return Boolean
+ * @return bool
*/
public function supportsDefinitionAndArgument(DefinitionCall $definitionCall, $argumentIndex, $argumentValue);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ColumnBasedTableTransformation.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ColumnBasedTableTransformation.php
index 1c8cc0ec3..c26df56d2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ColumnBasedTableTransformation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ColumnBasedTableTransformation.php
@@ -25,7 +25,7 @@
*/
final class ColumnBasedTableTransformation extends RuntimeCallee implements SimpleArgumentTransformation
{
- const PATTERN_REGEX = '/^table\:(?:\*|[[:print:]]+)$/';
+ public const PATTERN_REGEX = '/^table\:(?:\*|[[:print:]]+)$/';
/**
* @var string
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ReturnTypeTransformation.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ReturnTypeTransformation.php
index ecdc613a1..dd2e9c08c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ReturnTypeTransformation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/ReturnTypeTransformation.php
@@ -16,9 +16,12 @@
use Behat\Testwork\Call\CallCenter;
use Behat\Testwork\Call\RuntimeCallee;
use Closure;
+use ReflectionClass;
+use ReflectionException;
use ReflectionFunctionAbstract;
use ReflectionMethod;
use ReflectionParameter;
+use ReflectionNamedType;
/**
* By-type object transformation.
@@ -126,10 +129,15 @@ static private function getReturnClass(ReflectionFunctionAbstract $reflection)
{
$type = $reflection->getReturnType();
- if (null === $type || $type->isBuiltin()) {
+ // Skip ReflectionUnionType as they can't be relied on for a transform
+ if (null === $type || !($type instanceof \ReflectionNamedType) || $type->isBuiltin()) {
return null;
}
+ if ($type instanceof ReflectionNamedType) {
+ return $type->getName();
+ }
+
return (string) $type;
}
@@ -147,9 +155,14 @@ private function getParameterClassNameByIndex(DefinitionCall $definitionCall, $a
array_filter($this->getCallParameters($definitionCall),
$this->hasIndex($argumentIndex)
),
- $this->isClass()
+ $this->getClassReflection()
);
- return count($parameters) ? current($parameters)->getClass()->getName() : null;
+
+ if (count($parameters) == 0) {
+ return null;
+ }
+
+ return ($this->getClassReflection())(current($parameters))->getName();
}
/**
@@ -209,10 +222,22 @@ private function hasPosition($index)
*
* @return Closure
*/
- private function isClass()
+ private function getClassReflection() : closure
{
- return function (ReflectionParameter $parameter) {
- return $parameter->getClass();
+ return function (ReflectionParameter $parameter) : ?ReflectionClass
+ {
+ $t = $parameter->getType();
+
+ if ($t instanceof ReflectionNamedType) {
+ try {
+ return new ReflectionClass($t->getName());
+ }
+ catch (ReflectionException $t) {
+ return null;
+ }
+ }
+
+ return null;
};
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/RowBasedTableTransformation.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/RowBasedTableTransformation.php
index 61389834d..a5b1c5123 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/RowBasedTableTransformation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/RowBasedTableTransformation.php
@@ -26,7 +26,7 @@
*/
final class RowBasedTableTransformation extends RuntimeCallee implements SimpleArgumentTransformation
{
- const PATTERN_REGEX = '/^rowtable\:[[:print:]]+$/';
+ public const PATTERN_REGEX = '/^rowtable\:[[:print:]]+$/';
/**
* @var string
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php
index 571f1f0cd..1a71c0b7b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php
@@ -25,7 +25,7 @@
*/
final class TableRowTransformation extends RuntimeCallee implements SimpleArgumentTransformation
{
- const PATTERN_REGEX = '/^row\:[[:print:]]+$/';
+ public const PATTERN_REGEX = '/^row\:[[:print:]]+$/';
/**
* @var string
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TokenNameTransformation.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TokenNameTransformation.php
index cd4f4ab0b..a64d86e64 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TokenNameTransformation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TokenNameTransformation.php
@@ -24,7 +24,7 @@
*/
final class TokenNameTransformation extends RuntimeCallee implements SimpleArgumentTransformation
{
- const PATTERN_REGEX = '/^\:\w+$/';
+ public const PATTERN_REGEX = '/^\:\w+$/';
/**
* @var string
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/ArgumentTransformer.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/ArgumentTransformer.php
index 4773960e0..4457d838b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/ArgumentTransformer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/ArgumentTransformer.php
@@ -26,7 +26,7 @@ interface ArgumentTransformer
* @param integer|string $argumentIndex
* @param mixed $argumentValue
*
- * @return Boolean
+ * @return bool
*/
public function supportsDefinitionAndArgument(DefinitionCall $definitionCall, $argumentIndex, $argumentValue);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/RepositoryArgumentTransformer.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/RepositoryArgumentTransformer.php
index 795f42fae..4bdca2378 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/RepositoryArgumentTransformer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Transformation/Transformer/RepositoryArgumentTransformer.php
@@ -12,6 +12,7 @@
use Behat\Behat\Definition\Call\DefinitionCall;
use Behat\Behat\Definition\Pattern\PatternTransformer;
+use Behat\Behat\Definition\Translator\TranslatorInterface;
use Behat\Behat\Transformation\SimpleArgumentTransformation;
use Behat\Behat\Transformation\Transformation\PatternTransformation;
use Behat\Behat\Transformation\RegexGenerator;
@@ -19,7 +20,6 @@
use Behat\Behat\Transformation\TransformationRepository;
use Behat\Gherkin\Node\ArgumentInterface;
use Behat\Testwork\Call\CallCenter;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Argument transformer based on transformations repository.
@@ -115,11 +115,7 @@ public function generateRegex($suiteName, $pattern, $language)
private function applySimpleTransformations(array $transformations, DefinitionCall $definitionCall, $index, $value)
{
usort($transformations, function (SimpleArgumentTransformation $t1, SimpleArgumentTransformation $t2) {
- if ($t1->getPriority() == $t2->getPriority()) {
- return 0;
- }
-
- return ($t1->getPriority() > $t2->getPriority()) ? -1 : 1;
+ return $t2->getPriority() <=> $t1->getPriority();
});
$newValue = $value;
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterFeature.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterFeature.php
new file mode 100644
index 000000000..05c818009
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterFeature.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Represents an Attribute for AfterFeature hook
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class AfterFeature implements Hook
+{
+ /**
+ * @var string
+ */
+ public $filterString;
+
+ public function __construct($filterString = null)
+ {
+ $this->filterString = $filterString;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterScenario.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterScenario.php
new file mode 100644
index 000000000..feb480cc1
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterScenario.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Represents an Attribute for AfterScenario hook
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class AfterScenario implements Hook
+{
+ /**
+ * @var string
+ */
+ public $filterString;
+
+ public function __construct($filterString = null)
+ {
+ $this->filterString = $filterString;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterStep.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterStep.php
new file mode 100644
index 000000000..8a27ff646
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/AfterStep.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Represents an Attribute for AfterStep hook
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class AfterStep implements Hook
+{
+ /**
+ * @var string
+ */
+ public $filterString;
+
+ public function __construct($filterString = null)
+ {
+ $this->filterString = $filterString;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeFeature.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeFeature.php
new file mode 100644
index 000000000..401ae2e75
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeFeature.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Represents an Attribute for BeforeFeature hook
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class BeforeFeature implements Hook
+{
+ /**
+ * @var string
+ */
+ public $filterString;
+
+ public function __construct($filterString = null)
+ {
+ $this->filterString = $filterString;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeScenario.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeScenario.php
new file mode 100644
index 000000000..d1d0bb7ef
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeScenario.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Represents an Attribute for BeforeScenario hook
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class BeforeScenario implements Hook
+{
+ /**
+ * @var string
+ */
+ public $filterString;
+
+ public function __construct($filterString = null)
+ {
+ $this->filterString = $filterString;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeStep.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeStep.php
new file mode 100644
index 000000000..1c7097143
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/BeforeStep.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Represents an Attribute for BeforeStep hook
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class BeforeStep implements Hook
+{
+ /**
+ * @var string
+ */
+ public $filterString;
+
+ public function __construct($filterString = null)
+ {
+ $this->filterString = $filterString;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Hook/Hook.php b/tests/integration/vendor/behat/behat/src/Behat/Hook/Hook.php
new file mode 100644
index 000000000..8c6dc7d8b
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Hook/Hook.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Hook;
+
+/**
+ * Marker interface for all Attributes regarding
+ * Hooks
+ *
+ * @internal Only meant as marker, not as an extension point
+ */
+interface Hook
+{
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Step/Definition.php b/tests/integration/vendor/behat/behat/src/Behat/Step/Definition.php
new file mode 100644
index 000000000..29578aebd
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Step/Definition.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Step;
+
+/**
+ * Marker interface for all Attributes regarding
+ * Call definitions
+ *
+ * @internal Only meant as marker, not as an extension point
+ */
+interface Definition
+{
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Step/Given.php b/tests/integration/vendor/behat/behat/src/Behat/Step/Given.php
new file mode 100644
index 000000000..6e07bf1a2
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Step/Given.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Step;
+
+/**
+ * Represents an Attribute for Given steps
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class Given implements Definition
+{
+ /**
+ * @var string
+ */
+ public $pattern;
+
+ public function __construct($pattern = null)
+ {
+ $this->pattern = $pattern;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Step/Then.php b/tests/integration/vendor/behat/behat/src/Behat/Step/Then.php
new file mode 100644
index 000000000..a3b9923c7
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Step/Then.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Step;
+
+/**
+ * Represents an Attribute for Then steps
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class Then implements Definition
+{
+ /**
+ * @var string
+ */
+ public $pattern;
+
+ public function __construct($pattern = null)
+ {
+ $this->pattern = $pattern;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Step/When.php b/tests/integration/vendor/behat/behat/src/Behat/Step/When.php
new file mode 100644
index 000000000..d6727e4c2
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Step/When.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Step;
+
+/**
+ * Represents an Attribute for When steps
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+final class When implements Definition
+{
+ /**
+ * @var string
+ */
+ public $pattern;
+
+ public function __construct($pattern = null)
+ {
+ $this->pattern = $pattern;
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php
index 88ace2243..49694e298 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php
@@ -10,10 +10,10 @@
namespace Behat\Testwork\Argument;
-use Behat\Testwork\Argument\Exception\UnknownParameterValueException;
use ReflectionFunctionAbstract;
-use ReflectionMethod;
+use ReflectionClass;
use ReflectionParameter;
+use ReflectionException;
/**
* Organises function arguments using its reflection.
@@ -34,12 +34,7 @@ final class MixedArgumentOrganiser implements ArgumentOrganiser
*/
public function organiseArguments(ReflectionFunctionAbstract $function, array $arguments)
{
- $parameters = $function->getParameters();
- $arguments = $this->prepareArguments($parameters, $arguments);
-
- $this->validateArguments($function, $parameters, $arguments);
-
- return $arguments;
+ return $this->prepareArguments($function->getParameters(), $arguments);
}
/**
@@ -58,7 +53,7 @@ private function prepareArguments(array $parameters, array $arguments)
$arguments =
$this->prepareNamedArguments($parameters, $named) +
- $typehinted +
+ $this->prepareTypehintedArguments($parameters, $typehinted) +
$this->prepareNumberedArguments($parameters, $numbered) +
$this->prepareDefaultArguments($parameters);
@@ -88,8 +83,8 @@ function (ReflectionParameter $parameter) {
foreach ($arguments as $key => $val) {
if ($this->isStringKeyAndExistsInParameters($key, $parameterNames)) {
$namedArguments[$key] = $val;
- } elseif ($num = $this->getParameterNumberWithTypehintingValue($parameters, $val)) {
- $typehintedArguments[$num] = $val;
+ } elseif ($this->isParameterTypehintedInArgumentList($parameters, $val)) {
+ $typehintedArguments[] = $val;
} else {
$numberedArguments[] = $val;
}
@@ -104,7 +99,7 @@ function (ReflectionParameter $parameter) {
* @param mixed $argumentKey
* @param string[] $parameterNames
*
- * @return Boolean
+ * @return bool
*/
private function isStringKeyAndExistsInParameters($argumentKey, $parameterNames)
{
@@ -112,41 +107,40 @@ private function isStringKeyAndExistsInParameters($argumentKey, $parameterNames)
}
/**
- * Tries to find a parameter number, which typehints provided value.
+ * Check if a given value is typehinted in the argument list.
*
- * @param ReflectionParameter[] $parameters
- * @param mixed $value
+ * @param ReflectionParameter[] $parameters
+ * @param mixed $value
*
- * @return null|integer
+ * @return bool
*/
- private function getParameterNumberWithTypehintingValue(array $parameters, $value)
+ private function isParameterTypehintedInArgumentList(array $parameters, $value)
{
if (!is_object($value)) {
- return null;
+ return false;
}
- foreach ($parameters as $num => $parameter) {
+ foreach ($parameters as $parameter) {
if ($this->isValueMatchesTypehintedParameter($value, $parameter)) {
- return $num;
+ return true;
}
}
- return null;
+ return false;
}
/**
* Checks if value matches typehint of provided parameter.
- *
- * @param object $value
- * @param ReflectionParameter $parameter
- *
- * @return Boolean
*/
- private function isValueMatchesTypehintedParameter($value, ReflectionParameter $parameter)
+ private function isValueMatchesTypehintedParameter($value, ReflectionParameter $parameter) : bool
{
- $typehintRefl = $parameter->getClass();
+ foreach($this->getReflectionClassesFromParameter($parameter) as $typehintRefl) {
+ if($typehintRefl->isInstance($value)) {
+ return true;
+ }
+ }
- return $typehintRefl && $typehintRefl->isInstance($value);
+ return false;
}
/**
@@ -173,6 +167,198 @@ private function prepareNamedArguments(array $parameters, array $namedArguments)
return $arguments;
}
+ /**
+ * Captures argument values for typehinted arguments based on the given candidates.
+ *
+ * This method attempts to match up the best fitting arguments to each constructor argument.
+ *
+ * This case specifically fixes the issue where a constructor asks for a parent and child class,
+ * as separate arguments, but both arguments could satisfy the first argument,
+ * so they would both be passed in (overwriting each other).
+ *
+ * This will ensure that the children (exact class matches) are mapped first, and then other dependencies
+ * are mapped sequentially (to arguments which they are an `instanceof`).
+ *
+ * As such, this requires two passes of the $parameters array to ensure it is mapped as accurately as possible.
+ *
+ * @param ReflectionParameter[] $parameters Reflection Parameters (constructor argument requirements)
+ * @param mixed[] $typehintedArguments Resolved arguments
+ *
+ * @return mixed[] Ordered list of arguments, index is the constructor argument position, value is what will be injected
+ */
+ private function prepareTypehintedArguments(array $parameters, array $typehintedArguments)
+ {
+ $arguments = array();
+
+ $candidates = $typehintedArguments;
+
+ $this->applyPredicateToTypehintedArguments(
+ $parameters,
+ $candidates,
+ $arguments,
+ array($this, 'classMatchingPredicateForTypehintedArguments')
+ );
+
+ // This iteration maps up everything else, providing the argument is an instanceof the parameter.
+ $this->applyPredicateToTypehintedArguments(
+ $parameters,
+ $candidates,
+ $arguments,
+ array($this, 'isInstancePredicateForTypehintedArguments')
+ );
+
+ return $arguments;
+ }
+
+ /**
+ * Filtered out superfluous parameters for matching up typehinted arguments.
+ *
+ * @param ReflectionParameter[] $parameters Constructor Arguments
+ * @return ReflectionParameter[] Filtered $parameters
+ */
+ private function filterApplicableTypehintedParameters(array $parameters) : array
+ {
+ return array_filter($parameters,
+ function($parameter, $num) {
+ return !$this->isArgumentDefined($num)
+ && $this->getReflectionClassesFromParameter($parameter);
+ },
+ ARRAY_FILTER_USE_BOTH
+ );
+
+ }
+
+ /**
+ * @return ReflectionClass[]
+ */
+ private function getReflectionClassesFromParameter(\ReflectionParameter $parameter): array
+ {
+ $classes = [];
+
+ if (!$parameter->hasType()) {
+ return $classes;
+ }
+
+ $type = $parameter->getType();
+
+ if ($type instanceof \ReflectionNamedType) {
+ $types = [$type];
+ }
+ elseif ($parameter->getType() instanceof \ReflectionUnionType) {
+ $types = $type->getTypes();
+ }
+ else {
+ $types = [];
+ }
+
+ foreach ($types as $type) {
+
+ // ReflectionUnionType::getTypes is only documented as returning ReflectionType[]
+ if (!$type instanceof \ReflectionNamedType) {
+ continue;
+ }
+
+ $typeString = $type->getName();
+
+ if ($typeString == 'self') {
+ $typeString = $parameter->getDeclaringClass();
+ } elseif ($typeString == 'parent') {
+ $typeString = $parameter->getDeclaringClass()->getParentClass();
+ }
+
+ try {
+ $classes[] = new ReflectionClass($typeString);
+ } catch (ReflectionException $e) {
+ continue;
+ }
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Applies a predicate for each candidate when matching up typehinted arguments.
+ * This passes through to another loop of the candidates in @matchParameterToCandidateUsingPredicate,
+ * because this method is "too complex" with two loops...
+ *
+ * @param ReflectionParameter[] $parameters Reflection Parameters (constructor argument requirements)
+ * @param mixed[] &$candidates Resolved arguments
+ * @param mixed[] &$arguments Argument mapping
+ * @param callable $predicate Callable predicate to apply to each candidate
+ * @return void
+ */
+ private function applyPredicateToTypehintedArguments(
+ array $parameters,
+ array &$candidates,
+ array &$arguments,
+ $predicate
+ ) {
+ $filtered = $this->filterApplicableTypehintedParameters($parameters);
+
+ foreach ($filtered as $num => $parameter) {
+ $this->matchParameterToCandidateUsingPredicate($parameter, $candidates, $arguments, $predicate);
+ }
+ }
+
+ /**
+ * Applies a predicate for each candidate when matching up typehinted arguments.
+ * This helps to avoid repetition when looping them, as multiple passes are needed over the parameters / candidates.
+ *
+ * @param ReflectionParameter $parameter Reflection Parameter (constructor argument requirements)
+ * @param mixed[] &$candidates Resolved arguments
+ * @param mixed[] &$arguments Argument mapping
+ * @param callable $predicate Callable predicate to apply to each candidate
+ * @return bool Returns true if a candidate has been matched to the given parameter, otherwise false
+ */
+ public function matchParameterToCandidateUsingPredicate(
+ ReflectionParameter $parameter,
+ array &$candidates,
+ array &$arguments,
+ $predicate
+ ) {
+ foreach ($candidates as $candidateIndex => $candidate) {
+ foreach($this->getReflectionClassesFromParameter($parameter) as $class) {
+ if ($predicate($class, $candidate)) {
+ $num = $parameter->getPosition();
+
+ $arguments[$num] = $candidate;
+
+ $this->markArgumentDefined($num);
+
+ unset($candidates[$candidateIndex]);
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Typehinted argument predicate to check if the argument and parameter classes match equally.
+ *
+ * @param ReflectionClass $reflectionClass Typehinted argument
+ * @param mixed $candidate Resolved argument
+ * @return bool
+ */
+ private function classMatchingPredicateForTypehintedArguments(ReflectionClass $reflectionClass, $candidate)
+ {
+ return $reflectionClass->getName() === get_class($candidate);
+ }
+
+ /**
+ * Typehinted argument predicate to check if the argument is an instance of the parameter.
+ *
+ * @param ReflectionClass $reflectionClass Typehinted argument
+ * @param mixed $candidate Resolved argument
+ * @return bool
+ */
+ private function isInstancePredicateForTypehintedArguments(ReflectionClass $reflectionClass, $candidate)
+ {
+ return $reflectionClass->isInstance($candidate);
+ }
+
/**
* Captures argument values for undefined arguments based on their respective numbers.
*
@@ -250,55 +436,6 @@ private function reorderArguments(array $parameters, array $arguments)
return $orderedArguments;
}
- /**
- * Validates that all arguments are in place, throws exception otherwise.
- *
- * @param ReflectionFunctionAbstract $function
- * @param ReflectionParameter[] $parameters
- * @param mixed[] $arguments
- *
- * @throws UnknownParameterValueException
- */
- private function validateArguments(
- ReflectionFunctionAbstract $function,
- array $parameters,
- array $arguments
- ) {
- foreach ($parameters as $num => $parameter) {
- $name = $parameter->getName();
-
- if (array_key_exists($num, $arguments) || array_key_exists($name, $arguments)) {
- continue;
- }
-
- throw new UnknownParameterValueException(sprintf(
- 'Can not find a matching value for an argument `$%s` of the method `%s`.',
- $name,
- $this->getFunctionPath($function)
- ));
- }
- }
-
- /**
- * Returns function path for a provided reflection.
- *
- * @param ReflectionFunctionAbstract $function
- *
- * @return string
- */
- private function getFunctionPath(ReflectionFunctionAbstract $function)
- {
- if ($function instanceof ReflectionMethod) {
- return sprintf(
- '%s::%s()',
- $function->getDeclaringClass()->getName(),
- $function->getName()
- );
- }
-
- return sprintf('%s()', $function->getName());
- }
-
/**
* Marks arguments at all positions as undefined.
*
@@ -324,7 +461,7 @@ private function markArgumentDefined($position)
*
* @param integer $position
*
- * @return Boolean
+ * @return bool
*/
private function isArgumentDefined($position)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/PregMatchArgumentOrganiser.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/PregMatchArgumentOrganiser.php
index 2fb053585..8a03b884f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/PregMatchArgumentOrganiser.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/PregMatchArgumentOrganiser.php
@@ -81,7 +81,7 @@ private function cleanupMatchDuplicates(array $match)
* @param integer $keyIndex
* @param mixed[] $keys
*
- * @return Boolean
+ * @return bool
*/
private function isKeyAStringAndNexOneIsAnInteger($keyIndex, array $keys)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/ServiceContainer/ArgumentExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/ServiceContainer/ArgumentExtension.php
index 021966440..88172a979 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/ServiceContainer/ArgumentExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/ServiceContainer/ArgumentExtension.php
@@ -18,7 +18,7 @@
use Symfony\Component\DependencyInjection\Reference;
/**
- * Enables argument organises for the Testwork.
+ * Enables argument organisers for Testwork.
*
* @author Konstantin Kudryashov
*/
@@ -27,9 +27,9 @@ final class ArgumentExtension implements Extension
/*
* Available services
*/
- const MIXED_ARGUMENT_ORGANISER_ID = 'argument.mixed_organiser';
- const PREG_MATCH_ARGUMENT_ORGANISER_ID = 'argument.preg_match_organiser';
- const CONSTRUCTOR_ARGUMENT_ORGANISER_ID = 'argument.constructor_organiser';
+ public const MIXED_ARGUMENT_ORGANISER_ID = 'argument.mixed_organiser';
+ public const PREG_MATCH_ARGUMENT_ORGANISER_ID = 'argument.preg_match_organiser';
+ public const CONSTRUCTOR_ARGUMENT_ORGANISER_ID = 'argument.constructor_organiser';
/**
* {@inheritdoc}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/Validator.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/Validator.php
new file mode 100644
index 000000000..3d47e7e5a
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/Validator.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Testwork\Argument;
+
+use Behat\Testwork\Argument\Exception\UnknownParameterValueException;
+use ReflectionFunctionAbstract;
+use ReflectionMethod;
+use ReflectionParameter;
+
+/**
+ * Validates function arguments.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class Validator
+{
+ /**
+ * Validates that all arguments are in place, throws exception otherwise.
+ *
+ * @param ReflectionFunctionAbstract $function
+ * @param mixed[] $arguments
+ *
+ * @throws UnknownParameterValueException
+ */
+ public function validateArguments(ReflectionFunctionAbstract $function, array $arguments)
+ {
+ foreach ($function->getParameters() as $num => $parameter) {
+ $this->validateArgument($parameter, $num, $arguments);
+ }
+ }
+
+ /**
+ * Validates given argument.
+ *
+ * @param ReflectionParameter $parameter
+ * @param integer $parameterIndex
+ * @param array $givenArguments
+ */
+ private function validateArgument(ReflectionParameter $parameter, $parameterIndex, array $givenArguments)
+ {
+ if ($parameter->isDefaultValueAvailable()) {
+ return;
+ }
+
+ if (array_key_exists($parameterIndex, $givenArguments)) {
+ return;
+ }
+
+ if (array_key_exists($parameter->getName(), $givenArguments)) {
+ return;
+ }
+
+ throw new UnknownParameterValueException(sprintf(
+ 'Can not find a matching value for an argument `$%s` of the method `%s`.',
+ $parameter->getName(),
+ $this->getFunctionPath($parameter->getDeclaringFunction())
+ ));
+ }
+
+ /**
+ * Returns function path for a provided reflection.
+ *
+ * @param ReflectionFunctionAbstract $function
+ *
+ * @return string
+ */
+ private function getFunctionPath(ReflectionFunctionAbstract $function)
+ {
+ if ($function instanceof ReflectionMethod) {
+ return sprintf(
+ '%s::%s()',
+ $function->getDeclaringClass()->getName(),
+ $function->getName()
+ );
+ }
+
+ return sprintf('%s()', $function->getName());
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/Cli/AutoloaderController.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/Cli/AutoloaderController.php
index 991eb412c..70ebe94af 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/Cli/AutoloaderController.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/Cli/AutoloaderController.php
@@ -11,7 +11,7 @@
namespace Behat\Testwork\Autoloader\Cli;
use Behat\Testwork\Cli\Controller;
-use Symfony\Component\ClassLoader\ClassLoader;
+use Composer\Autoload\ClassLoader;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/ServiceContainer/AutoloaderExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/ServiceContainer/AutoloaderExtension.php
index 2c5f021cd..3908e0f15 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/ServiceContainer/AutoloaderExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Autoloader/ServiceContainer/AutoloaderExtension.php
@@ -28,7 +28,7 @@ final class AutoloaderExtension implements Extension
/*
* Available services
*/
- const CLASS_LOADER_ID = 'class_loader';
+ public const CLASS_LOADER_ID = 'class_loader';
/**
* @var array
@@ -108,7 +108,7 @@ public function process(ContainerBuilder $container)
*/
private function loadAutoloader(ContainerBuilder $container)
{
- $definition = new Definition('Symfony\Component\ClassLoader\ClassLoader');
+ $definition = new Definition('Composer\Autoload\ClassLoader');
$container->setDefinition(self::CLASS_LOADER_ID, $definition);
}
@@ -146,6 +146,10 @@ private function setLoaderPrefixes(ContainerBuilder $container, array $prefixes)
private function processLoaderPrefixes(ContainerBuilder $container)
{
$loaderDefinition = $container->getDefinition(self::CLASS_LOADER_ID);
- $loaderDefinition->addMethodCall('addPrefixes', array($container->getParameter('class_loader.prefixes')));
+ $prefixes = $container->getParameter('class_loader.prefixes');
+
+ foreach ($prefixes as $prefix => $path) {
+ $loaderDefinition->addMethodCall('add', array($prefix, $path));
+ }
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php
index 448367b2d..2798acf68 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php
@@ -94,8 +94,6 @@ public function makeCall(Call $call)
{
try {
return $this->filterResult($this->handleCall($this->filterCall($call)));
- } catch (Exception $exception) {
- return new CallResult($call, null, $this->handleException($exception), null);
} catch (Throwable $exception) {
return new CallResult($call, null, $this->handleException($exception), null);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php
index ca3c52837..4ee808b82 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php
@@ -75,7 +75,10 @@ public function getReturn()
/**
* Check if call thrown exception.
*
- * @return Boolean
+ * @psalm-assert-if-true Exception $this->exception
+ * @psalm-assert-if-true Exception $this->getException()
+ *
+ * @return bool
*/
public function hasException()
{
@@ -95,7 +98,7 @@ public function getException()
/**
* Checks if call produced stdOut.
*
- * @return Boolean
+ * @return bool
*/
public function hasStdOut()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResults.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResults.php
index f79ea0c9e..6bc3e8b11 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResults.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/CallResults.php
@@ -12,7 +12,6 @@
use ArrayIterator;
use Countable;
-use Iterator;
use IteratorAggregate;
/**
@@ -53,7 +52,7 @@ public static function merge(CallResults $first, CallResults $second)
/**
* Checks if any call in collection throws an exception.
*
- * @return Boolean
+ * @return bool
*/
public function hasExceptions()
{
@@ -69,7 +68,7 @@ public function hasExceptions()
/**
* Checks if any call in collection produces an output.
*
- * @return Boolean
+ * @return bool
*/
public function hasStdOuts()
{
@@ -87,7 +86,7 @@ public function hasStdOuts()
*
* @return integer
*/
- public function count()
+ public function count(): int
{
return count($this->results);
}
@@ -95,9 +94,9 @@ public function count()
/**
* Returns collection iterator.
*
- * @return Iterator
+ * @return ArrayIterator
*/
- public function getIterator()
+ public function getIterator(): ArrayIterator
{
return new ArrayIterator($this->results);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Callee.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Callee.php
index c03e77649..17ed0f5cc 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Callee.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Callee.php
@@ -36,14 +36,14 @@ public function getDescription();
/**
* Returns true if callee is a method, false otherwise.
*
- * @return Boolean
+ * @return bool
*/
public function isAMethod();
/**
* Returns true if callee is an instance (non-static) method, false otherwise.
*
- * @return Boolean
+ * @return bool
*/
public function isAnInstanceMethod();
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Exception/CallErrorException.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Exception/CallErrorException.php
index 423abf38f..1622f0fe2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Exception/CallErrorException.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Exception/CallErrorException.php
@@ -42,7 +42,7 @@ public function __construct($level, $message, $file, $line)
parent::__construct(
sprintf(
'%s: %s in %s line %d',
- isset($this->levels[$level]) ? $this->levels[$level] : $level,
+ $this->levels[$level] ?? $level,
$message,
$file,
$line
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/CallFilter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/CallFilter.php
index 5426c160a..1519823db 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/CallFilter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/CallFilter.php
@@ -27,7 +27,7 @@ interface CallFilter
*
* @param Call $call
*
- * @return Boolean
+ * @return bool
*/
public function supportsCall(Call $call);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/ResultFilter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/ResultFilter.php
index ac3ebe000..02267029a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/ResultFilter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Filter/ResultFilter.php
@@ -27,7 +27,7 @@ interface ResultFilter
*
* @param CallResult $result
*
- * @return Boolean
+ * @return bool
*/
public function supportsResult(CallResult $result);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/CallHandler.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/CallHandler.php
index e553d2a76..93966130d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/CallHandler.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/CallHandler.php
@@ -28,7 +28,7 @@ interface CallHandler
*
* @param Call $call
*
- * @return Boolean
+ * @return bool
*/
public function supportsCall(Call $call);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/ClassNotFoundHandler.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/ClassNotFoundHandler.php
index 8d0f488fd..6ddeee21e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/ClassNotFoundHandler.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/ClassNotFoundHandler.php
@@ -22,7 +22,7 @@
*/
abstract class ClassNotFoundHandler implements ExceptionHandler
{
- const PATTERN = "/^Class '([^']+)' not found$/";
+ public const PATTERN = "/^Class (?:'|\")([^'\"]+)(?:'|\") not found$/";
/**
* {@inheritdoc}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/MethodNotFoundHandler.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/MethodNotFoundHandler.php
index 3ca680dae..f35890999 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/MethodNotFoundHandler.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/Exception/MethodNotFoundHandler.php
@@ -22,7 +22,7 @@
*/
abstract class MethodNotFoundHandler implements ExceptionHandler
{
- const PATTERN = '/^Call to undefined method ([^:]+)::([^\)]+)\(\)$/';
+ public const PATTERN = '/^Call to undefined method ([^:]+)::([^\)]+)\(\)$/';
/**
* {@inheritdoc}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php
index 09267bbd4..9f51cd06c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php
@@ -10,6 +10,7 @@
namespace Behat\Testwork\Call\Handler;
+use Behat\Testwork\Argument\Validator;
use Behat\Testwork\Call\Call;
use Behat\Testwork\Call\CallResult;
use Behat\Testwork\Call\Exception\CallErrorException;
@@ -26,11 +27,14 @@ final class RuntimeCallHandler implements CallHandler
* @var integer
*/
private $errorReportingLevel;
-
/**
* @var bool
*/
private $obStarted = false;
+ /**
+ * @var Validator
+ */
+ private $validator;
/**
* Initializes executor.
@@ -40,6 +44,7 @@ final class RuntimeCallHandler implements CallHandler
public function __construct($errorReportingLevel = E_ALL)
{
$this->errorReportingLevel = $errorReportingLevel;
+ $this->validator = new Validator();
}
/**
@@ -72,7 +77,7 @@ public function handleCall(Call $call)
* @param string $file
* @param integer $line
*
- * @return Boolean
+ * @return bool
*
* @throws CallErrorException
*/
@@ -94,13 +99,15 @@ public function handleError($level, $message, $file, $line)
*/
private function executeCall(Call $call)
{
+ $reflection = $call->getCallee()->getReflection();
$callable = $call->getBoundCallable();
$arguments = $call->getArguments();
-
$return = $exception = null;
try {
- $return = call_user_func_array($callable, $arguments);
+ $arguments = array_values($arguments);
+ $this->validator->validateArguments($reflection, $arguments);
+ $return = $callable(...$arguments);
} catch (Exception $caught) {
$exception = $caught;
}
@@ -148,7 +155,7 @@ private function stopErrorAndOutputBuffering()
*
* @param integer $level
*
- * @return Boolean
+ * @return bool
*/
private function errorLevelIsNotReportable($level)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/RuntimeCallee.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/RuntimeCallee.php
index c764629d2..fa232f836 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/RuntimeCallee.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/RuntimeCallee.php
@@ -112,7 +112,7 @@ public function getReflection()
/**
* Returns true if callee is a method, false otherwise.
*
- * @return Boolean
+ * @return bool
*/
public function isAMethod()
{
@@ -122,7 +122,7 @@ public function isAMethod()
/**
* Returns true if callee is an instance (non-static) method, false otherwise.
*
- * @return Boolean
+ * @return bool
*/
public function isAnInstanceMethod()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/ServiceContainer/CallExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/ServiceContainer/CallExtension.php
index b9df7ea22..81bf25825 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/ServiceContainer/CallExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Call/ServiceContainer/CallExtension.php
@@ -27,15 +27,15 @@ final class CallExtension implements Extension
/*
* Available services
*/
- const CALL_CENTER_ID = 'call.center';
+ public const CALL_CENTER_ID = 'call.center';
/*
* Available extension points
*/
- const CALL_FILTER_TAG = 'call.call_filter';
- const CALL_HANDLER_TAG = 'call.call_handler';
- const RESULT_FILTER_TAG = 'call.result_filter';
- const EXCEPTION_HANDLER_TAG = 'call.exception_handler';
+ public const CALL_FILTER_TAG = 'call.call_filter';
+ public const CALL_HANDLER_TAG = 'call.call_handler';
+ public const RESULT_FILTER_TAG = 'call.result_filter';
+ public const EXCEPTION_HANDLER_TAG = 'call.exception_handler';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php
index 08eca8711..006b3f1b7 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php
@@ -63,7 +63,7 @@ public function __construct($name, $version, ConfigurationLoader $configLoader,
*
* @return InputDefinition An InputDefinition instance
*/
- public function getDefaultInputDefinition()
+ public function getDefaultInputDefinition(): InputDefinition
{
return new InputDefinition(array(
new InputOption('--profile', '-p', InputOption::VALUE_REQUIRED, 'Specify config profile to use.'),
@@ -75,8 +75,8 @@ public function getDefaultInputDefinition()
),
new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'),
new InputOption('--config-reference', null, InputOption::VALUE_NONE, 'Display the configuration reference.'),
- new InputOption('--debug', null, InputOption::VALUE_NONE, 'Provide debuggin information about current environment.'),
- new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this behat version.'),
+ new InputOption('--debug', null, InputOption::VALUE_NONE, 'Provide debugging information about current environment.'),
+ new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display version.'),
new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question.'),
new InputOption(
'--colors', null, InputOption::VALUE_NONE,
@@ -124,7 +124,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
return parent::doRun($input, $output);
}
- protected function getDefaultCommands()
+ protected function getDefaultCommands(): array
{
$commands = parent::getDefaultCommands();
@@ -210,7 +210,7 @@ private function getBasePath()
*
* @return string The command name
*/
- protected function getCommandName(InputInterface $input)
+ protected function getCommandName(InputInterface $input): string
{
if ($input->hasParameterOption(array('--config-reference'))) {
return 'dump-reference';
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DebugCommand.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DebugCommand.php
index d888cb90b..d24ffd5d0 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DebugCommand.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DebugCommand.php
@@ -76,5 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln(sprintf(' extensions loaded: %s', count($debug['extensions_list']) ? implode(', ', $debug['extensions_list']) : 'none'));
$output->writeln('');
+
+ return 0;
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DumpReferenceCommand.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DumpReferenceCommand.php
index d6b57d442..e4242bbb5 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DumpReferenceCommand.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/DumpReferenceCommand.php
@@ -47,15 +47,11 @@ public function __construct(ExtensionManager $extensionManager)
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- if (class_exists('Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper')) {
- $dumper = new YamlReferenceDumper();
- } else {
- // Support Symfony Config 2.3
- $dumper = new ReferenceDumper();
- }
-
+ $dumper = new YamlReferenceDumper();
$configTree = new ConfigurationTree();
$output->writeln($dumper->dumpNode($configTree->getConfigTree($this->extensionManager->getExtensions())));
+
+ return 0;
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/ServiceContainer/CliExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/ServiceContainer/CliExtension.php
index 4b9fba847..faca4ce61 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/ServiceContainer/CliExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/ServiceContainer/CliExtension.php
@@ -27,14 +27,14 @@ final class CliExtension implements Extension
/*
* Available services
*/
- const COMMAND_ID = 'cli.command';
- const INPUT_ID = 'cli.input';
- const OUTPUT_ID = 'cli.output';
+ public const COMMAND_ID = 'cli.command';
+ public const INPUT_ID = 'cli.input';
+ public const OUTPUT_ID = 'cli.output';
/*
* Available extension points
*/
- const CONTROLLER_TAG = 'cli.controller';
+ public const CONTROLLER_TAG = 'cli.controller';
/**
* @var ServiceProcessor
@@ -81,6 +81,7 @@ public function configure(ArrayNodeDefinition $builder)
public function load(ContainerBuilder $container, array $config)
{
$this->loadCommand($container);
+ $this->loadSyntheticServices($container);
}
/**
@@ -99,9 +100,16 @@ public function process(ContainerBuilder $container)
protected function loadCommand(ContainerBuilder $container)
{
$definition = new Definition('Behat\Testwork\Cli\Command', array('%cli.command.name%', array()));
+ $definition->setPublic(true);
$container->setDefinition(self::COMMAND_ID, $definition);
}
+ protected function loadSyntheticServices(ContainerBuilder $container)
+ {
+ $container->register(self::INPUT_ID)->setSynthetic(true)->setPublic(true);
+ $container->register(self::OUTPUT_ID)->setSynthetic(true)->setPublic(true);
+ }
+
/**
* Processes all controllers in container.
*
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Handler/EnvironmentHandler.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Handler/EnvironmentHandler.php
index f2b6b9820..1b4358919 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Handler/EnvironmentHandler.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Handler/EnvironmentHandler.php
@@ -28,7 +28,7 @@ interface EnvironmentHandler
*
* @param Suite $suite
*
- * @return Boolean
+ * @return bool
*/
public function supportsSuite(Suite $suite);
@@ -47,7 +47,7 @@ public function buildEnvironment(Suite $suite);
* @param Environment $environment
* @param mixed $testSubject
*
- * @return Boolean
+ * @return bool
*/
public function supportsEnvironmentAndSubject(Environment $environment, $testSubject = null);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Reader/EnvironmentReader.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Reader/EnvironmentReader.php
index dcf66fde8..39cd46724 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Reader/EnvironmentReader.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/Reader/EnvironmentReader.php
@@ -28,7 +28,7 @@ interface EnvironmentReader
*
* @param Environment $environment
*
- * @return Boolean
+ * @return bool
*/
public function supportsEnvironment(Environment $environment);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/ServiceContainer/EnvironmentExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/ServiceContainer/EnvironmentExtension.php
index e06f058c7..389b36143 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/ServiceContainer/EnvironmentExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Environment/ServiceContainer/EnvironmentExtension.php
@@ -29,13 +29,13 @@ final class EnvironmentExtension implements Extension
/*
* Available services
*/
- const MANAGER_ID = 'environment.manager';
+ public const MANAGER_ID = 'environment.manager';
/*
* Available extension points
*/
- const HANDLER_TAG = 'environment.handler';
- const READER_TAG = 'environment.reader';
+ public const HANDLER_TAG = 'environment.handler';
+ public const READER_TAG = 'environment.reader';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Event/Event.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Event/Event.php
new file mode 100644
index 000000000..61c65cac3
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Event/Event.php
@@ -0,0 +1,9 @@
+eventDispatcher->dispatch(ExerciseCompleted::AFTER, new AfterExerciseAborted());
+ $this->eventDispatcher->dispatch(new AfterExerciseAborted(), ExerciseCompleted::AFTER);
exit(1);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/ExerciseCompleted.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/ExerciseCompleted.php
index 026592bdc..4a88dfbff 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/ExerciseCompleted.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/ExerciseCompleted.php
@@ -10,8 +10,9 @@
namespace Behat\Testwork\EventDispatcher\Event;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Specification\SpecificationIterator;
-use Symfony\Component\EventDispatcher\Event;
+
/**
* Represents an exercise event.
@@ -20,10 +21,10 @@
*/
abstract class ExerciseCompleted extends Event
{
- const BEFORE = 'tester.exercise_completed.before';
- const AFTER_SETUP = 'tester.exercise_completed.after_setup';
- const BEFORE_TEARDOWN = 'tester.exercise_completed.before_teardown';
- const AFTER = 'tester.exercise_completed.after';
+ public const BEFORE = 'tester.exercise_completed.before';
+ public const AFTER_SETUP = 'tester.exercise_completed.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.exercise_completed.before_teardown';
+ public const AFTER = 'tester.exercise_completed.after';
/**
* Returns specification iterators.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/LifecycleEvent.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/LifecycleEvent.php
index 50191b463..b2867f020 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/LifecycleEvent.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/LifecycleEvent.php
@@ -11,8 +11,8 @@
namespace Behat\Testwork\EventDispatcher\Event;
use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Suite\Suite;
-use Symfony\Component\EventDispatcher\Event;
/**
* Represents an event which holds references to current suite and environment.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/SuiteTested.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/SuiteTested.php
index 2ded66a28..de56d077b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/SuiteTested.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Event/SuiteTested.php
@@ -19,10 +19,10 @@
*/
abstract class SuiteTested extends LifecycleEvent
{
- const BEFORE = 'tester.suite_tested.before';
- const AFTER_SETUP = 'tester.suite_tested.after_setup';
- const BEFORE_TEARDOWN = 'tester.suite_tested.before_teardown';
- const AFTER = 'tester.suite_tested.after';
+ public const BEFORE = 'tester.suite_tested.before';
+ public const AFTER_SETUP = 'tester.suite_tested.after_setup';
+ public const BEFORE_TEARDOWN = 'tester.suite_tested.before_teardown';
+ public const AFTER = 'tester.suite_tested.after';
/**
* Returns specification iterator.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/ServiceContainer/EventDispatcherExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/ServiceContainer/EventDispatcherExtension.php
index 72376dac5..502740a5f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/ServiceContainer/EventDispatcherExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/ServiceContainer/EventDispatcherExtension.php
@@ -30,12 +30,12 @@ class EventDispatcherExtension implements Extension
/*
* Available services
*/
- const DISPATCHER_ID = 'event_dispatcher';
+ public const DISPATCHER_ID = 'event_dispatcher';
/*
* Available extension points
*/
- const SUBSCRIBER_TAG = 'event_dispatcher.subscriber';
+ public const SUBSCRIBER_TAG = 'event_dispatcher.subscriber';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php
index 10f34196e..9c319761d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php
@@ -14,6 +14,7 @@
use Behat\Testwork\EventDispatcher\Event\AfterExerciseSetup;
use Behat\Testwork\EventDispatcher\Event\BeforeExerciseCompleted;
use Behat\Testwork\EventDispatcher\Event\BeforeExerciseTeardown;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Tester\Exercise;
use Behat\Testwork\Tester\Result\TestResult;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -52,12 +53,14 @@ public function __construct(Exercise $baseExercise, EventDispatcherInterface $ev
public function setUp(array $iterators, $skip)
{
$event = new BeforeExerciseCompleted($iterators);
- $this->eventDispatcher->dispatch($event::BEFORE, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseExercise->setUp($iterators, $skip);
$event = new AfterExerciseSetup($iterators, $setup);
- $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@@ -76,12 +79,14 @@ public function test(array $iterators, $skip = false)
public function tearDown(array $iterators, $skip, TestResult $result)
{
$event = new BeforeExerciseTeardown($iterators, $result);
- $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE_TEARDOWN);
$teardown = $this->baseExercise->tearDown($iterators, $skip, $result);
$event = new AfterExerciseCompleted($iterators, $result, $teardown);
- $this->eventDispatcher->dispatch($event::AFTER, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php
index 84b2d07c0..acfef275a 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php
@@ -15,6 +15,7 @@
use Behat\Testwork\EventDispatcher\Event\AfterSuiteTested;
use Behat\Testwork\EventDispatcher\Event\BeforeSuiteTeardown;
use Behat\Testwork\EventDispatcher\Event\BeforeSuiteTested;
+use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Specification\SpecificationIterator;
use Behat\Testwork\Tester\Result\TestResult;
use Behat\Testwork\Tester\SuiteTester;
@@ -54,12 +55,14 @@ public function __construct(SuiteTester $baseTester, EventDispatcherInterface $e
public function setUp(Environment $env, SpecificationIterator $iterator, $skip)
{
$event = new BeforeSuiteTested($env, $iterator);
- $this->eventDispatcher->dispatch($event::BEFORE, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::BEFORE);
$setup = $this->baseTester->setUp($env, $iterator, $skip);
$event = new AfterSuiteSetup($env, $iterator, $setup);
- $this->eventDispatcher->dispatch($event::AFTER_SETUP, $event);
+
+ $this->eventDispatcher->dispatch($event, $event::AFTER_SETUP);
return $setup;
}
@@ -78,12 +81,13 @@ public function test(Environment $env, SpecificationIterator $iterator, $skip =
public function tearDown(Environment $env, SpecificationIterator $iterator, $skip, TestResult $result)
{
$event = new BeforeSuiteTeardown($env, $iterator, $result);
- $this->eventDispatcher->dispatch($event::BEFORE_TEARDOWN, $event);
+ $this->eventDispatcher->dispatch( $event, $event::BEFORE_TEARDOWN);
$teardown = $this->baseTester->tearDown($env, $iterator, $skip, $result);
$event = new AfterSuiteTested($env, $iterator, $result, $teardown);
- $this->eventDispatcher->dispatch($event::AFTER, $event);
+
+ $this->eventDispatcher->dispatch( $event, $event::AFTER);
return $teardown;
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php
index c1200f300..cf96c5d78 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php
@@ -10,8 +10,8 @@
namespace Behat\Testwork\EventDispatcher;
-use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Contracts\EventDispatcher\Event;
/**
* Extends Symfony2 event dispatcher with catch-all listeners.
@@ -20,40 +20,47 @@
*/
final class TestworkEventDispatcher extends EventDispatcher
{
- const BEFORE_ALL_EVENTS = '*~';
- const AFTER_ALL_EVENTS = '~*';
+ public const BEFORE_ALL_EVENTS = '*~';
+ public const AFTER_ALL_EVENTS = '~*';
+ public const DISPATCHER_VERSION = 2;
/**
* {@inheritdoc}
+ *
+ * @param string|null $eventName
*/
- public function dispatch($eventName, Event $event = null)
+ public function getListeners($eventName = null): array
{
- if (null === $event) {
- $event = new Event();
+ if (null === $eventName || self::BEFORE_ALL_EVENTS === $eventName) {
+ return parent::getListeners($eventName);
}
- if (method_exists($event, 'setName')) {
- $event->setName($eventName);
- }
+ return array_merge(
+ parent::getListeners(self::BEFORE_ALL_EVENTS),
+ parent::getListeners($eventName),
+ parent::getListeners(self::AFTER_ALL_EVENTS)
+ );
+ }
- $this->doDispatch($this->getListeners($eventName), $eventName, $event);
+ public function dispatch($event, $eventName = null): object
+ {
+ if (is_object($event)) {
+ return $this->bcAwareDispatch($event, $eventName);
+ }
- return $event;
+ return $this->bcAwareDispatch($eventName, $event);
}
- /**
- * {@inheritdoc}
- */
- public function getListeners($eventName = null)
+ private function bcAwareDispatch(object $event, $eventName)
{
- if (null == $eventName || self::BEFORE_ALL_EVENTS === $eventName) {
- return parent::getListeners($eventName);
+ if (null === $event) {
+ $event = new Event();
}
- return array_merge(
- parent::getListeners(self::BEFORE_ALL_EVENTS),
- parent::getListeners($eventName),
- parent::getListeners(self::AFTER_ALL_EVENTS)
- );
+ if (method_exists($event, 'setName')) {
+ $event->setName($eventName);
+ }
+
+ return parent::dispatch($event, $eventName);
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfony5.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfony5.php
new file mode 100644
index 000000000..d82c500dd
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfony5.php
@@ -0,0 +1,68 @@
+=5.0) event dispatcher with catch-all listeners.
+ *
+ * This is magically aliased to TestworkEventDispatcher by the code in TestworkEventDispatcher.php
+ * if the new symfony interface is detected.
+ *
+ * @deprecated Do not reference this class directly, use TestworkEventDispatcher
+ */
+final class TestworkEventDispatcherSymfony5 extends EventDispatcher
+{
+ public const BEFORE_ALL_EVENTS = '*~';
+ public const AFTER_ALL_EVENTS = '~*';
+ public const DISPATCHER_VERSION = 2;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function dispatch($event, string $eventName = null): object
+ {
+ trigger_error(
+ 'Class "\Behat\Testwork\EventDispatcher\TestworkEventDispatcherSymfony5" is deprecated ' .
+ 'and should not be relied upon anymore. Use "Behat\Testwork\EventDispatcher\TestworkEventDispatcher" ' .
+ 'instead',
+ E_USER_DEPRECATED
+ );
+ if (null === $event) {
+ $event = new \Symfony\Contracts\EventDispatcher\Event();
+ }
+ if (method_exists($event, 'setName')) {
+ $event->setName($eventName);
+ }
+
+ $this->callListeners($this->getListeners($eventName), $eventName, $event);
+
+ return $event;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getListeners($eventName = null)
+ {
+ trigger_error(
+ 'Class "\Behat\Testwork\EventDispatcher\TestworkEventDispatcherSymfony5" is deprecated ' .
+ 'and should not be relied upon anymore. Use "Behat\Testwork\EventDispatcher\TestworkEventDispatcher" ' .
+ 'instead',
+ E_USER_DEPRECATED
+ );
+
+ if (null == $eventName || self::BEFORE_ALL_EVENTS === $eventName) {
+ return parent::getListeners($eventName);
+ }
+
+ return array_merge(
+ parent::getListeners(self::BEFORE_ALL_EVENTS),
+ parent::getListeners($eventName),
+ parent::getListeners(self::AFTER_ALL_EVENTS)
+ );
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfonyLegacy.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfonyLegacy.php
new file mode 100644
index 000000000..3a41ba6d5
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfonyLegacy.php
@@ -0,0 +1,71 @@
+setName($eventName);
+ }
+ /** @scrutinizer ignore-call */
+ $this->doDispatch($this->getListeners($eventName), $eventName, $event);
+
+ return $event;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getListeners($eventName = null)
+ {
+ trigger_error(
+ 'Class "\Behat\Testwork\EventDispatcher\TestworkEventDispatcherSymfonyLegacy" is deprecated ' .
+ 'and should not be relied upon anymore. Use "Behat\Testwork\EventDispatcher\TestworkEventDispatcher" ' .
+ 'instead',
+ E_USER_DEPRECATED
+ );
+
+ if (null == $eventName || self::BEFORE_ALL_EVENTS === $eventName) {
+ return parent::getListeners($eventName);
+ }
+
+ return array_merge(
+ parent::getListeners(self::BEFORE_ALL_EVENTS),
+ parent::getListeners($eventName),
+ parent::getListeners(self::AFTER_ALL_EVENTS)
+ );
+ }
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ExceptionPresenter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ExceptionPresenter.php
index fce59bbf6..9ad0d14c2 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ExceptionPresenter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ExceptionPresenter.php
@@ -13,6 +13,7 @@
use Behat\Testwork\Exception\Stringer\ExceptionStringer;
use Behat\Testwork\Output\Printer\OutputPrinter;
use Exception;
+use Symfony\Component\Console\Output\OutputInterface;
/**
* Presents exceptions as strings using registered stringers.
@@ -93,13 +94,45 @@ public function presentException(Exception $exception, $verbosity = null)
}
}
- if (OutputPrinter::VERBOSITY_VERY_VERBOSE <= $verbosity) {
+ if (OutputInterface::VERBOSITY_VERY_VERBOSE <= $verbosity) {
+ if (OutputInterface::VERBOSITY_DEBUG > $verbosity) {
+ $exception = $this->removeBehatCallsFromTrace($exception);
+ }
+
return $this->relativizePaths(trim($exception));
}
return trim($this->relativizePaths($exception->getMessage()) . ' (' . get_class($exception) . ')');
}
+ private function removeBehatCallsFromTrace(Exception $exception)
+ {
+ $traceOutput = '';
+ foreach ($exception->getTrace() as $i => $trace) {
+ if (isset($trace['file']) && false !== strpos(str_replace('\\', '/', $trace['file']), 'Behat/Testwork/Call/Handler/RuntimeCallHandler')) {
+ break;
+ }
+
+ $traceOutput .= sprintf(
+ '#%d %s: %s()'.PHP_EOL,
+ $i,
+ isset($trace['file']) ? $trace['file'].'('.$trace['line'].')' : '[internal function]',
+ isset($trace['class']) ? $trace['class'].$trace['type'].$trace['function'] : $trace['function']
+ );
+ }
+
+ return sprintf(
+ "%s: %s in %s:%d%sStack trace:%s%s",
+ get_class($exception),
+ $exception->getMessage(),
+ $exception->getFile(),
+ $exception->getLine(),
+ PHP_EOL,
+ PHP_EOL,
+ $traceOutput
+ );
+ }
+
/**
* Relativizes absolute paths in the text.
*
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ServiceContainer/ExceptionExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ServiceContainer/ExceptionExtension.php
index ac89715e5..92ae6afee 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ServiceContainer/ExceptionExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/ServiceContainer/ExceptionExtension.php
@@ -30,12 +30,12 @@ final class ExceptionExtension implements Extension
/*
* Available services
*/
- const PRESENTER_ID = 'exception.presenter';
+ public const PRESENTER_ID = 'exception.presenter';
/*
* Available extension points
*/
- const STRINGER_TAG = 'exception.stringer';
+ public const STRINGER_TAG = 'exception.stringer';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/ExceptionStringer.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/ExceptionStringer.php
index eab706186..5f8de153c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/ExceptionStringer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/ExceptionStringer.php
@@ -27,7 +27,7 @@ interface ExceptionStringer
*
* @param Exception $exception
*
- * @return Boolean
+ * @return bool
*/
public function supportsException(Exception $exception);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php
index 3534924f8..0b06299ef 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php
@@ -11,8 +11,6 @@
namespace Behat\Testwork\Exception\Stringer;
use Exception;
-use PHPUnit_Framework_Exception;
-use PHPUnit_Framework_TestFailure;
/**
* Strings PHPUnit assertion exceptions.
@@ -28,7 +26,8 @@ final class PHPUnitExceptionStringer implements ExceptionStringer
*/
public function supportsException(Exception $exception)
{
- return $exception instanceof PHPUnit_Framework_Exception;
+ return $exception instanceof \PHPUnit_Framework_Exception
+ || $exception instanceof \PHPUnit\Framework\Exception;
}
/**
@@ -36,9 +35,13 @@ public function supportsException(Exception $exception)
*/
public function stringException(Exception $exception, $verbosity)
{
+ if (!class_exists('PHPUnit\\Framework\\TestFailure')) {
+ return trim(\PHPUnit_Framework_TestFailure::exceptionToString($exception));
+ }
+
// PHPUnit assertion exceptions do not include expected / observed info in their
// messages, but expect the test listeners to format that info like the following
// (see e.g. PHPUnit_TextUI_ResultPrinter::printDefectTrace)
- return trim(PHPUnit_Framework_TestFailure::exceptionToString($exception));
+ return trim(\PHPUnit\Framework\TestFailure::exceptionToString($exception));
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Filesystem/ServiceContainer/FilesystemExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Filesystem/ServiceContainer/FilesystemExtension.php
index 4fdc537ca..0d668ff11 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Filesystem/ServiceContainer/FilesystemExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Filesystem/ServiceContainer/FilesystemExtension.php
@@ -28,7 +28,7 @@ final class FilesystemExtension implements Extension
/*
* Available services
*/
- const LOGGER_ID = 'filesystem.logger';
+ public const LOGGER_ID = 'filesystem.logger';
/**
* {@inheritdoc}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Call/RuntimeSuiteHook.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Call/RuntimeSuiteHook.php
index 237bc7615..44b7f6573 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Call/RuntimeSuiteHook.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Call/RuntimeSuiteHook.php
@@ -70,7 +70,7 @@ public function filterMatches(HookScope $scope)
* @param Suite $suite
* @param string $filterString
*
- * @return Boolean
+ * @return bool
*/
private function isSuiteMatch(Suite $suite, $filterString)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/FilterableHook.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/FilterableHook.php
index 48ece6aba..a241ff816 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/FilterableHook.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/FilterableHook.php
@@ -24,7 +24,7 @@ interface FilterableHook extends Hook
*
* @param HookScope $scope
*
- * @return Boolean
+ * @return bool
*/
public function filterMatches(HookScope $scope);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Scope/SuiteScope.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Scope/SuiteScope.php
index 6cc308f00..659a8f6cd 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Scope/SuiteScope.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/Scope/SuiteScope.php
@@ -19,8 +19,8 @@
*/
interface SuiteScope extends HookScope
{
- const BEFORE = 'suite.before';
- const AFTER = 'suite.after';
+ public const BEFORE = 'suite.before';
+ public const AFTER = 'suite.after';
/**
* Returns specification iterator.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/ServiceContainer/HookExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/ServiceContainer/HookExtension.php
index fee6de4d4..9697c98e5 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/ServiceContainer/HookExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Hook/ServiceContainer/HookExtension.php
@@ -30,8 +30,8 @@ class HookExtension implements Extension
/*
* Available services
*/
- const DISPATCHER_ID = 'hook.dispatcher';
- const REPOSITORY_ID = 'hook.repository';
+ public const DISPATCHER_ID = 'hook.dispatcher';
+ public const REPOSITORY_ID = 'hook.repository';
/**
* {@inheritdoc}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php
index 1cc3055a6..aba9ba894 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php
@@ -58,7 +58,7 @@ public function __construct(Exercise $decoratedExercise)
* Sets up exercise for a test.
*
* @param SpecificationIterator[] $iterators
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -71,7 +71,7 @@ public function setUp(array $iterators, $skip)
* Tests suites specifications.
*
* @param SpecificationIterator[] $iterators
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -84,7 +84,7 @@ public function test(array $iterators, $skip)
* Tears down exercise after a test.
*
* @param SpecificationIterator[] $iterators
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/Orderer/RandomOrderer.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/Orderer/RandomOrderer.php
index 551e44796..8dc9c9e0e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/Orderer/RandomOrderer.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/Orderer/RandomOrderer.php
@@ -11,6 +11,7 @@
namespace Behat\Testwork\Ordering\Orderer;
use Behat\Testwork\Specification\SpecificationArrayIterator;
+use Behat\Testwork\Specification\SpecificationIterator;
/**
* Prioritises Suites and Features into random order
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/ServiceContainer/OrderingExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/ServiceContainer/OrderingExtension.php
index 2a9d5a7fa..329227330 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/ServiceContainer/OrderingExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Ordering/ServiceContainer/OrderingExtension.php
@@ -28,7 +28,7 @@
*/
final class OrderingExtension implements Extension
{
- const ORDERER_TAG = 'tester.orderer';
+ public const ORDERER_TAG = 'tester.orderer';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Cli/OutputController.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Cli/OutputController.php
index ae886519b..bf8f94488 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Cli/OutputController.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Cli/OutputController.php
@@ -153,7 +153,7 @@ protected function locateOutputPath($path)
*
* @param array $formats
* @param array $outputs
- * @param Boolean $decorated
+ * @param bool $decorated
*/
private function configureOutputs(array $formats, array $outputs, $decorated = false)
{
@@ -184,7 +184,7 @@ private function configureOutputs(array $formats, array $outputs, $decorated = f
*
* @param string $outputId
*
- * @return Boolean
+ * @return bool
*/
private function isStandardOutput($outputId)
{
@@ -196,7 +196,7 @@ private function isStandardOutput($outputId)
*
* @param string $file A file path
*
- * @return Boolean
+ * @return bool
*/
private function isAbsolutePath($file)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Exception/MissingExtensionException.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Exception/MissingExtensionException.php
new file mode 100644
index 000000000..a54cdbd9f
--- /dev/null
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Exception/MissingExtensionException.php
@@ -0,0 +1,22 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Testwork\Output\Exception;
+
+use RuntimeException;
+
+/**
+ * Represents an exception thrown when a required extension is missing.
+ *
+ * @author Konstantin Kudryashov
+ */
+class MissingExtensionException extends RuntimeException implements PrinterException
+{
+}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/ChainEventListener.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/ChainEventListener.php
index 0c76bac39..2fb8d44cb 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/ChainEventListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/ChainEventListener.php
@@ -11,10 +11,10 @@
namespace Behat\Testwork\Output\Node\EventListener;
use ArrayIterator;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Countable;
use IteratorAggregate;
-use Symfony\Component\EventDispatcher\Event;
/**
* Used to compose formatter event listeners.
@@ -51,7 +51,7 @@ public function listenEvent(Formatter $formatter, Event $event, $eventName)
/**
* {@inheritdoc}
*/
- public function count()
+ public function count(): int
{
return count($this->listeners);
}
@@ -59,7 +59,7 @@ public function count()
/**
* {@inheritdoc}
*/
- public function getIterator()
+ public function getIterator(): ArrayIterator
{
return new ArrayIterator($this->listeners);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/EventListener.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/EventListener.php
index 6fbc078ff..2faaef957 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/EventListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/EventListener.php
@@ -10,8 +10,8 @@
namespace Behat\Testwork\Output\Node\EventListener;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
-use Symfony\Component\EventDispatcher\Event;
/**
* Used to define formatter event listeners.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/Flow/FireOnlyIfFormatterParameterListener.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/Flow/FireOnlyIfFormatterParameterListener.php
index 0df21eb3a..3c917189b 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/Flow/FireOnlyIfFormatterParameterListener.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/Flow/FireOnlyIfFormatterParameterListener.php
@@ -10,9 +10,9 @@
namespace Behat\Testwork\Output\Node\EventListener\Flow;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\Output\Formatter;
use Behat\Testwork\Output\Node\EventListener\EventListener;
-use Symfony\Component\EventDispatcher\Event;
/**
* Catches all events, but proxies them only if formatter has specific parameter set to a specific value.
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php
index 3894d49fa..4ecdd2085 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php
@@ -10,10 +10,10 @@
namespace Behat\Testwork\Output;
+use Behat\Testwork\Event\Event;
use Behat\Testwork\EventDispatcher\TestworkEventDispatcher;
use Behat\Testwork\Output\Node\EventListener\EventListener;
use Behat\Testwork\Output\Printer\OutputPrinter;
-use Symfony\Component\EventDispatcher\Event;
/**
* Formatter built around the idea of event delegation and composition.
@@ -79,7 +79,13 @@ public static function getSubscribedEvents()
*/
public function listenEvent(Event $event, $eventName = null)
{
- $eventName = $eventName ?: $event->getName();
+ if (null === $eventName) {
+ if (method_exists($event, 'getName')) {
+ $eventName = $event->getName();
+ } else {
+ $eventName = get_class($event);
+ }
+ }
$this->listener->listenEvent($this, $event, $eventName);
}
@@ -121,6 +127,6 @@ public function setParameter($name, $value)
*/
public function getParameter($name)
{
- return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
+ return $this->parameters[$name] ?? null;
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/OutputManager.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/OutputManager.php
index cdf776018..ede7b574f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/OutputManager.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/OutputManager.php
@@ -58,7 +58,7 @@ public function registerFormatter(Formatter $formatter)
*
* @param string $name
*
- * @return Boolean
+ * @return bool
*/
public function isFormatterRegistered($name)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/OutputFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/OutputFactory.php
index 20f47d35a..e65f7f152 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/OutputFactory.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/OutputFactory.php
@@ -18,10 +18,10 @@
*/
abstract class OutputFactory
{
- const VERBOSITY_NORMAL = 1;
- const VERBOSITY_VERBOSE = 2;
- const VERBOSITY_VERY_VERBOSE = 3;
- const VERBOSITY_DEBUG = 4;
+ public const VERBOSITY_NORMAL = 1;
+ public const VERBOSITY_VERBOSE = 2;
+ public const VERBOSITY_VERY_VERBOSE = 3;
+ public const VERBOSITY_DEBUG = 4;
/**
* @var null|string
@@ -32,7 +32,7 @@ abstract class OutputFactory
*/
private $outputStyles = array();
/**
- * @var null|Boolean
+ * @var null|bool
*/
private $outputDecorated = null;
/**
@@ -83,7 +83,7 @@ public function getOutputStyles()
/**
* Forces output to be decorated.
*
- * @param Boolean $decorated
+ * @param bool $decorated
*/
public function setOutputDecorated($decorated)
{
@@ -93,7 +93,7 @@ public function setOutputDecorated($decorated)
/**
* Returns output decoration status.
*
- * @return null|Boolean
+ * @return null|bool
*/
public function isOutputDecorated()
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php
index 7577e111c..f415b96a1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php
@@ -10,6 +10,7 @@
namespace Behat\Testwork\Output\Printer;
+use Behat\Testwork\Output\Exception\MissingExtensionException;
use Behat\Testwork\Output\Printer\Factory\FilesystemOutputFactory;
use Symfony\Component\Console\Output\OutputInterface;
@@ -22,8 +23,8 @@
*/
final class JUnitOutputPrinter extends StreamOutputPrinter
{
- const XML_VERSION = '1.0';
- const XML_ENCODING = 'UTF-8';
+ public const XML_VERSION = '1.0';
+ public const XML_ENCODING = 'UTF-8';
/**
* @var \DOMDocument
@@ -57,6 +58,10 @@ public function __construct(FilesystemOutputFactory $outputFactory)
*/
public function createNewFile($name, array $testsuitesAttributes = array())
{
+ // This requires the DOM extension to be enabled.
+ if (!extension_loaded('dom')) {
+ throw new MissingExtensionException('The PHP DOM extension is required to generate JUnit reports.');
+ }
$this->setFileName(strtolower(trim(preg_replace('/[^[:alnum:]_]+/', '_', $name), '_')));
$this->domDocument = new \DOMDocument(self::XML_VERSION, self::XML_ENCODING);
@@ -102,7 +107,7 @@ public function addTestcase(array $testcaseAttributes = array())
*/
public function addTestcaseChild($nodeName, array $nodeAttributes = array(), $nodeValue = null)
{
- $childNode = $this->domDocument->createElement($nodeName, $nodeValue);
+ $childNode = $this->domDocument->createElement($nodeName, $nodeValue ?? '');
$this->currentTestcase->appendChild($childNode);
$this->addAttributesToNode($childNode, $nodeAttributes);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/OutputPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/OutputPrinter.php
index 91292d39c..6ef907439 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/OutputPrinter.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/OutputPrinter.php
@@ -20,19 +20,19 @@ interface OutputPrinter
/**
* @deprecated since 3.1, to be removed in 4.0
*/
- const VERBOSITY_NORMAL = 1;
+ public const VERBOSITY_NORMAL = 1;
/**
* @deprecated since 3.1, to be removed in 4.0
*/
- const VERBOSITY_VERBOSE = 2;
+ public const VERBOSITY_VERBOSE = 2;
/**
* @deprecated since 3.1, to be removed in 4.0
*/
- const VERBOSITY_VERY_VERBOSE = 3;
+ public const VERBOSITY_VERY_VERBOSE = 3;
/**
* @deprecated since 3.1, to be removed in 4.0
*/
- const VERBOSITY_DEBUG = 4;
+ public const VERBOSITY_DEBUG = 4;
/**
* Sets output path.
@@ -69,14 +69,14 @@ public function getOutputStyles();
/**
* Forces output to be decorated.
*
- * @param Boolean $decorated
+ * @param bool $decorated
*/
public function setOutputDecorated($decorated);
/**
* Returns output decoration status.
*
- * @return null|Boolean
+ * @return null|bool
*
* @deprecated since 3.1, to be removed in 4.0
*/
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/ServiceContainer/OutputExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/ServiceContainer/OutputExtension.php
index f49babe97..dff83fde1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/ServiceContainer/OutputExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/ServiceContainer/OutputExtension.php
@@ -31,12 +31,12 @@ final class OutputExtension implements Extension
/*
* Available services
*/
- const MANAGER_ID = 'output.manager';
+ public const MANAGER_ID = 'output.manager';
/*
* Available extension points
*/
- const FORMATTER_TAG = 'output.formatter';
+ public const FORMATTER_TAG = 'output.formatter';
/**
* @var string
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php
index 33521c10d..dfc02eb4d 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php
@@ -29,7 +29,7 @@ final class ConfigurationLoader
*/
private $environmentVariable;
/**
- * @var Boolean
+ * @var bool
*/
private $profileFound;
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationTree.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationTree.php
index d713cbc9b..f5b215fab 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationTree.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationTree.php
@@ -11,6 +11,7 @@
namespace Behat\Testwork\ServiceContainer\Configuration;
use Behat\Testwork\ServiceContainer\Extension;
+use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\NodeInterface;
@@ -30,13 +31,14 @@ final class ConfigurationTree
*/
public function getConfigTree(array $extensions)
{
- $tree = new TreeBuilder();
- $root = $tree->root('testwork');
+ $treeBuilder = new TreeBuilder('testwork');
+ /** @var ArrayNodeDefinition $rootNode */
+ $rootNode = $treeBuilder->getRootNode();
foreach ($extensions as $extension) {
- $extension->configure($root->children()->arrayNode($extension->getConfigKey()));
+ $extension->configure($rootNode->children()->arrayNode($extension->getConfigKey()));
}
- return $tree->buildTree();
+ return $treeBuilder->buildTree();
}
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/ExtensionManager.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/ExtensionManager.php
index 7e2d955dc..ad49484c8 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/ExtensionManager.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/ExtensionManager.php
@@ -81,11 +81,11 @@ public function activateExtension($locator)
*
* @param string $key
*
- * @return Extension
+ * @return Extension|null
*/
public function getExtension($key)
{
- return isset($this->extensions[$key]) ? $this->extensions[$key] : null;
+ return $this->extensions[$key] ?? null;
}
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/GroupedSpecificationIterator.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/GroupedSpecificationIterator.php
index bac556d05..8975040fc 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/GroupedSpecificationIterator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/GroupedSpecificationIterator.php
@@ -77,7 +77,7 @@ public function getSuite()
/**
* {@inheritdoc}
*/
- public function rewind()
+ public function rewind(): void
{
$this->position = 0;
while (isset($this->iterators[$this->position])) {
@@ -93,7 +93,7 @@ public function rewind()
/**
* {@inheritdoc}
*/
- public function next()
+ public function next(): void
{
if (!isset($this->iterators[$this->position])) {
return;
@@ -114,7 +114,7 @@ public function next()
/**
* {@inheritdoc}
*/
- public function valid()
+ public function valid(): bool
{
return isset($this->iterators[$this->position]) && $this->iterators[$this->position]->valid();
}
@@ -122,6 +122,7 @@ public function valid()
/**
* {@inheritdoc}
*/
+ #[\ReturnTypeWillChange]
public function current()
{
return $this->iterators[$this->position]->current();
@@ -130,7 +131,7 @@ public function current()
/**
* {@inheritdoc}
*/
- public function key()
+ public function key(): int
{
return $this->position + $this->iterators[$this->position]->key();
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/ServiceContainer/SpecificationExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/ServiceContainer/SpecificationExtension.php
index 03ca52de7..d369d458c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/ServiceContainer/SpecificationExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Specification/ServiceContainer/SpecificationExtension.php
@@ -27,12 +27,12 @@ final class SpecificationExtension implements Extension
/*
* Available services
*/
- const FINDER_ID = 'specifications.finder';
+ public const FINDER_ID = 'specifications.finder';
/*
* Available extension points
*/
- const LOCATOR_TAG = 'specifications.locator';
+ public const LOCATOR_TAG = 'specifications.locator';
/**
* @var ServiceProcessor
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/SuiteGenerator.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/SuiteGenerator.php
index 876d6b600..5d8934683 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/SuiteGenerator.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/SuiteGenerator.php
@@ -28,7 +28,7 @@ interface SuiteGenerator
* @param string $type
* @param array $settings
*
- * @return Boolean
+ * @return bool
*/
public function supportsTypeAndSettings($type, array $settings);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/GenericSuite.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/GenericSuite.php
index 766cffe5b..1c6702b61 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/GenericSuite.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/GenericSuite.php
@@ -65,7 +65,7 @@ public function getSettings()
*
* @param string $key
*
- * @return Boolean
+ * @return bool
*/
public function hasSetting($key)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/ServiceContainer/SuiteExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/ServiceContainer/SuiteExtension.php
index 79fbcda84..804cb92e4 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/ServiceContainer/SuiteExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/ServiceContainer/SuiteExtension.php
@@ -29,14 +29,14 @@ final class SuiteExtension implements Extension
/*
* Available services
*/
- const REGISTRY_ID = 'suite.registry';
- const BOOTSTRAPPER_ID = 'suite.bootstrapper';
+ public const REGISTRY_ID = 'suite.registry';
+ public const BOOTSTRAPPER_ID = 'suite.bootstrapper';
/*
* Available extension points
*/
- const GENERATOR_TAG = 'suite.generator';
- const SETUP_TAG = 'suite.setup';
+ public const GENERATOR_TAG = 'suite.generator';
+ public const SETUP_TAG = 'suite.setup';
/**
* @var ServiceProcessor
@@ -89,9 +89,7 @@ public function configure(ArrayNodeDefinition $builder)
return is_array($suite) && count($suite);
})
->then(function ($suite) {
- $suite['settings'] = isset($suite['settings'])
- ? $suite['settings']
- : array();
+ $suite['settings'] = $suite['settings'] ?? array();
foreach ($suite as $key => $val) {
$suiteKeys = array('enabled', 'type', 'settings');
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Setup/SuiteSetup.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Setup/SuiteSetup.php
index 616562434..75eef7c13 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Setup/SuiteSetup.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Setup/SuiteSetup.php
@@ -27,7 +27,7 @@ interface SuiteSetup
*
* @param Suite $suite
*
- * @return Boolean
+ * @return bool
*/
public function supportsSuite(Suite $suite);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Suite.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Suite.php
index 782f8fd7c..e26c1617e 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Suite.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/Suite.php
@@ -36,7 +36,7 @@ public function getSettings();
*
* @param string $key
*
- * @return Boolean
+ * @return bool
*/
public function hasSetting($key);
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/SuiteRegistry.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/SuiteRegistry.php
index 5ad98fdcb..b5f90df46 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/SuiteRegistry.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Suite/SuiteRegistry.php
@@ -23,7 +23,7 @@
final class SuiteRegistry implements SuiteRepository
{
/**
- * @var Boolean
+ * @var bool
*/
private $suitesGenerated = false;
/**
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php
index b3d2eac5b..2fc5642e1 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php
@@ -52,7 +52,7 @@ final class ExerciseController implements Controller
*/
private $resultInterpreter;
/**
- * @var Boolean
+ * @var bool
*/
private $skip;
@@ -63,7 +63,7 @@ final class ExerciseController implements Controller
* @param SpecificationFinder $specificationFinder
* @param Exercise $exercise
* @param ResultInterpreter $resultInterpreter
- * @param Boolean $skip
+ * @param bool $skip
*/
public function __construct(
SuiteRepository $suiteRepository,
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/StrictController.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/StrictController.php
index 1e610be21..697b881fc 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/StrictController.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/StrictController.php
@@ -30,7 +30,7 @@ final class StrictController implements Controller
*/
private $resultInterpreter;
/**
- * @var Boolean
+ * @var bool
*/
private $strict;
@@ -38,7 +38,7 @@ final class StrictController implements Controller
* Initializes controller.
*
* @param ResultInterpreter $resultInterpreter
- * @param Boolean $strict
+ * @param bool $strict
*/
public function __construct(ResultInterpreter $resultInterpreter, $strict = false)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Exercise.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Exercise.php
index 6a19c1efb..e63883d8c 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Exercise.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Exercise.php
@@ -26,7 +26,7 @@ interface Exercise
* Sets up exercise for a test.
*
* @param SpecificationIterator[] $iterators
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -36,7 +36,7 @@ public function setUp(array $iterators, $skip);
* Tests suites specifications.
*
* @param SpecificationIterator[] $iterators
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -46,7 +46,7 @@ public function test(array $iterators, $skip);
* Tears down exercise after a test.
*
* @param SpecificationIterator[] $iterators
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/ExceptionResult.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/ExceptionResult.php
index f30edcf19..1b724f5c3 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/ExceptionResult.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/ExceptionResult.php
@@ -22,7 +22,7 @@ interface ExceptionResult extends TestResult
/**
* Checks that the test result has exception.
*
- * @return Boolean
+ * @return bool
*/
public function hasException();
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/Interpretation/ResultInterpretation.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/Interpretation/ResultInterpretation.php
index 555e75fa8..cc9250915 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/Interpretation/ResultInterpretation.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/Interpretation/ResultInterpretation.php
@@ -27,7 +27,7 @@ interface ResultInterpretation
*
* @param TestResult $result
*
- * @return Boolean
+ * @return bool
*/
public function isFailure(TestResult $result);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResult.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResult.php
index 9d557965d..7c3df6ffe 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResult.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResult.php
@@ -17,15 +17,15 @@
*/
interface TestResult
{
- const PASSED = 0;
- const SKIPPED = 10;
- const PENDING = 20;
- const FAILED = 99;
+ public const PASSED = 0;
+ public const SKIPPED = 10;
+ public const PENDING = 20;
+ public const FAILED = 99;
/**
* Checks that test has passed.
*
- * @return Boolean
+ * @return bool
*/
public function isPassed();
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResults.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResults.php
index 5102f3747..cf8e4aa52 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResults.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Result/TestResults.php
@@ -21,7 +21,7 @@
*/
final class TestResults implements TestResult, Countable, IteratorAggregate
{
- const NO_TESTS = -100;
+ public const NO_TESTS = -100;
/**
* @var TestResult[]
@@ -62,7 +62,7 @@ public function getResultCode()
/**
* {@inheritdoc}
*/
- public function count()
+ public function count(): int
{
return count($this->results);
}
@@ -70,7 +70,7 @@ public function count()
/**
* {@inheritdoc}
*/
- public function getIterator()
+ public function getIterator(): ArrayIterator
{
return new ArrayIterator($this->results);
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/ServiceContainer/TesterExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/ServiceContainer/TesterExtension.php
index 55bcfa9da..8892992ce 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/ServiceContainer/TesterExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/ServiceContainer/TesterExtension.php
@@ -32,18 +32,18 @@ abstract class TesterExtension implements Extension
/*
* Available services
*/
- const EXERCISE_ID = 'tester.exercise';
- const SUITE_TESTER_ID = 'tester.suite';
- const SPECIFICATION_TESTER_ID = 'tester.specification';
- const RESULT_INTERPRETER_ID = 'tester.result.interpreter';
+ public const EXERCISE_ID = 'tester.exercise';
+ public const SUITE_TESTER_ID = 'tester.suite';
+ public const SPECIFICATION_TESTER_ID = 'tester.specification';
+ public const RESULT_INTERPRETER_ID = 'tester.result.interpreter';
/**
* Available extension points
*/
- const EXERCISE_WRAPPER_TAG = 'tester.exercise.wrapper';
- const SUITE_TESTER_WRAPPER_TAG = 'tester.suite.wrapper';
- const SPECIFICATION_TESTER_WRAPPER_TAG = 'tester.specification.wrapper';
- const RESULT_INTERPRETATION_TAG = 'test.result.interpretation';
+ public const EXERCISE_WRAPPER_TAG = 'tester.exercise.wrapper';
+ public const SUITE_TESTER_WRAPPER_TAG = 'tester.suite.wrapper';
+ public const SPECIFICATION_TESTER_WRAPPER_TAG = 'tester.specification.wrapper';
+ public const RESULT_INTERPRETATION_TAG = 'test.result.interpretation';
/**
* @var ServiceProcessor
@@ -123,7 +123,7 @@ public function process(ContainerBuilder $container)
* Loads exercise cli controllers.
*
* @param ContainerBuilder $container
- * @param Boolean $skip
+ * @param bool $skip
*/
protected function loadExerciseController(ContainerBuilder $container, $skip = false)
{
@@ -142,7 +142,7 @@ protected function loadExerciseController(ContainerBuilder $container, $skip = f
* Loads exercise cli controllers.
*
* @param ContainerBuilder $container
- * @param Boolean $strict
+ * @param bool $strict
*/
protected function loadStrictController(ContainerBuilder $container, $strict = false)
{
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Setup.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Setup.php
index e904ebb35..5f6fd45b7 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Setup.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Setup.php
@@ -20,14 +20,14 @@ interface Setup
/**
* Returns true if fixtures have been handled successfully.
*
- * @return Boolean
+ * @return bool
*/
public function isSuccessful();
/**
* Checks if setup has produced any output.
*
- * @return Boolean
+ * @return bool
*/
public function hasOutput();
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Teardown.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Teardown.php
index fbb445b17..7ff253168 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Teardown.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/Setup/Teardown.php
@@ -20,14 +20,14 @@ interface Teardown
/**
* Returns true if fixtures have been handled successfully.
*
- * @return Boolean
+ * @return bool
*/
public function isSuccessful();
/**
* Checks if tear down has produced any output.
*
- * @return Boolean
+ * @return bool
*/
public function hasOutput();
}
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SpecificationTester.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SpecificationTester.php
index 9dc106a22..b6e06ff41 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SpecificationTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SpecificationTester.php
@@ -27,7 +27,7 @@ interface SpecificationTester
*
* @param Environment $env
* @param mixed $spec
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -38,7 +38,7 @@ public function setUp(Environment $env, $spec, $skip);
*
* @param Environment $env
* @param mixed $spec
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -49,7 +49,7 @@ public function test(Environment $env, $spec, $skip);
*
* @param Environment $env
* @param mixed $spec
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SuiteTester.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SuiteTester.php
index f139f1a14..61dffad7f 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SuiteTester.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Tester/SuiteTester.php
@@ -28,7 +28,7 @@ interface SuiteTester
*
* @param Environment $env
* @param SpecificationIterator $iterator
- * @param Boolean $skip
+ * @param bool $skip
*
* @return Setup
*/
@@ -39,7 +39,7 @@ public function setUp(Environment $env, SpecificationIterator $iterator, $skip);
*
* @param Environment $env
* @param SpecificationIterator $iterator
- * @param Boolean $skip
+ * @param bool $skip
*
* @return TestResult
*/
@@ -50,7 +50,7 @@ public function test(Environment $env, SpecificationIterator $iterator, $skip);
*
* @param Environment $env
* @param SpecificationIterator $iterator
- * @param Boolean $skip
+ * @param bool $skip
* @param TestResult $result
*
* @return Teardown
diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Translator/ServiceContainer/TranslatorExtension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Translator/ServiceContainer/TranslatorExtension.php
index 39de237cf..5fc53f0b9 100644
--- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Translator/ServiceContainer/TranslatorExtension.php
+++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Translator/ServiceContainer/TranslatorExtension.php
@@ -28,7 +28,7 @@ final class TranslatorExtension implements Extension
/*
* Available services
*/
- const TRANSLATOR_ID = 'translator';
+ public const TRANSLATOR_ID = 'translator';
/**
* {@inheritdoc}
@@ -91,7 +91,7 @@ public function process(ContainerBuilder $container)
*/
private function loadTranslator(ContainerBuilder $container, $locale, $fallbackLocale)
{
- $definition = new Definition('Symfony\Component\Translation\Translator', array($locale));
+ $definition = new Definition('Behat\Behat\Definition\Translator\Translator', array($locale));
$container->setDefinition(self::TRANSLATOR_ID, $definition);
$definition->addMethodCall('setFallbackLocales', array(array($fallbackLocale)));
diff --git a/tests/integration/vendor/behat/gherkin/.github/workflows/build.yml b/tests/integration/vendor/behat/gherkin/.github/workflows/build.yml
new file mode 100644
index 000000000..93d5d1d11
--- /dev/null
+++ b/tests/integration/vendor/behat/gherkin/.github/workflows/build.yml
@@ -0,0 +1,47 @@
+name: Build
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+ release:
+ types: [created]
+
+jobs:
+ tests:
+ runs-on: ubuntu-latest
+ name: Build and test
+ strategy:
+ fail-fast: false
+ matrix:
+ php: [7.2, 7.3, 7.4, 8.0, 8.1]
+ composer-flags: [ "" ]
+ symfony-version: [ "" ]
+ include:
+ - php: 7.2
+ symfony-version: '3.*'
+ - php: 7.3
+ symfony-version: '4.*'
+ - php: 7.4
+ symfony-version: '5.*'
+ - php: 8.0
+ symfony-version: '5.*'
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: "${{ matrix.php }}"
+ coverage: none
+
+ - name: Update Symfony version
+ if: matrix.symfony-version != ''
+ run: composer require --no-update "symfony/symfony:${{ matrix.symfony-version }}"
+
+ - name: Install dependencies
+ run: composer update ${{ matrix.composer-flags }}
+
+ - name: Run tests (phpunit)
+ run: ./vendor/bin/phpunit
diff --git a/tests/integration/vendor/behat/gherkin/.github/workflows/update.yml b/tests/integration/vendor/behat/gherkin/.github/workflows/update.yml
new file mode 100644
index 000000000..0ba32d3f9
--- /dev/null
+++ b/tests/integration/vendor/behat/gherkin/.github/workflows/update.yml
@@ -0,0 +1,49 @@
+name: Update Cucumber
+
+on:
+ schedule:
+ - cron: '0 7 * * *'
+
+jobs:
+ cucumber-update:
+ runs-on: ubuntu-latest
+ name: Upstream cucumber update
+ steps:
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: 7.4
+ coverage: none
+
+ - uses: actions/checkout@v2
+
+ - name: Install dependencies
+ run: composer update
+
+ - name: Update cucumber tag
+ id: cucumber
+ run: bin/update_cucumber
+
+ - name: Re-install dependencies
+ run: composer update
+ if: steps.cucumber.outputs.cucumber_version
+
+ - name: Update translations
+ run: bin/update_i18n
+ if: steps.cucumber.outputs.cucumber_version
+
+ - name: Find changelog
+ id: changelog
+ run: bin/cucumber_changelog ${{ steps.cucumber.outputs.cucumber_version }}
+ if: steps.cucumber.outputs.cucumber_version
+
+ - name: Open a PR
+ uses: peter-evans/create-pull-request@v3
+ if: steps.cucumber.outputs.cucumber_version
+ with:
+ commit-message: Automatic Cucumber tag update to ${{ steps.cucumber.outputs.cucumber_version }}
+ branch: cucumber-update-${{ steps.cucumber.outputs.cucumber_version }}
+ delete-branch: true
+ title: Cucumber update ${{ steps.cucumber.outputs.cucumber_version }}
+ body: ${{ steps.changelog.outputs.changelog }}
+ base: 'master'
diff --git a/tests/integration/vendor/behat/gherkin/.gitignore b/tests/integration/vendor/behat/gherkin/.gitignore
deleted file mode 100644
index 33b7c6582..000000000
--- a/tests/integration/vendor/behat/gherkin/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.tgz
-vendor
-composer.phar
-composer.lock
diff --git a/tests/integration/vendor/behat/gherkin/.travis.yml b/tests/integration/vendor/behat/gherkin/.travis.yml
deleted file mode 100644
index 97b6ce67f..000000000
--- a/tests/integration/vendor/behat/gherkin/.travis.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-language: php
-
-sudo: false
-
-cache:
- directories:
- - $HOME/.composer/cache/files
-
-php: [5.3, 5.4, 5.5, 5.6, 7.0, hhvm]
-
-matrix:
- include:
- - php: 5.6
- env: SYMFONY_VERSION='2.3.*'
- - php: 5.6
- env: SYMFONY_VERSION='2.7.*'
- - php: 5.6
- env: SYMFONY_VERSION='2.8.*'
- - php: 7.0
- env: SYMFONY_VERSION='3.0.*'
-
-before_install:
- - composer self-update
- - if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/yaml=$SYMFONY_VERSION; fi;
-
-install:
- - composer install
-
-script: vendor/bin/phpunit -v --coverage-clover=coverage.clover
-
-after_script:
- # don't upload coverage on PHP 7 and HHVM as it cannot be generated. We don't want to tell Scrutinizer that the coverage generation failed.
- - if [[ "7.0" != "$TRAVIS_PHP_VERSION" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
diff --git a/tests/integration/vendor/behat/gherkin/CHANGES.md b/tests/integration/vendor/behat/gherkin/CHANGES.md
index f2c1043c3..4533536ce 100644
--- a/tests/integration/vendor/behat/gherkin/CHANGES.md
+++ b/tests/integration/vendor/behat/gherkin/CHANGES.md
@@ -1,3 +1,78 @@
+4.9.0 / 2021-10-12
+==================
+
+* Simplify the boolean condition for the tag matching by @stof in https://github.com/Behat/Gherkin/pull/219
+* Remove symfony phpunit bridge by @ciaranmcnulty in https://github.com/Behat/Gherkin/pull/220
+* Ignore the bin folder in archives by @stof in https://github.com/Behat/Gherkin/pull/226
+* Cast table node exceptions into ParserExceptions when throwing by @ciaranmcnulty in https://github.com/Behat/Gherkin/pull/216
+* Cucumber changelog in PRs and using correct hash by @ciaranmcnulty in https://github.com/Behat/Gherkin/pull/225
+* Support alternative docstrings format (```) by @ciaranmcnulty in https://github.com/Behat/Gherkin/pull/214
+* Fix DocBlocks (Boolean -> bool) by @simonhammes in https://github.com/Behat/Gherkin/pull/237
+* Tag parsing by @ciaranmcnulty in https://github.com/Behat/Gherkin/pull/215
+* Remove test - cucumber added an example with Rule which is not supported by @ciaranmcnulty in https://github.com/Behat/Gherkin/pull/239
+* Add PHP 8.1 support by @javer in https://github.com/Behat/Gherkin/pull/242
+* Fix main branch alias version by @mvorisek in https://github.com/Behat/Gherkin/pull/244
+
+4.8.0 / 2021-02-04
+==================
+
+* Drop support for PHP before version 7.2
+
+4.7.3 / 2021-02-04
+==================
+
+* Refactored comments parsing to avoid Maximum function nesting level errors
+
+4.7.2 / 2021-02-03
+==================
+
+* Issue where Scenario Outline title was not populated into Examples
+* Updated translations from cucumber 16.0.0
+
+4.7.1 / 2021-01-26
+==================
+
+* Issue parsing comments before scenarios when following an Examples table
+
+4.7.0 / 2021-01-24
+==================
+
+ * Provides better messages for TableNode construct errors
+ * Now allows single character steps
+ * Supports multiple Example Tables with tags
+
+4.6.2 / 2020-03-17
+==================
+
+ * Fixed issues due to incorrect cache key
+
+4.6.1 / 2020-02-27
+==================
+
+ * Fix AZ translations
+ * Correctly filter features, now that the base path is correctly set
+
+4.6.0 / 2019-01-16
+==================
+
+ * Updated translations (including 'Example' as synonym for 'Scenario' in `en`)
+
+4.5.1 / 2017-08-30
+==================
+
+ * Fix regression in `PathsFilter`
+
+4.5.0 / 2017-08-30
+==================
+
+ * Sync i18n with Cucumber Gherkin
+ * Drop support for HHVM tests on Travis
+ * Add `TableNode::fromList()` method (thanks @TravisCarden)
+ * Add `ExampleNode::getOutlineTitle()` method (thanks @duxet)
+ * Use realpath, so the feature receives the cwd prefixed (thanks @glennunipro)
+ * Explicitly handle non-two-dimensional arrays in TableNode (thanks @TravisCarden)
+ * Fix to line/linefilter scenario runs which take relative paths to files (thanks @generalconsensus)
+
4.4.5 / 2016-10-30
==================
diff --git a/tests/integration/vendor/behat/gherkin/CONTRIBUTING.md b/tests/integration/vendor/behat/gherkin/CONTRIBUTING.md
index 5e8d97b7f..6869f76df 100644
--- a/tests/integration/vendor/behat/gherkin/CONTRIBUTING.md
+++ b/tests/integration/vendor/behat/gherkin/CONTRIBUTING.md
@@ -23,7 +23,7 @@ Contributing to Gherkin Translations
Gherkin supports →40 different languages and you could add more! You might notice
`i18n.php` file in the root of the library. This file is downloaded and **autogenerated**
-from original [cucumber/gherkin translations](https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.json).
+from original [cucumber/gherkin translations](https://github.com/cucumber/cucumber/blob/master/gherkin/gherkin-languages.json).
So, in order to fix/update/add some translation, you should send Pull Request to the
`cucumber/gherkin` repository. `Behat\Gherkin` will redownload/regenerate translations
from there before each release.
diff --git a/tests/integration/vendor/behat/gherkin/README.md b/tests/integration/vendor/behat/gherkin/README.md
index e7034df92..0e263845a 100644
--- a/tests/integration/vendor/behat/gherkin/README.md
+++ b/tests/integration/vendor/behat/gherkin/README.md
@@ -4,10 +4,6 @@ Behat Gherkin Parser
This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages
(see `i18n.php`) support & clean architecture.
-[](https://travis-ci.org/Behat/Gherkin)
-[](https://scrutinizer-ci.com/g/Behat/Gherkin/)
-[](https://scrutinizer-ci.com/g/Behat/Gherkin/)
-
Useful Links
------------
diff --git a/tests/integration/vendor/behat/gherkin/bin/update_i18n b/tests/integration/vendor/behat/gherkin/bin/update_i18n
deleted file mode 100755
index cef40686a..000000000
--- a/tests/integration/vendor/behat/gherkin/bin/update_i18n
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env php
- $keywords) {
- $langMessages = array();
-
- foreach ($keywords as $type => $words) {
- if (!is_array($words)) {
- $words = array($words);
- }
-
- if ('scenarioOutline' === $type) {
- $type = 'scenario_outline';
- }
-
- if (in_array($type, array('given', 'when', 'then', 'and', 'but'))) {
- $formattedKeywords = array();
-
- foreach ($words as $word) {
- $formattedWord = trim($word);
-
- if ($formattedWord === $word) {
- $formattedWord = $formattedWord.'<'; // Convert the keywords to the syntax used by Gherkin 2, which is expected by our Lexer.
- }
-
- $formattedKeywords[] = $formattedWord;
- }
-
- $words = $formattedKeywords;
- }
-
- usort($words, function($type1, $type2) {
- return mb_strlen($type2, 'utf8') - mb_strlen($type1, 'utf8');
- });
-
- $langMessages[$type] = implode('|', $words);
- }
-
- // ensure that the order of keys is consistent between updates
- ksort($langMessages);
-
- $array[$lang] = $langMessages;
-}
-
-// ensure that the languages are sorted to avoid useless diffs between updates. We keep the English first though as it is the reference.
-$enData = $array['en'];
-unset($array['en']);
-ksort($array);
-$array = array_merge(array('en' => $enData), $array);
-$arrayString = var_export($array, true);
-
-file_put_contents(__DIR__.'/../i18n.php', <<=5.3.1"
+ "php": "~7.2|~8.0"
},
"require-dev": {
- "symfony/yaml": "~2.3|~3",
- "symfony/phpunit-bridge": "~2.7|~3",
- "phpunit/phpunit": "~4.5|~5"
+ "symfony/yaml": "~3|~4|~5",
+ "phpunit/phpunit": "~8|~9",
+ "cucumber/cucumber": "dev-gherkin-22.0.0"
},
"suggest": {
- "symfony/yaml": "If you want to parse features, represented in YAML files"
+ "symfony/yaml": "If you want to parse features, represented in YAML files"
},
"autoload": {
"psr-0": {
- "Behat\\Gherkin": "src/"
+ "Behat\\Gherkin": "src/"
}
},
@@ -41,7 +41,27 @@
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "4.x-dev"
}
- }
+ },
+
+ "repositories": [
+ {
+ "type": "package",
+ "package": {
+ "name": "cucumber/cucumber",
+ "version": "dev-gherkin-22.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/cucumber/cucumber.git",
+ "reference": "379280b6b98ee9a1bf79444e7c75e23265ccb3e0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/cucumber/cucumber/zipball/379280b6b98ee9a1bf79444e7c75e23265ccb3e0",
+ "reference": "379280b6b98ee9a1bf79444e7c75e23265ccb3e0"
+ }
+ }
+ }
+ ]
}
diff --git a/tests/integration/vendor/behat/gherkin/i18n.php b/tests/integration/vendor/behat/gherkin/i18n.php
index ea71bad59..7f7c2e135 100644
--- a/tests/integration/vendor/behat/gherkin/i18n.php
+++ b/tests/integration/vendor/behat/gherkin/i18n.php
@@ -5,7 +5,7 @@
*
* This file is automatically generated by `bin/update_i18n`.
* Actual Gherkin translations live in cucumber/gherkin repo:
- * https://raw.github.com/cucumber/gherkin/master/gherkin-languages.json
+ * https://github.com/cucumber/cucumber/blob/master/gherkin/gherkin-languages.json
* Please send your translation changes there.
*/
@@ -16,11 +16,12 @@
'background' => 'Background',
'but' => 'But|*',
'examples' => 'Scenarios|Examples',
- 'feature' => 'Business Need|Feature|Ability',
+ 'feature' => 'Business Need|Ability|Feature',
'given' => 'Given|*',
'name' => 'English',
'native' => 'English',
- 'scenario' => 'Scenario',
+ 'rule' => 'Rule',
+ 'scenario' => 'Scenario|Example',
'scenario_outline' => 'Scenario Template|Scenario Outline',
'then' => 'Then|*',
'when' => 'When|*',
@@ -35,7 +36,8 @@
'given' => 'Gegewe|*',
'name' => 'Afrikaans',
'native' => 'Afrikaans',
- 'scenario' => 'Situasie',
+ 'rule' => 'Regel',
+ 'scenario' => 'Voorbeeld|Situasie',
'scenario_outline' => 'Situasie Uiteensetting',
'then' => 'Dan|*',
'when' => 'Wanneer|*',
@@ -50,10 +52,27 @@
'given' => 'Դիցուք|*',
'name' => 'Armenian',
'native' => 'հայերեն',
- 'scenario' => 'Սցենար',
+ 'rule' => 'Rule',
+ 'scenario' => 'Սցենար|Օրինակ',
'scenario_outline' => 'Սցենարի կառուցվացքը',
'then' => 'Ապա|*',
- 'when' => 'Երբ|Եթե|*',
+ 'when' => 'Եթե|Երբ|*',
+ ),
+ 'an' =>
+ array (
+ 'and' => '*|E|Y',
+ 'background' => 'Antecedents',
+ 'but' => 'Pero|*',
+ 'examples' => 'Eixemplos',
+ 'feature' => 'Caracteristica',
+ 'given' => 'Dadas|Dada|Daus|Dau|*',
+ 'name' => 'Aragonese',
+ 'native' => 'Aragonés',
+ 'rule' => 'Rule',
+ 'scenario' => 'Eixemplo|Caso',
+ 'scenario_outline' => 'Esquema del caso',
+ 'then' => 'Antonces|Alavez|Allora|*',
+ 'when' => 'Cuan|*',
),
'ar' =>
array (
@@ -65,7 +84,8 @@
'given' => 'بفرض|*',
'name' => 'Arabic',
'native' => 'العربية',
- 'scenario' => 'سيناريو',
+ 'rule' => 'Rule',
+ 'scenario' => 'سيناريو|مثال',
'scenario_outline' => 'سيناريو مخطط',
'then' => 'اذاً|ثم|*',
'when' => 'عندما|متى|*',
@@ -77,10 +97,11 @@
'but' => 'Peru|*',
'examples' => 'Exemplos',
'feature' => 'Carauterística',
- 'given' => 'Dada|Daos|Daes|Dáu|*',
+ 'given' => 'Dada|Daes|Daos|Dáu|*',
'name' => 'Asturian',
'native' => 'asturianu',
- 'scenario' => 'Casu',
+ 'rule' => 'Rule',
+ 'scenario' => 'Exemplo|Casu',
'scenario_outline' => 'Esbozu del casu',
'then' => 'Entós|*',
'when' => 'Cuando|*',
@@ -95,7 +116,8 @@
'given' => 'Tutaq ki|Verilir|*',
'name' => 'Azerbaijani',
'native' => 'Azərbaycanca',
- 'scenario' => 'Ssenari',
+ 'rule' => 'Rule',
+ 'scenario' => 'Ssenari|Nümunə',
'scenario_outline' => 'Ssenarinin strukturu',
'then' => 'O halda|*',
'when' => 'Nə vaxt ki|Əgər|*',
@@ -110,7 +132,8 @@
'given' => 'Дадено|*',
'name' => 'Bulgarian',
'native' => 'български',
- 'scenario' => 'Сценарий',
+ 'rule' => 'Rule',
+ 'scenario' => 'Сценарий|Пример',
'scenario_outline' => 'Рамка на сценарий',
'then' => 'То|*',
'when' => 'Когато|*',
@@ -125,14 +148,15 @@
'given' => 'Diberi|Bagi|*',
'name' => 'Malay',
'native' => 'Bahasa Melayu',
- 'scenario' => 'Senario|Situasi|Keadaan',
- 'scenario_outline' => 'Garis Panduan Senario|Kerangka Senario|Kerangka Situasi|Kerangka Keadaan',
+ 'rule' => 'Rule',
+ 'scenario' => 'Keadaan|Senario|Situasi',
+ 'scenario_outline' => 'Garis Panduan Senario|Kerangka Keadaan|Kerangka Senario|Kerangka Situasi',
'then' => 'Kemudian|Maka|*',
'when' => 'Apabila|*',
),
'bs' =>
array (
- 'and' => '*|I|A',
+ 'and' => '*|A|I',
'background' => 'Pozadina',
'but' => 'Ali|*',
'examples' => 'Primjeri',
@@ -140,7 +164,8 @@
'given' => 'Dato|*',
'name' => 'Bosnian',
'native' => 'Bosanski',
- 'scenario' => 'Scenariju|Scenario',
+ 'rule' => 'Rule',
+ 'scenario' => 'Scenariju|Scenario|Primjer',
'scenario_outline' => 'Scenario-outline|Scenariju-obris',
'then' => 'Zatim|*',
'when' => 'Kada|*',
@@ -152,10 +177,11 @@
'but' => 'Però|*',
'examples' => 'Exemples',
'feature' => 'Característica|Funcionalitat',
- 'given' => 'Donada|Donat|Atesa|Atès|*',
+ 'given' => 'Donada|Atesa|Donat|Atès|*',
'name' => 'Catalan',
'native' => 'català',
- 'scenario' => 'Escenari',
+ 'rule' => 'Rule',
+ 'scenario' => 'Escenari|Exemple',
'scenario_outline' => 'Esquema de l\'escenari',
'then' => 'Aleshores|Cal|*',
'when' => 'Quan|*',
@@ -170,7 +196,8 @@
'given' => 'Za předpokladu|Pokud|*',
'name' => 'Czech',
'native' => 'Česky',
- 'scenario' => 'Scénář',
+ 'rule' => 'Pravidlo',
+ 'scenario' => 'Příklad|Scénář',
'scenario_outline' => 'Osnova scénáře|Náčrt Scénáře',
'then' => 'Pak|*',
'when' => 'Když|*',
@@ -185,7 +212,8 @@
'given' => 'Anrhegedig a|*',
'name' => 'Welsh',
'native' => 'Cymraeg',
- 'scenario' => 'Scenario',
+ 'rule' => 'Rule',
+ 'scenario' => 'Enghraifft|Scenario',
'scenario_outline' => 'Scenario Amlinellol',
'then' => 'Yna|*',
'when' => 'Pryd|*',
@@ -200,7 +228,8 @@
'given' => 'Givet|*',
'name' => 'Danish',
'native' => 'dansk',
- 'scenario' => 'Scenarie',
+ 'rule' => 'Rule',
+ 'scenario' => 'Eksempel|Scenarie',
'scenario_outline' => 'Abstrakt Scenario',
'then' => 'Så|*',
'when' => 'Når|*',
@@ -208,15 +237,16 @@
'de' =>
array (
'and' => 'Und|*',
- 'background' => 'Grundlage',
+ 'background' => 'Voraussetzungen|Vorbedingungen|Hintergrund|Grundlage',
'but' => 'Aber|*',
'examples' => 'Beispiele',
- 'feature' => 'Funktionalität',
+ 'feature' => 'Funktionalität|Funktion',
'given' => 'Gegeben seien|Gegeben sei|Angenommen|*',
'name' => 'German',
'native' => 'Deutsch',
- 'scenario' => 'Szenario',
- 'scenario_outline' => 'Szenariogrundriss',
+ 'rule' => 'Regel|Rule',
+ 'scenario' => 'Beispiel|Szenario',
+ 'scenario_outline' => 'Szenariogrundriss|Szenarien',
'then' => 'Dann|*',
'when' => 'Wenn|*',
),
@@ -230,8 +260,9 @@
'given' => 'Δεδομένου|*',
'name' => 'Greek',
'native' => 'Ελληνικά',
- 'scenario' => 'Σενάριο',
- 'scenario_outline' => 'Περιγραφή Σεναρίου',
+ 'rule' => 'Rule',
+ 'scenario' => 'Παράδειγμα|Σενάριο',
+ 'scenario_outline' => 'Περίγραμμα Σεναρίου|Περιγραφή Σεναρίου',
'then' => 'Τότε|*',
'when' => 'Όταν|*',
),
@@ -245,7 +276,8 @@
'given' => '😐<|*',
'name' => 'Emoji',
'native' => '😀',
- 'scenario' => '📕',
+ 'rule' => 'Rule',
+ 'scenario' => '📕|🥒',
'scenario_outline' => '📖',
'then' => '🙏<|*',
'when' => '🎬<|*',
@@ -260,6 +292,7 @@
'given' => 'Youse know when youse got|Givun|*',
'name' => 'Scouse',
'native' => 'Scouse',
+ 'rule' => 'Rule',
'scenario' => 'The thing of it is',
'scenario_outline' => 'Wharrimean is',
'then' => 'Den youse gotta|Dun|*',
@@ -275,6 +308,7 @@
'given' => 'Y\'know|*',
'name' => 'Australian',
'native' => 'Australian',
+ 'rule' => 'Rule',
'scenario' => 'Awww, look mate',
'scenario_outline' => 'Reckon it\'s like',
'then' => 'But at the end of the day I reckon|*',
@@ -290,6 +324,7 @@
'given' => 'I CAN HAZ|*',
'name' => 'LOLCAT',
'native' => 'LOLCAT',
+ 'rule' => 'Rule',
'scenario' => 'MISHUN',
'scenario_outline' => 'MISHUN SRSLY',
'then' => 'DEN|*',
@@ -300,15 +335,16 @@
'and' => 'Ond|*|7',
'background' => 'Aer|Ær',
'but' => 'Ac|*',
- 'examples' => 'Se the|Se þe|Se ðe',
+ 'examples' => 'Se the|Se ðe|Se þe',
'feature' => 'Hwaet|Hwæt',
- 'given' => 'Thurh|Þurh|Ðurh|*',
+ 'given' => 'Thurh|Ðurh|Þurh|*',
'name' => 'Old English',
'native' => 'Englisc',
+ 'rule' => 'Rule',
'scenario' => 'Swa',
'scenario_outline' => 'Swa hwaer swa|Swa hwær swa',
- 'then' => 'Tha the|Þa þe|Ða ðe|Tha|Þa|Ða|*',
- 'when' => 'Tha|Þa|Ða|*',
+ 'then' => 'Tha the|Ða ðe|Þa þe|Tha|Ða|Þa|*',
+ 'when' => 'Tha|Ða|Þa|*',
),
'en-pirate' =>
array (
@@ -320,11 +356,28 @@
'given' => 'Gangway!|*',
'name' => 'Pirate',
'native' => 'Pirate',
+ 'rule' => 'Rule',
'scenario' => 'Heave to',
'scenario_outline' => 'Shiver me timbers',
'then' => 'Let go and haul|*',
'when' => 'Blimey!|*',
),
+ 'en-tx' =>
+ array (
+ 'and' => 'Come hell or high water',
+ 'background' => 'Lemme tell y\'all a story',
+ 'but' => 'Well now hold on, I\'ll you what',
+ 'examples' => 'Now that\'s a story longer than a cattle drive in July',
+ 'feature' => 'This ain’t my first rodeo|All gussied up',
+ 'given' => 'All git out|Fixin\' to',
+ 'name' => 'Texas',
+ 'native' => 'Texas',
+ 'rule' => 'Rule ',
+ 'scenario' => 'All hat and no cattle',
+ 'scenario_outline' => 'Busy as a hound in flea season|Serious as a snake bite',
+ 'then' => 'There’s no tree but bears some fruit',
+ 'when' => 'Quick out of the chute',
+ ),
'eo' =>
array (
'and' => 'Kaj|*',
@@ -335,22 +388,24 @@
'given' => 'Donitaĵo|Komence|*',
'name' => 'Esperanto',
'native' => 'Esperanto',
- 'scenario' => 'Scenaro|Kazo',
+ 'rule' => 'Rule',
+ 'scenario' => 'Ekzemplo|Scenaro|Kazo',
'scenario_outline' => 'Konturo de la scenaro|Kazo-skizo|Skizo',
'then' => 'Do|*',
'when' => 'Se|*',
),
'es' =>
array (
- 'and' => '*|Y|E',
+ 'and' => '*|E|Y',
'background' => 'Antecedentes',
'but' => 'Pero|*',
'examples' => 'Ejemplos',
- 'feature' => 'Característica',
- 'given' => 'Dados|Dadas|Dada|Dado|*',
+ 'feature' => 'Necesidad del negocio|Característica|Requisito',
+ 'given' => 'Dadas|Dados|Dada|Dado|*',
'name' => 'Spanish',
'native' => 'español',
- 'scenario' => 'Escenario',
+ 'rule' => 'Regla de negocio|Regla',
+ 'scenario' => 'Escenario|Ejemplo',
'scenario_outline' => 'Esquema del escenario',
'then' => 'Entonces|*',
'when' => 'Cuando|*',
@@ -365,8 +420,9 @@
'given' => 'Eeldades|*',
'name' => 'Estonian',
'native' => 'eesti keel',
- 'scenario' => 'Stsenaarium',
- 'scenario_outline' => 'Raamstsenaarium',
+ 'rule' => 'Reegel',
+ 'scenario' => 'Stsenaarium|Juhtum',
+ 'scenario_outline' => 'Raamstsenaarium|Raamjuhtum',
'then' => 'Siis|*',
'when' => 'Kui|*',
),
@@ -380,7 +436,8 @@
'given' => 'با فرض|*',
'name' => 'Persian',
'native' => 'فارسی',
- 'scenario' => 'سناریو',
+ 'rule' => 'Rule',
+ 'scenario' => 'سناریو|مثال',
'scenario_outline' => 'الگوی سناریو',
'then' => 'آنگاه|*',
'when' => 'هنگامی|*',
@@ -395,6 +452,7 @@
'given' => 'Oletetaan|*',
'name' => 'Finnish',
'native' => 'suomi',
+ 'rule' => 'Rule',
'scenario' => 'Tapaus',
'scenario_outline' => 'Tapausaihio',
'then' => 'Niin|*',
@@ -407,12 +465,13 @@
'but' => 'Mais qu\'<|Mais que|Mais|*',
'examples' => 'Exemples',
'feature' => 'Fonctionnalité',
- 'given' => 'Etant donné qu\'<|Étant donné qu\'<|Etant donné que|Étant donné que|Etant données|Étant données|Etant donnée|Etant donnés|Étant donnée|Étant donnés|Etant donné|Étant donné|Soit|*',
+ 'given' => 'Etant donné qu\'<|Étant donné qu\'<|Etant donné que|Étant donné que|Etant données|Étant données|Etant donnée|Etant donnés|Sachant qu\'<|Étant donnée|Étant donnés|Etant donné|Sachant que|Étant donné|Sachant|Soit|*',
'name' => 'French',
'native' => 'français',
- 'scenario' => 'Scénario',
- 'scenario_outline' => 'Plan du scénario|Plan du Scénario',
- 'then' => 'Alors|*',
+ 'rule' => 'Règle',
+ 'scenario' => 'Scénario|Exemple',
+ 'scenario_outline' => 'Plan du Scénario|Plan du scénario',
+ 'then' => 'Alors|Donc|*',
'when' => 'Lorsqu\'<|Lorsque|Quand|*',
),
'ga' =>
@@ -425,7 +484,8 @@
'given' => 'Cuir i gcás nach<|Cuir i gcás gur<|Cuir i gcás nár<|Cuir i gcás go<|*',
'name' => 'Irish',
'native' => 'Gaeilge',
- 'scenario' => 'Cás',
+ 'rule' => 'Rule',
+ 'scenario' => 'Sampla|Cás',
'scenario_outline' => 'Cás Achomair',
'then' => 'Ansin<|*',
'when' => 'Nuair nach<|Nuair nár<|Nuair ba<|Nuair a<|*',
@@ -440,7 +500,8 @@
'given' => 'આપેલ છે|*',
'name' => 'Gujarati',
'native' => 'ગુજરાતી',
- 'scenario' => 'સ્થિતિ',
+ 'rule' => 'Rule',
+ 'scenario' => 'ઉદાહરણ|સ્થિતિ',
'scenario_outline' => 'પરિદ્દશ્ય રૂપરેખા|પરિદ્દશ્ય ઢાંચો',
'then' => 'પછી|*',
'when' => 'ક્યારે|*',
@@ -449,13 +510,14 @@
array (
'and' => '*|E',
'background' => 'Contexto',
- 'but' => 'Pero|Mais|*',
+ 'but' => 'Mais|Pero|*',
'examples' => 'Exemplos',
'feature' => 'Característica',
- 'given' => 'Dados|Dadas|Dada|Dado|*',
+ 'given' => 'Dadas|Dados|Dada|Dado|*',
'name' => 'Galician',
'native' => 'galego',
- 'scenario' => 'Escenario',
+ 'rule' => 'Rule',
+ 'scenario' => 'Escenario|Exemplo',
'scenario_outline' => 'Esbozo do escenario',
'then' => 'Entón|Logo|*',
'when' => 'Cando|*',
@@ -470,7 +532,8 @@
'given' => 'בהינתן|*',
'name' => 'Hebrew',
'native' => 'עברית',
- 'scenario' => 'תרחיש',
+ 'rule' => 'כלל',
+ 'scenario' => 'דוגמא|תרחיש',
'scenario_outline' => 'תבנית תרחיש',
'then' => 'אזי|אז|*',
'when' => 'כאשר|*',
@@ -479,12 +542,13 @@
array (
'and' => 'तथा|और|*',
'background' => 'पृष्ठभूमि',
- 'but' => 'परन्तु|किन्तु|पर|*',
+ 'but' => 'किन्तु|परन्तु|पर|*',
'examples' => 'उदाहरण',
'feature' => 'रूप लेख',
- 'given' => 'चूंकि|यदि|अगर|*',
+ 'given' => 'चूंकि|अगर|यदि|*',
'name' => 'Hindi',
'native' => 'हिंदी',
+ 'rule' => 'नियम',
'scenario' => 'परिदृश्य',
'scenario_outline' => 'परिदृश्य रूपरेखा',
'then' => 'तदा|तब|*',
@@ -497,10 +561,11 @@
'but' => 'Ali|*',
'examples' => 'Scenariji|Primjeri',
'feature' => 'Mogucnost|Mogućnost|Osobina',
- 'given' => 'Zadani|Zadano|Zadan|*',
+ 'given' => 'Ukoliko|Zadani|Zadano|Zadan|*',
'name' => 'Croatian',
'native' => 'hrvatski',
- 'scenario' => 'Scenarij',
+ 'rule' => 'Rule',
+ 'scenario' => 'Scenarij|Primjer',
'scenario_outline' => 'Koncept|Skica',
'then' => 'Onda|*',
'when' => 'Kada|Kad|*',
@@ -508,15 +573,16 @@
'ht' =>
array (
'and' => 'Epi|Ak|*|E',
- 'background' => 'Kontèks|Istorik',
+ 'background' => 'Istorik|Kontèks',
'but' => 'Men|*',
'examples' => 'Egzanp',
- 'feature' => 'Karakteristik|Fonksyonalite|Mak',
- 'given' => 'Sipoze ke|Sipoze Ke|Sipoze|*',
+ 'feature' => 'Fonksyonalite|Karakteristik|Mak',
+ 'given' => 'Sipoze Ke|Sipoze ke|Sipoze|*',
'name' => 'Creole',
'native' => 'kreyòl',
+ 'rule' => 'Rule',
'scenario' => 'Senaryo',
- 'scenario_outline' => 'Senaryo deskripsyon|Senaryo Deskripsyon|Dyagram senaryo|Dyagram Senaryo|Plan senaryo|Plan Senaryo',
+ 'scenario_outline' => 'Senaryo Deskripsyon|Senaryo deskripsyon|Dyagram Senaryo|Dyagram senaryo|Plan Senaryo|Plan senaryo',
'then' => 'Le sa a|Lè sa a|*',
'when' => 'Le|Lè|*',
),
@@ -530,7 +596,8 @@
'given' => 'Amennyiben|Adott|*',
'name' => 'Hungarian',
'native' => 'magyar',
- 'scenario' => 'Forgatókönyv',
+ 'rule' => 'Szabály',
+ 'scenario' => 'Forgatókönyv|Példa',
'scenario_outline' => 'Forgatókönyv vázlat',
'then' => 'Akkor|*',
'when' => 'Amikor|Majd|Ha|*',
@@ -538,16 +605,17 @@
'id' =>
array (
'and' => 'Dan|*',
- 'background' => 'Dasar',
- 'but' => 'Tapi|*',
- 'examples' => 'Contoh',
+ 'background' => 'Latar Belakang|Dasar',
+ 'but' => 'Tetapi|Tapi|*',
+ 'examples' => 'Contoh|Misal',
'feature' => 'Fitur',
- 'given' => 'Dengan|*',
+ 'given' => 'Diasumsikan|Diketahui|Dengan|Bila|Jika|*',
'name' => 'Indonesian',
'native' => 'Bahasa Indonesia',
+ 'rule' => 'Aturan|Rule',
'scenario' => 'Skenario',
- 'scenario_outline' => 'Skenario konsep',
- 'then' => 'Maka|*',
+ 'scenario_outline' => 'Garis-Besar Skenario|Skenario konsep',
+ 'then' => 'Kemudian|Maka|*',
'when' => 'Ketika|*',
),
'is' =>
@@ -560,6 +628,7 @@
'given' => 'Ef|*',
'name' => 'Icelandic',
'native' => 'Íslenska',
+ 'rule' => 'Rule',
'scenario' => 'Atburðarás',
'scenario_outline' => 'Lýsing Atburðarásar|Lýsing Dæma',
'then' => 'Þá|*',
@@ -571,11 +640,12 @@
'background' => 'Contesto',
'but' => 'Ma|*',
'examples' => 'Esempi',
- 'feature' => 'Funzionalità',
- 'given' => 'Data|Dato|Dati|Date|*',
+ 'feature' => 'Esigenza di Business|Funzionalità|Abilità',
+ 'given' => 'Data|Date|Dati|Dato|*',
'name' => 'Italian',
'native' => 'italiano',
- 'scenario' => 'Scenario',
+ 'rule' => 'Regola',
+ 'scenario' => 'Scenario|Esempio',
'scenario_outline' => 'Schema dello scenario',
'then' => 'Allora|*',
'when' => 'Quando|*',
@@ -590,6 +660,7 @@
'given' => '前提<|*',
'name' => 'Japanese',
'native' => '日本語',
+ 'rule' => 'Rule',
'scenario' => 'シナリオ',
'scenario_outline' => 'シナリオアウトライン|シナリオテンプレート|シナリオテンプレ|テンプレ',
'then' => 'ならば<|*',
@@ -605,10 +676,27 @@
'given' => 'Nalikaning|Nalika|*',
'name' => 'Javanese',
'native' => 'Basa Jawa',
+ 'rule' => 'Rule',
'scenario' => 'Skenario',
'scenario_outline' => 'Konsep skenario',
'then' => 'Banjur|Njuk|*',
- 'when' => 'Menawa|Manawa|*',
+ 'when' => 'Manawa|Menawa|*',
+ ),
+ 'ka' =>
+ array (
+ 'and' => 'და<|*',
+ 'background' => 'კონტექსტი',
+ 'but' => 'მაგრამ<|*',
+ 'examples' => 'მაგალითები',
+ 'feature' => 'თვისება',
+ 'given' => 'მოცემული<|*',
+ 'name' => 'Georgian',
+ 'native' => 'ქართველი',
+ 'rule' => 'Rule',
+ 'scenario' => 'მაგალითად|სცენარის',
+ 'scenario_outline' => 'სცენარის ნიმუში',
+ 'then' => 'მაშინ<|*',
+ 'when' => 'როდესაც<|*',
),
'kn' =>
array (
@@ -620,7 +708,8 @@
'given' => 'ನೀಡಿದ|*',
'name' => 'Kannada',
'native' => 'ಕನ್ನಡ',
- 'scenario' => 'ಕಥಾಸಾರಾಂಶ',
+ 'rule' => 'Rule',
+ 'scenario' => 'ಕಥಾಸಾರಾಂಶ|ಉದಾಹರಣೆ',
'scenario_outline' => 'ವಿವರಣೆ',
'then' => 'ನಂತರ|*',
'when' => 'ಸ್ಥಿತಿಯನ್ನು|*',
@@ -635,6 +724,7 @@
'given' => '먼저<|조건<|*',
'name' => 'Korean',
'native' => '한국어',
+ 'rule' => 'Rule',
'scenario' => '시나리오',
'scenario_outline' => '시나리오 개요',
'then' => '그러면<|*',
@@ -650,7 +740,8 @@
'given' => 'Duota|*',
'name' => 'Lithuanian',
'native' => 'lietuvių kalba',
- 'scenario' => 'Scenarijus',
+ 'rule' => 'Rule',
+ 'scenario' => 'Scenarijus|Pavyzdys',
'scenario_outline' => 'Scenarijaus šablonas',
'then' => 'Tada|*',
'when' => 'Kai|*',
@@ -665,7 +756,8 @@
'given' => 'ugeholl|*',
'name' => 'Luxemburgish',
'native' => 'Lëtzebuergesch',
- 'scenario' => 'Szenario',
+ 'rule' => 'Rule',
+ 'scenario' => 'Beispill|Szenario',
'scenario_outline' => 'Plang vum Szenario',
'then' => 'dann|*',
'when' => 'wann|*',
@@ -675,16 +767,49 @@
'and' => 'Un|*',
'background' => 'Konteksts|Situācija',
'but' => 'Bet|*',
- 'examples' => 'Piemēri|Paraugs',
+ 'examples' => 'Paraugs|Piemēri',
'feature' => 'Funkcionalitāte|Fīča',
'given' => 'Kad|*',
'name' => 'Latvian',
'native' => 'latviešu',
- 'scenario' => 'Scenārijs',
+ 'rule' => 'Rule',
+ 'scenario' => 'Scenārijs|Piemērs',
'scenario_outline' => 'Scenārijs pēc parauga',
'then' => 'Tad|*',
'when' => 'Ja|*',
),
+ 'mk-Cyrl' =>
+ array (
+ 'and' => '*|И',
+ 'background' => 'Контекст|Содржина',
+ 'but' => 'Но|*',
+ 'examples' => 'Сценарија|Примери',
+ 'feature' => 'Бизнис потреба|Функционалност|Можност',
+ 'given' => 'Дадена|Дадено|*',
+ 'name' => 'Macedonian',
+ 'native' => 'Македонски',
+ 'rule' => 'Rule',
+ 'scenario' => 'На пример|Сценарио|Пример',
+ 'scenario_outline' => 'Преглед на сценарија|Концепт|Скица',
+ 'then' => 'Тогаш|*',
+ 'when' => 'Кога|*',
+ ),
+ 'mk-Latn' =>
+ array (
+ 'and' => '*|I',
+ 'background' => 'Sodrzhina|Kontekst',
+ 'but' => 'No|*',
+ 'examples' => 'Scenaria|Primeri',
+ 'feature' => 'Biznis potreba|Funkcionalnost|Mozhnost',
+ 'given' => 'Dadena|Dadeno|*',
+ 'name' => 'Macedonian (Latin)',
+ 'native' => 'Makedonski (Latinica)',
+ 'rule' => 'Rule',
+ 'scenario' => 'Na primer|Scenario',
+ 'scenario_outline' => 'Pregled na scenarija|Koncept|Skica',
+ 'then' => 'Togash|*',
+ 'when' => 'Koga|*',
+ ),
'mn' =>
array (
'and' => 'Тэгээд|Мөн|*',
@@ -695,11 +820,44 @@
'given' => 'Өгөгдсөн нь|Анх|*',
'name' => 'Mongolian',
'native' => 'монгол',
+ 'rule' => 'Rule',
'scenario' => 'Сценар',
'scenario_outline' => 'Сценарын төлөвлөгөө',
'then' => 'Үүний дараа|Тэгэхэд|*',
'when' => 'Хэрэв|*',
),
+ 'mr' =>
+ array (
+ 'and' => 'तसेच|आणि|*',
+ 'background' => 'पार्श्वभूमी',
+ 'but' => 'परंतु|पण|*',
+ 'examples' => 'उदाहरण',
+ 'feature' => 'वैशिष्ट्य|सुविधा',
+ 'given' => 'दिलेल्या प्रमाणे|जर<|*',
+ 'name' => 'Marathi',
+ 'native' => 'मराठी',
+ 'rule' => 'नियम',
+ 'scenario' => 'परिदृश्य',
+ 'scenario_outline' => 'परिदृश्य रूपरेखा',
+ 'then' => 'तेव्हा|मग|*',
+ 'when' => 'जेव्हा|*',
+ ),
+ 'ne' =>
+ array (
+ 'and' => 'अनी|*|र',
+ 'background' => 'पृष्ठभूमी',
+ 'but' => 'तर|*',
+ 'examples' => 'उदाहरणहरु|उदाहरण',
+ 'feature' => 'विशेषता|सुविधा',
+ 'given' => 'दिइएको|दिएको|यदि|*',
+ 'name' => 'Nepali',
+ 'native' => 'नेपाली',
+ 'rule' => 'नियम',
+ 'scenario' => 'परिदृश्य',
+ 'scenario_outline' => 'परिदृश्य रूपरेखा',
+ 'then' => 'त्यसपछि|अनी|*',
+ 'when' => 'जब|*',
+ ),
'nl' =>
array (
'and' => 'En|*',
@@ -710,10 +868,11 @@
'given' => 'Gegeven|Stel|*',
'name' => 'Dutch',
'native' => 'Nederlands',
- 'scenario' => 'Scenario',
+ 'rule' => 'Rule',
+ 'scenario' => 'Voorbeeld|Scenario',
'scenario_outline' => 'Abstract Scenario',
'then' => 'Dan|*',
- 'when' => 'Als|*',
+ 'when' => 'Wanneer|Als|*',
),
'no' =>
array (
@@ -725,7 +884,8 @@
'given' => 'Gitt|*',
'name' => 'Norwegian',
'native' => 'norsk',
- 'scenario' => 'Scenario',
+ 'rule' => 'Regel',
+ 'scenario' => 'Eksempel|Scenario',
'scenario_outline' => 'Abstrakt Scenario|Scenariomal',
'then' => 'Så|*',
'when' => 'Når|*',
@@ -740,7 +900,8 @@
'given' => 'ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|*',
'name' => 'Panjabi',
'native' => 'ਪੰਜਾਬੀ',
- 'scenario' => 'ਪਟਕਥਾ',
+ 'rule' => 'Rule',
+ 'scenario' => 'ਉਦਾਹਰਨ|ਪਟਕਥਾ',
'scenario_outline' => 'ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ',
'then' => 'ਤਦ|*',
'when' => 'ਜਦੋਂ|*',
@@ -755,7 +916,8 @@
'given' => 'Zakładając, że|Zakładając|Mając|*',
'name' => 'Polish',
'native' => 'polski',
- 'scenario' => 'Scenariusz',
+ 'rule' => 'Reguła|Zasada',
+ 'scenario' => 'Scenariusz|Przykład',
'scenario_outline' => 'Szablon scenariusza',
'then' => 'Wtedy|*',
'when' => 'Jeżeli|Jeśli|Kiedy|Gdy|*',
@@ -765,44 +927,47 @@
'and' => '*|E',
'background' => 'Cenario de Fundo|Cenário de Fundo|Contexto|Fundo',
'but' => 'Mas|*',
- 'examples' => 'Exemplos|Cenários|Cenarios',
- 'feature' => 'Funcionalidade|Característica|Caracteristica',
- 'given' => 'Dados|Dadas|Dada|Dado|*',
+ 'examples' => 'Cenarios|Cenários|Exemplos',
+ 'feature' => 'Caracteristica|Característica|Funcionalidade',
+ 'given' => 'Dadas|Dados|Dada|Dado|*',
'name' => 'Portuguese',
'native' => 'português',
- 'scenario' => 'Cenário|Cenario',
- 'scenario_outline' => 'Delineação do Cenário|Delineacao do Cenario|Esquema do Cenário|Esquema do Cenario',
+ 'rule' => 'Regra',
+ 'scenario' => 'Cenario|Cenário|Exemplo',
+ 'scenario_outline' => 'Delineacao do Cenario|Delineação do Cenário|Esquema do Cenario|Esquema do Cenário',
'then' => 'Entao|Então|*',
'when' => 'Quando|*',
),
'ro' =>
array (
- 'and' => 'Și|Si|Şi|*',
+ 'and' => 'Si|Şi|Și|*',
'background' => 'Context',
'but' => 'Dar|*',
'examples' => 'Exemple',
- 'feature' => 'Functionalitate|Funcționalitate|Funcţionalitate',
- 'given' => 'Date fiind|Dati fiind|Dați fiind|Daţi fiind|Dat fiind|*',
+ 'feature' => 'Functionalitate|Funcţionalitate|Funcționalitate',
+ 'given' => 'Dată fiind<|Date fiind|Dati fiind|Daţi fiind|Dați fiind|Dat fiind|*',
'name' => 'Romanian',
'native' => 'română',
- 'scenario' => 'Scenariu',
+ 'rule' => 'Rule',
+ 'scenario' => 'Scenariu|Exemplu',
'scenario_outline' => 'Structura scenariu|Structură scenariu',
'then' => 'Atunci|*',
- 'when' => 'Când|Cand|*',
+ 'when' => 'Cand|Când|*',
),
'ru' =>
array (
'and' => 'К тому же|Также|*|И',
'background' => 'Предыстория|Контекст',
- 'but' => 'Но|*|А',
+ 'but' => 'Иначе|Но|*|А',
'examples' => 'Примеры',
'feature' => 'Функциональность|Функционал|Свойство|Функция',
'given' => 'Допустим|Пусть|Дано|*',
'name' => 'Russian',
'native' => 'русский',
- 'scenario' => 'Сценарий',
- 'scenario_outline' => 'Структура сценария',
- 'then' => 'Тогда|То|*',
+ 'rule' => 'Правило',
+ 'scenario' => 'Сценарий|Пример',
+ 'scenario_outline' => 'Структура сценария|Шаблон сценария',
+ 'then' => 'Затем|Тогда|То|*',
'when' => 'Когда|Если|*',
),
'sk' =>
@@ -815,8 +980,9 @@
'given' => 'Za predpokladu|Pokiaľ|*',
'name' => 'Slovak',
'native' => 'Slovensky',
- 'scenario' => 'Scenár',
- 'scenario_outline' => 'Osnova Scenára|Náčrt Scenáru|Náčrt Scenára',
+ 'rule' => 'Rule',
+ 'scenario' => 'Príklad|Scenár',
+ 'scenario_outline' => 'Osnova Scenára|Náčrt Scenára|Náčrt Scenáru',
'then' => 'Potom|Tak|*',
'when' => 'Keď|Ak|*',
),
@@ -826,14 +992,15 @@
'background' => 'Kontekst|Osnova|Ozadje',
'but' => 'Vendar|Ampak|Toda',
'examples' => 'Scenariji|Primeri',
- 'feature' => 'Funkcionalnost|Značilnost|Funkcija|Možnosti|Moznosti|Lastnost',
- 'given' => 'Privzeto|Zaradi|Podano|Dano',
+ 'feature' => 'Funkcionalnost|Značilnost|Funkcija|Lastnost|Moznosti|Možnosti',
+ 'given' => 'Privzeto|Podano|Zaradi|Dano',
'name' => 'Slovenian',
'native' => 'Slovenski',
+ 'rule' => 'Rule',
'scenario' => 'Scenarij|Primer',
'scenario_outline' => 'Struktura scenarija|Oris scenarija|Koncept|Osnutek|Skica',
'then' => 'Takrat|Potem|Nato',
- 'when' => 'Kadar|Ko|Ce|Če',
+ 'when' => 'Kadar|Ce|Ko|Če',
),
'sr-Cyrl' =>
array (
@@ -842,10 +1009,11 @@
'but' => 'Али|*',
'examples' => 'Сценарији|Примери',
'feature' => 'Функционалност|Могућност|Особина',
- 'given' => 'За дате|За дато|За дати|*',
+ 'given' => 'За дате|За дати|За дато|*',
'name' => 'Serbian',
'native' => 'Српски',
- 'scenario' => 'Сценарио|Пример',
+ 'rule' => 'Правило',
+ 'scenario' => 'Сценарио|Пример|Пример',
'scenario_outline' => 'Структура сценарија|Концепт|Скица',
'then' => 'Онда|*',
'when' => 'Када|Кад|*',
@@ -856,10 +1024,11 @@
'background' => 'Kontekst|Pozadina|Osnova',
'but' => 'Ali|*',
'examples' => 'Scenariji|Primeri',
- 'feature' => 'Funkcionalnost|Mogućnost|Mogucnost|Osobina',
- 'given' => 'Za date|Za dato|Za dati|*',
+ 'feature' => 'Funkcionalnost|Mogucnost|Mogućnost|Osobina',
+ 'given' => 'Za date|Za dati|Za dato|*',
'name' => 'Serbian (Latin)',
'native' => 'Srpski (Latinica)',
+ 'rule' => 'Pravilo',
'scenario' => 'Scenario|Primer',
'scenario_outline' => 'Struktura scenarija|Koncept|Skica',
'then' => 'Onda|*',
@@ -875,6 +1044,7 @@
'given' => 'Givet|*',
'name' => 'Swedish',
'native' => 'Svenska',
+ 'rule' => 'Regel',
'scenario' => 'Scenario',
'scenario_outline' => 'Abstrakt Scenario|Scenariomall',
'then' => 'Så|*',
@@ -885,16 +1055,33 @@
'and' => 'மற்றும்|மேலும்|*',
'background' => 'பின்னணி',
'but' => 'ஆனால்|*',
- 'examples' => 'எடுத்துக்காட்டுகள்| நிலைமைகளில்|காட்சிகள்',
+ 'examples' => 'எடுத்துக்காட்டுகள்|நிலைமைகளில்|காட்சிகள்',
'feature' => 'வணிக தேவை|அம்சம்|திறன்',
'given' => 'கொடுக்கப்பட்ட|*',
'name' => 'Tamil',
'native' => 'தமிழ்',
- 'scenario' => 'காட்சி',
+ 'rule' => 'Rule',
+ 'scenario' => 'உதாரணமாக|காட்சி',
'scenario_outline' => 'காட்சி வார்ப்புரு|காட்சி சுருக்கம்',
'then' => 'அப்பொழுது|*',
'when' => 'எப்போது|*',
),
+ 'te' =>
+ array (
+ 'and' => 'మరియు|*',
+ 'background' => 'నేపథ్యం',
+ 'but' => 'కాని|*',
+ 'examples' => 'ఉదాహరణలు',
+ 'feature' => 'గుణము',
+ 'given' => 'చెప్పబడినది|*',
+ 'name' => 'Telugu',
+ 'native' => 'తెలుగు',
+ 'rule' => 'Rule',
+ 'scenario' => 'సన్నివేశం|ఉదాహరణ',
+ 'scenario_outline' => 'కథనం',
+ 'then' => 'అప్పుడు|*',
+ 'when' => 'ఈ పరిస్థితిలో|*',
+ ),
'th' =>
array (
'and' => 'และ|*',
@@ -905,26 +1092,12 @@
'given' => 'กำหนดให้|*',
'name' => 'Thai',
'native' => 'ไทย',
+ 'rule' => 'Rule',
'scenario' => 'เหตุการณ์',
'scenario_outline' => 'โครงสร้างของเหตุการณ์|สรุปเหตุการณ์',
'then' => 'ดังนั้น|*',
'when' => 'เมื่อ|*',
),
- 'tl' =>
- array (
- 'and' => 'మరియు|*',
- 'background' => 'నేపథ్యం',
- 'but' => 'కాని|*',
- 'examples' => 'ఉదాహరణలు',
- 'feature' => 'గుణము',
- 'given' => 'చెప్పబడినది|*',
- 'name' => 'Telugu',
- 'native' => 'తెలుగు',
- 'scenario' => 'సన్నివేశం',
- 'scenario_outline' => 'కథనం',
- 'then' => 'అప్పుడు|*',
- 'when' => 'ఈ పరిస్థితిలో|*',
- ),
'tlh' =>
array (
'and' => 'latlh|\'ej|*',
@@ -935,6 +1108,7 @@
'given' => 'DaH ghu\' bejlu\'|ghu\' noblu\'|*',
'name' => 'Klingon',
'native' => 'tlhIngan',
+ 'rule' => 'Rule',
'scenario' => 'lut',
'scenario_outline' => 'lut chovnatlh',
'then' => 'vaj|*',
@@ -950,7 +1124,8 @@
'given' => 'Diyelim ki|*',
'name' => 'Turkish',
'native' => 'Türkçe',
- 'scenario' => 'Senaryo',
+ 'rule' => 'Kural',
+ 'scenario' => 'Senaryo|Örnek',
'scenario_outline' => 'Senaryo taslağı',
'then' => 'O zaman|*',
'when' => 'Eğer ki|*',
@@ -960,11 +1135,12 @@
'and' => 'Һәм|Вә|*',
'background' => 'Кереш',
'but' => 'Ләкин|Әмма|*',
- 'examples' => 'Үрнәкләр|Мисаллар',
+ 'examples' => 'Мисаллар|Үрнәкләр',
'feature' => 'Үзенчәлеклелек|Мөмкинлек',
'given' => 'Әйтик|*',
'name' => 'Tatar',
'native' => 'Татарча',
+ 'rule' => 'Rule',
'scenario' => 'Сценарий',
'scenario_outline' => 'Сценарийның төзелеше',
'then' => 'Нәтиҗәдә|*',
@@ -980,7 +1156,8 @@
'given' => 'Припустимо, що|Припустимо|Нехай|Дано|*',
'name' => 'Ukrainian',
'native' => 'Українська',
- 'scenario' => 'Сценарій',
+ 'rule' => 'Rule',
+ 'scenario' => 'Сценарій|Приклад',
'scenario_outline' => 'Структура сценарію',
'then' => 'Тоді|То|*',
'when' => 'Коли|Якщо|*',
@@ -991,10 +1168,11 @@
'background' => 'پس منظر',
'but' => 'لیکن|*',
'examples' => 'مثالیں',
- 'feature' => 'کاروبار کی ضرورت|صلاحیت|خصوصیت',
+ 'feature' => 'کاروبار کی ضرورت|خصوصیت|صلاحیت',
'given' => 'فرض کیا|بالفرض|اگر|*',
'name' => 'Urdu',
'native' => 'اردو',
+ 'rule' => 'Rule',
'scenario' => 'منظرنامہ',
'scenario_outline' => 'منظر نامے کا خاکہ',
'then' => 'پھر|تب|*',
@@ -1010,6 +1188,7 @@
'given' => 'Агар|*',
'name' => 'Uzbek',
'native' => 'Узбекча',
+ 'rule' => 'Rule',
'scenario' => 'Сценарий',
'scenario_outline' => 'Сценарий структураси',
'then' => 'Унда|*',
@@ -1025,6 +1204,7 @@
'given' => 'Biết|Cho|*',
'name' => 'Vietnamese',
'native' => 'Tiếng Việt',
+ 'rule' => 'Rule',
'scenario' => 'Tình huống|Kịch bản',
'scenario_outline' => 'Khung tình huống|Khung kịch bản',
'then' => 'Thì|*',
@@ -1032,31 +1212,33 @@
),
'zh-CN' =>
array (
- 'and' => '并且<|而且<|同时<|*',
+ 'and' => '同时<|并且<|而且<|*',
'background' => '背景',
'but' => '但是<|*',
'examples' => '例子',
'feature' => '功能',
- 'given' => '假设<|假如<|假定<|*',
+ 'given' => '假如<|假定<|假设<|*',
'name' => 'Chinese simplified',
'native' => '简体中文',
- 'scenario' => '场景|剧本',
- 'scenario_outline' => '场景大纲|剧本大纲',
+ 'rule' => 'Rule',
+ 'scenario' => '剧本|场景',
+ 'scenario_outline' => '剧本大纲|场景大纲',
'then' => '那么<|*',
'when' => '当<|*',
),
'zh-TW' =>
array (
- 'and' => '並且<|而且<|同時<|*',
+ 'and' => '並且<|同時<|而且<|*',
'background' => '背景',
'but' => '但是<|*',
'examples' => '例子',
'feature' => '功能',
- 'given' => '假設<|假如<|假定<|*',
+ 'given' => '假如<|假定<|假設<|*',
'name' => 'Chinese traditional',
'native' => '繁體中文',
- 'scenario' => '場景|劇本',
- 'scenario_outline' => '場景大綱|劇本大綱',
+ 'rule' => 'Rule',
+ 'scenario' => '劇本|場景',
+ 'scenario_outline' => '劇本大綱|場景大綱',
'then' => '那麼<|*',
'when' => '當<|*',
),
diff --git a/tests/integration/vendor/behat/gherkin/package.xml.tpl b/tests/integration/vendor/behat/gherkin/package.xml.tpl
deleted file mode 100644
index 1714236c7..000000000
--- a/tests/integration/vendor/behat/gherkin/package.xml.tpl
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
- gherkin
- pear.behat.org
- Behat\Gherkin is a BDD DSL for PHP
-
- Behat\Gherkin is an open source behavior driven development DSL for php 5.3.
-
-
- Konstantin Kudryashov
- everzet
- ever.zet@gmail.com
- yes
-
- ##CURRENT_DATE##
-
- ##GHERKIN_VERSION##
- 1.0.0
-
-
- ##STABILITY##
- ##STABILITY##
-
- MIT
- -
-
-
-
- ##SOURCE_FILES##
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 5.3.1
-
-
- 1.4.0
-
-
- pcre
-
-
- simplexml
-
-
- xml
-
-
- mbstring
-
-
-
-
-
diff --git a/tests/integration/vendor/behat/gherkin/phpdoc.ini.dist b/tests/integration/vendor/behat/gherkin/phpdoc.ini.dist
deleted file mode 100644
index f983946e2..000000000
--- a/tests/integration/vendor/behat/gherkin/phpdoc.ini.dist
+++ /dev/null
@@ -1,14 +0,0 @@
-files = "*.php"
-ignore = "CVS, .svn, .git, _compiled"
-source_path = "./src"
-doclet = standard
-overview = readme.html
-package_comment_dir = ./
-public = on
-d = "api"
-default_package = "Behat Gherkin"
-windowtitle = "Behat Gherkin"
-doctitle = "Behat Gherkin: PHP 5.3 Gherkin parser"
-header = "Behat Gherkin"
-footer = "Behat Gherkin"
-tree = on
diff --git a/tests/integration/vendor/behat/gherkin/phpunit.xml.dist b/tests/integration/vendor/behat/gherkin/phpunit.xml.dist
deleted file mode 100644
index 24fc8d87a..000000000
--- a/tests/integration/vendor/behat/gherkin/phpunit.xml.dist
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
- ./tests/Behat/Gherkin/
-
-
-
-
-
- ./src/Behat/Gherkin/
-
-
-
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php
index 87d4a472e..d54397830 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/CacheInterface.php
@@ -25,7 +25,7 @@ interface CacheInterface
* @param string $path Feature path
* @param integer $timestamp The last time feature was updated
*
- * @return Boolean
+ * @return bool
*/
public function isFresh($path, $timestamp);
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php
index 17a206ac7..44707c2da 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/FileCache.php
@@ -50,7 +50,7 @@ public function __construct($path)
* @param string $path Feature path
* @param integer $timestamp The last time feature was updated
*
- * @return Boolean
+ * @return bool
*/
public function isFresh($path, $timestamp)
{
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/MemoryCache.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/MemoryCache.php
index e404f3048..12d56ffa2 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/MemoryCache.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Cache/MemoryCache.php
@@ -29,7 +29,7 @@ class MemoryCache implements CacheInterface
* @param string $path Feature path
* @param integer $timestamp The last time feature was updated
*
- * @return Boolean
+ * @return bool
*/
public function isFresh($path, $timestamp)
{
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/ComplexFilterInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/ComplexFilterInterface.php
index 8a0ebd566..82addd029 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/ComplexFilterInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/ComplexFilterInterface.php
@@ -26,7 +26,7 @@ interface ComplexFilterInterface extends FeatureFilterInterface
* @param FeatureNode $feature Feature node instance
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(FeatureNode $feature, ScenarioInterface $scenario);
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FeatureFilterInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FeatureFilterInterface.php
index a7c43eccb..6994b318e 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FeatureFilterInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FeatureFilterInterface.php
@@ -24,7 +24,7 @@ interface FeatureFilterInterface
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature);
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php
index 4a531a0dd..469cb3cff 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/FilterInterface.php
@@ -24,7 +24,7 @@ interface FilterInterface extends FeatureFilterInterface
*
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(ScenarioInterface $scenario);
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php
index 455e9ac35..9cf6b3042 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineFilter.php
@@ -39,7 +39,7 @@ public function __construct($filterLine)
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -51,7 +51,7 @@ public function isFeatureMatch(FeatureNode $feature)
*
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(ScenarioInterface $scenario)
{
@@ -83,24 +83,26 @@ public function filterFeature(FeatureNode $feature)
}
if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
- $table = $scenario->getExampleTable()->getTable();
- $lines = array_keys($table);
-
- if (in_array($this->filterLine, $lines)) {
- $filteredTable = array($lines[0] => $table[$lines[0]]);
-
- if ($lines[0] !== $this->filterLine) {
- $filteredTable[$this->filterLine] = $table[$this->filterLine];
+ foreach ($scenario->getExampleTables() as $exampleTable) {
+ $table = $exampleTable->getTable();
+ $lines = array_keys($table);
+
+ if (in_array($this->filterLine, $lines)) {
+ $filteredTable = array($lines[0] => $table[$lines[0]]);
+
+ if ($lines[0] !== $this->filterLine) {
+ $filteredTable[$this->filterLine] = $table[$this->filterLine];
+ }
+
+ $scenario = new OutlineNode(
+ $scenario->getTitle(),
+ $scenario->getTags(),
+ $scenario->getSteps(),
+ array(new ExampleTableNode($filteredTable, $exampleTable->getKeyword(), $exampleTable->getTags())),
+ $scenario->getKeyword(),
+ $scenario->getLine()
+ );
}
-
- $scenario = new OutlineNode(
- $scenario->getTitle(),
- $scenario->getTags(),
- $scenario->getSteps(),
- new ExampleTableNode($filteredTable, $scenario->getExampleTable()->getKeyword()),
- $scenario->getKeyword(),
- $scenario->getLine()
- );
}
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php
index b8062bed5..e73d12d87 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/LineRangeFilter.php
@@ -46,7 +46,7 @@ public function __construct($filterMinLine, $filterMaxLine)
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -59,7 +59,7 @@ public function isFeatureMatch(FeatureNode $feature)
*
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(ScenarioInterface $scenario)
{
@@ -94,15 +94,24 @@ public function filterFeature(FeatureNode $feature)
}
if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
- $table = $scenario->getExampleTable()->getTable();
- $lines = array_keys($table);
+ // first accumulate examples and then create scenario
+ $exampleTableNodes = array();
- $filteredTable = array($lines[0] => $table[$lines[0]]);
- unset($table[$lines[0]]);
+ foreach ($scenario->getExampleTables() as $exampleTable) {
+ $table = $exampleTable->getTable();
+ $lines = array_keys($table);
- foreach ($table as $line => $row) {
- if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) {
- $filteredTable[$line] = $row;
+ $filteredTable = array($lines[0] => $table[$lines[0]]);
+ unset($table[$lines[0]]);
+
+ foreach ($table as $line => $row) {
+ if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) {
+ $filteredTable[$line] = $row;
+ }
+ }
+
+ if (count($filteredTable) > 1) {
+ $exampleTableNodes[] = new ExampleTableNode($filteredTable, $exampleTable->getKeyword(), $exampleTable->getTags());
}
}
@@ -110,7 +119,7 @@ public function filterFeature(FeatureNode $feature)
$scenario->getTitle(),
$scenario->getTags(),
$scenario->getSteps(),
- new ExampleTableNode($filteredTable, $scenario->getExampleTable()->getKeyword()),
+ $exampleTableNodes,
$scenario->getKeyword(),
$scenario->getLine()
);
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php
index 82ae0e582..80974d1fc 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NameFilter.php
@@ -37,10 +37,14 @@ public function __construct($filterString)
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
+ if (null === $feature->getTitle()) {
+ return false;
+ }
+
if ('/' === $this->filterString[0]) {
return 1 === preg_match($this->filterString, $feature->getTitle());
}
@@ -53,10 +57,14 @@ public function isFeatureMatch(FeatureNode $feature)
*
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(ScenarioInterface $scenario)
{
+ if (null === $scenario->getTitle()) {
+ return false;
+ }
+
if ('/' === $this->filterString[0] && 1 === preg_match($this->filterString, $scenario->getTitle())) {
return true;
} elseif (false !== mb_strpos($scenario->getTitle(), $this->filterString, 0, 'utf8')) {
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NarrativeFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NarrativeFilter.php
index 61126e569..eb5ae48d4 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NarrativeFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/NarrativeFilter.php
@@ -40,11 +40,11 @@ public function __construct($regex)
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
- return 1 === preg_match($this->regex, $feature->getDescription());
+ return 1 === preg_match($this->regex, $feature->getDescription() ?? '');
}
/**
@@ -52,7 +52,7 @@ public function isFeatureMatch(FeatureNode $feature)
*
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(ScenarioInterface $scenario)
{
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/PathsFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/PathsFilter.php
index 5dac3dc9d..f92859774 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/PathsFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/PathsFilter.php
@@ -45,12 +45,12 @@ function ($realpath) {
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
foreach ($this->filterPaths as $path) {
- if (0 === strpos($feature->getFile(), $path)) {
+ if (0 === strpos(realpath($feature->getFile()), $path)) {
return true;
}
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/RoleFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/RoleFilter.php
index 19e9377a9..0ad3a29a5 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/RoleFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/RoleFilter.php
@@ -42,11 +42,11 @@ public function __construct($role)
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
- return 1 === preg_match($this->pattern, $feature->getDescription());
+ return 1 === preg_match($this->pattern, $feature->getDescription() ?? '');
}
/**
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php
index fed6c1afd..579ed4e8d 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Filter/TagFilter.php
@@ -11,6 +11,7 @@
namespace Behat\Gherkin\Filter;
use Behat\Gherkin\Node\FeatureNode;
+use Behat\Gherkin\Node\OutlineNode;
use Behat\Gherkin\Node\ScenarioInterface;
/**
@@ -30,6 +31,64 @@ class TagFilter extends ComplexFilter
public function __construct($filterString)
{
$this->filterString = trim($filterString);
+
+ if(preg_match('/\s/u', $this->filterString)) {
+ trigger_error(
+ "Tags with whitespace are deprecated and may be removed in a future version",
+ E_USER_DEPRECATED
+ );
+ }
+ }
+
+ /**
+ * Filters feature according to the filter.
+ *
+ * @param FeatureNode $feature
+ *
+ * @return FeatureNode
+ */
+ public function filterFeature(FeatureNode $feature)
+ {
+ $scenarios = array();
+ foreach ($feature->getScenarios() as $scenario) {
+ if (!$this->isScenarioMatch($feature, $scenario)) {
+ continue;
+ }
+
+ if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
+
+ $exampleTables = array();
+
+ foreach ($scenario->getExampleTables() as $exampleTable) {
+ if ($this->isTagsMatchCondition(array_merge($feature->getTags(), $scenario->getTags(), $exampleTable->getTags()))) {
+ $exampleTables[] = $exampleTable;
+ }
+ }
+
+ $scenario = new OutlineNode(
+ $scenario->getTitle(),
+ $scenario->getTags(),
+ $scenario->getSteps(),
+ $exampleTables,
+ $scenario->getKeyword(),
+ $scenario->getLine()
+ );
+ }
+
+ $scenarios[] = $scenario;
+ }
+
+ return new FeatureNode(
+ $feature->getTitle(),
+ $feature->getDescription(),
+ $feature->getTags(),
+ $feature->getBackground(),
+ $scenarios,
+ $feature->getKeyword(),
+ $feature->getLanguage(),
+ $feature->getFile(),
+ $feature->getLine()
+ );
}
/**
@@ -37,7 +96,7 @@ public function __construct($filterString)
*
* @param FeatureNode $feature Feature instance
*
- * @return Boolean
+ * @return bool
*/
public function isFeatureMatch(FeatureNode $feature)
{
@@ -47,13 +106,23 @@ public function isFeatureMatch(FeatureNode $feature)
/**
* Checks if scenario or outline matches specified filter.
*
- * @param FeatureNode $feature Feature node instance
+ * @param FeatureNode $feature Feature node instance
* @param ScenarioInterface $scenario Scenario or Outline node instance
*
- * @return Boolean
+ * @return bool
*/
public function isScenarioMatch(FeatureNode $feature, ScenarioInterface $scenario)
{
+ if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
+ foreach ($scenario->getExampleTables() as $example) {
+ if ($this->isTagsMatchCondition(array_merge($feature->getTags(), $scenario->getTags(), $example->getTags()))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
return $this->isTagsMatchCondition(array_merge($feature->getTags(), $scenario->getTags()));
}
@@ -62,7 +131,7 @@ public function isScenarioMatch(FeatureNode $feature, ScenarioInterface $scenari
*
* @param string[] $tags
*
- * @return Boolean
+ * @return bool
*/
protected function isTagsMatchCondition($tags)
{
@@ -82,7 +151,7 @@ protected function isTagsMatchCondition($tags)
}
}
- $satisfies = (false !== $satisfiesComma && $satisfies && $satisfiesComma) || false;
+ $satisfies = $satisfiesComma && $satisfies;
}
return $satisfies;
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php
index e457cd873..c3cc5c0e8 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Gherkin.php
@@ -23,7 +23,7 @@
*/
class Gherkin
{
- const VERSION = '4.4-dev';
+ const VERSION = '4.8.0';
/**
* @var LoaderInterface[]
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php
index 35b9b821a..2aa6b3086 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php
@@ -31,7 +31,7 @@
* 'background' => 'Предыстория',
* 'scenario' => 'Сценарий',
* 'scenario_outline' => 'Структура сценария',
- * 'examples' => 'Значения',
+ * 'examples' => 'Примеры',
* 'given' => 'Допустим',
* 'when' => 'Если',
* 'then' => 'То',
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php
index fcd9769ba..3254a3a34 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/KeywordsDumper.php
@@ -34,7 +34,7 @@ public function __construct(KeywordsInterface $keywords)
/**
* Sets keywords mapper function.
*
- * Callable should accept 2 arguments (array $keywords and Boolean $isShort)
+ * Callable should accept 2 arguments (array $keywords and bool $isShort)
*
* @param callable $mapper Mapper function
*/
@@ -46,8 +46,8 @@ public function setKeywordsDumperFunction($mapper)
/**
* Defaults keywords dumper.
*
- * @param array $keywords Keywords list
- * @param Boolean $isShort Is short version
+ * @param array $keywords Keywords list
+ * @param bool $isShort Is short version
*
* @return string
*/
@@ -63,9 +63,9 @@ public function dumpKeywords(array $keywords, $isShort)
/**
* Dumps keyworded feature into string.
*
- * @param string $language Keywords language
- * @param Boolean $short Dump short version
- * @param bool $excludeAsterisk
+ * @param string $language Keywords language
+ * @param bool $short Dump short version
+ * @param bool $excludeAsterisk
*
* @return string|array String for short version and array of features for extended
*/
@@ -98,7 +98,7 @@ public function dump($language, $short = true, $excludeAsterisk = false)
* Dumps feature example.
*
* @param string $keyword Item keyword
- * @param Boolean $short Dump short version?
+ * @param bool $short Dump short version?
*
* @return string
*/
@@ -153,8 +153,8 @@ protected function dumpFeature($keyword, $short = true, $excludeAsterisk = false
/**
* Dumps background example.
*
- * @param string $keyword Item keyword
- * @param Boolean $short Dump short version?
+ * @param string $keyword Item keyword
+ * @param bool $short Dump short version?
*
* @return string
*/
@@ -187,8 +187,8 @@ protected function dumpBackground($keyword, $short = true, $excludeAsterisk = fa
/**
* Dumps scenario example.
*
- * @param string $keyword Item keyword
- * @param Boolean $short Dump short version?
+ * @param string $keyword Item keyword
+ * @param bool $short Dump short version?
*
* @return string
*/
@@ -245,8 +245,8 @@ protected function dumpScenario($keyword, $short = true, $excludeAsterisk = fals
/**
* Dumps outline example.
*
- * @param string $keyword Item keyword
- * @param Boolean $short Dump short version?
+ * @param string $keyword Item keyword
+ * @param bool $short Dump short version?
*
* @return string
*/
@@ -318,9 +318,9 @@ protected function dumpOutline($keyword, $short = true, $excludeAsterisk = false
/**
* Dumps step example.
*
- * @param string $keywords Item keyword
- * @param string $text Step text
- * @param Boolean $short Dump short version?
+ * @param string $keywords Item keyword
+ * @param string $text Step text
+ * @param bool $short Dump short version?
*
* @return string
*/
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php
index 446d462c9..1f3b3c40d 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Lexer.php
@@ -38,6 +38,7 @@ class Lexer
private $featureStarted = false;
private $allowMultilineArguments = false;
private $allowSteps = false;
+ private $pyStringDelimiter = null;
/**
* Initializes lexer.
@@ -121,7 +122,7 @@ public function deferToken(array $token)
}
/**
- * Predicts for number of tokens.
+ * Predicts the upcoming token without passing over it.
*
* @return array
*/
@@ -134,6 +135,16 @@ public function predictToken()
return $this->stashedToken;
}
+ /**
+ * Skips over the currently-predicted token, if any.
+ *
+ * @return void
+ */
+ public function skipPredictedToken()
+ {
+ $this->stashedToken = null;
+ }
+
/**
* Constructs token with specified parameters.
*
@@ -169,6 +180,15 @@ protected function consumeLine()
$this->trimmedLine = null;
}
+ /**
+ * Consumes first part of line from input without incrementing the line number
+ */
+ protected function consumeLineUntil(int $trimmedOffset)
+ {
+ $this->line = mb_substr(ltrim($this->line), $trimmedOffset, null, 'utf-8');
+ $this->trimmedLine = null;
+ }
+
/**
* Returns trimmed version of line.
*
@@ -399,7 +419,7 @@ protected function scanStep()
}
$keywords = $this->getKeywords('Step');
- if (!preg_match('/^\s*(' . $keywords . ')([^\s].+)/u', $this->line, $matches)) {
+ if (!preg_match('/^\s*(' . $keywords . ')([^\s].*)/u', $this->line, $matches)) {
return null;
}
@@ -425,13 +445,25 @@ protected function scanPyStringOp()
return null;
}
- if (false === ($pos = mb_strpos($this->line, '"""', 0, 'utf8'))) {
+ if(!preg_match('/^\s*(?"""|```)/u', $this->line, $matches, PREG_OFFSET_CAPTURE)) {
return null;
}
+ ['delimiter' => [0 => $delimiter, 1 => $indent]] = $matches;
+
+ if ($this->inPyString) {
+ if ($this->pyStringDelimiter !== $delimiter) {
+ return null;
+ }
+ $this->pyStringDelimiter = null;
+ }
+ else {
+ $this->pyStringDelimiter= $delimiter;
+ }
+
$this->inPyString = !$this->inPyString;
$token = $this->takeToken('PyStringOp');
- $this->pyStringSwallow = $pos;
+ $this->pyStringSwallow = $indent;
$this->consumeLine();
@@ -451,7 +483,7 @@ protected function scanPyStringContent()
$token = $this->scanText();
// swallow trailing spaces
- $token['value'] = preg_replace('/^\s{0,' . $this->pyStringSwallow . '}/u', '', $token['value']);
+ $token['value'] = preg_replace('/^\s{0,' . $this->pyStringSwallow . '}/u', '', $token['value'] ?? '');
return $token;
}
@@ -492,16 +524,23 @@ protected function scanTableRow()
protected function scanTags()
{
$line = $this->getTrimmedLine();
+
if (!isset($line[0]) || '@' !== $line[0]) {
return null;
}
+ if(preg_match('/^(?.*)\s+#.*$/', $line, $matches)) {
+ ['line' => $line] = $matches;
+ $this->consumeLineUntil(mb_strlen($line, 'utf-8'));
+ } else {
+ $this->consumeLine();
+ }
+
$token = $this->takeToken('Tag');
$tags = explode('@', mb_substr($line, 1, mb_strlen($line, 'utf8') - 1, 'utf8'));
$tags = array_map('trim', $tags);
$token['tags'] = $tags;
- $this->consumeLine();
return $token;
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php
index 3492d6e6a..145bed9d6 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/ArrayLoader.php
@@ -31,7 +31,7 @@ class ArrayLoader implements LoaderInterface
*
* @param mixed $resource Resource to load
*
- * @return Boolean
+ * @return bool
*/
public function supports($resource)
{
@@ -179,7 +179,15 @@ protected function loadOutlineHash(array $hash, $line = 0)
$examplesKeyword = 'Examples';
}
- $examples = new ExampleTableNode($hash['examples'], $examplesKeyword);
+ $exHash = $hash['examples'];
+ $examples = array();
+
+ if ($this->examplesAreInArray($exHash)) {
+ $examples = $this->processExamplesArray($exHash, $examplesKeyword, $examples);
+ } else {
+ // examples as a single table - we create an array with the only one element
+ $examples[] = new ExampleTableNode($exHash, $examplesKeyword);;
+ }
return new OutlineNode($hash['title'], $hash['tags'], $steps, $examples, $hash['keyword'], $hash['line']);
}
@@ -266,4 +274,39 @@ protected function loadPyStringHash(array $hash, $line = 0)
return new PyStringNode($strings, $line);
}
+
+ /**
+ * Checks if examples node is an array
+ * @param $exHash object hash
+ * @return bool
+ */
+ private function examplesAreInArray($exHash)
+ {
+ return isset($exHash[0]);
+ }
+
+ /**
+ * Processes cases when examples are in the form of array of arrays
+ * OR in the form of array of objects
+ *
+ * @param $exHash array hash
+ * @param $examplesKeyword string
+ * @param $examples array
+ * @return array
+ */
+ private function processExamplesArray($exHash, $examplesKeyword, $examples)
+ {
+ for ($i = 0; $i < count($exHash); $i++) {
+ if (isset($exHash[$i]['table'])) {
+ // we have examples as objects, hence there could be tags
+ $exHashTags = isset($exHash[$i]['tags']) ? $exHash[$i]['tags'] : array();
+ $examples[] = new ExampleTableNode($exHash[$i]['table'], $examplesKeyword, $exHashTags);
+ } else {
+ // we have examples as arrays
+ $examples[] = new ExampleTableNode($exHash[$i], $examplesKeyword);
+ }
+ }
+
+ return $examples;
+ }
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/CucumberNDJsonAstLoader.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/CucumberNDJsonAstLoader.php
new file mode 100644
index 000000000..9fe763bcf
--- /dev/null
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/CucumberNDJsonAstLoader.php
@@ -0,0 +1,193 @@
+findRelativePath($path);
$content = file_get_contents($path);
- $feature = $this->parser->parse($content, $filename);
+ $feature = $this->parser->parse($content, $path);
return $feature;
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php
index 861332ccc..322ce6c96 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/LoaderInterface.php
@@ -24,7 +24,7 @@ interface LoaderInterface
*
* @param mixed $resource Resource to load
*
- * @return Boolean
+ * @return bool
*/
public function supports($resource);
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php
index 0c268fd3a..88193aa35 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Loader/YamlFileLoader.php
@@ -32,7 +32,7 @@ public function __construct()
*
* @param mixed $path Resource to load
*
- * @return Boolean
+ * @return bool
*/
public function supports($path)
{
@@ -54,9 +54,8 @@ public function load($path)
$hash = Yaml::parse(file_get_contents($path));
$features = $this->loader->load($hash);
- $filename = $this->findRelativePath($path);
- return array_map(function (FeatureNode $feature) use ($filename) {
+ return array_map(function (FeatureNode $feature) use ($path) {
return new FeatureNode(
$feature->getTitle(),
$feature->getDescription(),
@@ -65,7 +64,7 @@ public function load($path)
$feature->getScenarios(),
$feature->getKeyword(),
$feature->getLanguage(),
- $filename,
+ $path,
$feature->getLine()
);
}, $features);
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php
index fb1edb4b2..61044866c 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/BackgroundNode.php
@@ -73,7 +73,7 @@ public function getTitle()
/**
* Checks if background has steps.
*
- * @return Boolean
+ * @return bool
*/
public function hasSteps()
{
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleNode.php
index b4beaba48..59d9705de 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleNode.php
@@ -41,23 +41,29 @@ class ExampleNode implements ScenarioInterface
* @var null|StepNode[]
*/
private $steps;
+ /**
+ * @var string
+ */
+ private $outlineTitle;
/**
* Initializes outline.
*
- * @param string $title
- * @param string[] $tags
- * @param StepNode[] $outlineSteps
- * @param string[] $tokens
- * @param integer $line
+ * @param string $title
+ * @param string[] $tags
+ * @param StepNode[] $outlineSteps
+ * @param string[] $tokens
+ * @param integer $line
+ * @param string|null $outlineTitle
*/
- public function __construct($title, array $tags, $outlineSteps, array $tokens, $line)
+ public function __construct($title, array $tags, $outlineSteps, array $tokens, $line, $outlineTitle = null)
{
$this->title = $title;
$this->tags = $tags;
$this->outlineSteps = $outlineSteps;
$this->tokens = $tokens;
$this->line = $line;
+ $this->outlineTitle = $outlineTitle;
}
/**
@@ -95,7 +101,7 @@ public function getTitle()
*
* @param string $tag
*
- * @return Boolean
+ * @return bool
*/
public function hasTag($tag)
{
@@ -105,7 +111,7 @@ public function hasTag($tag)
/**
* Checks if outline has tags (both inherited from feature and own).
*
- * @return Boolean
+ * @return bool
*/
public function hasTags()
{
@@ -125,7 +131,7 @@ public function getTags()
/**
* Checks if outline has steps.
*
- * @return Boolean
+ * @return bool
*/
public function hasSteps()
{
@@ -162,6 +168,16 @@ public function getLine()
return $this->line;
}
+ /**
+ * Returns outline title.
+ *
+ * @return string
+ */
+ public function getOutlineTitle()
+ {
+ return $this->outlineTitle;
+ }
+
/**
* Creates steps for this example from abstract outline steps.
*
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php
index 805e659ef..917535117 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ExampleTableNode.php
@@ -17,6 +17,11 @@
*/
class ExampleTableNode extends TableNode
{
+ /**
+ * @var string[]
+ */
+ private $tags;
+
/**
* @var string
*/
@@ -25,12 +30,14 @@ class ExampleTableNode extends TableNode
/**
* Initializes example table.
*
- * @param array $table Table in form of [$rowLineNumber => [$val1, $val2, $val3]]
+ * @param array $table Table in form of [$rowLineNumber => [$val1, $val2, $val3]]
* @param string $keyword
+ * @param string[] $tags
*/
- public function __construct(array $table, $keyword)
+ public function __construct(array $table, $keyword, array $tags = array())
{
$this->keyword = $keyword;
+ $this->tags = $tags;
parent::__construct($table);
}
@@ -45,6 +52,15 @@ public function getNodeType()
return 'ExampleTable';
}
+ /**
+ * Returns attached tags
+ * @return \string[]
+ */
+ public function getTags()
+ {
+ return $this->tags;
+ }
+
/**
* Returns example table keyword.
*
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php
index 641365996..d53b97c67 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/FeatureNode.php
@@ -64,7 +64,7 @@ class FeatureNode implements KeywordNodeInterface, TaggedNodeInterface
* @param ScenarioInterface[] $scenarios
* @param string $keyword
* @param string $language
- * @param null|string $file
+ * @param null|string $file The absolute path to the feature file.
* @param integer $line
*/
public function __construct(
@@ -78,6 +78,10 @@ public function __construct(
$file,
$line
) {
+ // Verify that the feature file is an absolute path.
+ if (!empty($file) && !$this->isAbsolutePath($file)) {
+ throw new \InvalidArgumentException('The file should be an absolute path.');
+ }
$this->title = $title;
$this->description = $description;
$this->tags = $tags;
@@ -112,7 +116,7 @@ public function getTitle()
/**
* Checks if feature has a description.
*
- * @return Boolean
+ * @return bool
*/
public function hasDescription()
{
@@ -134,7 +138,7 @@ public function getDescription()
*
* @param string $tag
*
- * @return Boolean
+ * @return bool
*/
public function hasTag($tag)
{
@@ -144,7 +148,7 @@ public function hasTag($tag)
/**
* Checks if feature has tags.
*
- * @return Boolean
+ * @return bool
*/
public function hasTags()
{
@@ -164,7 +168,7 @@ public function getTags()
/**
* Checks if feature has background.
*
- * @return Boolean
+ * @return bool
*/
public function hasBackground()
{
@@ -184,7 +188,7 @@ public function getBackground()
/**
* Checks if feature has scenarios.
*
- * @return Boolean
+ * @return bool
*/
public function hasScenarios()
{
@@ -222,7 +226,7 @@ public function getLanguage()
}
/**
- * Returns feature file.
+ * Returns feature file as an absolute path.
*
* @return null|string
*/
@@ -240,4 +244,28 @@ public function getLine()
{
return $this->line;
}
+
+ /**
+ * Returns whether the file path is an absolute path.
+ *
+ * @param string $file A file path
+ *
+ * @return bool
+ *
+ * @see https://github.com/symfony/filesystem/blob/master/Filesystem.php
+ */
+ protected function isAbsolutePath($file)
+ {
+ if (null === $file) {
+ @trigger_error(sprintf('Calling "%s()" with a null in the $file argument is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED);
+ }
+
+ return strspn($file, '/\\', 0, 1)
+ || (\strlen($file) > 3 && ctype_alpha($file[0])
+ && ':' === $file[1]
+ && strspn($file, '/\\', 2, 1)
+ )
+ || null !== parse_url($file, PHP_URL_SCHEME)
+ ;
+ }
}
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php
index 083b411fc..8e68b25ae 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/OutlineNode.php
@@ -30,9 +30,9 @@ class OutlineNode implements ScenarioInterface
*/
private $steps;
/**
- * @var ExampleTableNode
+ * @var ExampleTableNode|ExampleTableNode[]
*/
- private $table;
+ private $tables;
/**
* @var string
*/
@@ -52,7 +52,7 @@ class OutlineNode implements ScenarioInterface
* @param null|string $title
* @param string[] $tags
* @param StepNode[] $steps
- * @param ExampleTableNode $table
+ * @param ExampleTableNode|ExampleTableNode[] $tables
* @param string $keyword
* @param integer $line
*/
@@ -60,16 +60,20 @@ public function __construct(
$title,
array $tags,
array $steps,
- ExampleTableNode $table,
+ $tables,
$keyword,
$line
) {
$this->title = $title;
$this->tags = $tags;
$this->steps = $steps;
- $this->table = $table;
$this->keyword = $keyword;
$this->line = $line;
+ if (!is_array($tables)) {
+ $this->tables = array($tables);
+ } else {
+ $this->tables = $tables;
+ }
}
/**
@@ -97,7 +101,7 @@ public function getTitle()
*
* @param string $tag
*
- * @return Boolean
+ * @return bool
*/
public function hasTag($tag)
{
@@ -107,7 +111,7 @@ public function hasTag($tag)
/**
* Checks if outline has tags (both inherited from feature and own).
*
- * @return Boolean
+ * @return bool
*/
public function hasTags()
{
@@ -127,7 +131,7 @@ public function getTags()
/**
* Checks if outline has steps.
*
- * @return Boolean
+ * @return bool
*/
public function hasSteps()
{
@@ -147,31 +151,52 @@ public function getSteps()
/**
* Checks if outline has examples.
*
- * @return Boolean
+ * @return bool
*/
public function hasExamples()
{
- return 0 < count($this->table->getColumnsHash());
+ return 0 < count($this->tables);
}
/**
- * Returns examples table.
+ * Builds and returns examples table for the outline.
+ *
+ * WARNING: it returns a merged table with tags lost.
*
+ * @deprecated use getExampleTables instead
* @return ExampleTableNode
*/
public function getExampleTable()
{
- return $this->table;
+ $table = array();
+ foreach ($this->tables[0]->getTable() as $k => $v) {
+ $table[$k] = $v;
+ }
+
+ /** @var ExampleTableNode $exampleTableNode */
+ $exampleTableNode = new ExampleTableNode($table, $this->tables[0]->getKeyword());
+ for ($i = 1; $i < count($this->tables); $i++) {
+ $exampleTableNode->mergeRowsFromTable($this->tables[$i]);
+ }
+ return $exampleTableNode;
}
/**
* Returns list of examples for the outline.
- *
* @return ExampleNode[]
*/
public function getExamples()
{
- return $this->examples = $this->examples ? : $this->createExamples();
+ return $this->examples = $this->examples ?: $this->createExamples();
+ }
+
+ /**
+ * Returns examples tables array for the outline.
+ * @return ExampleTableNode[]
+ */
+ public function getExampleTables()
+ {
+ return $this->tables;
}
/**
@@ -202,14 +227,18 @@ public function getLine()
protected function createExamples()
{
$examples = array();
- foreach ($this->table->getColumnsHash() as $rowNum => $row) {
- $examples[] = new ExampleNode(
- $this->table->getRowAsString($rowNum + 1),
- $this->tags,
- $this->getSteps(),
- $row,
- $this->table->getRowLine($rowNum + 1)
- );
+
+ foreach ($this->getExampleTables() as $exampleTable) {
+ foreach ($exampleTable->getColumnsHash() as $rowNum => $row) {
+ $examples[] = new ExampleNode(
+ $exampleTable->getRowAsString($rowNum + 1),
+ array_merge($this->tags, $exampleTable->getTags()),
+ $this->getSteps(),
+ $row,
+ $exampleTable->getRowLine($rowNum + 1),
+ $this->getTitle()
+ );
+ }
}
return $examples;
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php
index 58267e1e2..277ab9689 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/ScenarioNode.php
@@ -81,7 +81,7 @@ public function getTitle()
*
* @param string $tag
*
- * @return Boolean
+ * @return bool
*/
public function hasTag($tag)
{
@@ -91,7 +91,7 @@ public function hasTag($tag)
/**
* Checks if scenario has tags (both inherited from feature and own).
*
- * @return Boolean
+ * @return bool
*/
public function hasTags()
{
@@ -111,7 +111,7 @@ public function getTags()
/**
* Checks if scenario has steps.
*
- * @return Boolean
+ * @return bool
*/
public function hasSteps()
{
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepContainerInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepContainerInterface.php
index 2a5c73d9e..ebec3c4be 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepContainerInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepContainerInterface.php
@@ -20,7 +20,7 @@ interface StepContainerInterface extends NodeInterface
/**
* Checks if container has steps.
*
- * @return Boolean
+ * @return bool
*/
public function hasSteps();
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php
index 82eaef490..77113bba5 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/StepNode.php
@@ -123,7 +123,7 @@ public function getText()
/**
* Checks if step has arguments.
*
- * @return Boolean
+ * @return bool
*/
public function hasArguments()
{
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php
index 9e5d17407..4099f640a 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TableNode.php
@@ -14,6 +14,7 @@
use Behat\Gherkin\Exception\NodeException;
use Iterator;
use IteratorAggregate;
+use ReturnTypeWillChange;
/**
* Represents Gherkin Table argument.
@@ -35,21 +36,35 @@ class TableNode implements ArgumentInterface, IteratorAggregate
* Initializes table.
*
* @param array $table Table in form of [$rowLineNumber => [$val1, $val2, $val3]]
- *
- * @throws NodeException If the number of columns is not the same in each row
+ *
+ * @throws NodeException If the given table is invalid
*/
public function __construct(array $table)
{
$this->table = $table;
$columnCount = null;
- foreach ($this->getRows() as $row) {
+ foreach ($this->getRows() as $ridx => $row) {
+
+ if (!is_array($row)) {
+ throw new NodeException(sprintf(
+ "Table row '%s' is expected to be array, got %s",
+ $ridx,
+ gettype($row)
+ ));
+ }
+
if ($columnCount === null) {
$columnCount = count($row);
}
if (count($row) !== $columnCount) {
- throw new NodeException('Table does not have same number of columns in every row.');
+ throw new NodeException(sprintf(
+ "Table row '%s' is expected to have %s columns, got %s",
+ $ridx,
+ $columnCount,
+ count($row)
+ ));
}
foreach ($row as $column => $string) {
@@ -57,11 +72,41 @@ public function __construct(array $table)
$this->maxLineLength[$column] = 0;
}
+ if (!is_scalar($string)) {
+ throw new NodeException(sprintf(
+ "Table cell at row '%s', col '%s' is expected to be scalar, got %s",
+ $ridx,
+ $column,
+ gettype($string)
+ ));
+ }
+
$this->maxLineLength[$column] = max($this->maxLineLength[$column], mb_strlen($string, 'utf8'));
}
}
}
+ /**
+ * Creates a table from a given list.
+ *
+ * @param array $list One-dimensional array
+ *
+ * @return TableNode
+ *
+ * @throws NodeException If the given list is not a one-dimensional array
+ */
+ public static function fromList(array $list)
+ {
+ if (count($list) !== count($list, COUNT_RECURSIVE)) {
+ throw new NodeException('List is not a one-dimensional array.');
+ }
+
+ array_walk($list, function (&$item) {
+ $item = array($item);
+ });
+ return new self($list);
+ }
+
/**
* Returns node type.
*
@@ -289,11 +334,36 @@ public function __toString()
*
* @return Iterator
*/
+ #[ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->getHash());
}
+ /**
+ * Obtains and adds rows from another table to the current table.
+ * The second table should have the same structure as the current one.
+ * @param TableNode $node
+ *
+ * @deprecated remove together with OutlineNode::getExampleTable
+ */
+ public function mergeRowsFromTable(TableNode $node)
+ {
+ // check structure
+ if ($this->getRow(0) !== $node->getRow(0)) {
+ throw new NodeException("Tables have different structure. Cannot merge one into another");
+ }
+
+ $firstLine = $node->getLine();
+ foreach ($node->getTable() as $line => $value) {
+ if ($line === $firstLine) {
+ continue;
+ }
+
+ $this->table[$line] = $value;
+ }
+ }
+
/**
* Pads string right.
*
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TaggedNodeInterface.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TaggedNodeInterface.php
index cce6bcafd..4afa6d1d8 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TaggedNodeInterface.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Node/TaggedNodeInterface.php
@@ -22,14 +22,14 @@ interface TaggedNodeInterface extends NodeInterface
*
* @param string $tag
*
- * @return Boolean
+ * @return bool
*/
public function hasTag($tag);
/**
* Checks if node has tags (both inherited from feature and own).
*
- * @return Boolean
+ * @return bool
*/
public function hasTags();
diff --git a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php
index 5cc85424b..cdfe44505 100644
--- a/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php
+++ b/tests/integration/vendor/behat/gherkin/src/Behat/Gherkin/Parser.php
@@ -11,6 +11,7 @@
namespace Behat\Gherkin;
use Behat\Gherkin\Exception\LexerException;
+use Behat\Gherkin\Exception\NodeException;
use Behat\Gherkin\Exception\ParserException;
use Behat\Gherkin\Node\BackgroundNode;
use Behat\Gherkin\Node\ExampleTableNode;
@@ -39,6 +40,8 @@ class Parser
private $tags = array();
private $languageSpecifierLine;
+ private $passedNodesStack = array();
+
/**
* Initializes parser.
*
@@ -181,7 +184,15 @@ protected function predictTokenType()
*/
protected function parseExpression()
{
- switch ($type = $this->predictTokenType()) {
+ $type = $this->predictTokenType();
+
+ while ($type === 'Comment') {
+ $this->expectTokenType('Comment');
+
+ $type = $this->predictTokenType();
+ }
+
+ switch ($type) {
case 'Feature':
return $this->parseFeature();
case 'Background':
@@ -204,8 +215,6 @@ protected function parseExpression()
return $this->parseNewline();
case 'Tag':
return $this->parseTags();
- case 'Comment':
- return $this->parseComment();
case 'Language':
return $this->parseLanguage();
case 'EOS':
@@ -226,7 +235,7 @@ protected function parseFeature()
{
$token = $this->expectTokenType('Feature');
- $title = trim($token['value']) ?: null;
+ $title = trim($token['value'] ?? '');
$description = null;
$tags = $this->popTags();
$background = null;
@@ -236,6 +245,8 @@ protected function parseFeature()
$file = $this->file;
$line = $token['line'];
+ array_push($this->passedNodesStack, 'Feature');
+
// Parse description, background, scenarios & outlines
while ('EOS' !== $this->predictTokenType()) {
$node = $this->parseExpression();
@@ -277,7 +288,7 @@ protected function parseFeature()
return new FeatureNode(
rtrim($title) ?: null,
- rtrim($description) ?: null,
+ rtrim($description ?? '') ?: null,
$tags,
$background,
$scenarios,
@@ -299,7 +310,7 @@ protected function parseBackground()
{
$token = $this->expectTokenType('Background');
- $title = trim($token['value']);
+ $title = trim($token['value'] ?? '');
$keyword = $token['keyword'];
$line = $token['line'];
@@ -364,11 +375,13 @@ protected function parseScenario()
{
$token = $this->expectTokenType('Scenario');
- $title = trim($token['value']);
+ $title = trim($token['value'] ?? '');
$tags = $this->popTags();
$keyword = $token['keyword'];
$line = $token['line'];
+ array_push($this->passedNodesStack, 'Scenario');
+
// Parse description and steps
$steps = array();
while (in_array($this->predictTokenType(), array('Step', 'Newline', 'Text', 'Comment'))) {
@@ -407,6 +420,8 @@ protected function parseScenario()
}
}
+ array_pop($this->passedNodesStack);
+
return new ScenarioNode(rtrim($title) ?: null, $tags, $steps, $keyword, $line);
}
@@ -421,15 +436,25 @@ protected function parseOutline()
{
$token = $this->expectTokenType('Outline');
- $title = trim($token['value']);
+ $title = trim($token['value'] ?? '');
$tags = $this->popTags();
$keyword = $token['keyword'];
- $examples = null;
+
+ /** @var ExampleTableNode $examples */
+ $examples = array();
$line = $token['line'];
// Parse description, steps and examples
$steps = array();
- while (in_array($this->predictTokenType(), array('Step', 'Examples', 'Newline', 'Text', 'Comment'))) {
+
+ array_push($this->passedNodesStack, 'Outline');
+
+ while (in_array($nextTokenType = $this->predictTokenType(), array('Step', 'Examples', 'Newline', 'Text', 'Comment', 'Tag'))) {
+ if ($nextTokenType === 'Comment') {
+ $this->lexer->skipPredictedToken();
+ continue;
+ }
+
$node = $this->parseExpression();
if ($node instanceof StepNode) {
@@ -438,7 +463,8 @@ protected function parseOutline()
}
if ($node instanceof ExampleTableNode) {
- $examples = $node;
+ $examples[] = $node;
+
continue;
}
@@ -470,7 +496,7 @@ protected function parseOutline()
}
}
- if (null === $examples) {
+ if (empty($examples)) {
throw new ParserException(sprintf(
'Outline should have examples table, but got none for outline "%s" on line: %d%s',
rtrim($title),
@@ -496,6 +522,8 @@ protected function parseStep()
$text = trim($token['text']);
$line = $token['line'];
+ array_push($this->passedNodesStack, 'Step');
+
$arguments = array();
while (in_array($predicted = $this->predictTokenType(), array('PyStringOp', 'TableRow', 'Newline', 'Comment'))) {
if ('Comment' === $predicted || 'Newline' === $predicted) {
@@ -510,6 +538,8 @@ protected function parseStep()
}
}
+ array_pop($this->passedNodesStack);
+
return new StepNode($keyword, $text, $arguments, $line, $keywordType);
}
@@ -520,11 +550,15 @@ protected function parseStep()
*/
protected function parseExamples()
{
- $token = $this->expectTokenType('Examples');
+ $keyword = ($this->expectTokenType('Examples'))['keyword'];
+ $tags = empty($this->tags) ? array() : $this->popTags();
+ $table = $this->parseTableRows();
- $keyword = $token['keyword'];
-
- return new ExampleTableNode($this->parseTableRows(), $keyword);
+ try {
+ return new ExampleTableNode($table, $keyword, $tags);
+ } catch(NodeException $e) {
+ $this->rethrowNodeException($e);
+ }
}
/**
@@ -534,7 +568,13 @@ protected function parseExamples()
*/
protected function parseTable()
{
- return new TableNode($this->parseTableRows());
+ $table = $this->parseTableRows();
+
+ try {
+ return new TableNode($table);
+ } catch(NodeException $e) {
+ $this->rethrowNodeException($e);
+ }
}
/**
@@ -568,9 +608,30 @@ protected function parsePyString()
protected function parseTags()
{
$token = $this->expectTokenType('Tag');
+
+ $this->guardTags($token['tags']);
+
$this->tags = array_merge($this->tags, $token['tags']);
- return $this->parseExpression();
+ $possibleTransitions = array(
+ 'Outline' => array(
+ 'Examples',
+ 'Step'
+ )
+ );
+
+ $currentType = '-1';
+ // check if that is ok to go inside:
+ if (!empty($this->passedNodesStack)) {
+ $currentType = $this->passedNodesStack[count($this->passedNodesStack) - 1];
+ }
+
+ $nextType = $this->predictTokenType();
+ if (!isset($possibleTransitions[$currentType]) || in_array($nextType, $possibleTransitions[$currentType])) {
+ return $this->parseExpression();
+ }
+
+ return "\n";
}
/**
@@ -586,6 +647,20 @@ protected function popTags()
return $tags;
}
+ /**
+ * Checks the tags fit the required format
+ *
+ * @param string[] $tags
+ */
+ protected function guardTags(array $tags)
+ {
+ foreach ($tags as $tag) {
+ if (preg_match('/\s/', $tag)) {
+ trigger_error('Whitespace in tags is deprecated, found "$tag"', E_USER_DEPRECATED);
+ }
+ }
+ }
+
/**
* Parses next text line & returns it.
*
@@ -610,18 +685,6 @@ protected function parseNewline()
return "\n";
}
- /**
- * Parses next comment token & returns it's string content.
- *
- * @return BackgroundNode|FeatureNode|OutlineNode|ScenarioNode|StepNode|TableNode|string
- */
- protected function parseComment()
- {
- $this->expectTokenType('Comment');
-
- return $this->parseExpression();
- }
-
/**
* Parses language block and updates lexer configuration based on it.
*
@@ -696,4 +759,13 @@ private function normalizeStepNodeKeywordType(StepNode $node, array $steps = arr
}
return $node;
}
+
+ private function rethrowNodeException(NodeException $e): void
+ {
+ throw new ParserException(
+ $e->getMessage() . ($this->file ? ' in file ' . $this->file : ''),
+ 0,
+ $e
+ );
+ }
}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/FileCacheTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/FileCacheTest.php
deleted file mode 100644
index 2f0b7c950..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/FileCacheTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-assertFalse($this->cache->isFresh('unexisting', time() + 100));
- }
-
- public function testIsFreshOnFreshFile()
- {
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, null);
-
- $this->cache->write('some_path', $feature);
-
- $this->assertFalse($this->cache->isFresh('some_path', time() + 100));
- }
-
- public function testIsFreshOnOutdated()
- {
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, null);
-
- $this->cache->write('some_path', $feature);
-
- $this->assertTrue($this->cache->isFresh('some_path', time() - 100));
- }
-
- public function testCacheAndRead()
- {
- $scenarios = array(new ScenarioNode('Some scenario', array(), array(), null, null));
- $feature = new FeatureNode('Some feature', 'some description', array(), null, $scenarios, null, null, null, null);
-
- $this->cache->write('some_feature', $feature);
- $featureRead = $this->cache->read('some_feature');
-
- $this->assertEquals($feature, $featureRead);
- }
-
- public function testBrokenCacheRead()
- {
- $this->setExpectedException('Behat\Gherkin\Exception\CacheException');
-
- touch($this->path . '/v' . Gherkin::VERSION . '/' . md5('broken_feature') . '.feature.cache');
- $this->cache->read('broken_feature');
- }
-
- public function testUnwriteableCacheDir()
- {
- $this->setExpectedException('Behat\Gherkin\Exception\CacheException');
-
- new FileCache('/dev/null/gherkin-test');
- }
-
- protected function setUp()
- {
- $this->cache = new FileCache($this->path = sys_get_temp_dir() . '/gherkin-test');
- }
-
- protected function tearDown()
- {
- foreach (glob($this->path . '/*.feature.cache') as $file) {
- unlink((string) $file);
- }
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/MemoryCacheTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/MemoryCacheTest.php
deleted file mode 100644
index a0bb6c86f..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Cache/MemoryCacheTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-assertFalse($this->cache->isFresh('unexisting', time() + 100));
- }
-
- public function testIsFreshOnFreshFile()
- {
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, null);
-
- $this->cache->write('some_path', $feature);
-
- $this->assertFalse($this->cache->isFresh('some_path', time() + 100));
- }
-
- public function testIsFreshOnOutdated()
- {
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, null);
-
- $this->cache->write('some_path', $feature);
-
- $this->assertTrue($this->cache->isFresh('some_path', time() - 100));
- }
-
- public function testCacheAndRead()
- {
- $scenarios = array(new ScenarioNode('Some scenario', array(), array(), null, null));
- $feature = new FeatureNode('Some feature', 'some description', array(), null, $scenarios, null, null, null, null);
-
- $this->cache->write('some_feature', $feature);
- $featureRead = $this->cache->read('some_feature');
-
- $this->assertEquals($feature, $featureRead);
- }
-
- protected function setUp()
- {
- $this->cache = new MemoryCache();
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/FilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/FilterTest.php
deleted file mode 100644
index 994e6564a..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/FilterTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
- array(
- 'feature' => 'Feature',
- 'background' => 'Background',
- 'scenario' => 'Scenario',
- 'scenario_outline' => 'Scenario Outline|Scenario Template',
- 'examples' => 'Examples|Scenarios',
- 'given' => 'Given',
- 'when' => 'When',
- 'then' => 'Then',
- 'and' => 'And',
- 'but' => 'But'
- )
- ))
- )
- );
- }
-
- protected function getGherkinFeature()
- {
- return << occurs
- Then should be visible
-
- Examples:
- | action | outcome |
- | act#1 | out#1 |
- | act#2 | out#2 |
- | act#3 | out#3 |
-GHERKIN;
- }
-
- protected function getParsedFeature()
- {
- return $this->getParser()->parse($this->getGherkinFeature());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/Fixtures/full/file2 b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/Fixtures/full/file2
deleted file mode 100644
index e69de29bb..000000000
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/Fixtures/full_path/file1 b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/Fixtures/full_path/file1
deleted file mode 100644
index e69de29bb..000000000
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineFilterTest.php
deleted file mode 100644
index 846a719de..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineFilterTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new LineFilter(2);
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new LineFilter(3);
- $this->assertFalse($filter->isFeatureMatch($feature));
- }
-
- public function testIsScenarioMatchFilter()
- {
- $scenario = new ScenarioNode(null, array(), array(), null, 2);
-
- $filter = new LineFilter(2);
- $this->assertTrue($filter->isScenarioMatch($scenario));
-
- $filter = new LineFilter(1);
- $this->assertFalse($filter->isScenarioMatch($scenario));
-
- $filter = new LineFilter(5);
- $this->assertFalse($filter->isScenarioMatch($scenario));
-
- $outline = new OutlineNode(null, array(), array(), new ExampleTableNode(array(), null), null, 20);
-
- $filter = new LineFilter(5);
- $this->assertFalse($filter->isScenarioMatch($outline));
-
- $filter = new LineFilter(20);
- $this->assertTrue($filter->isScenarioMatch($outline));
- }
-
- public function testFilterFeatureScenario()
- {
- $filter = new LineFilter(2);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#1', $scenarios[0]->getTitle());
-
- $filter = new LineFilter(7);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#2', $scenarios[0]->getTitle());
-
- $filter = new LineFilter(5);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(0, $scenarios = $feature->getScenarios());
- }
-
- public function testFilterFeatureOutline()
- {
- $filter = new LineFilter(13);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#3', $scenarios[0]->getTitle());
- $this->assertCount(4, $scenarios[0]->getExampleTable()->getRows());
-
- $filter = new LineFilter(19);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#3', $scenarios[0]->getTitle());
- $this->assertCount(2, $scenarios[0]->getExampleTable()->getRows());
- $this->assertSame(array(
- array('action', 'outcome'),
- array('act#1', 'out#1'),
- ), $scenarios[0]->getExampleTable()->getRows());
-
- $filter = new LineFilter(21);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#3', $scenarios[0]->getTitle());
- $this->assertCount(2, $scenarios[0]->getExampleTable()->getRows());
- $this->assertSame(array(
- array('action', 'outcome'),
- array('act#3', 'out#3'),
- ), $scenarios[0]->getExampleTable()->getRows());
-
- $filter = new LineFilter(18);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#3', $scenarios[0]->getTitle());
- $this->assertCount(1, $scenarios[0]->getExampleTable()->getRows());
- $this->assertSame(array(
- array('action', 'outcome'),
- ), $scenarios[0]->getExampleTable()->getRows());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php
deleted file mode 100644
index fb8abe1ce..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-assertSame($expected, $filter->isFeatureMatch($feature));
- }
-
- public function scenarioLineRangeProvider()
- {
- return array(
- array('1', '2', 1),
- array('1', '*', 2),
- array('2', '2', 1),
- array('2', '*', 2),
- array('3', '3', 1),
- array('3', '*', 1),
- array('1', '1', 0),
- array('4', '4', 0),
- array('4', '*', 0)
- );
- }
-
- /**
- * @dataProvider scenarioLineRangeProvider
- */
- public function testIsScenarioMatchFilter($filterMinLine, $filterMaxLine, $expectedNumberOfMatches)
- {
- $scenario = new ScenarioNode(null, array(), array(), null, 2);
- $outline = new OutlineNode(null, array(), array(), new ExampleTableNode(array(), null), null, 3);
-
- $filter = new LineRangeFilter($filterMinLine, $filterMaxLine);
- $this->assertEquals(
- $expectedNumberOfMatches,
- intval($filter->isScenarioMatch($scenario)) + intval($filter->isScenarioMatch($outline))
- );
- }
-
- public function testFilterFeatureScenario()
- {
- $filter = new LineRangeFilter(1, 3);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#1', $scenarios[0]->getTitle());
-
- $filter = new LineRangeFilter(5, 9);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#2', $scenarios[0]->getTitle());
-
- $filter = new LineRangeFilter(5, 6);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(0, $scenarios = $feature->getScenarios());
- }
-
- public function testFilterFeatureOutline()
- {
- $filter = new LineRangeFilter(12, 14);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#3', $scenarios[0]->getTitle());
- $this->assertCount(1, $scenarios[0]->getExampleTable()->getRows());
-
- $filter = new LineRangeFilter(15, 20);
- $feature = $filter->filterFeature($this->getParsedFeature());
- $this->assertCount(1, $scenarios = $feature->getScenarios());
- $this->assertSame('Scenario#3', $scenarios[0]->getTitle());
- $this->assertCount(3, $scenarios[0]->getExampleTable()->getRows());
- $this->assertSame(array(
- array('action', 'outcome'),
- array('act#1', 'out#1'),
- array('act#2', 'out#2'),
- ), $scenarios[0]->getExampleTable()->getRows());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NameFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NameFilterTest.php
deleted file mode 100644
index 24914ecf1..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NameFilterTest.php
+++ /dev/null
@@ -1,79 +0,0 @@
-assertSame($feature, $filter->filterFeature($feature));
-
- $scenarios = array(
- new ScenarioNode('scenario1', array(), array(), null, 2),
- $matchedScenario = new ScenarioNode('scenario2', array(), array(), null, 4)
- );
- $feature = new FeatureNode('feature1', null, array(), null, $scenarios, null, null, null, 1);
- $filter = new NameFilter('scenario2');
- $filteredFeature = $filter->filterFeature($feature);
-
- $this->assertSame(array($matchedScenario), $filteredFeature->getScenarios());
- }
-
- public function testIsFeatureMatchFilter()
- {
- $feature = new FeatureNode('random feature title', null, array(), null, array(), null, null, null, 1);
-
- $filter = new NameFilter('feature1');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode('feature1', null, array(), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode('feature1 title', null, array(), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode('some feature1 title', null, array(), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode('some feature title', null, array(), null, array(), null, null, null, 1);
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new NameFilter('/fea.ure/');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode('some feaSure title', null, array(), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode('some feture title', null, array(), null, array(), null, null, null, 1);
- $this->assertFalse($filter->isFeatureMatch($feature));
- }
-
- public function testIsScenarioMatchFilter()
- {
- $filter = new NameFilter('scenario1');
-
- $scenario = new ScenarioNode('UNKNOWN', array(), array(), null, 2);
- $this->assertFalse($filter->isScenarioMatch($scenario));
-
- $scenario = new ScenarioNode('scenario1', array(), array(), null, 2);
- $this->assertTrue($filter->isScenarioMatch($scenario));
-
- $scenario = new ScenarioNode('scenario1 title', array(), array(), null, 2);
- $this->assertTrue($filter->isScenarioMatch($scenario));
-
- $scenario = new ScenarioNode('some scenario title', array(), array(), null, 2);
- $this->assertFalse($filter->isScenarioMatch($scenario));
-
- $filter = new NameFilter('/sce.ario/');
- $this->assertTrue($filter->isScenarioMatch($scenario));
-
- $filter = new NameFilter('/scen.rio/');
- $this->assertTrue($filter->isScenarioMatch($scenario));
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php
deleted file mode 100644
index 6a50e1eb0..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new NarrativeFilter('/as (?:a|an) french user/i');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new NarrativeFilter('/french .*/');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new NarrativeFilter('/^french/');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new NarrativeFilter('/user$/');
- $this->assertFalse($filter->isFeatureMatch($feature));
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/PathsFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/PathsFilterTest.php
deleted file mode 100644
index b53e18dc7..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/PathsFilterTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array('/abc', '/def', dirname(__DIR__)));
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array('/abc', '/def', __DIR__));
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array('/abc', __DIR__, '/def'));
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array('/abc', '/def', '/wrong/path'));
- $this->assertFalse($filter->isFeatureMatch($feature));
- }
-
- public function testItDoesNotMatchPartialPaths()
- {
- $fixtures = __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR;
-
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, $fixtures . 'full_path' . DIRECTORY_SEPARATOR . 'file1', 1);
-
- $filter = new PathsFilter(array($fixtures . 'full'));
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array($fixtures . 'full' . DIRECTORY_SEPARATOR));
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array($fixtures . 'full_path' . DIRECTORY_SEPARATOR));
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new PathsFilter(array($fixtures . 'full_path'));
- $this->assertTrue($filter->isFeatureMatch($feature));
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/RoleFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/RoleFilterTest.php
deleted file mode 100644
index 8e8af3e0d..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/RoleFilterTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('french *');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('french');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('user');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('*user');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('French User');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, 1);
- $filter = new RoleFilter('French User');
- $this->assertFalse($filter->isFeatureMatch($feature));
- }
-
- public function testFeatureRolePrefixedWithAn()
- {
- $description = <<assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('american *');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('american');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('user');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('*user');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new RoleFilter('American User');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, 1);
- $filter = new RoleFilter('American User');
- $this->assertFalse($filter->isFeatureMatch($feature));
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/TagFilterTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/TagFilterTest.php
deleted file mode 100644
index 5c6c9ab28..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/TagFilterTest.php
+++ /dev/null
@@ -1,144 +0,0 @@
-assertEquals($feature, $filter->filterFeature($feature));
-
- $scenarios = array(
- new ScenarioNode(null, array(), array(), null, 2),
- $matchedScenario = new ScenarioNode(null, array('wip'), array(), null, 4)
- );
- $feature = new FeatureNode(null, null, array(), null, $scenarios, null, null, null, 1);
- $filteredFeature = $filter->filterFeature($feature);
-
- $this->assertSame(array($matchedScenario), $filteredFeature->getScenarios());
-
- $filter = new TagFilter('~@wip');
- $scenarios = array(
- $matchedScenario = new ScenarioNode(null, array(), array(), null, 2),
- new ScenarioNode(null, array('wip'), array(), null, 4)
- );
- $feature = new FeatureNode(null, null, array(), null, $scenarios, null, null, null, 1);
- $filteredFeature = $filter->filterFeature($feature);
-
- $this->assertSame(array($matchedScenario), $filteredFeature->getScenarios());
- }
-
- public function testIsFeatureMatchFilter()
- {
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, 1);
-
- $filter = new TagFilter('@wip');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('wip'), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new TagFilter('~@done');
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('wip', 'done'), null, array(), null, null, null, 1);
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('tag1', 'tag2', 'tag3'), null, array(), null, null, null, 1);
- $filter = new TagFilter('@tag5,@tag4,@tag6');
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array(
- 'tag1',
- 'tag2',
- 'tag3',
- 'tag5'
- ), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new TagFilter('@wip&&@vip');
- $feature = new FeatureNode(null, null, array('wip', 'done'), null, array(), null, null, null, 1);
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('wip', 'done', 'vip'), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $filter = new TagFilter('@wip,@vip&&@user');
- $feature = new FeatureNode(null, null, array('wip'), null, array(), null, null, null, 1);
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('vip'), null, array(), null, null, null, 1);
- $this->assertFalse($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('wip', 'user'), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
-
- $feature = new FeatureNode(null, null, array('vip', 'user'), null, array(), null, null, null, 1);
- $this->assertTrue($filter->isFeatureMatch($feature));
- }
-
- public function testIsScenarioMatchFilter()
- {
- $feature = new FeatureNode(null, null, array('feature-tag'), null, array(), null, null, null, 1);
- $scenario = new ScenarioNode(null, array(), array(), null, 2);
-
- $filter = new TagFilter('@wip');
- $this->assertFalse($filter->isScenarioMatch($feature, $scenario));
-
- $filter = new TagFilter('~@done');
- $this->assertTrue($filter->isScenarioMatch($feature, $scenario));
-
- $scenario = new ScenarioNode(null, array(
- 'tag1',
- 'tag2',
- 'tag3'
- ), array(), null, 2);
- $filter = new TagFilter('@tag5,@tag4,@tag6');
- $this->assertFalse($filter->isScenarioMatch($feature, $scenario));
-
- $scenario = new ScenarioNode(null, array(
- 'tag1',
- 'tag2',
- 'tag3',
- 'tag5'
- ), array(), null, 2);
- $this->assertTrue($filter->isScenarioMatch($feature, $scenario));
-
- $filter = new TagFilter('@wip&&@vip');
- $scenario = new ScenarioNode(null, array('wip', 'not-done'), array(), null, 2);
- $this->assertFalse($filter->isScenarioMatch($feature, $scenario));
-
- $scenario = new ScenarioNode(null, array(
- 'wip',
- 'not-done',
- 'vip'
- ), array(), null, 2);
- $this->assertTrue($filter->isScenarioMatch($feature, $scenario));
-
- $filter = new TagFilter('@wip,@vip&&@user');
- $scenario = new ScenarioNode(null, array(
- 'wip'
- ), array(), null, 2);
- $this->assertFalse($filter->isScenarioMatch($feature, $scenario));
-
- $scenario = new ScenarioNode(null, array('vip'), array(), null, 2);
- $this->assertFalse($filter->isScenarioMatch($feature, $scenario));
-
- $scenario = new ScenarioNode(null, array('wip', 'user'), array(), null, 2);
- $this->assertTrue($filter->isScenarioMatch($feature, $scenario));
-
- $filter = new TagFilter('@feature-tag&&@user');
- $scenario = new ScenarioNode(null, array('wip', 'user'), array(), null, 2);
- $this->assertTrue($filter->isScenarioMatch($feature, $scenario));
-
- $filter = new TagFilter('@feature-tag&&@user');
- $scenario = new ScenarioNode(null, array('wip'), array(), null, 2);
- $this->assertFalse($filter->isScenarioMatch($feature, $scenario));
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/directories/phps/some_file.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/directories/phps/some_file.php
deleted file mode 100644
index e69de29bb..000000000
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/addition.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/addition.yml
deleted file mode 100644
index 7627fe614..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/addition.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-feature:
- title: Addition
- language: en
- line: 2
- description: |-
- In order to avoid silly mistakes
- As a math idiot
- I want to be told the sum of two numbers
-
- scenarios:
- -
- type: scenario
- title: Add two numbers
- line: 7
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'I have entered 11 into the calculator', line: 8 }
- - { keyword_type: 'Given', type: 'And', text: 'I have entered 12 into the calculator', line: 9 }
- - { keyword_type: 'When', type: 'When', text: 'I press add', line: 10 }
- - { keyword_type: 'Then', type: 'Then', text: 'the result should be 23 on the screen', line: 11 }
-
- -
- type: scenario
- title: Div two numbers
- line: 13
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'I have entered 10 into the calculator', line: 14 }
- - { keyword_type: 'Given', type: 'And', text: 'I have entered 2 into the calculator', line: 15 }
- - { keyword_type: 'When', type: 'When', text: 'I press div', line: 16 }
- - { keyword_type: 'Then', type: 'Then', text: 'the result should be 5 on the screen', line: 17 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background.yml
deleted file mode 100644
index a7b1a7b25..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-feature:
- title: Feature with background
- language: en
- line: 1
- description: ~
-
- background:
- line: 3
- steps:
- - { keyword_type: Given, type: Given, text: a passing step, line: 4 }
-
- scenarios:
- -
- type: scenario
- title: ~
- line: 6
- steps:
- - { keyword_type: Given, type: Given, text: a failing step, line: 7 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background_title.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background_title.yml
deleted file mode 100644
index f69277d74..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/background_title.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-feature:
- title: Feature with titled background
- language: en
- line: 1
- description: ~
-
- background:
- line: 3
- title: |-
- Some Background
- title with
- couple
- of
- | continuous |
- """
- strings
- steps:
- - { keyword_type: Given, type: Given, text: a passing step, line: 10 }
-
- scenarios:
- -
- type: scenario
- title: ~
- line: 12
- steps:
- - { keyword_type: Given, type: Given, text: a failing step, line: 13 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/big_pystring.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/big_pystring.yml
deleted file mode 100644
index 31089fd5d..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/big_pystring.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-feature:
- line: 1
- title: Big PyString
-
- scenarios:
- -
- type: scenario
- line: 2
- steps:
- -
- keyword_type: Then
- type: Then
- text: it should fail with:
- line: 3
- arguments:
- -
- type: pystring
- text: "\n# language: ru\n\nUUUUUU\n\n2 scenarios (2 undefined)\n6 steps (6 undefined)\n\nYou can implement step definitions for undefined steps with these snippets:\n\n$steps->Given('/^I have entered (\\d+)$/', function($world, $arg1) {\n throw new \\Everzet\\Behat\\Exception\\Pending();\n});\n\n$steps->Then('/^I must have (\\d+)$/', function($world, $arg1) {\n throw new \\Everzet\\Behat\\Exception\\Pending();\n});\n\n$steps->Then('/^String must be \\'([^\\']*)\\'$/', function($world, $arg1) {\n throw new \\Everzet\\Behat\\Exception\\Pending();\n});"
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/clean_tags.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/clean_tags.yml
deleted file mode 100644
index 014c8d38a..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/clean_tags.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-feature:
- title: Feature N4
- line: 1
- description: ~
-
- scenarios:
- -
- type: scenario
- tags: [normal]
- line: 4
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'Some normal step N41', line: 5 }
- - { keyword_type: 'Given', type: 'And', text: 'Some fast step N42', line: 6 }
-
- -
- type: scenario
- tags: [fast]
- line: 9
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'Some slow step N43', line: 10 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/commented_out.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/commented_out.yml
deleted file mode 100644
index a8a2c5159..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/commented_out.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-feature:
- title: Fibonacci
- language: en
- line: 1
- description: |-
- In order to calculate super fast fibonacci series
- As a pythonista
- I want to use Python for that
-
- scenarios: ~
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/comments.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/comments.yml
deleted file mode 100644
index 2ae46cbc1..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/comments.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-feature:
- title: Using the Console Formatter
- language: en
- line: 3
- description: |-
- In order to verify this error # comment
-
-
-
- I want to run this feature using the progress format#comment
- So that it can be fixed
-
- scenarios:
- -
- type: scenario
- title: "A normal feature #comment in scenario title"
- line: 19
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'I have a pending step #comment', line: 21 }
- - { keyword_type: 'When', type: 'When', text: 'I run this feature with the progress format #comment', line: 24 }
- - { keyword_type: 'Then', type: 'Then', text: "I should get a no method error for 'backtrace_line'", line: 31 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/complex_descriptions.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/complex_descriptions.yml
deleted file mode 100644
index d0d65dc27..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/complex_descriptions.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-feature:
- title: Complex descriptions
- language: en
- line: 7
- description: |-
- Some description with
- | table | row|
-
- and
-
- """
- """
-
- scenarios:
- -
- type: scenario
- title: |-
- Some
- | complex | description |
-
- """
- hell yeah
- """
- line: 16
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'one two three', line: 22 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty.yml
deleted file mode 100644
index e13f36391..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-feature:
- title: Some feature
- language: en
- line: 1
- description: ~
-
- scenarios: []
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario.yml
deleted file mode 100644
index 43e7201d5..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-feature:
- title: Cucumber command line
- language: en
- line: 1
- description: |-
- In order to write better software
- Developers should be able to execute requirements as tests
-
- scenarios:
- -
- type: scenario
- title: Pending Scenario at the end of a file with whitespace after it
- line: 6
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario_without_linefeed.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario_without_linefeed.yml
deleted file mode 100644
index 43e7201d5..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenario_without_linefeed.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-feature:
- title: Cucumber command line
- language: en
- line: 1
- description: |-
- In order to write better software
- Developers should be able to execute requirements as tests
-
- scenarios:
- -
- type: scenario
- title: Pending Scenario at the end of a file with whitespace after it
- line: 6
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenarios.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenarios.yml
deleted file mode 100644
index 35a144ba0..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/empty_scenarios.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-feature:
- title: Math
- language: en
- line: 1
- description: |-
- In order to avoid silly mistakes
- As a math idiot
- I want to be told the calculation of two numbers
-
- scenarios:
- -
- type: scenario
- title: Add two numbers
- line: 6
- steps: []
- -
- type: scenario
- title: Div two numbers
- line: 7
- steps: []
- -
- type: scenario
- title: Multiply two numbers
- line: 9
- steps: []
- -
- type: scenario
- title: Sub two numbers
- line: 12
- steps: []
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/fibonacci.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/fibonacci.yml
deleted file mode 100644
index c450a8b10..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/fibonacci.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-feature:
- title: Fibonacci
- language: en
- line: 1
- description: |-
- In order to calculate super fast fibonacci series
- As a pythonista
- I want to use Python for that
-
- scenarios:
- -
- type: outline
- title: Series
- line: 6
- steps:
- - { keyword_type: 'When', type: 'When', text: 'I ask python to calculate fibonacci up to ', line: 7 }
- - { keyword_type: 'Then', type: 'Then', text: 'it should give me ', line: 8 }
-
- examples:
- 11: [ n , series ]
- 12: [ 1 , '[]' ]
- 13: [ 2 , '[1, 1]' ]
- 14: [ 3 , '[1, 1, 2]' ]
- 15: [ 4 , '[1, 1, 2, 3]' ]
- 16: [ 6 , '[1, 1, 2, 3, 5]' ]
- 17: [ 9 , '[1, 1, 2, 3, 5, 8]' ]
- 18: [ 100 , '[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]' ]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/hashes_in_quotes.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/hashes_in_quotes.yml
deleted file mode 100644
index 55abe3b22..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/hashes_in_quotes.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-feature:
- title: "Some '#quoted' string"
- language: en
- line: 2
- description: |-
- In order to avoid silly mistakes
- As a "#math" idiot
- I want to be told the sum of two numbers
-
- scenarios:
- -
- type: scenario
- title: Add two numbers
- line: 7
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'I have entered 11 into the calculator', line: 8 }
- - { keyword_type: 'Given', type: 'And', text: 'I have entered 12 into the calculator', line: 9 }
- - { keyword_type: 'When', type: 'When', text: 'I press "#add"', line: 10 }
- - { keyword_type: 'Then', type: 'Then', text: 'the result should be 23 on the screen', line: 11 }
-
- -
- type: scenario
- title: 'Div "#two" numbers # as'
- line: 13
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'I have entered 10 into the calculator', line: 14 }
- - { keyword_type: 'Given', type: 'And', text: 'I have entered # 2 into the calculator', line: 15 }
- - { keyword_type: 'When', type: 'When', text: 'I press div', line: 16 }
- - { keyword_type: 'Then', type: 'Then', text: 'the result should be 5 on the screen', line: 17 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/issue_13.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/issue_13.yml
deleted file mode 100644
index 091103c2f..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/issue_13.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-feature:
- title: test pystring
- description: second line
- language: en
- line: 1
-
- scenarios:
- -
- type: scenario
- title: |-
- testing py string in scenario
- second line
- line: 4
- steps:
- -
- keyword_type: Given
- type: Given
- text: the pystring is
- line: 7
- arguments:
- -
- type: pystring
- text: |-
- Test store name
- Denmark, Kolding
- 6000
-
- -
- type: outline
- title: |-
- testing py string in scenario outline
- second line
- line: 14
- steps:
- -
- keyword_type: Given
- type: Given
- text: the pystring is
- line: 17
- arguments:
- arguments:
- -
- type: pystring
- text: |-
- Test store name
- Denmark, Kolding
- 6000
- examples:
- 24: ['']
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ja_addition.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ja_addition.yml
deleted file mode 100644
index d56aa4412..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ja_addition.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-feature:
- title: '加算'
- keyword: 'フィーチャ'
- language: ja
- line: 2
- description: |-
- バカな間違いを避けるために
- 数学オンチとして
- 2つの数の合計を知りたい
-
- scenarios:
- -
- type: scenario
- keyword: 'シナリオ'
- title: '2つの数の加算について'
- line: 7
- steps:
- - { keyword_type: 'Given', type: '前提', type: '前提', text: '50 を入力', line: 8 }
- - { keyword_type: 'Given', type: 'かつ', type: 'かつ', text: '70 を入力', line: 9 }
- - { keyword_type: 'When', type: 'もし', type: 'もし', text: 'add ボタンを押した', line: 10 }
- - { keyword_type: 'Then', type: 'ならば', type: 'ならば', text: '結果は 120 を表示', line: 11 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/long_title_feature.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/long_title_feature.yml
deleted file mode 100644
index 7e30cf54d..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/long_title_feature.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-feature:
- title: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match
- language: en
- line: 1
- description: ~
-
- scenarios:
- -
- type: scenario
- title: See "No Record(s) Found" for Zero Existing
- line: 3
- steps:
- - { keyword_type: Given, type: Given, text: no public holiday exists in the system, line: 4 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name.yml
deleted file mode 100644
index b41bc58d6..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-feature:
- title: multiline
- language: en
- line: 1
- description: ~
-
- background:
- line: 3
- steps:
- - { keyword_type: Given, type: Given, text: passing without a table, line: 4 }
-
- scenarios:
- -
- type: scenario
- title: |-
- I'm a multiline name
- which goes on and on and on for three lines
- yawn
- line: 6
- steps:
- - { keyword_type: Given, type: Given, text: passing without a table, line: 9 }
-
- -
- type: outline
- title: |-
- I'm a multiline name
- which goes on and on and on for three lines
- yawn
- line: 11
- steps:
- - { keyword_type: Given, type: 'Given', text: ' without a table', line: 14 }
- examples:
- 16: [state]
- 17: [passing]
-
- -
- type: outline
- title: name
- line: 19
- steps:
- - { keyword_type: Given, type: 'Given', text: ' without a table', line: 20 }
- examples:
- 22: [state]
- 23: [passing]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name_with_newlines.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name_with_newlines.yml
deleted file mode 100644
index d7aebc06c..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiline_name_with_newlines.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-feature:
- title: multiline
- language: en
- line: 1
- description: |-
-
- Feature description
-
- With etc.
-
- background:
- line: 8
- steps:
- - { keyword_type: Given, type: Given, text: passing without a table, line: 11 }
-
- scenarios:
- -
- type: scenario
- title: |-
-
- I'm a multiline name
- which goes on and on and on for three lines
- yawn
- line: 13
- steps:
- - { keyword_type: Given, type: Given, text: passing without a table, line: 19 }
-
- -
- type: outline
- title: |-
- I'm a multiline name
-
- which goes on and on and on for three lines
-
- yawn
- line: 21
- steps:
- - { keyword_type: 'Given', type: 'Given', text: ' without a table', line: 28 }
- examples:
- 34: [state]
- 35: [passing]
-
- -
- type: outline
- title: name
- line: 37
- steps:
- - { keyword_type: 'Given', type: 'Given', text: ' without a table', line: 40 }
- examples:
- 45: [state]
- 46: [passing]
- -
- type: outline
- title: |-
-
-
- I'm a multiline name
- which goes on and on and on for three lines
- yawn
- line: 48
- steps:
- - { keyword_type: 'Given', type: 'Given', text: ' without a table', line: 55 }
- examples:
- 60: [state]
- 61: [passing]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiplepystrings.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiplepystrings.yml
deleted file mode 100644
index 6c73bba01..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/multiplepystrings.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-feature:
- title: A multiple py string feature
- line: 1
- language: en
- description: ~
-
- scenarios:
- -
- type: scenario
- title: ~
- line: 3
- steps:
- -
- keyword_type: When
- type: When
- text: I enter a string
- line: 4
- arguments:
- -
- type: pystring
- text: |-
- -
- a string
- with something
- be
- a
- u
- ti
- ful
-
- -
- keyword_type: Then
- type: Then
- text: String must be
- line: 15
- arguments:
- -
- type: pystring
- text: |-
- -
- a string
- with something
- be
- a
- u
- ti
- ful
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_spaces.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_spaces.yml
deleted file mode 100644
index c6e897725..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_spaces.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-feature:
- title: Login
- language: en
- line: 1
- description: |-
- To ensure the safety of the application
- A regular user of the system
- Must authenticate before using the app
-
- scenarios:
- -
- type: outline
- title: Failed Login
- line: 7
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'the user "known_user"', line: 8 }
- - { keyword_type: 'When', type: 'When', text: 'I go to the main page', line: 10 }
- - { keyword_type: 'Then', type: 'Then', text: 'I should see the login form', line: 11 }
- - { keyword_type: 'When', type: 'When', text: 'I fill in "login" with ""', line: 13 }
- - { keyword_type: 'When', type: 'And', text: 'I fill in "password" with ""', line: 14 }
- - { keyword_type: 'When', type: 'And', text: 'I press "Log In"', line: 15 }
- - { keyword_type: 'Then', type: 'Then', text: 'the login request should fail', line: 16 }
- - { keyword_type: 'Then', type: 'And', text: 'I should see the error message "Login or Password incorrect"', line: 17 }
- examples:
- 20: [login, password]
- 21: ['', '']
- 22: [unknown_user, '']
- 23: [known_user, '']
- 24: ['', wrong_password]
- 25: ['', known_userpass]
- 26: [unknown_user, wrong_password]
- 27: [unknown_user, known_userpass]
- 28: [known_user, wrong_password]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_step_table.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_step_table.yml
deleted file mode 100644
index 8c59ff132..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/outline_with_step_table.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-feature:
- title: Unsubstituted argument placeholder
- language: en
- line: 1
- description: ~
-
- scenarios:
- -
- type: outline
- title: 'See Annual Leave Details (as Management & Human Resource)'
- line: 3
- steps:
- -
- keyword_type: Given
- type: Given
- text: the following users exist in the system
- line: 4
- arguments:
- -
- type: table
- rows:
- 5: [ name, email, role_assignments, group_memberships ]
- 6: [ Jane, jane@fmail.com, , Sales (manager) ]
- 7: [ Max, max@fmail.com, '', Sales (member) ]
- 8: [ Carol, carol@fmail.com, '', Sales (member) ]
- 9: [ Cat, cat@fmail.com, '', '' ]
- examples:
- 12: [ role ]
- 13: [ HUMAN RESOURCE ]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/pystring.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/pystring.yml
deleted file mode 100644
index bc21a9a95..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/pystring.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-feature:
- title: A py string feature
- language: en
- line: 1
- description: ~
-
- scenarios:
- -
- type: scenario
- title: ~
- line: 3
- steps:
- -
- keyword_type: Then
- type: Then
- text: I should see
- line: 4
- arguments:
- -
- type: pystring
- swallow: 6
- text: "a string with #something"
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_addition.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_addition.yml
deleted file mode 100644
index 9c0db4aa2..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_addition.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-feature:
- title: Сложение чисел
- keyword: Функционал
- language: ru
- line: 2
- description: |-
- Чтобы не складывать в уме
- Все, у кого с этим туго
- Хотят автоматическое сложение целых чисел
-
- scenarios:
- -
- type: scenario
- keyword: Сценарий
- title: Сложение двух целых чисел
- line: 7
- steps:
- - { keyword_type: 'Given', type: 'Допустим', text: 'я ввожу число 50', line: 8 }
- - { keyword_type: 'Given', type: 'И', text: 'затем ввожу число 70', line: 9 }
- - { keyword_type: 'Then', type: 'Если', text: 'я нажимаю "+"', line: 10 }
- - { keyword_type: 'When', type: 'То', text: 'результатом должно быть число 120', line: 11 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_commented.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_commented.yml
deleted file mode 100644
index 1097d5d5f..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_commented.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-feature:
- title: Тест комментов
- keyword: Функционал
- language: ru
- line: 7
- description: |-
- i18n должен правильно считываться
- Даже если в начале файла 1000
- комментов!
-
- scenarios: ~
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_consecutive_calculations.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_consecutive_calculations.yml
deleted file mode 100644
index 358d86787..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_consecutive_calculations.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-feature:
- title: Последовательные вычисления
- keyword: Функционал
- language: ru
- line: 2
- description: |-
- Чтобы вычислять сложные выражения
- Пользователи хотят проводить вычисления над результатом предыдущей операций
-
- background:
- keyword: Предыстория
- line: 6
- steps:
- - { keyword_type: Given, type: Допустим, text: я сложил 3 и 5, line: 7 }
-
- scenarios:
- -
- type: scenario
- keyword: Сценарий
- title: сложение с результатом последней операций
- line: 9
- steps:
- - { keyword_type: Then, type: Если, text: 'я ввожу число 4', line: 10 }
- - { keyword_type: Then, type: И, text: 'нажимаю "+"', line: 11 }
- - { keyword_type: When, type: То, text: 'результатом должно быть число 12', line: 12 }
- -
- type: scenario
- keyword: Сценарий
- title: деление результата последней операции
- line: 14
- steps:
- - { keyword_type: Then, type: Если, text: 'я ввожу число 2', line: 15 }
- - { keyword_type: Then, type: И, text: 'нажимаю "/"', line: 16 }
- - { keyword_type: When, type: То, text: 'результатом должно быть число 4', line: 17 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_division.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_division.yml
deleted file mode 100644
index b4d3005c7..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/ru_division.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-feature:
- title: Деление чисел
- keyword: Функционал
- language: ru
- line: 2
- description: |-
- Поскольку деление сложный процесс и люди часто допускают ошибки
- Нужно дать им возможность делить на калькуляторе
-
- scenarios:
- -
- type: outline
- keyword: Структура сценария
- title: Целочисленное деление
- line: 6
- steps:
- - { keyword_type: Given, type: 'Допустим', text: 'я ввожу число <делимое>', line: 7 }
- - { keyword_type: Given, type: 'И', text: 'затем ввожу число <делитель>', line: 8 }
- - { keyword_type: Then, type: 'Если', text: 'я нажимаю "/"', line: 9 }
- - { keyword_type: When, type: 'То', text: 'результатом должно быть число <частное>', line: 10 }
-
- examples:
- keyword: Значения
- 13: [делимое, делитель, частное]
- 14: [100, 2, 50]
- 15: [28, 7, 4]
- 16: [0, 5, 0]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/start_comments.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/start_comments.yml
deleted file mode 100644
index 45fcd77cd..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/start_comments.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-feature:
- title: Using the Console Formatter
- language: en
- line: 3
- description: |-
- In order to verify this error
- I want to run this feature using the progress format
- So that it can be fixed
-
- scenarios:
- -
- type: scenario
- title: A normal feature
- line: 8
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'I have a pending step', line: 9 }
- - { keyword_type: 'When', type: 'When', text: 'I run this feature with the progress format', line: 10 }
- - { keyword_type: 'Then', type: 'Then', text: "I should get a no method error for 'backtrace_line'", line: 11 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tables.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tables.yml
deleted file mode 100644
index 97966665f..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tables.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-feature:
- title: A scenario outline
- language: en
- line: 1
- description: ~
-
- scenarios:
- -
- type: outline
- title: ~
- line: 3
- steps:
- - { keyword_type: Given, type: Given, text: I add and , line: 4 }
- -
- keyword_type: When
- type: When
- text: I pass a table argument
- line: 6
- arguments:
- -
- type: table
- rows:
- 7: [foo, bar]
- 8: [bar, baz]
- - { keyword_type: Then, type: Then, text: I the result should be , line: 10 }
- -
- keyword_type: Then
- type: And
- text: the table should be properly escaped:
- line: 12
- arguments:
- -
- type: table
- rows:
- 13: ['|a', b, c]
- 14: [1, '|2', 3]
- 15: [2, 3, '|4']
-
- examples:
- 18: [ a, b, c ]
- 19: [ 1, '|2', 3 ]
- 20: [ 2, 3, 4 ]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tags_sample.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tags_sample.yml
deleted file mode 100644
index 486d9585c..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/tags_sample.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-feature:
- title: Tag samples
- language: en
- tags: [sample_one]
- line: 2
- description: ~
-
- scenarios:
- -
- type: scenario
- title: Passing
- tags: [sample_two, sample_four]
- line: 5
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'missing', line: 6 }
-
- -
- type: outline
- title: ~
- tags: [sample_three]
- line: 9
- steps:
- - { keyword_type: 'Given', type: 'Given', text: '', line: 10 }
-
- examples:
- 12: [state]
- 13: [missing]
-
- -
- type: scenario
- title: Skipped
- tags: [sample_three, sample_four]
- line: 16
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'missing', line: 17 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/test_unit.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/test_unit.yml
deleted file mode 100644
index fca7e2075..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/test_unit.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-feature:
- title: Test::Unit
- language: en
- line: 1
- description: |-
- In order to please people who like Test::Unit
- As a Cucumber user
- I want to be able to use assert* in my step definitions
-
- scenarios:
- -
- type: scenario
- title: assert_equal
- line: 6
- steps:
- - { keyword_type: 'Given', type: 'Given', text: 'x = 5', line: 7 }
- - { keyword_type: 'Given', type: 'And', text: 'y = 5', line: 8 }
- - { keyword_type: 'Then', type: 'Then', text: 'I can assert that x == y', line: 9 }
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/trimpystring.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/trimpystring.yml
deleted file mode 100644
index 3857fdf3d..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/trimpystring.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-feature:
- title: A py string feature
- language: en
- line: 1
- description: ~
-
- scenarios:
- -
- type: scenario
- title: ~
- line: 3
- steps:
- -
- keyword_type: Then
- type: Then
- text: String must be
- line: 4
- arguments:
- -
- type: pystring
- text: |-
- -
- a string
- with something
- be
- a
- u
- ti
- ful
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/undefined_multiline_args.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/undefined_multiline_args.yml
deleted file mode 100644
index 84cb8ff64..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/etalons/undefined_multiline_args.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-feature:
- title: undefined multiline args
- language: en
- line: 1
- description: ~
-
- scenarios:
- -
- type: scenario
- title: pystring
- line: 3
- steps:
- -
- keyword_type: Given
- type: Given
- text: a pystring
- line: 4
- arguments:
- -
- type: pystring
- text: ' example'
-
- -
- type: scenario
- title: table
- line: 9
- steps:
- -
- keyword_type: Given
- type: Given
- text: a table
- line: 10
- arguments:
- -
- type: table
- rows:
- 11: [table]
- 12: [example]
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/addition.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/addition.feature
deleted file mode 100644
index 744184f16..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/addition.feature
+++ /dev/null
@@ -1,17 +0,0 @@
-# language: en
-Feature: Addition
- In order to avoid silly mistakes
- As a math idiot
- I want to be told the sum of two numbers
-
- Scenario: Add two numbers
- Given I have entered 11 into the calculator
- And I have entered 12 into the calculator
- When I press add
- Then the result should be 23 on the screen
-
- Scenario: Div two numbers
- Given I have entered 10 into the calculator
- And I have entered 2 into the calculator
- When I press div
- Then the result should be 5 on the screen
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background.feature
deleted file mode 100644
index 9a3ffb82c..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background.feature
+++ /dev/null
@@ -1,7 +0,0 @@
-Feature: Feature with background
-
- Background:
- Given a passing step
-
- Scenario:
- Given a failing step
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background_title.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background_title.feature
deleted file mode 100644
index d8ed4d3d4..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/background_title.feature
+++ /dev/null
@@ -1,13 +0,0 @@
-Feature: Feature with titled background
-
- Background: Some Background
- title with
- couple
- of
- | continuous |
- """
- strings
- Given a passing step
-
- Scenario:
- Given a failing step
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/big_pystring.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/big_pystring.feature
deleted file mode 100644
index 900d6c718..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/big_pystring.feature
+++ /dev/null
@@ -1,26 +0,0 @@
-Feature: Big PyString
- Scenario:
- Then it should fail with:
- """
-
- # language: ru
-
- UUUUUU
-
- 2 scenarios (2 undefined)
- 6 steps (6 undefined)
-
- You can implement step definitions for undefined steps with these snippets:
-
- $steps->Given('/^I have entered (\d+)$/', function($world, $arg1) {
- throw new \Everzet\Behat\Exception\Pending();
- });
-
- $steps->Then('/^I must have (\d+)$/', function($world, $arg1) {
- throw new \Everzet\Behat\Exception\Pending();
- });
-
- $steps->Then('/^String must be \'([^\']*)\'$/', function($world, $arg1) {
- throw new \Everzet\Behat\Exception\Pending();
- });
- """
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/clean_tags.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/clean_tags.feature
deleted file mode 100644
index e3e9cc7bd..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/clean_tags.feature
+++ /dev/null
@@ -1,10 +0,0 @@
-Feature: Feature N4
-
- @normal
- Scenario:
- Given Some normal step N41
- And Some fast step N42
-
- @fast
- Scenario:
- Given Some slow step N43
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/commented_out.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/commented_out.feature
deleted file mode 100644
index 61d7bef59..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/commented_out.feature
+++ /dev/null
@@ -1,34 +0,0 @@
-Feature: Fibonacci
- In order to calculate super fast fibonacci series
- As a pythonista
- I want to use Python for that
-
-#
-# Background:
-# Given passing without a table
-#
-# Scenario: I'm a multiline name
-# which goes on and on and on for three lines
-# yawn
-# Given passing without a table
-#
-# Scenario:
-# Then I should see
-# """
-# a string with #something
-# """
-#
-# Scenario Outline: Series
-# When I ask python to calculate fibonacci up to
-# Then it should give me
-#
-# Examples:
-# | n | series |
-# | 1 | [] |
-# | 2 | [1, 1] |
-# | 3 | [1, 1, 2] |
-# | 4 | [1, 1, 2, 3] |
-# | 6 | [1, 1, 2, 3, 5] |
-# | 9 | [1, 1, 2, 3, 5, 8] |
-# | 100 | [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] |
-#
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/comments.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/comments.feature
deleted file mode 100644
index 02ca25cc9..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/comments.feature
+++ /dev/null
@@ -1,32 +0,0 @@
-# Users want to use cucumber, so tests are necessary to verify
-# it is all working as expected
-Feature: Using the Console Formatter
-# com
-# comment
-#com
- In order to verify this error # comment
-
-
-
- I want to run this feature using the progress format#comment
- # COMMENT
- # COMMENT
- # COMMENT
- # COMMENT
- So that it can be fixed
-
- #comment
- Scenario: A normal feature #comment in scenario title
- #comment
- Given I have a pending step #comment
- #comment
- #comment
- When I run this feature with the progress format #comment
-
-
-#comment
- #comment
- #comment
-
- Then I should get a no method error for 'backtrace_line'
-
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/complex_descriptions.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/complex_descriptions.feature
deleted file mode 100644
index 4db3b874e..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/complex_descriptions.feature
+++ /dev/null
@@ -1,22 +0,0 @@
-# language: en
-
-# multiline
-# comment
-# YEAH
-
-Feature: Complex descriptions
- Some description with
- | table | row|
-
- and
-
- """
- """
-
- Scenario: Some
- | complex | description |
-
-"""
-hell yeah
-"""
-Given one two three
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty.feature
deleted file mode 100644
index 8a560d71d..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty.feature
+++ /dev/null
@@ -1,2 +0,0 @@
-Feature: Some feature
-#
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario.feature
deleted file mode 100644
index 6c661c123..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario.feature
+++ /dev/null
@@ -1,7 +0,0 @@
-Feature: Cucumber command line
- In order to write better software
- Developers should be able to execute requirements as tests
-
-
- Scenario: Pending Scenario at the end of a file with whitespace after it
-
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario_without_linefeed.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario_without_linefeed.feature
deleted file mode 100644
index 7e17ff2ad..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenario_without_linefeed.feature
+++ /dev/null
@@ -1,7 +0,0 @@
-Feature: Cucumber command line
- In order to write better software
- Developers should be able to execute requirements as tests
-
-
- Scenario: Pending Scenario at the end of a file with whitespace after it
- #
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenarios.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenarios.feature
deleted file mode 100644
index f17bef5e5..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/empty_scenarios.feature
+++ /dev/null
@@ -1,12 +0,0 @@
-Feature: Math
- In order to avoid silly mistakes
- As a math idiot
- I want to be told the calculation of two numbers
-
- Scenario: Add two numbers
- Scenario: Div two numbers
-
- Scenario: Multiply two numbers
-
-
- Scenario: Sub two numbers
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/fibonacci.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/fibonacci.feature
deleted file mode 100644
index 4a743ea72..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/fibonacci.feature
+++ /dev/null
@@ -1,19 +0,0 @@
-Feature: Fibonacci
- In order to calculate super fast fibonacci series
- As a pythonista
- I want to use Python for that
-
- Scenario Outline: Series
- When I ask python to calculate fibonacci up to
- Then it should give me
-
- Examples:
- | n | series |
- | 1 | [] |
- | 2 | [1, 1] |
- | 3 | [1, 1, 2] |
- | 4 | [1, 1, 2, 3] |
- | 6 | [1, 1, 2, 3, 5] |
- | 9 | [1, 1, 2, 3, 5, 8] |
- | 100 | [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] |
-
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/hashes_in_quotes.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/hashes_in_quotes.feature
deleted file mode 100644
index e08fa7043..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/hashes_in_quotes.feature
+++ /dev/null
@@ -1,17 +0,0 @@
-# language: en
-Feature: Some '#quoted' string
- In order to avoid silly mistakes
- As a "#math" idiot
- I want to be told the sum of two numbers
-
- Scenario: Add two numbers
- Given I have entered 11 into the calculator
- And I have entered 12 into the calculator
- When I press "#add"
- Then the result should be 23 on the screen
-
- Scenario: Div "#two" numbers # as
- Given I have entered 10 into the calculator
- And I have entered # 2 into the calculator
- When I press div
- Then the result should be 5 on the screen
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/issue_13.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/issue_13.feature
deleted file mode 100644
index 4218a974a..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/issue_13.feature
+++ /dev/null
@@ -1,24 +0,0 @@
-Feature: test pystring
-second line
-
-Scenario: testing py string in scenario
-second line
-
-Given the pystring is
-"""
-Test store name
-Denmark, Kolding
-6000
-"""
-
-Scenario Outline: testing py string in scenario outline
-second line
-
-Given the pystring is
-"""
-Test store name
-Denmark, Kolding
-6000
-"""
- Examples:
- ||
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ja_addition.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ja_addition.feature
deleted file mode 100644
index b843852d9..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ja_addition.feature
+++ /dev/null
@@ -1,11 +0,0 @@
-# language: ja
-フィーチャ: 加算
- バカな間違いを避けるために
- 数学オンチとして
- 2つの数の合計を知りたい
-
- シナリオ: 2つの数の加算について
- 前提 50 を入力
- かつ 70 を入力
- もし add ボタンを押した
- ならば結果は 120 を表示
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/long_title_feature.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/long_title_feature.feature
deleted file mode 100644
index a93cb4d83..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/long_title_feature.feature
+++ /dev/null
@@ -1,4 +0,0 @@
-Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match
-
-Scenario: See "No Record(s) Found" for Zero Existing
- Given no public holiday exists in the system
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name.feature
deleted file mode 100644
index 95b9d5590..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name.feature
+++ /dev/null
@@ -1,23 +0,0 @@
-Feature: multiline
-
- Background:
- Given passing without a table
-
- Scenario: I'm a multiline name
- which goes on and on and on for three lines
- yawn
- Given passing without a table
-
- Scenario Outline: I'm a multiline name
- which goes on and on and on for three lines
- yawn
- Given without a table
- Examples:
- | state |
- |passing|
-
- Scenario Outline: name
- Given without a table
- Examples:
- | state |
- |passing|
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name_with_newlines.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name_with_newlines.feature
deleted file mode 100644
index bfc3e064e..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiline_name_with_newlines.feature
+++ /dev/null
@@ -1,61 +0,0 @@
-Feature: multiline
-
- Feature description
-
- With etc.
-
-
- Background:
-
-
- Given passing without a table
-
- Scenario:
- I'm a multiline name
- which goes on and on and on for three lines
- yawn
-
-
- Given passing without a table
-
- Scenario Outline: I'm a multiline name
-
- which goes on and on and on for three lines
-
- yawn
-
-
- Given without a table
-
-
- Examples:
-
-
- | state |
- |passing|
-
- Scenario Outline: name
-
-
- Given without a table
-
-
- Examples:
-
- | state |
- |passing|
-
- Scenario Outline:
-
- I'm a multiline name
- which goes on and on and on for three lines
- yawn
-
-
- Given without a table
-
-
- Examples:
-
- | state |
- |passing|
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiplepystrings.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiplepystrings.feature
deleted file mode 100644
index f5526af42..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/multiplepystrings.feature
+++ /dev/null
@@ -1,25 +0,0 @@
-Feature: A multiple py string feature
-
- Scenario:
- When I enter a string
- """
--
- a string
- with something
- be
- a
- u
- ti
- ful
- """
- Then String must be
- """
--
- a string
- with something
- be
- a
- u
- ti
- ful
- """
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_spaces.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_spaces.feature
deleted file mode 100644
index e587faada..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_spaces.feature
+++ /dev/null
@@ -1,28 +0,0 @@
-Feature: Login
- To ensure the safety of the application
- A regular user of the system
- Must authenticate before using the app
-
-
- Scenario Outline: Failed Login
- Given the user "known_user"
-
- When I go to the main page
- Then I should see the login form
-
- When I fill in "login" with ""
- And I fill in "password" with ""
- And I press "Log In"
- Then the login request should fail
- And I should see the error message "Login or Password incorrect"
-
- Examples:
- | login | password |
- | | |
- | unknown_user | |
- | known_user | |
- | | wrong_password |
- | | known_userpass |
- | unknown_user | wrong_password |
- | unknown_user | known_userpass |
- | known_user | wrong_password |
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_step_table.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_step_table.feature
deleted file mode 100644
index 9d317719e..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/outline_with_step_table.feature
+++ /dev/null
@@ -1,13 +0,0 @@
-Feature: Unsubstituted argument placeholder
-
- Scenario Outline: See Annual Leave Details (as Management & Human Resource)
- Given the following users exist in the system
- | name | email | role_assignments | group_memberships |
- | Jane | jane@fmail.com | | Sales (manager) |
- | Max | max@fmail.com | | Sales (member) |
- | Carol | carol@fmail.com | | Sales (member) |
- | Cat | cat@fmail.com | | |
-
- Examples:
- | role |
- | HUMAN RESOURCE |
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/pystring.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/pystring.feature
deleted file mode 100644
index 601373f25..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/pystring.feature
+++ /dev/null
@@ -1,8 +0,0 @@
-Feature: A py string feature
-
- Scenario:
- Then I should see
- """
- a string with #something
- """
-
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_addition.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_addition.feature
deleted file mode 100644
index eda57222a..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_addition.feature
+++ /dev/null
@@ -1,11 +0,0 @@
-# language: ru
-Функционал: Сложение чисел
- Чтобы не складывать в уме
- Все, у кого с этим туго
- Хотят автоматическое сложение целых чисел
-
- Сценарий: Сложение двух целых чисел
- Допустим я ввожу число 50
- И затем ввожу число 70
- Если я нажимаю "+"
- То результатом должно быть число 120
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_commented.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_commented.feature
deleted file mode 100644
index 36cbd054e..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_commented.feature
+++ /dev/null
@@ -1,10 +0,0 @@
-# Comments
-# comments
-# COOOOOMMEEEENTS
-#
-# language: ru
-
-Функционал: Тест комментов
- i18n должен правильно считываться
- Даже если в начале файла 1000
- комментов!
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_consecutive_calculations.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_consecutive_calculations.feature
deleted file mode 100644
index 87cc7f2ee..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_consecutive_calculations.feature
+++ /dev/null
@@ -1,17 +0,0 @@
-# language: ru
-Функционал: Последовательные вычисления
- Чтобы вычислять сложные выражения
- Пользователи хотят проводить вычисления над результатом предыдущей операций
-
- Предыстория:
- Допустим я сложил 3 и 5
-
- Сценарий: сложение с результатом последней операций
- Если я ввожу число 4
- И нажимаю "+"
- То результатом должно быть число 12
-
- Сценарий: деление результата последней операции
- Если я ввожу число 2
- И нажимаю "/"
- То результатом должно быть число 4
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_division.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_division.feature
deleted file mode 100644
index 7f024f6bb..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/ru_division.feature
+++ /dev/null
@@ -1,16 +0,0 @@
-# language: ru
-Функционал: Деление чисел
- Поскольку деление сложный процесс и люди часто допускают ошибки
- Нужно дать им возможность делить на калькуляторе
-
- Структура сценария: Целочисленное деление
- Допустим я ввожу число <делимое>
- И затем ввожу число <делитель>
- Если я нажимаю "/"
- То результатом должно быть число <частное>
-
- Значения:
- | делимое | делитель | частное |
- | 100 | 2 | 50 |
- | 28 | 7 | 4 |
- | 0 | 5 | 0 |
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/start_comments.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/start_comments.feature
deleted file mode 100644
index 45dd501a3..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/start_comments.feature
+++ /dev/null
@@ -1,12 +0,0 @@
-# Users want to use cucumber, so tests are necessary to verify
-# it is all working as expected
-Feature: Using the Console Formatter
- In order to verify this error
- I want to run this feature using the progress format
- So that it can be fixed
-
- Scenario: A normal feature
- Given I have a pending step
- When I run this feature with the progress format
- Then I should get a no method error for 'backtrace_line'
-
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tables.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tables.feature
deleted file mode 100644
index 92f4c78fc..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tables.feature
+++ /dev/null
@@ -1,20 +0,0 @@
-Feature: A scenario outline
- # COMMENT
- Scenario Outline:
- Given I add and
- # comment
- When I pass a table argument
- | foo | bar |
- | bar | baz |
- #comment
- Then I the result should be
- # comment
- And the table should be properly escaped:
- | \|a | b | c |
- | 1 | \|2 | 3 |
- | 2 | 3 | \|4 |
-#comment
- Examples:
- | a | b | c |
- | 1 | \|2 | 3 |
- | 2 | 3 | 4 |
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tags_sample.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tags_sample.feature
deleted file mode 100644
index 21eaaab16..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/tags_sample.feature
+++ /dev/null
@@ -1,17 +0,0 @@
-@sample_one
-Feature: Tag samples
-
- @sample_two @sample_four
- Scenario: Passing
- Given missing
-
- @sample_three
- Scenario Outline:
- Given
- Examples:
- |state|
- |missing|
-
- @sample_three @sample_four
- Scenario: Skipped
- Given missing
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/test_unit.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/test_unit.feature
deleted file mode 100644
index ed08ba42b..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/test_unit.feature
+++ /dev/null
@@ -1,9 +0,0 @@
-Feature: Test::Unit
- In order to please people who like Test::Unit
- As a Cucumber user
- I want to be able to use assert* in my step definitions
-
- Scenario: assert_equal
- Given x = 5
- And y = 5
- Then I can assert that x == y
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/trimpystring.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/trimpystring.feature
deleted file mode 100644
index 4e04950b0..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/trimpystring.feature
+++ /dev/null
@@ -1,14 +0,0 @@
-Feature: A py string feature
-
- Scenario:
- Then String must be
- """
- -
- a string
- with something
- be
- a
- u
- ti
- ful
- """
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/undefined_multiline_args.feature b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/undefined_multiline_args.feature
deleted file mode 100644
index ae3c7321b..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/features/undefined_multiline_args.feature
+++ /dev/null
@@ -1,12 +0,0 @@
-Feature: undefined multiline args
-
- Scenario: pystring
- Given a pystring
- """
- example
- """
-
- Scenario: table
- Given a table
- | table |
- |example|
\ No newline at end of file
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml
deleted file mode 100644
index 398c60cf5..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml
+++ /dev/null
@@ -1,606 +0,0 @@
-
-#
-# !!! DON'T TOUCH THIS FILE, IT WAS AUTODOWNLOADED FROM:
-# https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.yml
-#
-
-# encoding: UTF-8
-#
-# We use ISO 639-1 (language) and ISO 3166 alpha-2 (region - if applicable):
-# http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
-# http://en.wikipedia.org/wiki/ISO_3166-1
-#
-# If you want several aliases for a keyword, just separate them
-# with a | character. The * is a step keyword alias for all translations.
-#
-# If you do *not* want a trailing space after a keyword, end it with a < character.
-# (See Chinese for examples).
-#
-"en":
- name: English
- native: English
- feature: Feature
- background: Background
- scenario: Scenario
- scenario_outline: Scenario Outline|Scenario Template
- examples: Examples|Scenarios
- given: "*|Given"
- when: "*|When"
- then: "*|Then"
- and: "*|And"
- but: "*|But"
-
-# Please keep the grammars in alphabetical order by name from here and down.
-
-"ar":
- name: Arabic
- native: العربية
- feature: خاصية
- background: الخلفية
- scenario: سيناريو
- scenario_outline: سيناريو مخطط
- examples: امثلة
- given: "*|بفرض"
- when: "*|متى|عندما"
- then: "*|اذاً|ثم"
- and: "*|و"
- but: "*|لكن"
-"bg":
- name: Bulgarian
- native: български
- feature: Функционалност
- background: Предистория
- scenario: Сценарий
- scenario_outline: Рамка на сценарий
- examples: Примери
- given: "*|Дадено"
- when: "*|Когато"
- then: "*|То"
- and: "*|И"
- but: "*|Но"
-"ca":
- name: Catalan
- native: català
- background: Rerefons|Antecedents
- feature: Característica|Funcionalitat
- scenario: Escenari
- scenario_outline: Esquema de l'escenari
- examples: Exemples
- given: "*|Donat|Donada|Atès|Atesa"
- when: "*|Quan"
- then: "*|Aleshores|Cal"
- and: "*|I"
- but: "*|Però"
-"cy-GB":
- name: Welsh
- native: Cymraeg
- background: Cefndir
- feature: Arwedd
- scenario: Scenario
- scenario_outline: Scenario Amlinellol
- examples: Enghreifftiau
- given: "*|Anrhegedig a"
- when: "*|Pryd"
- then: "*|Yna"
- and: "*|A"
- but: "*|Ond"
-"cs":
- name: Czech
- native: Česky
- feature: Požadavek
- background: Pozadí|Kontext
- scenario: Scénář
- scenario_outline: Náčrt Scénáře|Osnova scénáře
- examples: Příklady
- given: "*|Pokud"
- when: "*|Když"
- then: "*|Pak"
- and: "*|A také|A"
- but: "*|Ale"
-"da":
- name: Danish
- native: dansk
- feature: Egenskab
- background: Baggrund
- scenario: Scenarie
- scenario_outline: Abstrakt Scenario
- examples: Eksempler
- given: "*|Givet"
- when: "*|Når"
- then: "*|Så"
- and: "*|Og"
- but: "*|Men"
-"de":
- name: German
- native: Deutsch
- feature: Funktionalität
- background: Grundlage
- scenario: Szenario
- scenario_outline: Szenariogrundriss
- examples: Beispiele
- given: "*|Angenommen|Gegeben sei"
- when: "*|Wenn"
- then: "*|Dann"
- and: "*|Und"
- but: "*|Aber"
-"en-au":
- name: Australian
- native: Australian
- feature: Crikey
- background: Background
- scenario: Mate
- scenario_outline: Blokes
- examples: Cobber
- given: "*|Ya know how"
- when: "*|When"
- then: "*|Ya gotta"
- and: "*|N"
- but: "*|Cept"
-"en-lol":
- name: LOLCAT
- native: LOLCAT
- feature: OH HAI
- background: B4
- scenario: MISHUN
- scenario_outline: MISHUN SRSLY
- examples: EXAMPLZ
- given: "*|I CAN HAZ"
- when: "*|WEN"
- then: "*|DEN"
- and: "*|AN"
- but: "*|BUT"
-"en-pirate":
- name: Pirate
- native: Pirate
- feature: Ahoy matey!
- background: Yo-ho-ho
- scenario: Heave to
- scenario_outline: Shiver me timbers
- examples: Dead men tell no tales
- given: "*|Gangway!"
- when: "*|Blimey!"
- then: "*|Let go and haul"
- and: "*|Aye"
- but: "*|Avast!"
-"en-Scouse":
- name: Scouse
- native: Scouse
- feature: Feature
- background: "Dis is what went down"
- scenario: "The thing of it is"
- scenario_outline: "Wharrimean is"
- examples: Examples
- given: "*|Givun|Youse know when youse got"
- when: "*|Wun|Youse know like when"
- then: "*|Dun|Den youse gotta"
- and: "*|An"
- but: "*|Buh"
-"en-tx":
- name: Texan
- native: Texan
- feature: Feature
- background: Background
- scenario: Scenario
- scenario_outline: All y'all
- examples: Examples
- given: "*|Given y'all"
- when: "*|When y'all"
- then: "*|Then y'all"
- and: "*|And y'all"
- but: "*|But y'all"
-"eo":
- name: Esperanto
- native: Esperanto
- feature: Trajto
- background: Fono
- scenario: Scenaro
- scenario_outline: Konturo de la scenaro
- examples: Ekzemploj
- given: "*|Donitaĵo"
- when: "*|Se"
- then: "*|Do"
- and: "*|Kaj"
- but: "*|Sed"
-"es":
- name: Spanish
- native: español
- background: Antecedentes
- feature: Característica
- scenario: Escenario
- scenario_outline: Esquema del escenario
- examples: Ejemplos
- given: "*|Dado|Dada|Dados|Dadas"
- when: "*|Cuando"
- then: "*|Entonces"
- and: "*|Y"
- but: "*|Pero"
-"et":
- name: Estonian
- native: eesti keel
- feature: Omadus
- background: Taust
- scenario: Stsenaarium
- scenario_outline: Raamstsenaarium
- examples: Juhtumid
- given: "*|Eeldades"
- when: "*|Kui"
- then: "*|Siis"
- and: "*|Ja"
- but: "*|Kuid"
-"fi":
- name: Finnish
- native: suomi
- feature: Ominaisuus
- background: Tausta
- scenario: Tapaus
- scenario_outline: Tapausaihio
- examples: Tapaukset
- given: "*|Oletetaan"
- when: "*|Kun"
- then: "*|Niin"
- and: "*|Ja"
- but: "*|Mutta"
-"fr":
- name: French
- native: français
- feature: Fonctionnalité
- background: Contexte
- scenario: Scénario
- scenario_outline: Plan du scénario|Plan du Scénario
- examples: Exemples
- given: "*|Soit|Etant donné|Etant donnée|Etant donnés|Etant données|Étant donné|Étant donnée|Étant donnés|Étant données"
- when: "*|Quand|Lorsque|Lorsqu'<"
- then: "*|Alors"
- and: "*|Et"
- but: "*|Mais"
-"he":
- name: Hebrew
- native: עברית
- feature: תכונה
- background: רקע
- scenario: תרחיש
- scenario_outline: תבנית תרחיש
- examples: דוגמאות
- given: "*|בהינתן"
- when: "*|כאשר"
- then: "*|אז|אזי"
- and: "*|וגם"
- but: "*|אבל"
-"hr":
- name: Croatian
- native: hrvatski
- feature: Osobina|Mogućnost|Mogucnost
- background: Pozadina
- scenario: Scenarij
- scenario_outline: Skica|Koncept
- examples: Primjeri|Scenariji
- given: "*|Zadan|Zadani|Zadano"
- when: "*|Kada|Kad"
- then: "*|Onda"
- and: "*|I"
- but: "*|Ali"
-"hu":
- name: Hungarian
- native: magyar
- feature: Jellemző
- background: Háttér
- scenario: Forgatókönyv
- scenario_outline: Forgatókönyv vázlat
- examples: Példák
- given: "*|Amennyiben|Adott"
- when: "*|Majd|Ha|Amikor"
- then: "*|Akkor"
- and: "*|És"
- but: "*|De"
-"id":
- name: Indonesian
- native: Bahasa Indonesia
- feature: Fitur
- background: Dasar
- scenario: Skenario
- scenario_outline: Skenario konsep
- examples: Contoh
- given: "*|Dengan"
- when: "*|Ketika"
- then: "*|Maka"
- and: "*|Dan"
- but: "*|Tapi"
-"is":
- name: Icelandic
- native: Íslenska
- feature: Eiginleiki
- background: Bakgrunnur
- scenario: Atburðarás
- scenario_outline: Lýsing Atburðarásar|Lýsing Dæma
- examples: Dæmi|Atburðarásir
- given: "*|Ef"
- when: "*|Þegar"
- then: "*|Þá"
- and: "*|Og"
- but: "*|En"
-"it":
- name: Italian
- native: italiano
- feature: Funzionalità
- background: Contesto
- scenario: Scenario
- scenario_outline: Schema dello scenario
- examples: Esempi
- given: "*|Dato|Data|Dati|Date"
- when: "*|Quando"
- then: "*|Allora"
- and: "*|E"
- but: "*|Ma"
-"ja":
- name: Japanese
- native: 日本語
- feature: フィーチャ|機能
- background: 背景
- scenario: シナリオ
- scenario_outline: シナリオアウトライン|シナリオテンプレート|テンプレ|シナリオテンプレ
- examples: 例|サンプル
- given: "*|前提<"
- when: "*|もし<"
- then: "*|ならば<"
- and: "*|かつ<"
- but: "*|しかし<|但し<|ただし<"
-"ko":
- name: Korean
- native: 한국어
- background: 배경
- feature: 기능
- scenario: 시나리오
- scenario_outline: 시나리오 개요
- examples: 예
- given: "*|조건<|먼저<"
- when: "*|만일<|만약<"
- then: "*|그러면<"
- and: "*|그리고<"
- but: "*|하지만<|단<"
-"lt":
- name: Lithuanian
- native: lietuvių kalba
- feature: Savybė
- background: Kontekstas
- scenario: Scenarijus
- scenario_outline: Scenarijaus šablonas
- examples: Pavyzdžiai|Scenarijai|Variantai
- given: "*|Duota"
- when: "*|Kai"
- then: "*|Tada"
- and: "*|Ir"
- but: "*|Bet"
-"lu":
- name: Luxemburgish
- native: Lëtzebuergesch
- feature: Funktionalitéit
- background: Hannergrond
- scenario: Szenario
- scenario_outline: Plang vum Szenario
- examples: Beispiller
- given: "*|ugeholl"
- when: "*|wann"
- then: "*|dann"
- and: "*|an|a"
- but: "*|awer|mä"
-"lv":
- name: Latvian
- native: latviešu
- feature: Funkcionalitāte|Fīča
- background: Konteksts|Situācija
- scenario: Scenārijs
- scenario_outline: Scenārijs pēc parauga
- examples: Piemēri|Paraugs
- given: "*|Kad"
- when: "*|Ja"
- then: "*|Tad"
- and: "*|Un"
- but: "*|Bet"
-"nl":
- name: Dutch
- native: Nederlands
- feature: Functionaliteit
- background: Achtergrond
- scenario: Scenario
- scenario_outline: Abstract Scenario
- examples: Voorbeelden
- given: "*|Gegeven|Stel"
- when: "*|Als"
- then: "*|Dan"
- and: "*|En"
- but: "*|Maar"
-"no":
- name: Norwegian
- native: norsk
- feature: Egenskap
- background: Bakgrunn
- scenario: Scenario
- scenario_outline: Scenariomal|Abstrakt Scenario
- examples: Eksempler
- given: "*|Gitt"
- when: "*|Når"
- then: "*|Så"
- and: "*|Og"
- but: "*|Men"
-"pl":
- name: Polish
- native: polski
- feature: Właściwość
- background: Założenia
- scenario: Scenariusz
- scenario_outline: Szablon scenariusza
- examples: Przykłady
- given: "*|Zakładając|Mając"
- when: "*|Jeżeli|Jeśli"
- then: "*|Wtedy"
- and: "*|Oraz|I"
- but: "*|Ale"
-"pt":
- name: Portuguese
- native: português
- background: Contexto
- feature: Funcionalidade
- scenario: Cenário|Cenario
- scenario_outline: Esquema do Cenário|Esquema do Cenario
- examples: Exemplos
- given: "*|Dado|Dada|Dados|Dadas"
- when: "*|Quando"
- then: "*|Então|Entao"
- and: "*|E"
- but: "*|Mas"
-"ro":
- name: Romanian
- native: română
- background: Context
- feature: Functionalitate|Funcționalitate|Funcţionalitate
- scenario: Scenariu
- scenario_outline: Structura scenariu|Structură scenariu
- examples: Exemple
- given: "*|Date fiind|Dat fiind|Dati fiind|Dați fiind|Daţi fiind"
- when: "*|Cand|Când"
- then: "*|Atunci"
- and: "*|Si|Și|Şi"
- but: "*|Dar"
-"ru":
- name: Russian
- native: русский
- feature: Функция|Функционал|Свойство
- background: Предыстория|Контекст
- scenario: Сценарий
- scenario_outline: Структура сценария
- examples: Примеры
- given: "*|Допустим|Дано|Пусть"
- when: "*|Если|Когда"
- then: "*|То|Тогда"
- and: "*|И|К тому же"
- but: "*|Но|А"
-"sv":
- name: Swedish
- native: Svenska
- feature: Egenskap
- background: Bakgrund
- scenario: Scenario
- scenario_outline: Abstrakt Scenario|Scenariomall
- examples: Exempel
- given: "*|Givet"
- when: "*|När"
- then: "*|Så"
- and: "*|Och"
- but: "*|Men"
-"sk":
- name: Slovak
- native: Slovensky
- feature: Požiadavka
- background: Pozadie
- scenario: Scenár
- scenario_outline: Náčrt Scenáru
- examples: Príklady
- given: "*|Pokiaľ"
- when: "*|Keď"
- then: "*|Tak"
- and: "*|A"
- but: "*|Ale"
-"sr-Latn":
- name: Serbian (Latin)
- native: Srpski (Latinica)
- feature: Funkcionalnost|Mogućnost|Mogucnost|Osobina
- background: Kontekst|Osnova|Pozadina
- scenario: Scenario|Primer
- scenario_outline: Struktura scenarija|Skica|Koncept
- examples: Primeri|Scenariji
- given: "*|Zadato|Zadate|Zatati"
- when: "*|Kada|Kad"
- then: "*|Onda"
- and: "*|I"
- but: "*|Ali"
-"sr-Cyrl":
- name: Serbian
- native: Српски
- feature: Функционалност|Могућност|Особина
- background: Контекст|Основа|Позадина
- scenario: Сценарио|Пример
- scenario_outline: Структура сценарија|Скица|Концепт
- examples: Примери|Сценарији
- given: "*|Задато|Задате|Задати"
- when: "*|Када|Кад"
- then: "*|Онда"
- and: "*|И"
- but: "*|Али"
-"tr":
- name: Turkish
- native: Türkçe
- feature: Özellik
- background: Geçmiş
- scenario: Senaryo
- scenario_outline: Senaryo taslağı
- examples: Örnekler
- given: "*|Diyelim ki"
- when: "*|Eğer ki"
- then: "*|O zaman"
- and: "*|Ve"
- but: "*|Fakat|Ama"
-"uk":
- name: Ukrainian
- native: Українська
- feature: Функціонал
- background: Передумова
- scenario: Сценарій
- scenario_outline: Структура сценарію
- examples: Приклади
- given: "*|Припустимо|Припустимо, що|Нехай|Дано"
- when: "*|Якщо|Коли"
- then: "*|То|Тоді"
- and: "*|І|А також|Та"
- but: "*|Але"
-"uz":
- name: Uzbek
- native: Узбекча
- feature: Функционал
- background: Тарих
- scenario: Сценарий
- scenario_outline: Сценарий структураси
- examples: Мисоллар
- given: "*|Агар"
- when: "*|Агар"
- then: "*|Унда"
- and: "*|Ва"
- but: "*|Лекин|Бирок|Аммо"
-"vi":
- name: Vietnamese
- native: Tiếng Việt
- feature: Tính năng
- background: Bối cảnh
- scenario: Tình huống|Kịch bản
- scenario_outline: Khung tình huống|Khung kịch bản
- examples: Dữ liệu
- given: "*|Biết|Cho"
- when: "*|Khi"
- then: "*|Thì"
- and: "*|Và"
- but: "*|Nhưng"
-"zh-CN":
- name: Chinese simplified
- native: 简体中文
- feature: 功能
- background: 背景
- scenario: 场景
- scenario_outline: 场景大纲
- examples: 例子
- given: "*|假如<"
- when: "*|当<"
- then: "*|那么<"
- and: "*|而且<"
- but: "*|但是<"
-"zh-TW":
- name: Chinese traditional
- native: 繁體中文
- feature: 功能
- background: 背景
- scenario: 場景|劇本
- scenario_outline: 場景大綱|劇本大綱
- examples: 例子
- given: "*|假設<"
- when: "*|當<"
- then: "*|那麼<"
- and: "*|而且<|並且<"
- but: "*|但是<"
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/GherkinTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/GherkinTest.php
deleted file mode 100644
index 9e5c0cb5e..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/GherkinTest.php
+++ /dev/null
@@ -1,184 +0,0 @@
-getCustomFilterMock();
- $customFilter2 = $this->getCustomFilterMock();
-
- $gherkin = new Gherkin();
- $gherkin->addLoader($loader = $this->getLoaderMock());
- $gherkin->addFilter($nameFilter = $this->getNameFilterMock());
- $gherkin->addFilter($tagFilter = $this->getTagFilterMock());
-
- $scenario = new ScenarioNode(null, array(), array(), null, null);
- $feature = new FeatureNode(null, null, array(), null, array($scenario), null, null, null, null);
-
- $loader
- ->expects($this->once())
- ->method('supports')
- ->with($resource = 'some/feature/resource')
- ->will($this->returnValue(true));
- $loader
- ->expects($this->once())
- ->method('load')
- ->with($resource)
- ->will($this->returnValue(array($feature)));
-
- $nameFilter
- ->expects($this->once())
- ->method('filterFeature')
- ->with($this->identicalTo($feature))
- ->will($this->returnValue($feature));
- $tagFilter
- ->expects($this->once())
- ->method('filterFeature')
- ->with($this->identicalTo($feature))
- ->will($this->returnValue($feature));
- $customFilter1
- ->expects($this->once())
- ->method('filterFeature')
- ->with($this->identicalTo($feature))
- ->will($this->returnValue($feature));
- $customFilter2
- ->expects($this->once())
- ->method('filterFeature')
- ->with($this->identicalTo($feature))
- ->will($this->returnValue($feature));
-
- $features = $gherkin->load($resource, array($customFilter1, $customFilter2));
- $this->assertEquals(1, count($features));
-
- $scenarios = $features[0]->getScenarios();
- $this->assertEquals(1, count($scenarios));
- $this->assertSame($scenario, $scenarios[0]);
- }
-
- public function testNotFoundLoader()
- {
- $gherkin = new Gherkin();
-
- $this->assertEquals(array(), $gherkin->load('some/feature/resource'));
- }
-
- public function testLoaderFiltersFeatures()
- {
- $gherkin = new Gherkin();
- $gherkin->addLoader($loader = $this->getLoaderMock());
- $gherkin->addFilter($nameFilter = $this->getNameFilterMock());
-
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, null);
-
- $loader
- ->expects($this->once())
- ->method('supports')
- ->with($resource = 'some/feature/resource')
- ->will($this->returnValue(true));
- $loader
- ->expects($this->once())
- ->method('load')
- ->with($resource)
- ->will($this->returnValue(array($feature)));
-
- $nameFilter
- ->expects($this->once())
- ->method('filterFeature')
- ->with($this->identicalTo($feature))
- ->will($this->returnValue($feature));
- $nameFilter
- ->expects($this->once())
- ->method('isFeatureMatch')
- ->with($this->identicalTo($feature))
- ->will($this->returnValue(false));
-
- $features = $gherkin->load($resource);
- $this->assertEquals(0, count($features));
- }
-
- public function testSetFiltersOverridesAllFilters()
- {
- $gherkin = new Gherkin();
- $gherkin->addLoader($loader = $this->getLoaderMock());
- $gherkin->addFilter($nameFilter = $this->getNameFilterMock());
- $gherkin->setFilters(array());
-
- $feature = new FeatureNode(null, null, array(), null, array(), null, null, null, null);
-
- $loader
- ->expects($this->once())
- ->method('supports')
- ->with($resource = 'some/feature/resource')
- ->will($this->returnValue(true));
- $loader
- ->expects($this->once())
- ->method('load')
- ->with($resource)
- ->will($this->returnValue(array($feature)));
-
- $nameFilter
- ->expects($this->never())
- ->method('filterFeature');
- $nameFilter
- ->expects($this->never())
- ->method('isFeatureMatch');
-
- $features = $gherkin->load($resource);
- $this->assertEquals(1, count($features));
- }
-
- public function testSetBasePath()
- {
- $gherkin = new Gherkin();
- $gherkin->addLoader($loader1 = $this->getLoaderMock());
- $gherkin->addLoader($loader2 = $this->getLoaderMock());
-
- $loader1
- ->expects($this->once())
- ->method('setBasePath')
- ->with($basePath = '/base/path')
- ->will($this->returnValue(null));
-
- $loader2
- ->expects($this->once())
- ->method('setBasePath')
- ->with($basePath = '/base/path')
- ->will($this->returnValue(null));
-
- $gherkin->setBasePath($basePath);
- }
-
- protected function getLoaderMock()
- {
- return $this->getMockBuilder('Behat\Gherkin\Loader\GherkinFileLoader')
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- protected function getCustomFilterMock()
- {
- return $this->getMockBuilder('Behat\Gherkin\Filter\FilterInterface')
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- protected function getNameFilterMock()
- {
- return $this->getMockBuilder('Behat\Gherkin\Filter\NameFilter')
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- protected function getTagFilterMock()
- {
- return $this->getMockBuilder('Behat\Gherkin\Filter\TagFilter')
- ->disableOriginalConstructor()
- ->getMock();
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php
deleted file mode 100644
index e6c18dc94..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-getKeywordsArray());
- }
-
- protected function getKeywordsArray()
- {
- return array(
- 'with_special_chars' => array(
- 'and' => 'And/foo',
- 'background' => 'Background.',
- 'but' => 'But[',
- 'examples' => 'Examples|Scenarios',
- 'feature' => 'Feature|Business Need|Ability',
- 'given' => 'Given',
- 'name' => 'English',
- 'native' => 'English',
- 'scenario' => 'Scenario',
- 'scenario_outline' => 'Scenario Outline|Scenario Template',
- 'then' => 'Then',
- 'when' => 'When',
- ),
- );
- }
-
- protected function getSteps($keywords, $text, &$line, $keywordType)
- {
- $steps = array();
- foreach (explode('|', $keywords) as $keyword) {
- if (false !== mb_strpos($keyword, '<')) {
- $keyword = mb_substr($keyword, 0, -1);
- }
-
- $steps[] = new StepNode($keyword, $text, array(), $line++, $keywordType);
- }
-
- return $steps;
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php
deleted file mode 100644
index bf10cb391..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-keywords = new ArrayKeywords(array(
- 'en' => array(
- 'feature' => 'Feature',
- 'background' => 'Background',
- 'scenario' => 'Scenario',
- 'scenario_outline' => 'Scenario Outline|Scenario Template',
- 'examples' => 'Examples|Scenarios',
- 'given' => 'Given',
- 'when' => 'When',
- 'then' => 'Then',
- 'and' => 'And',
- 'but' => 'But'
- ),
- 'ru' => array(
- 'feature' => 'Функционал|Фича',
- 'background' => 'Предыстория|Бэкграунд',
- 'scenario' => 'Сценарий|История',
- 'scenario_outline' => 'Структура сценария|Аутлайн',
- 'examples' => 'Значения',
- 'given' => 'Допустим',
- 'when' => 'Если|@',
- 'then' => 'То',
- 'and' => 'И',
- 'but' => 'Но'
- )
- ));
- }
-
- public function testEnKeywordsDumper()
- {
- $dumper = new KeywordsDumper($this->keywords);
-
- $dumped = $dumper->dump('en');
- $etalon = <<
- And there is agent
- When I erase agent 's memory
- Then there should be agent
- But there should not be agent
-
- (Examples|Scenarios):
- | agent1 | agent2 |
- | D | M |
-GHERKIN;
-
- $this->assertEquals($etalon, $dumped);
- }
-
- public function testRuKeywordsDumper()
- {
- $dumper = new KeywordsDumper($this->keywords);
-
- $dumped = $dumper->dump('ru');
- $etalon = <<
- И there is agent
- (Если|@) I erase agent 's memory
- То there should be agent
- Но there should not be agent
-
- Значения:
- | agent1 | agent2 |
- | D | M |
-GHERKIN;
-
- $this->assertEquals($etalon, $dumped);
- }
-
- public function testRuKeywordsCustomKeywordsDumper()
- {
- $dumper = new KeywordsDumper($this->keywords);
- $dumper->setKeywordsDumperFunction(function ($keywords) {
- return ''.implode(', ', $keywords).'';
- });
-
- $dumped = $dumper->dump('ru');
- $etalon = <<Функционал, Фича: Internal operations
- In order to stay secret
- As a secret organization
- We need to be able to erase past agents' memory
-
- Предыстория, Бэкграунд:
- Допустим there is agent A
- И there is agent B
-
- Сценарий, История: Erasing agent memory
- Допустим there is agent J
- И there is agent K
- Если, @ I erase agent K's memory
- То there should be agent J
- Но there should not be agent K
-
- Структура сценария, Аутлайн: Erasing other agents' memory
- Допустим there is agent
- И there is agent
- Если, @ I erase agent 's memory
- То there should be agent
- Но there should not be agent
-
- Значения:
- | agent1 | agent2 |
- | D | M |
-GHERKIN;
-
- $this->assertEquals($etalon, $dumped);
- }
-
- public function testExtendedVersionDumper()
- {
- $dumper = new KeywordsDumper($this->keywords);
-
- $dumped = $dumper->dump('ru', false);
- $etalon = array(
- <<
- И there is agent
- Если I erase agent 's memory
- @ I erase agent 's memory
- То there should be agent
- Но there should not be agent
-
- Значения:
- | agent1 | agent2 |
- | D | M |
-
- Аутлайн: Erasing other agents' memory
- Допустим there is agent
- И there is agent
- Если I erase agent 's memory
- @ I erase agent 's memory
- То there should be agent
- Но there should not be agent
-
- Значения:
- | agent1 | agent2 |
- | D | M |
-GHERKIN
- , <<
- И there is agent
- Если I erase agent 's memory
- @ I erase agent 's memory
- То there should be agent
- Но there should not be agent
-
- Значения:
- | agent1 | agent2 |
- | D | M |
-
- Аутлайн: Erasing other agents' memory
- Допустим there is agent
- И there is agent
- Если I erase agent 's memory
- @ I erase agent 's memory
- То there should be agent
- Но there should not be agent
-
- Значения:
- | agent1 | agent2 |
- | D | M |
-GHERKIN
- );
-
- $this->assertEquals($etalon, $dumped);
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php
deleted file mode 100644
index fdfc65e29..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php
+++ /dev/null
@@ -1,139 +0,0 @@
-getKeywords();
- $lexer = new Lexer($keywords);
- $parser = new Parser($lexer);
- $dumper = new KeywordsDumper($keywords);
- $keywordsArray = $this->getKeywordsArray();
-
- // Remove languages with repeated keywords
- unset($keywordsArray['en-old'], $keywordsArray['uz']);
-
- $data = array();
- foreach ($keywordsArray as $lang => $i18nKeywords) {
- $features = array();
- foreach (explode('|', $i18nKeywords['feature']) as $transNum => $featureKeyword) {
- $line = 1;
- if ('en' !== $lang) {
- $line = 2;
- }
-
- $featureLine = $line;
- $line += 5;
-
- $keywords = explode('|', $i18nKeywords['background']);
- $backgroundLine = $line;
- $line += 1;
- $background = new BackgroundNode(null, array_merge(
- $this->getSteps($i18nKeywords['given'], 'there is agent A', $line, 'Given'),
- $this->getSteps($i18nKeywords['and'], 'there is agent B', $line, 'Given')
- ), $keywords[0], $backgroundLine);
-
- $line += 1;
-
- $scenarios = array();
-
- foreach (explode('|', $i18nKeywords['scenario']) as $scenarioKeyword) {
- $scenarioLine = $line;
- $line += 1;
-
- $steps = array_merge(
- $this->getSteps($i18nKeywords['given'], 'there is agent J', $line, 'Given'),
- $this->getSteps($i18nKeywords['and'], 'there is agent K', $line, 'Given'),
- $this->getSteps($i18nKeywords['when'], 'I erase agent K\'s memory', $line, 'When'),
- $this->getSteps($i18nKeywords['then'], 'there should be agent J', $line, 'Then'),
- $this->getSteps($i18nKeywords['but'], 'there should not be agent K', $line, 'Then')
- );
-
- $scenarios[] = new ScenarioNode('Erasing agent memory', array(), $steps, $scenarioKeyword, $scenarioLine);
- $line += 1;
- }
- foreach (explode('|', $i18nKeywords['scenario_outline']) as $outlineKeyword) {
- $outlineLine = $line;
- $line += 1;
-
- $steps = array_merge(
- $this->getSteps($i18nKeywords['given'], 'there is agent ', $line, 'Given'),
- $this->getSteps($i18nKeywords['and'], 'there is agent ', $line, 'Given'),
- $this->getSteps($i18nKeywords['when'], 'I erase agent \'s memory', $line, 'When'),
- $this->getSteps($i18nKeywords['then'], 'there should be agent ', $line, 'Then'),
- $this->getSteps($i18nKeywords['but'], 'there should not be agent ', $line, 'Then')
- );
- $line += 1;
-
- $keywords = explode('|', $i18nKeywords['examples']);
- $table = new ExampleTableNode(array(
- ++$line => array('agent1', 'agent2'),
- ++$line => array('D', 'M')
- ), $keywords[0]);
- $line += 1;
-
- $scenarios[] = new OutlineNode('Erasing other agents\' memory', array(), $steps, $table, $outlineKeyword, $outlineLine);
- $line += 1;
- }
-
- $features[] = new FeatureNode(
- 'Internal operations',
- <<dump($lang, false, true);
- $parsed = array();
- try {
- foreach ($dumped as $num => $dumpedFeature) {
- $parsed[] = $parser->parse($dumpedFeature, $lang . '_' . ($num + 1) . '.feature');
- }
- } catch (\Exception $e) {
- throw new \Exception($e->getMessage() . ":\n" . json_encode($dumped), 0, $e);
- }
-
- $data[] = array($lang, $features, $parsed);
- }
-
- return $data;
- }
-
- /**
- * @dataProvider translationTestDataProvider
- *
- * @param string $language language name
- * @param array $etalon etalon features (to test against)
- * @param array $features array of parsed feature(s)
- */
- public function testTranslation($language, array $etalon, array $features)
- {
- $this->assertEquals($etalon, $features);
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/ArrayLoaderTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/ArrayLoaderTest.php
deleted file mode 100644
index 697d1d3d8..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/ArrayLoaderTest.php
+++ /dev/null
@@ -1,379 +0,0 @@
-loader = new ArrayLoader();
- }
-
- public function testSupports()
- {
- $this->assertFalse($this->loader->supports(__DIR__));
- $this->assertFalse($this->loader->supports(__FILE__));
- $this->assertFalse($this->loader->supports('string'));
- $this->assertFalse($this->loader->supports(array('wrong_root')));
- $this->assertFalse($this->loader->supports(array('features')));
- $this->assertTrue($this->loader->supports(array('features' => array())));
- $this->assertTrue($this->loader->supports(array('feature' => array())));
- }
-
- public function testLoadEmpty()
- {
- $this->assertEquals(array(), $this->loader->load(array('features' => array())));
- }
-
- public function testLoadFeatures()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- 'title' => 'First feature',
- 'line' => 3,
- ),
- array(
- 'description' => 'Second feature description',
- 'language' => 'ru',
- 'tags' => array('some', 'tags')
- )
- ),
- ));
-
- $this->assertEquals(2, count($features));
-
- $this->assertEquals(3, $features[0]->getLine());
- $this->assertEquals('First feature', $features[0]->getTitle());
- $this->assertNull($features[0]->getDescription());
- $this->assertNull($features[0]->getFile());
- $this->assertEquals('en', $features[0]->getLanguage());
- $this->assertFalse($features[0]->hasTags());
-
- $this->assertEquals(1, $features[1]->getLine());
- $this->assertNull($features[1]->getTitle());
- $this->assertEquals('Second feature description', $features[1]->getDescription());
- $this->assertNull($features[1]->getFile());
- $this->assertEquals('ru', $features[1]->getLanguage());
- $this->assertEquals(array('some', 'tags'), $features[1]->getTags());
- }
-
- public function testLoadScenarios()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- 'title' => 'Feature',
- 'scenarios' => array(
- array(
- 'title' => 'First scenario',
- 'line' => 2
- ),
- array(
- 'tags' => array('second', 'scenario', 'tags')
- ),
- array(
- 'tags' => array('third', 'scenario'),
- 'line' => 3
- )
- )
- )
- ),
- ));
-
- $this->assertEquals(1, count($features));
-
- $scenarios = $features[0]->getScenarios();
-
- $this->assertEquals(3, count($scenarios));
-
- $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[0]);
- $this->assertEquals('First scenario', $scenarios[0]->getTitle());
- $this->assertFalse($scenarios[0]->hasTags());
- $this->assertEquals(2, $scenarios[0]->getLine());
-
- $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[1]);
- $this->assertNull($scenarios[1]->getTitle());
- $this->assertEquals(array('second', 'scenario', 'tags'), $scenarios[1]->getTags());
- $this->assertEquals(1, $scenarios[1]->getLine());
-
- $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[2]);
- $this->assertNull($scenarios[2]->getTitle());
- $this->assertEquals(array('third', 'scenario'), $scenarios[2]->getTags());
- $this->assertEquals(3, $scenarios[2]->getLine());
- }
-
- public function testLoadOutline()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- 'title' => 'Feature',
- 'scenarios' => array(
- array(
- 'type' => 'outline',
- 'title' => 'First outline',
- 'line' => 2
- ),
- array(
- 'type' => 'outline',
- 'tags' => array('second', 'outline', 'tags')
- )
- )
- )
- ),
- ));
-
- $this->assertEquals(1, count($features));
-
- $outlines = $features[0]->getScenarios();
-
- $this->assertEquals(2, count($outlines));
-
- $this->assertInstanceOf('Behat\Gherkin\Node\OutlineNode', $outlines[0]);
- $this->assertEquals('First outline', $outlines[0]->getTitle());
- $this->assertFalse($outlines[0]->hasTags());
- $this->assertEquals(2, $outlines[0]->getLine());
-
- $this->assertInstanceOf('Behat\Gherkin\Node\OutlineNode', $outlines[1]);
- $this->assertNull($outlines[1]->getTitle());
- $this->assertEquals(array('second', 'outline', 'tags'), $outlines[1]->getTags());
- $this->assertEquals(1, $outlines[1]->getLine());
- }
-
- public function testOutlineExamples()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- 'title' => 'Feature',
- 'scenarios' => array(
- array(
- 'type' => 'outline',
- 'title' => 'First outline',
- 'line' => 2,
- 'examples' => array(
- array('user', 'pass'),
- array('ever', 'sdsd'),
- array('anto', 'fdfd')
- )
- ),
- array(
- 'type' => 'outline',
- 'tags' => array('second', 'outline', 'tags')
- )
- )
- )
- ),
- ));
-
- $this->assertEquals(1, count($features));
-
- $scenarios = $features[0]->getScenarios();
- $scenario = $scenarios[0];
-
- $this->assertEquals(
- array(array('user' => 'ever', 'pass' => 'sdsd'), array('user' => 'anto', 'pass' => 'fdfd')),
- $scenario->getExampleTable()->getHash()
- );
- }
-
- public function testLoadBackground()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- ),
- array(
- 'background' => array()
- ),
- array(
- 'background' => array(
- 'line' => 2
- )
- ),
- )
- ));
-
- $this->assertEquals(3, count($features));
-
- $this->assertFalse($features[0]->hasBackground());
- $this->assertTrue($features[1]->hasBackground());
- $this->assertEquals(0, $features[1]->getBackground()->getLine());
- $this->assertTrue($features[2]->hasBackground());
- $this->assertEquals(2, $features[2]->getBackground()->getLine());
- }
-
- public function testLoadSteps()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- 'background' => array(
- 'steps' => array(
- array('type' => 'Gangway!', 'keyword_type' => 'Given', 'text' => 'bg step 1', 'line' => 3),
- array('type' => 'Blimey!', 'keyword_type' => 'When', 'text' => 'bg step 2')
- )
- ),
- 'scenarios' => array(
- array(
- 'title' => 'Scenario',
- 'steps' => array(
- array('type' => 'Gangway!', 'keyword_type' => 'Given', 'text' => 'sc step 1'),
- array('type' => 'Blimey!', 'keyword_type' => 'When', 'text' => 'sc step 2')
- )
- ),
- array(
- 'title' => 'Outline',
- 'type' => 'outline',
- 'steps' => array(
- array('type' => 'Gangway!', 'keyword_type' => 'Given', 'text' => 'out step 1'),
- array('type' => 'Blimey!', 'keyword_type' => 'When', 'text' => 'out step 2')
- )
- )
- )
- )
- )
- ));
-
- $background = $features[0]->getBackground();
- $this->assertTrue($background->hasSteps());
- $this->assertEquals(2, count($background->getSteps()));
- $steps = $background->getSteps();
- $this->assertEquals('Gangway!', $steps[0]->getType());
- $this->assertEquals('Gangway!', $steps[0]->getKeyword());
- $this->assertEquals('Given', $steps[0]->getKeywordType());
- $this->assertEquals('bg step 1', $steps[0]->getText());
- $this->assertEquals(3, $steps[0]->getLine());
- $this->assertEquals('Blimey!', $steps[1]->getType());
- $this->assertEquals('Blimey!', $steps[1]->getKeyword());
- $this->assertEquals('When', $steps[1]->getKeywordType());
- $this->assertEquals('bg step 2', $steps[1]->getText());
- $this->assertEquals(1, $steps[1]->getLine());
-
- $scenarios = $features[0]->getScenarios();
-
- $scenario = $scenarios[0];
- $this->assertTrue($scenario->hasSteps());
- $this->assertEquals(2, count($scenario->getSteps()));
- $steps = $scenario->getSteps();
- $this->assertEquals('Gangway!', $steps[0]->getType());
- $this->assertEquals('Gangway!', $steps[0]->getKeyword());
- $this->assertEquals('Given', $steps[0]->getKeywordType());
- $this->assertEquals('sc step 1', $steps[0]->getText());
- $this->assertEquals(0, $steps[0]->getLine());
- $this->assertEquals('Blimey!', $steps[1]->getType());
- $this->assertEquals('Blimey!', $steps[1]->getKeyword());
- $this->assertEquals('When', $steps[1]->getKeywordType());
- $this->assertEquals('sc step 2', $steps[1]->getText());
- $this->assertEquals(1, $steps[1]->getLine());
-
- $outline = $scenarios[1];
- $this->assertTrue($outline->hasSteps());
- $this->assertEquals(2, count($outline->getSteps()));
- $steps = $outline->getSteps();
- $this->assertEquals('Gangway!', $steps[0]->getType());
- $this->assertEquals('Gangway!', $steps[0]->getKeyword());
- $this->assertEquals('Given', $steps[0]->getKeywordType());
- $this->assertEquals('out step 1', $steps[0]->getText());
- $this->assertEquals(0, $steps[0]->getLine());
- $this->assertEquals('Blimey!', $steps[1]->getType());
- $this->assertEquals('Blimey!', $steps[1]->getKeyword());
- $this->assertEquals('When', $steps[1]->getKeywordType());
- $this->assertEquals('out step 2', $steps[1]->getText());
- $this->assertEquals(1, $steps[1]->getLine());
- }
-
- public function testLoadStepArguments()
- {
- $features = $this->loader->load(array(
- 'features' => array(
- array(
- 'background' => array(
- 'steps' => array(
- array(
- 'type' => 'Gangway!', 'keyword_type' => 'Given', 'text' => 'step with table argument',
- 'arguments' => array(
- array(
- 'type' => 'table',
- 'rows' => array(
- array('key', 'val'),
- array(1, 2),
- array(3, 4)
- )
- )
- )
- ),
- array(
- 'type' => 'Blimey!', 'keyword_type' => 'When', 'text' => 'step with pystring argument',
- 'arguments' => array(
- array(
- 'type' => 'pystring',
- 'text' => ' some text',
- )
- )
- ),
- array(
- 'type' => 'Let go and haul', 'keyword_type' => 'Then', 'text' => '2nd step with pystring argument',
- 'arguments' => array(
- array(
- 'type' => 'pystring',
- 'text' => 'some text',
- )
- )
- )
- )
- )
- )
- )
- ));
-
- $background = $features[0]->getBackground();
-
- $this->assertTrue($background->hasSteps());
-
- $steps = $background->getSteps();
-
- $this->assertEquals(3, count($steps));
-
- $arguments = $steps[0]->getArguments();
- $this->assertEquals('Gangway!', $steps[0]->getType());
- $this->assertEquals('Gangway!', $steps[0]->getKeyword());
- $this->assertEquals('Given', $steps[0]->getKeywordType());
- $this->assertEquals('step with table argument', $steps[0]->getText());
- $this->assertInstanceOf('Behat\Gherkin\Node\TableNode', $arguments[0]);
- $this->assertEquals(array(array('key'=>1, 'val'=>2), array('key'=>3,'val'=>4)), $arguments[0]->getHash());
-
- $arguments = $steps[1]->getArguments();
- $this->assertEquals('Blimey!', $steps[1]->getType());
- $this->assertEquals('Blimey!', $steps[1]->getKeyword());
- $this->assertEquals('When', $steps[1]->getKeywordType());
- $this->assertEquals('step with pystring argument', $steps[1]->getText());
- $this->assertInstanceOf('Behat\Gherkin\Node\PyStringNode', $arguments[0]);
- $this->assertEquals(' some text', (string) $arguments[0]);
-
- $arguments = $steps[2]->getArguments();
- $this->assertEquals('Let go and haul', $steps[2]->getType());
- $this->assertEquals('Let go and haul', $steps[2]->getKeyword());
- $this->assertEquals('Then', $steps[2]->getKeywordType());
- $this->assertEquals('2nd step with pystring argument', $steps[2]->getText());
- $this->assertInstanceOf('Behat\Gherkin\Node\PyStringNode', $arguments[0]);
- $this->assertEquals('some text', (string) $arguments[0]);
- }
-
- public function testSingleFeatureArray()
- {
- $features = $this->loader->load(array(
- 'feature' => array(
- 'title' => 'Some feature'
- )
- ));
-
- $this->assertEquals(1, count($features));
- $this->assertEquals('Some feature', $features[0]->getTitle());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php
deleted file mode 100644
index de3270866..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php
+++ /dev/null
@@ -1,92 +0,0 @@
-gherkin = $this->createGherkinMock();
- $this->loader = new DirectoryLoader($this->gherkin);
-
- $this->featuresPath = realpath(__DIR__ . '/../Fixtures/directories');
- }
-
- protected function createGherkinMock()
- {
- $gherkin = $this->getMockBuilder('Behat\Gherkin\Gherkin')
- ->disableOriginalConstructor()
- ->getMock();
-
- return $gherkin;
- }
-
- protected function createGherkinFileLoaderMock()
- {
- $loader = $this->getMockBuilder('Behat\Gherkin\Loader\GherkinFileLoader')
- ->disableOriginalConstructor()
- ->getMock();
-
- return $loader;
- }
-
- public function testSupports()
- {
- $this->assertFalse($this->loader->supports('non-existent path'));
- $this->assertFalse($this->loader->supports('non-existent path:2'));
-
- $this->assertFalse($this->loader->supports(__DIR__ . ':d'));
- $this->assertFalse($this->loader->supports(__DIR__ . '/../Fixtures/features/pystring.feature'));
- $this->assertTrue($this->loader->supports(__DIR__));
- $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/features'));
- }
-
- public function testUndefinedFileLoad()
- {
- $this->gherkin
- ->expects($this->once())
- ->method('resolveLoader')
- ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php')
- ->will($this->returnValue(null));
-
- $this->assertEquals(array(), $this->loader->load($this->featuresPath . '/phps'));
- }
-
- public function testBasePath()
- {
- $this->gherkin
- ->expects($this->once())
- ->method('resolveLoader')
- ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php')
- ->will($this->returnValue(null));
-
- $this->loader->setBasePath($this->featuresPath);
-
- $this->assertEquals(array(), $this->loader->load('phps'));
- }
-
- public function testDefinedFileLoad()
- {
- $loaderMock = $this->createGherkinFileLoaderMock();
-
- $this->gherkin
- ->expects($this->once())
- ->method('resolveLoader')
- ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php')
- ->will($this->returnValue($loaderMock));
-
- $loaderMock
- ->expects($this->once())
- ->method('load')
- ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php')
- ->will($this->returnValue(array('feature1', 'feature2')));
-
- $this->assertEquals(array('feature1', 'feature2'), $this->loader->load($this->featuresPath . '/phps'));
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/GherkinFileLoaderTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/GherkinFileLoaderTest.php
deleted file mode 100644
index 8f5d2c17d..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/GherkinFileLoaderTest.php
+++ /dev/null
@@ -1,111 +0,0 @@
-assertFalse($this->loader->supports('non-existent path'));
- $this->assertFalse($this->loader->supports('non-existent path:2'));
-
- $this->assertFalse($this->loader->supports(__DIR__));
- $this->assertFalse($this->loader->supports(__DIR__ . ':d'));
- $this->assertFalse($this->loader->supports(__FILE__));
- $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/features/pystring.feature'));
- }
-
- public function testLoad()
- {
- $features = $this->loader->load($this->featuresPath . '/pystring.feature');
- $this->assertEquals(1, count($features));
- $this->assertEquals('A py string feature', $features[0]->getTitle());
- $this->assertEquals($this->featuresPath . DIRECTORY_SEPARATOR . 'pystring.feature', $features[0]->getFile());
-
- $features = $this->loader->load($this->featuresPath . '/multiline_name.feature');
- $this->assertEquals(1, count($features));
- $this->assertEquals('multiline', $features[0]->getTitle());
- $this->assertEquals($this->featuresPath . DIRECTORY_SEPARATOR . 'multiline_name.feature', $features[0]->getFile());
- }
-
- public function testParsingUncachedFeature()
- {
- $cache = $this->getMockBuilder('Behat\Gherkin\Cache\CacheInterface')->getMock();
- $this->loader->setCache($cache);
-
- $cache->expects($this->once())
- ->method('isFresh')
- ->with($path = $this->featuresPath . DIRECTORY_SEPARATOR . 'pystring.feature', filemtime($path))
- ->will($this->returnValue(false));
-
- $cache->expects($this->once())
- ->method('write');
-
- $features = $this->loader->load($this->featuresPath . '/pystring.feature');
- $this->assertEquals(1, count($features));
- }
-
- public function testParsingCachedFeature()
- {
- $cache = $this->getMockBuilder('Behat\Gherkin\Cache\CacheInterface')->getMock();
- $this->loader->setCache($cache);
-
- $cache->expects($this->once())
- ->method('isFresh')
- ->with($path = $this->featuresPath . DIRECTORY_SEPARATOR . 'pystring.feature', filemtime($path))
- ->will($this->returnValue(true));
-
- $cache->expects($this->once())
- ->method('read')
- ->with($path)
- ->will($this->returnValue('cache'));
-
- $cache->expects($this->never())
- ->method('write');
-
- $features = $this->loader->load($this->featuresPath . '/pystring.feature');
- $this->assertEquals('cache', $features[0]);
- }
-
- public function testBasePath()
- {
- $this->assertFalse($this->loader->supports('features'));
- $this->assertFalse($this->loader->supports('tables.feature'));
-
- $this->loader->setBasePath($this->featuresPath . '/../');
- $this->assertFalse($this->loader->supports('features'));
- $this->assertFalse($this->loader->supports('tables.feature'));
- $this->assertTrue($this->loader->supports('features/tables.feature'));
-
- $features = $this->loader->load('features/pystring.feature');
- $this->assertEquals(1, count($features));
- $this->assertEquals('A py string feature', $features[0]->getTitle());
- $this->assertEquals('features' . DIRECTORY_SEPARATOR . 'pystring.feature', $features[0]->getFile());
-
- $this->loader->setBasePath($this->featuresPath);
- $features = $this->loader->load('multiline_name.feature');
- $this->assertEquals(1, count($features));
- $this->assertEquals('multiline', $features[0]->getTitle());
- $this->assertEquals('multiline_name.feature', $features[0]->getFile());
- }
-
- protected function setUp()
- {
- $keywords = new CucumberKeywords(__DIR__ . '/../Fixtures/i18n.yml');
- $parser = new Parser(new Lexer($keywords));
- $this->loader = new GherkinFileLoader($parser);
-
- $this->featuresPath = realpath(__DIR__ . '/../Fixtures/features');
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/YamlFileLoaderTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/YamlFileLoaderTest.php
deleted file mode 100644
index 83b27398f..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/YamlFileLoaderTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-loader = new YamlFileLoader();
- }
-
- public function testSupports()
- {
- $this->assertFalse($this->loader->supports(__DIR__));
- $this->assertFalse($this->loader->supports(__FILE__));
- $this->assertFalse($this->loader->supports('string'));
- $this->assertFalse($this->loader->supports(__DIR__ . '/file.yml'));
- $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/etalons/addition.yml'));
- }
-
- public function testLoadAddition()
- {
- $this->loader->setBasePath(__DIR__ . '/../Fixtures');
- $features = $this->loader->load('etalons/addition.yml');
-
- $this->assertEquals(1, count($features));
- $this->assertEquals('etalons'.DIRECTORY_SEPARATOR.'addition.yml', $features[0]->getFile());
- $this->assertEquals('Addition', $features[0]->getTitle());
- $this->assertEquals(2, $features[0]->getLine());
- $this->assertEquals('en', $features[0]->getLanguage());
- $expectedDescription = <<assertEquals($expectedDescription, $features[0]->getDescription());
-
- $scenarios = $features[0]->getScenarios();
-
- $this->assertEquals(2, count($scenarios));
- $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[0]);
- $this->assertEquals(7, $scenarios[0]->getLine());
- $this->assertEquals('Add two numbers', $scenarios[0]->getTitle());
- $steps = $scenarios[0]->getSteps();
- $this->assertEquals(4, count($steps));
- $this->assertEquals(9, $steps[1]->getLine());
- $this->assertEquals('And', $steps[1]->getType());
- $this->assertEquals('And', $steps[1]->getKeyword());
- $this->assertEquals('Given', $steps[1]->getKeywordType());
- $this->assertEquals('I have entered 12 into the calculator', $steps[1]->getText());
-
- $this->assertInstanceOf('Behat\Gherkin\Node\ScenarioNode', $scenarios[1]);
- $this->assertEquals(13, $scenarios[1]->getLine());
- $this->assertEquals('Div two numbers', $scenarios[1]->getTitle());
- $steps = $scenarios[1]->getSteps();
- $this->assertEquals(4, count($steps));
- $this->assertEquals(16, $steps[2]->getLine());
- $this->assertEquals('When', $steps[2]->getType());
- $this->assertEquals('When', $steps[2]->getKeyword());
- $this->assertEquals('When', $steps[2]->getKeywordType());
- $this->assertEquals('I press div', $steps[2]->getText());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/ExampleNodeTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/ExampleNodeTest.php
deleted file mode 100644
index c6f46be54..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/ExampleNodeTest.php
+++ /dev/null
@@ -1,92 +0,0 @@
-', array(), null, 'Given'),
- $step2 = new StepNode('Aye!', 'my email is ', array(), null, 'And'),
- $step3 = new StepNode('Blimey!', 'I open homepage', array(), null, 'When'),
- $step4 = new StepNode('Let go and haul', 'website should recognise me', array(), null, 'Then'),
- );
-
- $table = new ExampleTableNode(array(
- array('name', 'email'),
- array('everzet', 'ever.zet@gmail.com'),
- array('example', 'example@example.com')
- ), 'Examples');
-
- $outline = new OutlineNode(null, array(), $steps, $table, null, null);
- $examples = $outline->getExamples();
-
- $this->assertCount(4, $steps = $examples[0]->getSteps());
-
- $this->assertEquals('Gangway!', $steps[0]->getType());
- $this->assertEquals('Gangway!', $steps[0]->getKeyword());
- $this->assertEquals('Given', $steps[0]->getKeywordType());
- $this->assertEquals('I am everzet', $steps[0]->getText());
- $this->assertEquals('Aye!', $steps[1]->getType());
- $this->assertEquals('Aye!', $steps[1]->getKeyword());
- $this->assertEquals('And', $steps[1]->getKeywordType());
- $this->assertEquals('my email is ever.zet@gmail.com', $steps[1]->getText());
- $this->assertEquals('Blimey!', $steps[2]->getType());
- $this->assertEquals('Blimey!', $steps[2]->getKeyword());
- $this->assertEquals('When', $steps[2]->getKeywordType());
- $this->assertEquals('I open homepage', $steps[2]->getText());
-
- $this->assertCount(4, $steps = $examples[1]->getSteps());
-
- $this->assertEquals('Gangway!', $steps[0]->getType());
- $this->assertEquals('Gangway!', $steps[0]->getKeyword());
- $this->assertEquals('Given', $steps[0]->getKeywordType());
- $this->assertEquals('I am example', $steps[0]->getText());
- $this->assertEquals('Aye!', $steps[1]->getType());
- $this->assertEquals('Aye!', $steps[1]->getKeyword());
- $this->assertEquals('And', $steps[1]->getKeywordType());
- $this->assertEquals('my email is example@example.com', $steps[1]->getText());
- $this->assertEquals('Blimey!', $steps[2]->getType());
- $this->assertEquals('Blimey!', $steps[2]->getKeyword());
- $this->assertEquals('When', $steps[2]->getKeywordType());
- $this->assertEquals('I open homepage', $steps[2]->getText());
- }
-
- public function testCreateExampleStepsWithArguments()
- {
- $steps = array(
- $step1 = new StepNode('Gangway!', 'I am ', array(), null, 'Given'),
- $step2 = new StepNode('Aye!', 'my email is ', array(), null, 'And'),
- $step3 = new StepNode('Blimey!', 'I open:', array(
- new PyStringNode(array('page: '), null)
- ), null, 'When'),
- $step4 = new StepNode('Let go and haul', 'website should recognise me', array(
- new TableNode(array(array('page', '')))
- ), null, 'Then'),
- );
-
- $table = new ExampleTableNode(array(
- array('name', 'email', 'url'),
- array('everzet', 'ever.zet@gmail.com', 'homepage'),
- array('example', 'example@example.com', 'other page')
- ), 'Examples');
-
- $outline = new OutlineNode(null, array(), $steps, $table, null, null);
- $examples = $outline->getExamples();
-
- $steps = $examples[0]->getSteps();
-
- $args = $steps[2]->getArguments();
- $this->assertEquals('page: homepage', $args[0]->getRaw());
-
- $args = $steps[3]->getArguments();
- $this->assertEquals('| page | homepage |', $args[0]->getTableAsString());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/OutlineNodeTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/OutlineNodeTest.php
deleted file mode 100644
index 1e889b80f..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/OutlineNodeTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-', array(), null, 'Given'),
- new StepNode('Aye!', 'my email is ', array(), null, 'And'),
- new StepNode('Blimey!', 'I open homepage', array(), null, 'When'),
- new StepNode('Let go and haul', 'website should recognise me', array(), null, 'Then'),
- );
-
- $table = new ExampleTableNode(array(
- array('name', 'email'),
- array('everzet', 'ever.zet@gmail.com'),
- array('example', 'example@example.com')
- ), 'Examples');
-
- $outline = new OutlineNode(null, array(), $steps, $table, null, null);
-
- $this->assertCount(2, $examples = $outline->getExamples());
- $this->assertEquals(1, $examples[0]->getLine());
- $this->assertEquals(2, $examples[1]->getLine());
- $this->assertEquals(array('name' => 'everzet', 'email' => 'ever.zet@gmail.com'), $examples[0]->getTokens());
- $this->assertEquals(array('name' => 'example', 'email' => 'example@example.com'), $examples[1]->getTokens());
- }
-
- public function testCreatesEmptyExamplesForEmptyExampleTable()
- {
- $steps = array(
- new StepNode('Gangway!', 'I am ', array(), null, 'Given'),
- new StepNode('Aye!', 'my email is ', array(), null, 'And'),
- new StepNode('Blimey!', 'I open homepage', array(), null, 'When'),
- new StepNode('Let go and haul', 'website should recognise me', array(), null, 'Then'),
- );
-
- $table = new ExampleTableNode(array(
- array('name', 'email')
- ), 'Examples');
-
- $outline = new OutlineNode(null, array(), $steps, $table, null, null);
-
- $this->assertCount(0, $examples = $outline->getExamples());
- }
-
- public function testCreatesEmptyExamplesForNoExampleTable()
- {
- $steps = array(
- new StepNode('Gangway!', 'I am ', array(), null, 'Given'),
- new StepNode('Aye!', 'my email is ', array(), null, 'And'),
- new StepNode('Blimey!', 'I open homepage', array(), null, 'When'),
- new StepNode('Let go and haul', 'website should recognise me', array(), null, 'Then'),
- );
-
- $table = new ExampleTableNode(array(), 'Examples');
-
- $outline = new OutlineNode(null, array(), $steps, $table, null, null);
-
- $this->assertCount(0, $examples = $outline->getExamples());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/PyStringNodeTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/PyStringNodeTest.php
deleted file mode 100644
index 1beed387e..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/PyStringNodeTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-assertEquals(array('line1', 'line2', 'line3'), $str->getStrings());
- }
-
- public function testGetRaw()
- {
- $str = new PyStringNode(array('line1', 'line2', 'line3'), 0);
-
- $expected = <<assertEquals($expected, $str->getRaw());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/StepNodeTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/StepNodeTest.php
deleted file mode 100644
index d334415d6..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/StepNodeTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-setExpectedException('Behat\Gherkin\Exception\NodeException');
-
- new StepNode('Gangway!', 'I am on the page:', array(
- new PyStringNode(array('one', 'two'), 11),
- new TableNode(array(array('one', 'two'))),
- ), 10, 'Given');
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/TableNodeTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/TableNodeTest.php
deleted file mode 100644
index 43dfff225..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/Node/TableNodeTest.php
+++ /dev/null
@@ -1,222 +0,0 @@
-assertEquals(
- array(
- array('username' => 'everzet', 'password' => 'qwerty')
- , array('username' => 'antono', 'password' => 'pa$sword')
- ),
- $table->getHash()
- );
-
- $table = new TableNode(array(
- array('username', 'password'),
- array('', 'qwerty'),
- array('antono', ''),
- array('', '')
- ));
-
- $this->assertEquals(
- array(
- array('username' => '', 'password' => 'qwerty'),
- array('username' => 'antono', 'password' => ''),
- array('username' => '', 'password' => ''),
- ),
- $table->getHash()
- );
- }
-
- public function testIterator()
- {
- $table = new TableNode(array(
- array('username', 'password'),
- array('', 'qwerty'),
- array('antono', ''),
- array('', ''),
- ));
-
- $this->assertEquals(
- array(
- array('username' => '', 'password' => 'qwerty'),
- array('username' => 'antono', 'password' => ''),
- array('username' => '', 'password' => ''),
- ),
- iterator_to_array($table)
- );
- }
-
- public function testRowsHashTable()
- {
- $table = new TableNode(array(
- array('username', 'everzet'),
- array('password', 'qwerty'),
- array('uid', '35'),
- ));
-
- $this->assertEquals(
- array('username' => 'everzet', 'password' => 'qwerty', 'uid' => '35'),
- $table->getRowsHash()
- );
- }
-
- public function testLongRowsHashTable()
- {
- $table = new TableNode(array(
- array('username', 'everzet', 'marcello'),
- array('password', 'qwerty', '12345'),
- array('uid', '35', '22')
- ));
-
- $this->assertEquals(array(
- 'username' => array('everzet', 'marcello'),
- 'password' => array('qwerty', '12345'),
- 'uid' => array('35', '22')
- ), $table->getRowsHash());
- }
-
- public function testGetRows()
- {
- $table = new TableNode(array(
- array('username', 'password'),
- array('everzet', 'qwerty'),
- array('antono', 'pa$sword')
- ));
-
- $this->assertEquals(array(
- array('username', 'password'),
- array('everzet', 'qwerty'),
- array('antono', 'pa$sword')
- ), $table->getRows());
- }
-
- public function testGetLines()
- {
- $table = new TableNode(array(
- 5 => array('username', 'password'),
- 10 => array('everzet', 'qwerty'),
- 13 => array('antono', 'pa$sword')
- ));
-
- $this->assertEquals(array(5, 10, 13), $table->getLines());
- }
-
- public function testGetRow()
- {
- $table = new TableNode(array(
- array('username', 'password'),
- array('everzet', 'qwerty'),
- array('antono', 'pa$sword')
- ));
-
- $this->assertEquals(array('username', 'password'), $table->getRow(0));
- $this->assertEquals(array('antono', 'pa$sword'), $table->getRow(2));
- }
-
- public function testGetColumn()
- {
- $table = new TableNode(array(
- array('username', 'password'),
- array('everzet', 'qwerty'),
- array('antono', 'pa$sword')
- ));
-
- $this->assertEquals(array('username', 'everzet', 'antono'), $table->getColumn(0));
- $this->assertEquals(array('password', 'qwerty', 'pa$sword'), $table->getColumn(1));
-
- $table = new TableNode(array(
- array('username'),
- array('everzet'),
- array('antono')
- ));
-
- $this->assertEquals(array('username', 'everzet', 'antono'), $table->getColumn(0));
- }
-
- public function testGetRowWithLineNumbers()
- {
- $table = new TableNode(array(
- 5 => array('username', 'password'),
- 10 => array('everzet', 'qwerty'),
- 13 => array('antono', 'pa$sword')
- ));
-
- $this->assertEquals(array('username', 'password'), $table->getRow(0));
- $this->assertEquals(array('antono', 'pa$sword'), $table->getRow(2));
- }
-
- public function testGetTable()
- {
- $table = new TableNode($a = array(
- 5 => array('username', 'password'),
- 10 => array('everzet', 'qwerty'),
- 13 => array('antono', 'pa$sword')
- ));
-
- $this->assertEquals($a, $table->getTable());
- }
-
- public function testGetRowLine()
- {
- $table = new TableNode(array(
- 5 => array('username', 'password'),
- 10 => array('everzet', 'qwerty'),
- 13 => array('antono', 'pa$sword')
- ));
-
- $this->assertEquals(5, $table->getRowLine(0));
- $this->assertEquals(13, $table->getRowLine(2));
- }
-
- public function testGetRowAsString()
- {
- $table = new TableNode(array(
- 5 => array('username', 'password'),
- 10 => array('everzet', 'qwerty'),
- 13 => array('antono', 'pa$sword')
- ));
-
- $this->assertEquals('| username | password |', $table->getRowAsString(0));
- $this->assertEquals('| antono | pa$sword |', $table->getRowAsString(2));
- }
-
- public function testGetTableAsString()
- {
- $table = new TableNode(array(
- 5 => array('id', 'username', 'password'),
- 10 => array('42', 'everzet', 'qwerty'),
- 13 => array('2', 'antono', 'pa$sword')
- ));
-
- $expected = <<assertEquals($expected, $table->getTableAsString());
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/ParserExceptionsTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/ParserExceptionsTest.php
deleted file mode 100644
index c416ec2e7..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/ParserExceptionsTest.php
+++ /dev/null
@@ -1,291 +0,0 @@
- array(
- 'feature' => 'Feature',
- 'background' => 'Background',
- 'scenario' => 'Scenario',
- 'scenario_outline' => 'Scenario Outline',
- 'examples' => 'Examples',
- 'given' => 'Given',
- 'when' => 'When',
- 'then' => 'Then',
- 'and' => 'And',
- 'but' => 'But'
- ),
- 'ru' => array(
- 'feature' => 'Функционал',
- 'background' => 'Предыстория',
- 'scenario' => 'Сценарий',
- 'scenario_outline' => 'Структура сценария',
- 'examples' => 'Значения',
- 'given' => 'Допустим',
- 'when' => 'То',
- 'then' => 'Если',
- 'and' => 'И',
- 'but' => 'Но'
- )
- ));
- $this->gherkin = new Parser(new Lexer($keywords));
- }
-
- public function testStepRightAfterFeature()
- {
- $feature = <<gherkin->parse($feature);
-
- $this->assertEquals("\n Given some step-like line", $parsed->getDescription());
- }
-
- public function testTextInBackground()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- public function testTextInScenario()
- {
- $feature = <<gherkin->parse($feature);
-
- $this->assertCount(2, $scenarios = $feature->getScenarios());
- $firstTitle = <<assertEquals($firstTitle, $scenarios[0]->getTitle());
- $secondTitle = <<assertEquals($secondTitle, $scenarios[1]->getTitle());
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testAmbigiousLanguage()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testEmptyOutline()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testWrongTagPlacement()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testBackgroundWithTag()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testEndlessPyString()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testWrongStepType()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testMultipleBackgrounds()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testMultipleFeatures()
- {
- $feature = <<gherkin->parse($feature);
- }
-
- /**
- * @expectedException \Behat\Gherkin\Exception\ParserException
- */
- public function testTableWithoutRightBorder()
- {
- $feature = <<gherkin->parse($feature);
- }
-}
diff --git a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/ParserTest.php b/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/ParserTest.php
deleted file mode 100644
index aff585cda..000000000
--- a/tests/integration/vendor/behat/gherkin/tests/Behat/Gherkin/ParserTest.php
+++ /dev/null
@@ -1,147 +0,0 @@
-parseEtalon($fixtureName . '.yml');
- $features = $this->parseFixture($fixtureName . '.feature');
-
- $this->assertInternalType('array', $features);
- $this->assertEquals(1, count($features));
- $fixture = $features[0];
-
- $this->assertEquals($etalon, $fixture);
- }
-
- public function testParserResetsTagsBetweenFeatures()
- {
- $parser = $this->getGherkinParser();
-
- $parser->parse(<<parse(<<assertFalse($feature2->hasTags());
- }
-
- protected function getGherkinParser()
- {
- if (null === $this->gherkin) {
- $keywords = new ArrayKeywords(array(
- 'en' => array(
- 'feature' => 'Feature',
- 'background' => 'Background',
- 'scenario' => 'Scenario',
- 'scenario_outline' => 'Scenario Outline',
- 'examples' => 'Examples',
- 'given' => 'Given',
- 'when' => 'When',
- 'then' => 'Then',
- 'and' => 'And',
- 'but' => 'But'
- ),
- 'ru' => array(
- 'feature' => 'Функционал',
- 'background' => 'Предыстория',
- 'scenario' => 'Сценарий',
- 'scenario_outline' => 'Структура сценария',
- 'examples' => 'Значения',
- 'given' => 'Допустим',
- 'when' => 'То',
- 'then' => 'Если',
- 'and' => 'И',
- 'but' => 'Но'
- ),
- 'ja' => array (
- 'feature' => 'フィーチャ',
- 'background' => '背景',
- 'scenario' => 'シナリオ',
- 'scenario_outline' => 'シナリオアウトライン',
- 'examples' => '例|サンプル',
- 'given' => '前提<',
- 'when' => 'もし<',
- 'then' => 'ならば<',
- 'and' => 'かつ<',
- 'but' => 'しかし<'
- )
- ));
- $this->gherkin = new Parser(new Lexer($keywords));
- }
-
- return $this->gherkin;
- }
-
- protected function getYamlParser()
- {
- if (null === $this->yaml) {
- $this->yaml = new YamlFileLoader();
- }
-
- return $this->yaml;
- }
-
- protected function parseFixture($fixture)
- {
- $file = __DIR__ . '/Fixtures/features/' . $fixture;
-
- return array($this->getGherkinParser()->parse(file_get_contents($file), $file));
- }
-
- protected function parseEtalon($etalon)
- {
- $features = $this->getYamlParser()->load(__DIR__ . '/Fixtures/etalons/' . $etalon);
- $feature = $features[0];
-
- return new FeatureNode(
- $feature->getTitle(),
- $feature->getDescription(),
- $feature->getTags(),
- $feature->getBackground(),
- $feature->getScenarios(),
- $feature->getKeyword(),
- $feature->getLanguage(),
- __DIR__ . '/Fixtures/features/' . basename($etalon, '.yml') . '.feature',
- $feature->getLine()
- );
- }
-}
diff --git a/tests/integration/vendor/behat/transliterator/.gitignore b/tests/integration/vendor/behat/transliterator/.gitignore
deleted file mode 100644
index a79486fe9..000000000
--- a/tests/integration/vendor/behat/transliterator/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-vendor
-composer.lock
-phpunit.xml
diff --git a/tests/integration/vendor/behat/transliterator/.travis.yml b/tests/integration/vendor/behat/transliterator/.travis.yml
deleted file mode 100644
index a0aa87550..000000000
--- a/tests/integration/vendor/behat/transliterator/.travis.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-language: php
-
-sudo: false
-
-php: [5.3, 5.4, 5.5, 5.6, nightly, hhvm]
-
-matrix:
- fast_finish: true
- allow_failures:
- - php: nightly
-
-cache:
- directories:
- - $HOME/.composer/cache
-
-install:
- - composer install
-
-script: phpunit -v --coverage-clover=coverage.clover
-
-after_script:
- - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
diff --git a/tests/integration/vendor/behat/transliterator/CHANGELOG.md b/tests/integration/vendor/behat/transliterator/CHANGELOG.md
index d441b7067..a6cf15ecc 100644
--- a/tests/integration/vendor/behat/transliterator/CHANGELOG.md
+++ b/tests/integration/vendor/behat/transliterator/CHANGELOG.md
@@ -1,15 +1,22 @@
-1.1.0 / 2015-09-28
-==================
+# 1.3.0 / 2020-01-14
- * Updated unicode bank files
- * Added a testsuite for the library
+- Fix existing Travis CI builds
+- Add CI builds for all PHP versions between 5.3 and 7.4
+- Add preliminary support for PHP 7.4
-1.0.1 / 2014-05-14
-==================
+# 1.2.0 / 2017-04-04
- * fixed the regex used to replace non-word characters
+- Stop Transliterator::postProcessText() breaking words containing apostrophes
-1.0.0 / 2014-01-12
-==================
+# 1.1.0 / 2015-09-28
- * Initial release as a standalone component
+- Updated unicode bank files
+- Added a testsuite for the library
+
+# 1.0.1 / 2014-05-14
+
+- fixed the regex used to replace non-word characters
+
+# 1.0.0 / 2014-01-12
+
+- Initial release as a standalone component
diff --git a/tests/integration/vendor/behat/transliterator/CONTRIBUTING.md b/tests/integration/vendor/behat/transliterator/CONTRIBUTING.md
new file mode 100644
index 000000000..29d047f53
--- /dev/null
+++ b/tests/integration/vendor/behat/transliterator/CONTRIBUTING.md
@@ -0,0 +1,18 @@
+Contributing to Behat Transliterator
+====================================
+
+Updating data
+-------------
+
+Setup dependencies with [Composer](https://getcomposer.org):
+
+```bash
+composer install
+```
+
+Run, char tables in Behat Transliterator will be synced from Perl library
+using version defined in `\Behat\Transliterator\SyncTool::LIB_VERSION`
+
+```bash
+bin/update-data
+```
diff --git a/tests/integration/vendor/behat/transliterator/composer.json b/tests/integration/vendor/behat/transliterator/composer.json
index 79e444b36..fd1cd0ab1 100644
--- a/tests/integration/vendor/behat/transliterator/composer.json
+++ b/tests/integration/vendor/behat/transliterator/composer.json
@@ -1,29 +1,34 @@
{
- "name": "behat/transliterator",
- "description": "String transliterator",
- "keywords": ["transliterator", "slug", "i18n"],
- "type": "library",
- "license": "Artistic-1.0",
-
- "require": {
- "php": ">=5.3.3"
- },
-
- "autoload": {
- "psr-0": {
- "Behat\\Transliterator": "src/"
- }
- },
-
- "autoload-dev": {
- "psr-4": {
- "Behat\\Tests\\Transliterator\\": "tests"
- }
- },
-
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
+ "name": "behat/transliterator",
+ "description": "String transliterator",
+ "keywords": [
+ "transliterator",
+ "slug",
+ "i18n"
+ ],
+ "type": "library",
+ "license": "Artistic-1.0",
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.36|^6.3",
+ "php-yaoi/php-yaoi": "^1.0",
+ "chuyskywalker/rolling-curl": "^3.1"
+ },
+ "autoload": {
+ "psr-4": {
+ "Behat\\Transliterator\\": "src/Behat/Transliterator"
}
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Behat\\Tests\\Transliterator\\": "tests"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ }
}
diff --git a/tests/integration/vendor/behat/transliterator/phpunit.xml.dist b/tests/integration/vendor/behat/transliterator/phpunit.xml.dist
deleted file mode 100644
index 2f67f11b4..000000000
--- a/tests/integration/vendor/behat/transliterator/phpunit.xml.dist
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- tests
-
-
-
-
-
- ./src
-
-
-
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php
new file mode 100644
index 000000000..87a07c72e
--- /dev/null
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php
@@ -0,0 +1,213 @@
+ '}',
+ '\\\\' => '\\',
+ '\\{' => '{',
+ '\\@' => '@',
+ '\\$' => '$',
+ );
+
+ $this->tokenizer = new Parser();
+ $this->tokenizer->addLineStopper('#');
+ $this->tokenizer->addQuote('qq{', '}', $escape);
+ $this->tokenizer->addQuote('q{', '}', $escape);
+ $this->tokenizer->addQuote('"', '"');
+ $this->tokenizer->addQuote("'", "'");
+ $this->tokenizer->addBracket('[', ']');
+ $this->tokenizer->addDelimiter(';');
+
+ $this->renderer = new Renderer();
+ $this->renderer
+ ->setBindKey('-~z', 'z~-')
+ ->strip('#')
+ ->keepBoundaries('[');
+ }
+
+ public static function setUpDefinition(\Yaoi\Command\Definition $definition, $options)
+ {
+ $definition->name = 'update-data';
+ $definition->description = 'Tool for converting char tables for Behat/Transliterator from Perl to PHP';
+ }
+
+ public function performAction()
+ {
+ $rollingCurl = new RollingCurl();
+
+ foreach ($this->getPerlTablesUrlList() as $url) {
+ $rollingCurl->get($url);
+ }
+
+ $rollingCurl->setCallback(function (Request $request, RollingCurl $rollingCurl) {
+ $this->response->addContent($request->getUrl());
+ $content = $request->getResponseText();
+ $this->parsePerlTable($content);
+ })
+ ->execute();
+ }
+
+ private function removePhpCharTable($phpFilePath, $reason)
+ {
+ $this->response->addContent($reason);
+ if (file_exists($phpFilePath)) {
+ if (unlink($phpFilePath)) {
+ $this->response->success('Deleted');
+ } else {
+ $this->response->error('Failed to delete');
+ }
+ } else {
+ $this->response->success('No PHP file, skipped');
+ }
+ }
+
+ private function pushItem($item)
+ {
+ if ($this->itemIndex >= 16) {
+ $this->phpTable = trim($this->phpTable);
+ $this->phpTable .= "\n";
+ $this->itemIndex = 0;
+ }
+ ++$this->itemIndex;
+
+ $item = new StringValue($item);
+ if ($item->starts('\x') || $item->starts('\n')) {
+ $this->phpTable .= '"' . $item . '", ';
+ $this->nonQuestionBoxFound = true;
+ } else {
+ // TODO check if this hack should be removed for chinese letters
+ if ($item->value === '[?] ') {
+ $item->value = '[?]';
+ }
+ //
+
+ if ($item->value !== '[?]') {
+ $this->nonQuestionBoxFound = true;
+ }
+
+ $this->phpTable .= "'" . str_replace(array('\\', '\''), array('\\\\', '\\\''), $item) . "', ";
+ }
+ }
+
+ private function tokenizePerlTable($content)
+ {
+ $tokens = $this->tokenizer->tokenize($content);
+
+ $expression = $this->renderer->getExpression($tokens);
+ $statement = $expression->getStatement();
+ /** @var Parsed[] $binds */
+ $binds = $expression->getBinds();
+
+ $parser = new StringParser($statement);
+ $block = (string)$parser->inner('$Text::Unidecode::Char[', ']');
+ if (!$block) {
+ throw new \Exception('Block not found');
+ }
+ $this->block = $this->renderer->getExpression($binds[$block])->getStatement();
+
+ $itemsBind = (string)$parser->inner('[', ']');
+
+ if (!$itemsBind) {
+ $items = array();
+ }
+ else {
+ $items = $binds[$itemsBind];
+ }
+
+ return $items;
+ }
+
+ private function parsePerlTable($content)
+ {
+ $items = $this->tokenizePerlTable($content);
+
+ $phpFilePath = __DIR__ . '/data/' . substr($this->block, 1) . '.php';
+ if (!$items) {
+ $this->removePhpCharTable($phpFilePath, 'Empty char table for block ' . $this->block);
+ return;
+ }
+
+ $this->phpTable = <<block] = array(
+
+PHP;
+
+ $itemsExpression = $this->renderer->getExpression($items);
+ $itemsStatement = $itemsExpression->getStatement();
+ $itemsBinds = $itemsExpression->getBinds();
+
+ $itemsStatement = explode(',', $itemsStatement);
+ $this->itemIndex = 0;
+ $this->nonQuestionBoxFound = false;
+ foreach ($itemsStatement as $item) {
+ $item = trim($item);
+ if (!$item) {
+ break;
+ }
+
+ if (isset($itemsBinds[$item])) {
+ /** @var Token $token */
+ $token = $itemsBinds[$item];
+ $item = $token->unEscapedContent;
+ }
+
+ $this->pushItem($item);
+ }
+
+ if ($this->nonQuestionBoxFound) {
+ $this->phpTable = trim($this->phpTable) . "\n" . ');' . "\n";
+ if (file_put_contents($phpFilePath, $this->phpTable)) {
+ $this->response->success('Block ' . $this->block . ' converted to ' . $phpFilePath);
+ } else {
+ $this->response->error('Failed to save ' . $phpFilePath);
+ }
+ } else {
+ $this->removePhpCharTable($phpFilePath, 'Block ' . $this->block . ' contains only [?]');
+ }
+
+ }
+
+ private function getPerlTablesUrlList()
+ {
+ $client = new Client();
+ $list = array();
+ $page = $client->fetch('http://cpansearch.perl.org/src/SBURKE/Text-Unidecode-' . self::LIB_VERSION . '/lib/Text/Unidecode/');
+ foreach (StringParser::create($page)->innerAll('.pm">', '') as $xXXpm) {
+ $list[] = 'http://cpansearch.perl.org/src/SBURKE/Text-Unidecode-' . self::LIB_VERSION . '/lib/Text/Unidecode/'
+ . $xXXpm;
+ }
+ return $list;
+ }
+}
+
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/Transliterator.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/Transliterator.php
index 500ec5aa7..5847993b9 100644
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/Transliterator.php
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/Transliterator.php
@@ -354,26 +354,26 @@ public static function utf8ToAscii($str, $unknown = '?')
$chars = $ar[0];
foreach ($chars as $i => $c) {
- if (ord($c{0}) >= 0 && ord($c{0}) <= 127) {
+ if (ord($c[0]) >= 0 && ord($c[0]) <= 127) {
continue;
} // ASCII - next please
- if (ord($c{0}) >= 192 && ord($c{0}) <= 223) {
- $ord = (ord($c{0}) - 192) * 64 + (ord($c{1}) - 128);
+ if (ord($c[0]) >= 192 && ord($c[0]) <= 223) {
+ $ord = (ord($c[0]) - 192) * 64 + (ord($c[1]) - 128);
}
- if (ord($c{0}) >= 224 && ord($c{0}) <= 239) {
- $ord = (ord($c{0}) - 224) * 4096 + (ord($c{1}) - 128) * 64 + (ord($c{2}) - 128);
+ if (ord($c[0]) >= 224 && ord($c[0]) <= 239) {
+ $ord = (ord($c[0]) - 224) * 4096 + (ord($c[1]) - 128) * 64 + (ord($c[2]) - 128);
}
- if (ord($c{0}) >= 240 && ord($c{0}) <= 247) {
- $ord = (ord($c{0}) - 240) * 262144 + (ord($c{1}) - 128) * 4096 + (ord($c{2}) - 128) * 64 + (ord($c{3}) - 128);
+ if (ord($c[0]) >= 240 && ord($c[0]) <= 247) {
+ $ord = (ord($c[0]) - 240) * 262144 + (ord($c[1]) - 128) * 4096 + (ord($c[2]) - 128) * 64 + (ord($c[3]) - 128);
}
- if (ord($c{0}) >= 248 && ord($c{0}) <= 251) {
- $ord = (ord($c{0}) - 248) * 16777216 + (ord($c{1}) - 128) * 262144 + (ord($c{2}) - 128) * 4096 + (ord($c{3}) - 128) * 64 + (ord($c{4}) - 128);
+ if (ord($c[0]) >= 248 && ord($c[0]) <= 251) {
+ $ord = (ord($c[0]) - 248) * 16777216 + (ord($c[1]) - 128) * 262144 + (ord($c[2]) - 128) * 4096 + (ord($c[3]) - 128) * 64 + (ord($c[4]) - 128);
}
- if (ord($c{0}) >= 252 && ord($c{0}) <= 253) {
- $ord = (ord($c{0}) - 252) * 1073741824 + (ord($c{1}) - 128) * 16777216 + (ord($c{2}) - 128) * 262144 + (ord($c{3}) - 128) * 4096 + (ord($c{4}) - 128) * 64 + (ord($c{5}) - 128);
+ if (ord($c[0]) >= 252 && ord($c[0]) <= 253) {
+ $ord = (ord($c[0]) - 252) * 1073741824 + (ord($c[1]) - 128) * 16777216 + (ord($c[2]) - 128) * 262144 + (ord($c[3]) - 128) * 4096 + (ord($c[4]) - 128) * 64 + (ord($c[5]) - 128);
}
- if (ord($c{0}) >= 254 && ord($c{0}) <= 255) {
- $chars{$i} = $unknown;
+ if (ord($c[0]) >= 254 && ord($c[0]) <= 255) {
+ $chars[$i] = $unknown;
continue;
} //error
@@ -390,9 +390,9 @@ public static function utf8ToAscii($str, $unknown = '?')
$newchar = $ord & 255;
if (array_key_exists($newchar, $UTF8_TO_ASCII[$bank])) {
- $chars{$i} = $UTF8_TO_ASCII[$bank][$newchar];
+ $chars[$i] = $UTF8_TO_ASCII[$bank][$newchar];
} else {
- $chars{$i} = $unknown;
+ $chars[$i] = $unknown;
}
}
@@ -460,7 +460,7 @@ public static function validUtf8($str)
$len = strlen($str);
for ($i = 0; $i < $len; ++$i) {
- $in = ord($str{$i});
+ $in = ord($str[$i]);
if ($mState == 0) {
// When mState is zero we expect either a US-ASCII character or a
// multi-octet sequence.
@@ -573,7 +573,10 @@ private static function postProcessText($text, $separator)
$text = strtolower($text);
}
- // Remove all none word characters
+ // Remove apostrophes which are not used as quotes around a string
+ $text = preg_replace('/(\\w)\'(\\w)/', '${1}${2}', $text);
+
+ // Replace all none word characters with a space
$text = preg_replace('/\W/', ' ', $text);
// More stripping. Replace spaces with dashes
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x00.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x00.php
index 2ee8bf0ab..9177c746c 100644
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x00.php
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x00.php
@@ -5,15 +5,15 @@
' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
-'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ']', '\\', ']', '^', '_',
+'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', "\x7f",
-'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
-'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
+'EUR', '', ',', 'f', ',,', '...', '+', '++', '^', '%0', 'S', '<', 'OE', '', 'Z', '',
+'', '\'', '\'', '"', '"', '*', '-', '--', '~', 'tm', 's', '>', 'oe', '', 'z', 'Y',
' ', '!', 'C/', 'PS', '$?', 'Y=', '|', 'SS', '"', '(c)', 'a', '<<', '!', '', '(r)', '-',
'deg', '+-', '2', '3', '\'', 'u', 'P', '*', ',', '1', 'o', '>>', '1/4', '1/2', '3/4', '?',
'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
-'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', 'O', 'U', 'U', 'U', 'U', 'U', 'Th', 'ss',
+'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', 'O', 'U', 'U', 'U', 'U', 'Y', 'Th', 'ss',
'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i',
'd', 'n', 'o', 'o', 'o', 'o', 'o', '/', 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y',
);
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x01.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x01.php
index f88fbf3c9..d74681782 100644
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x01.php
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x01.php
@@ -3,8 +3,8 @@
'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd',
'D', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g',
'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i',
-'I', 'i', 'IJ', '', 'J', 'j', 'K', 'k', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L',
-'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'ng', 'NG', 'O', 'o', 'O', 'o',
+'I', 'i', 'IJ', 'ij', 'J', 'j', 'K', 'k', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L',
+'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', '\'n', 'ng', 'NG', 'O', 'o', 'O', 'o',
'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's',
'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u',
'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's',
@@ -12,8 +12,8 @@
'E', 'F', 'f', 'G', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'l', 'W', 'N', 'n', 'O',
'O', 'o', 'OI', 'oi', 'P', 'p', 'YR', '2', '2', 'SH', 'sh', 't', 'T', 't', 'T', 'U',
'u', 'Y', 'V', 'Y', 'y', 'Z', 'z', 'ZH', 'ZH', 'zh', 'zh', '2', '5', '5', 'ts', 'w',
-'|', '||', '|=', '!', 'Dz', 'dz', 'LJ', 'Lj', 'lj', 'NJ', 'Nj', 'nj', 'A', 'a', 'I',
+'|', '||', '|=', '!', 'DZ', 'Dz', 'dz', 'LJ', 'Lj', 'lj', 'NJ', 'Nj', 'nj', 'A', 'a', 'I',
'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', '@', 'A', 'a',
'A', 'a', 'AE', 'ae', 'G', 'g', 'G', 'g', 'K', 'k', 'O', 'o', 'O', 'o', 'ZH', 'zh',
-'j', 'DZ', 'D', 'dz', 'G', 'g', 'HV', 'W', 'N', 'n', 'A', 'a', 'AE', 'ae', 'O', 'o',
+'j', 'DZ', 'Dz', 'dz', 'G', 'g', 'HV', 'W', 'N', 'n', 'A', 'a', 'AE', 'ae', 'O', 'o',
);
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php
index e6f037dd9..c6e3a08e3 100644
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php
@@ -2,16 +2,16 @@
$UTF8_TO_ASCII[0x02] = array(
'A', 'a', 'A', 'a', 'E', 'e', 'E', 'e', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o',
'R', 'r', 'R', 'r', 'U', 'u', 'U', 'u', 'S', 's', 'T', 't', 'Y', 'y', 'H', 'h',
-'[?]', '[?]', 'OU', 'ou', 'Z', 'z', 'A', 'a', 'E', 'e', 'O', 'o', 'O', 'o', 'O', 'o',
-'O', 'o', 'Y', 'y', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]',
-'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]',
+'N', 'd', 'OU', 'ou', 'Z', 'z', 'A', 'a', 'E', 'e', 'O', 'o', 'O', 'o', 'O', 'o',
+'O', 'o', 'Y', 'y', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's',
+'z', '[?]', '[?]', 'B', 'U', '^', 'E', 'e', 'J', 'j', 'q', 'q', 'R', 'r', 'Y', 'y',
'a', 'a', 'a', 'b', 'o', 'c', 'd', 'd', 'e', '@', '@', 'e', 'e', 'e', 'e', 'j',
'g', 'g', 'g', 'g', 'u', 'Y', 'h', 'h', 'i', 'i', 'I', 'l', 'l', 'l', 'lZ', 'W',
-'W', 'm', 'n', 'n', 'n', 'o', 'OE', 'O', 'F', 'R', 'R', 'R', 'R', 'r', 'r', 'R',
-'R', 'R', 's', 'S', 'j', 'S', 'S', 't', 't', 'U', 'U', 'v', '^', 'W', 'Y', 'Y',
+'W', 'm', 'n', 'n', 'n', 'o', 'OE', 'O', 'F', 'r', 'r', 'r', 'r', 'r', 'r', 'r',
+'R', 'R', 's', 'S', 'j', 'S', 'S', 't', 't', 'u', 'U', 'v', '^', 'w', 'y', 'Y',
'z', 'z', 'Z', 'Z', '?', '?', '?', 'C', '@', 'B', 'E', 'G', 'H', 'j', 'k', 'L',
-'q', '?', '?', 'dz', 'dZ', 'dz', 'ts', 'tS', 'tC', 'fN', 'ls', 'lz', 'WW', ']', '[?]', '[?]',
-'k', 'h', 'j', 'r', 'r', 'r', 'r', 'w', 'y', '\'', '"', '`', '\'', '`', '`', '\'',
+'q', '?', '?', 'dz', 'dZ', 'dz', 'ts', 'tS', 'tC', 'fN', 'ls', 'lz', 'WW', ']]', 'h', 'h',
+'h', 'h', 'j', 'r', 'r', 'r', 'r', 'w', 'y', '\'', '"', '`', '\'', '`', '`', '\'',
'?', '?', '<', '>', '^', 'V', '^', 'V', '\'', '-', '/', '\\', ',', '_', '\\', '/',
':', '.', '`', '\'', '^', 'V', '+', '-', 'V', '.', '@', ',', '~', '"', 'R', 'X',
'G', 'l', 's', 'x', '?', '', '', '', '', '', '', '', 'V', '=', '"', '[?]',
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php
index 8ff946537..a923ec04e 100644
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php
@@ -6,7 +6,7 @@
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '[?]',
'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]',
-'', '', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]',
+'', '', '', 'a', 'e', 'i', 'o', 'u', 'c', 'd', 'h', 'm', 'r', 't', 'v', 'x',
'[?]', '[?]', '[?]', '[?]', '\'', ',', '[?]', '[?]', '[?]', '[?]', '', '[?]', '[?]', '[?]', '?', '[?]',
'[?]', '[?]', '[?]', '[?]', '', '', 'A', ';', 'E', 'E', 'I', '[?]', 'O', '[?]', 'U', 'O',
'I', 'A', 'B', 'G', 'D', 'E', 'Z', 'E', 'Th', 'I', 'K', 'L', 'M', 'N', 'Ks', 'O',
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php
index 772a0489f..302181f26 100644
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php
+++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php
@@ -1,17 +1,17 @@
', '<<', '>> ', '[', '] ', '{', '} ',
'[(', ')] ', '@', 'X ', '[', '] ', '[[', ']] ', '((', ')) ', '[[', ']] ', '~ ', '``', '\'\'', ',,',
-'@', '1', '2', '3', '4', '5', '6', '7', '8', '9', "", "", "", "", "", "",
-'~', '+', '+', '+', '+', "", '@', ' // ', '+10+', '+20+', '+30+', '[?]', '[?]', '[?]', "", "",
+'@', '1', '2', '3', '4', '5', '6', '7', '8', '9', '', '', '', '', '', '',
+'~', '+', '+', '+', '+', '', '@', ' // ', '+10+', '+20+', '+30+', '[?]', '[?]', '[?]', '', '',
'[?]', 'a', 'a', 'i', 'i', 'u', 'u', 'e', 'e', 'o', 'o', 'ka', 'ga', 'ki', 'gi', 'ku',
'gu', 'ke', 'ge', 'ko', 'go', 'sa', 'za', 'si', 'zi', 'su', 'zu', 'se', 'ze', 'so', 'zo', 'ta',
'da', 'ti', 'di', 'tu', 'tu', 'du', 'te', 'de', 'to', 'do', 'na', 'ni', 'nu', 'ne', 'no', 'ha',
'ba', 'pa', 'hi', 'bi', 'pi', 'hu', 'bu', 'pu', 'he', 'be', 'pe', 'ho', 'bo', 'po', 'ma', 'mi',
'mu', 'me', 'mo', 'ya', 'ya', 'yu', 'yu', 'yo', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wa',
-'wi', 'we', 'wo', 'n', 'vu', '[?]', '[?]', '[?]', '[?]', "", "", "", "", '"', '"', '[?]',
+'wi', 'we', 'wo', 'n', 'vu', '[?]', '[?]', '[?]', '[?]', '', '', '', '', '"', '"', '[?]',
'[?]', 'a', 'a', 'i', 'i', 'u', 'u', 'e', 'e', 'o', 'o', 'ka', 'ga', 'ki', 'gi', 'ku',
'gu', 'ke', 'ge', 'ko', 'go', 'sa', 'za', 'si', 'zi', 'su', 'zu', 'se', 'ze', 'so', 'zo', 'ta',
'da', 'ti', 'di', 'tu', 'tu', 'du', 'te', 'de', 'to', 'do', 'na', 'ni', 'nu', 'ne', 'no', 'ha',
'ba', 'pa', 'hi', 'bi', 'pi', 'hu', 'bu', 'pu', 'he', 'be', 'pe', 'ho', 'bo', 'po', 'ma', 'mi',
'mu', 'me', 'mo', 'ya', 'ya', 'yu', 'yu', 'yo', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wa',
-'wi', 'we', 'wo', 'n', 'vu', 'ka', 'ke', 'va', 'vi', 've', 'vo', "", "", '"', '"',
+'wi', 'we', 'wo', 'n', 'vu', 'ka', 'ke', 'va', 'vi', 've', 'vo', '', '', '"', '"',
);
diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x4d.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x4d.php
deleted file mode 100644
index c54418f6d..000000000
--- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x4d.php
+++ /dev/null
@@ -1,19 +0,0 @@
-assertCount(1, $UTF8_TO_ASCII, 'Each data file should register a single key in $UTF8_TO_ASCII.');
-
- $data = current($UTF8_TO_ASCII);
-
- $this->assertInternalType('array', $data, 'The value in $UTF8_TO_ASCII should be an array.');
- // Accept 255 elements because of inconsistencies in the data of the original Perl library
- $this->assertEquals(256, count($data), 'The value in $UTF8_TO_ASCII should have 255 or 256 elements.', 1);
- }
-
- public function provideDataFiles()
- {
- $files = array();
-
- $iterator = new \FilesystemIterator(__DIR__.'/../src/Behat/Transliterator/data');
-
- foreach ($iterator as $file) {
- $files[] = array($file->getFilename());
- }
-
- return $files;
- }
-}
diff --git a/tests/integration/vendor/behat/transliterator/tests/TransliteratorTest.php b/tests/integration/vendor/behat/transliterator/tests/TransliteratorTest.php
deleted file mode 100644
index 8f7b16274..000000000
--- a/tests/integration/vendor/behat/transliterator/tests/TransliteratorTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-assertSame($expected, Transliterator::utf8ToAscii($input));
- }
-
- public function provideUtf8ConversionCases()
- {
- return array(
- array('', ''),
- array('BonJour', 'BonJour'),
- array('Déjà', 'Deja'),
- array('trąnslįteration tėst ųsąge ūž', 'transliteration test usage uz'),
- array('това е тестово заглавие', 'tova ie tiestovo zaghlaviie'),
- array('это тестовый заголовок', 'eto tiestovyi zagholovok'),
- array('führen Aktivitäten Haglöfs', 'fuhren Aktivitaten Haglofs'),
- );
- }
-
- /**
- * @dataProvider provideTransliterationCases
- */
- public function testTransliteration($input, $expected)
- {
- $this->assertSame($expected, Transliterator::transliterate($input));
- }
-
- public function provideTransliterationCases()
- {
- return array(
- array('', ''),
- array('BonJour', 'bonjour'),
- array('BonJour & au revoir', 'bonjour-au-revoir'),
- array('Déjà', 'deja'),
- array('trąnslįteration tėst ųsąge ūž', 'transliteration-test-usage-uz'),
- array('това е тестово заглавие', 'tova-ie-tiestovo-zaghlaviie'),
- array('это тестовый заголовок', 'eto-tiestovyi-zagholovok'),
- array('führen Aktivitäten Haglöfs', 'fuhren-aktivitaten-haglofs'),
- );
- }
-
- /**
- * @dataProvider provideUnaccentCases
- */
- public function testUnaccent($input, $expected)
- {
- $this->assertSame($expected, Transliterator::unaccent($input));
- }
-
- public function provideUnaccentCases()
- {
- return array(
- array('', ''),
- array('BonJour', 'BonJour'),
- array('Déjà', 'Deja'),
- array('това е тестово заглавие', 'това е тестово заглавие'),
- );
- }
-
- /**
- * @dataProvider provideUrlizationCases
- */
- public function testUrlization($input, $expected)
- {
- $this->assertSame($expected, Transliterator::urlize($input));
- }
-
- public function provideUrlizationCases()
- {
- return array(
- array('', ''),
- array('BonJour', 'bonjour'),
- array('BonJour & au revoir', 'bonjour-au-revoir'),
- array('Déjà', 'deja'),
- array('това е тестово заглавие', ''),
- );
- }
-}
diff --git a/tests/integration/vendor/bin/behat b/tests/integration/vendor/bin/behat
deleted file mode 120000
index 090aac153..000000000
--- a/tests/integration/vendor/bin/behat
+++ /dev/null
@@ -1 +0,0 @@
-../behat/behat/bin/behat
\ No newline at end of file
diff --git a/tests/integration/vendor/bin/behat b/tests/integration/vendor/bin/behat
new file mode 100755
index 000000000..084f2c9d3
--- /dev/null
+++ b/tests/integration/vendor/bin/behat
@@ -0,0 +1,107 @@
+#!/usr/bin/env php
+realpath = realpath($opened_path) ?: $opened_path;
+ $opened_path = $this->realpath;
+ $this->handle = fopen($this->realpath, $mode);
+ $this->position = 0;
+
+ return (bool) $this->handle;
+ }
+
+ public function stream_read($count)
+ {
+ $data = fread($this->handle, $count);
+
+ if ($this->position === 0) {
+ $data = preg_replace('{^#!.*\r?\n}', '', $data);
+ }
+
+ $this->position += strlen($data);
+
+ return $data;
+ }
+
+ public function stream_cast($castAs)
+ {
+ return $this->handle;
+ }
+
+ public function stream_close()
+ {
+ fclose($this->handle);
+ }
+
+ public function stream_lock($operation)
+ {
+ return $operation ? flock($this->handle, $operation) : true;
+ }
+
+ public function stream_tell()
+ {
+ return $this->position;
+ }
+
+ public function stream_eof()
+ {
+ return feof($this->handle);
+ }
+
+ public function stream_stat()
+ {
+ return array();
+ }
+
+ public function stream_set_option($option, $arg1, $arg2)
+ {
+ return true;
+ }
+
+ public function url_stat($path, $flags)
+ {
+ $path = substr($path, 17);
+ if (file_exists($path)) {
+ return stat($path);
+ }
+
+ return false;
+ }
+ }
+ }
+
+ if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
+ include("phpvfscomposer://" . __DIR__ . '/..'.'/behat/behat/bin/behat');
+ exit(0);
+ }
+}
+
+include __DIR__ . '/..'.'/behat/behat/bin/behat';
diff --git a/tests/integration/vendor/bin/yaml-lint b/tests/integration/vendor/bin/yaml-lint
new file mode 100755
index 000000000..a7061e388
--- /dev/null
+++ b/tests/integration/vendor/bin/yaml-lint
@@ -0,0 +1,107 @@
+#!/usr/bin/env php
+realpath = realpath($opened_path) ?: $opened_path;
+ $opened_path = $this->realpath;
+ $this->handle = fopen($this->realpath, $mode);
+ $this->position = 0;
+
+ return (bool) $this->handle;
+ }
+
+ public function stream_read($count)
+ {
+ $data = fread($this->handle, $count);
+
+ if ($this->position === 0) {
+ $data = preg_replace('{^#!.*\r?\n}', '', $data);
+ }
+
+ $this->position += strlen($data);
+
+ return $data;
+ }
+
+ public function stream_cast($castAs)
+ {
+ return $this->handle;
+ }
+
+ public function stream_close()
+ {
+ fclose($this->handle);
+ }
+
+ public function stream_lock($operation)
+ {
+ return $operation ? flock($this->handle, $operation) : true;
+ }
+
+ public function stream_tell()
+ {
+ return $this->position;
+ }
+
+ public function stream_eof()
+ {
+ return feof($this->handle);
+ }
+
+ public function stream_stat()
+ {
+ return array();
+ }
+
+ public function stream_set_option($option, $arg1, $arg2)
+ {
+ return true;
+ }
+
+ public function url_stat($path, $flags)
+ {
+ $path = substr($path, 17);
+ if (file_exists($path)) {
+ return stat($path);
+ }
+
+ return false;
+ }
+ }
+ }
+
+ if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
+ include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint');
+ exit(0);
+ }
+}
+
+include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint';
diff --git a/tests/integration/vendor/composer/ClassLoader.php b/tests/integration/vendor/composer/ClassLoader.php
index fce8549f0..afef3fa2a 100644
--- a/tests/integration/vendor/composer/ClassLoader.php
+++ b/tests/integration/vendor/composer/ClassLoader.php
@@ -37,57 +37,130 @@
*
* @author Fabien Potencier
* @author Jordi Boggiano
- * @see http://www.php-fig.org/psr/psr-0/
- * @see http://www.php-fig.org/psr/psr-4/
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
+ /** @var ?string */
+ private $vendorDir;
+
// PSR-4
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixLengthsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixDirsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr4 = array();
// PSR-0
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixesPsr0 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr0 = array();
+ /** @var bool */
private $useIncludePath = false;
+
+ /**
+ * @var string[]
+ * @psalm-var array
+ */
private $classMap = array();
+
+ /** @var bool */
private $classMapAuthoritative = false;
+
+ /**
+ * @var bool[]
+ * @psalm-var array
+ */
private $missingClasses = array();
+
+ /** @var ?string */
private $apcuPrefix;
+ /**
+ * @var self[]
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param ?string $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ }
+
+ /**
+ * @return string[]
+ */
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
- return call_user_func_array('array_merge', $this->prefixesPsr0);
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
+ /**
+ * @return array[]
+ * @psalm-return array>
+ */
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
+ /**
+ * @return string[] Array of classname => path
+ * @psalm-return array
+ */
public function getClassMap()
{
return $this->classMap;
}
/**
- * @param array $classMap Class to filename map
+ * @param string[] $classMap Class to filename map
+ * @psalm-param array $classMap
+ *
+ * @return void
*/
public function addClassMap(array $classMap)
{
@@ -102,9 +175,11 @@ public function addClassMap(array $classMap)
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @return void
*/
public function add($prefix, $paths, $prepend = false)
{
@@ -147,11 +222,13 @@ public function add($prefix, $paths, $prepend = false)
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
+ *
+ * @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
@@ -195,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false)
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 base directories
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 base directories
+ *
+ * @return void
*/
public function set($prefix, $paths)
{
@@ -211,10 +290,12 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
+ *
+ * @return void
*/
public function setPsr4($prefix, $paths)
{
@@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths)
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
+ *
+ * @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -256,6 +339,8 @@ public function getUseIncludePath()
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
+ *
+ * @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -276,6 +361,8 @@ public function isClassMapAuthoritative()
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
+ *
+ * @return void
*/
public function setApcuPrefix($apcuPrefix)
{
@@ -296,25 +383,44 @@ public function getApcuPrefix()
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
+ *
+ * @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
}
/**
* Unregisters this instance as an autoloader.
+ *
+ * @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
- * @return bool|null True if loaded, null otherwise
+ * @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
@@ -323,6 +429,8 @@ public function loadClass($class)
return true;
}
+
+ return null;
}
/**
@@ -367,6 +475,21 @@ public function findFile($class)
return $file;
}
+ /**
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ *
+ * @return self[]
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ /**
+ * @param string $class
+ * @param string $ext
+ * @return string|false
+ */
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext)
* Scope isolated include.
*
* Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ * @private
*/
function includeFile($file)
{
diff --git a/tests/integration/vendor/composer/InstalledVersions.php b/tests/integration/vendor/composer/InstalledVersions.php
new file mode 100644
index 000000000..d50e0c9fc
--- /dev/null
+++ b/tests/integration/vendor/composer/InstalledVersions.php
@@ -0,0 +1,350 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ */
+class InstalledVersions
+{
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages()
+ {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type)
+ {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
+ {
+ $constraint = $parser->parseConstraints($constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+ */
+ public static function getRootPackage()
+ {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}
+ */
+ public static function getRawData()
+ {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData()
+ {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled()
+ {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+
+ if (self::$canGetVendors) {
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+ self::$installed = $installed[count($installed) - 1];
+ }
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = require __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+ $installed[] = self::$installed;
+
+ return $installed;
+ }
+}
diff --git a/tests/integration/vendor/composer/autoload_classmap.php b/tests/integration/vendor/composer/autoload_classmap.php
index 7a91153b0..087401551 100644
--- a/tests/integration/vendor/composer/autoload_classmap.php
+++ b/tests/integration/vendor/composer/autoload_classmap.php
@@ -6,4 +6,13 @@
$baseDir = dirname($vendorDir);
return array(
+ 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+ 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
+ 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
+ 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
+ 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
+ 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
+ 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+ 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
diff --git a/tests/integration/vendor/composer/autoload_files.php b/tests/integration/vendor/composer/autoload_files.php
index 708c2e992..77d1f8dc7 100644
--- a/tests/integration/vendor/composer/autoload_files.php
+++ b/tests/integration/vendor/composer/autoload_files.php
@@ -6,9 +6,17 @@
$baseDir = dirname($vendorDir);
return array(
+ 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
+ '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
+ '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
+ '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
+ '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
+ 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
+ '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
+ 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
- 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
+ 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
);
diff --git a/tests/integration/vendor/composer/autoload_namespaces.php b/tests/integration/vendor/composer/autoload_namespaces.php
index 5de315ad9..4e4604cf7 100644
--- a/tests/integration/vendor/composer/autoload_namespaces.php
+++ b/tests/integration/vendor/composer/autoload_namespaces.php
@@ -6,8 +6,5 @@
$baseDir = dirname($vendorDir);
return array(
- 'Behat\\Transliterator' => array($vendorDir . '/behat/transliterator/src'),
- 'Behat\\Testwork' => array($vendorDir . '/behat/behat/src'),
'Behat\\Gherkin' => array($vendorDir . '/behat/gherkin/src'),
- 'Behat\\Behat' => array($vendorDir . '/behat/behat/src'),
);
diff --git a/tests/integration/vendor/composer/autoload_psr4.php b/tests/integration/vendor/composer/autoload_psr4.php
index 9d551629e..983d81b6d 100644
--- a/tests/integration/vendor/composer/autoload_psr4.php
+++ b/tests/integration/vendor/composer/autoload_psr4.php
@@ -6,20 +6,34 @@
$baseDir = dirname($vendorDir);
return array(
+ 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'),
+ 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
+ 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
+ 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
+ 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'),
+ 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
+ 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
+ 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
+ 'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
+ 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'),
'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\DependencyInjection\\' => array($vendorDir . '/symfony/dependency-injection'),
- 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'),
- 'Symfony\\Component\\ClassLoader\\' => array($vendorDir . '/symfony/class-loader'),
- 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
- 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
- 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
+ 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
+ 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'),
+ 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
+ 'Behat\\Transliterator\\' => array($vendorDir . '/behat/transliterator/src/Behat/Transliterator'),
+ 'Behat\\Testwork\\' => array($vendorDir . '/behat/behat/src/Behat/Testwork'),
+ 'Behat\\Step\\' => array($vendorDir . '/behat/behat/src/Behat/Step'),
+ 'Behat\\Hook\\' => array($vendorDir . '/behat/behat/src/Behat/Hook'),
+ 'Behat\\Behat\\' => array($vendorDir . '/behat/behat/src/Behat/Behat'),
);
diff --git a/tests/integration/vendor/composer/autoload_real.php b/tests/integration/vendor/composer/autoload_real.php
index 6259d240d..3f6da5899 100644
--- a/tests/integration/vendor/composer/autoload_real.php
+++ b/tests/integration/vendor/composer/autoload_real.php
@@ -13,19 +13,24 @@ public static function loadClassLoader($class)
}
}
+ /**
+ * @return \Composer\Autoload\ClassLoader
+ */
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
+ require __DIR__ . '/platform_check.php';
+
spl_autoload_register(array('ComposerAutoloaderInit2b078a63e93bc9e9825cefae96ca1eb3', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit2b078a63e93bc9e9825cefae96ca1eb3', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
- require_once __DIR__ . '/autoload_static.php';
+ require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::getInitializer($loader));
} else {
@@ -60,11 +65,16 @@ public static function getLoader()
}
}
+/**
+ * @param string $fileIdentifier
+ * @param string $file
+ * @return void
+ */
function composerRequire2b078a63e93bc9e9825cefae96ca1eb3($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
- require $file;
-
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+
+ require $file;
}
}
diff --git a/tests/integration/vendor/composer/autoload_static.php b/tests/integration/vendor/composer/autoload_static.php
index 55eb9166f..4f9f3e4e8 100644
--- a/tests/integration/vendor/composer/autoload_static.php
+++ b/tests/integration/vendor/composer/autoload_static.php
@@ -7,35 +7,49 @@
class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3
{
public static $files = array (
+ 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
+ '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
+ '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
+ '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php',
+ '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
+ 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
+ '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
+ 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
- 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
+ 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
);
public static $prefixLengthsPsr4 = array (
'S' =>
array (
+ 'Symfony\\Polyfill\\Php81\\' => 23,
+ 'Symfony\\Polyfill\\Php80\\' => 23,
+ 'Symfony\\Polyfill\\Php73\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
+ 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
+ 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31,
+ 'Symfony\\Polyfill\\Ctype\\' => 23,
+ 'Symfony\\Contracts\\Translation\\' => 30,
+ 'Symfony\\Contracts\\Service\\' => 26,
+ 'Symfony\\Contracts\\EventDispatcher\\' => 34,
'Symfony\\Component\\Yaml\\' => 23,
'Symfony\\Component\\Translation\\' => 30,
+ 'Symfony\\Component\\String\\' => 25,
'Symfony\\Component\\Filesystem\\' => 29,
'Symfony\\Component\\EventDispatcher\\' => 34,
'Symfony\\Component\\DependencyInjection\\' => 38,
- 'Symfony\\Component\\Debug\\' => 24,
'Symfony\\Component\\Console\\' => 26,
'Symfony\\Component\\Config\\' => 25,
- 'Symfony\\Component\\ClassLoader\\' => 30,
),
'P' =>
array (
- 'Psr\\Log\\' => 8,
'Psr\\Http\\Message\\' => 17,
- ),
- 'I' =>
- array (
- 'Interop\\Container\\' => 18,
+ 'Psr\\Http\\Client\\' => 16,
+ 'Psr\\EventDispatcher\\' => 20,
+ 'Psr\\Container\\' => 14,
),
'G' =>
array (
@@ -43,13 +57,57 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3
'GuzzleHttp\\Promise\\' => 19,
'GuzzleHttp\\' => 11,
),
+ 'B' =>
+ array (
+ 'Behat\\Transliterator\\' => 21,
+ 'Behat\\Testwork\\' => 15,
+ 'Behat\\Step\\' => 11,
+ 'Behat\\Hook\\' => 11,
+ 'Behat\\Behat\\' => 12,
+ ),
);
public static $prefixDirsPsr4 = array (
+ 'Symfony\\Polyfill\\Php81\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php81',
+ ),
+ 'Symfony\\Polyfill\\Php80\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
+ ),
+ 'Symfony\\Polyfill\\Php73\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
+ ),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
),
+ 'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
+ ),
+ 'Symfony\\Polyfill\\Intl\\Grapheme\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme',
+ ),
+ 'Symfony\\Polyfill\\Ctype\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
+ ),
+ 'Symfony\\Contracts\\Translation\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/translation-contracts',
+ ),
+ 'Symfony\\Contracts\\Service\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/service-contracts',
+ ),
+ 'Symfony\\Contracts\\EventDispatcher\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts',
+ ),
'Symfony\\Component\\Yaml\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/yaml',
@@ -58,6 +116,10 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3
array (
0 => __DIR__ . '/..' . '/symfony/translation',
),
+ 'Symfony\\Component\\String\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/string',
+ ),
'Symfony\\Component\\Filesystem\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/filesystem',
@@ -70,10 +132,6 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3
array (
0 => __DIR__ . '/..' . '/symfony/dependency-injection',
),
- 'Symfony\\Component\\Debug\\' =>
- array (
- 0 => __DIR__ . '/..' . '/symfony/debug',
- ),
'Symfony\\Component\\Console\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/console',
@@ -82,21 +140,22 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3
array (
0 => __DIR__ . '/..' . '/symfony/config',
),
- 'Symfony\\Component\\ClassLoader\\' =>
+ 'Psr\\Http\\Message\\' =>
array (
- 0 => __DIR__ . '/..' . '/symfony/class-loader',
+ 0 => __DIR__ . '/..' . '/psr/http-factory/src',
+ 1 => __DIR__ . '/..' . '/psr/http-message/src',
),
- 'Psr\\Log\\' =>
+ 'Psr\\Http\\Client\\' =>
array (
- 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
+ 0 => __DIR__ . '/..' . '/psr/http-client/src',
),
- 'Psr\\Http\\Message\\' =>
+ 'Psr\\EventDispatcher\\' =>
array (
- 0 => __DIR__ . '/..' . '/psr/http-message/src',
+ 0 => __DIR__ . '/..' . '/psr/event-dispatcher/src',
),
- 'Interop\\Container\\' =>
+ 'Psr\\Container\\' =>
array (
- 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
+ 0 => __DIR__ . '/..' . '/psr/container/src',
),
'GuzzleHttp\\Psr7\\' =>
array (
@@ -110,36 +169,57 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3
array (
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
),
+ 'Behat\\Transliterator\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/behat/transliterator/src/Behat/Transliterator',
+ ),
+ 'Behat\\Testwork\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/behat/behat/src/Behat/Testwork',
+ ),
+ 'Behat\\Step\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/behat/behat/src/Behat/Step',
+ ),
+ 'Behat\\Hook\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/behat/behat/src/Behat/Hook',
+ ),
+ 'Behat\\Behat\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/behat/behat/src/Behat/Behat',
+ ),
);
public static $prefixesPsr0 = array (
'B' =>
array (
- 'Behat\\Transliterator' =>
- array (
- 0 => __DIR__ . '/..' . '/behat/transliterator/src',
- ),
- 'Behat\\Testwork' =>
- array (
- 0 => __DIR__ . '/..' . '/behat/behat/src',
- ),
'Behat\\Gherkin' =>
array (
0 => __DIR__ . '/..' . '/behat/gherkin/src',
),
- 'Behat\\Behat' =>
- array (
- 0 => __DIR__ . '/..' . '/behat/behat/src',
- ),
),
);
+ public static $classMap = array (
+ 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
+ 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
+ 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
+ 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
+ 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
+ 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+ 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
+ );
+
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::$prefixesPsr0;
+ $loader->classMap = ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::$classMap;
}, null, ClassLoader::class);
}
diff --git a/tests/integration/vendor/composer/installed.json b/tests/integration/vendor/composer/installed.json
index def91a9dc..7df4ff526 100644
--- a/tests/integration/vendor/composer/installed.json
+++ b/tests/integration/vendor/composer/installed.json
@@ -1,1152 +1,2488 @@
-[
- {
- "name": "behat/behat",
- "version": "v3.3.0",
- "version_normalized": "3.3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Behat/Behat.git",
- "reference": "15a3a1857457eaa29cdf41564a5e421effb09526"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Behat/Behat/zipball/15a3a1857457eaa29cdf41564a5e421effb09526",
- "reference": "15a3a1857457eaa29cdf41564a5e421effb09526",
- "shasum": ""
- },
- "require": {
- "behat/gherkin": "^4.4.4",
- "behat/transliterator": "~1.0",
- "container-interop/container-interop": "^1.1",
- "ext-mbstring": "*",
- "php": ">=5.3.3",
- "symfony/class-loader": "~2.1||~3.0",
- "symfony/config": "~2.3||~3.0",
- "symfony/console": "~2.5||~3.0",
- "symfony/dependency-injection": "~2.1||~3.0",
- "symfony/event-dispatcher": "~2.1||~3.0",
- "symfony/translation": "~2.3||~3.0",
- "symfony/yaml": "~2.1||~3.0"
- },
- "require-dev": {
- "herrera-io/box": "~1.6.1",
- "phpunit/phpunit": "~4.5",
- "symfony/process": "~2.5|~3.0"
- },
- "suggest": {
- "behat/mink-extension": "for integration with Mink testing framework",
- "behat/symfony2-extension": "for integration with Symfony2 web framework",
- "behat/yii-extension": "for integration with Yii web framework"
- },
- "time": "2016-12-25T13:43:52+00:00",
- "bin": [
- "bin/behat"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Behat\\Behat": "src/",
- "Behat\\Testwork": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Konstantin Kudryashov",
- "email": "ever.zet@gmail.com",
- "homepage": "http://everzet.com"
- }
- ],
- "description": "Scenario-oriented BDD framework for PHP 5.3",
- "homepage": "http://behat.org/",
- "keywords": [
- "Agile",
- "BDD",
- "ScenarioBDD",
- "Scrum",
- "StoryBDD",
- "User story",
- "business",
- "development",
- "documentation",
- "examples",
- "symfony",
- "testing"
- ]
- },
- {
- "name": "behat/gherkin",
- "version": "v4.4.5",
- "version_normalized": "4.4.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Behat/Gherkin.git",
- "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74",
- "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.1"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.5|~5",
- "symfony/phpunit-bridge": "~2.7|~3",
- "symfony/yaml": "~2.3|~3"
- },
- "suggest": {
- "symfony/yaml": "If you want to parse features, represented in YAML files"
- },
- "time": "2016-10-30T11:50:56+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.4-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Behat\\Gherkin": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Konstantin Kudryashov",
- "email": "ever.zet@gmail.com",
- "homepage": "http://everzet.com"
- }
- ],
- "description": "Gherkin DSL parser for PHP 5.3",
- "homepage": "http://behat.org/",
- "keywords": [
- "BDD",
- "Behat",
- "Cucumber",
- "DSL",
- "gherkin",
- "parser"
- ]
- },
- {
- "name": "behat/transliterator",
- "version": "v1.1.0",
- "version_normalized": "1.1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Behat/Transliterator.git",
- "reference": "868e05be3a9f25ba6424c2dd4849567f50715003"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Behat/Transliterator/zipball/868e05be3a9f25ba6424c2dd4849567f50715003",
- "reference": "868e05be3a9f25ba6424c2dd4849567f50715003",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "time": "2015-09-28T16:26:35+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Behat\\Transliterator": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Artistic-1.0"
- ],
- "description": "String transliterator",
- "keywords": [
- "i18n",
- "slug",
- "transliterator"
- ]
- },
- {
- "name": "container-interop/container-interop",
- "version": "1.1.0",
- "version_normalized": "1.1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/container-interop/container-interop.git",
- "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e",
- "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e",
- "shasum": ""
- },
- "time": "2014-12-30T15:22:37+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Interop\\Container\\": "src/Interop/Container/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Promoting the interoperability of container objects (DIC, SL, etc.)"
- },
- {
- "name": "guzzlehttp/guzzle",
- "version": "6.3.3",
- "version_normalized": "6.3.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/guzzle.git",
- "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
- "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
- "shasum": ""
- },
- "require": {
- "guzzlehttp/promises": "^1.0",
- "guzzlehttp/psr7": "^1.4",
- "php": ">=5.5"
- },
- "require-dev": {
- "ext-curl": "*",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
- "psr/log": "^1.0"
- },
- "suggest": {
- "psr/log": "Required for using the Log middleware"
- },
- "time": "2018-04-22T15:46:56+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "6.3-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "files": [
- "src/functions_include.php"
- ],
- "psr-4": {
- "GuzzleHttp\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "description": "Guzzle is a PHP HTTP client library",
- "homepage": "http://guzzlephp.org/",
- "keywords": [
- "client",
- "curl",
- "framework",
- "http",
- "http client",
- "rest",
- "web service"
- ]
- },
- {
- "name": "guzzlehttp/promises",
- "version": "v1.3.1",
- "version_normalized": "1.3.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/promises.git",
- "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
- "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.0"
- },
- "time": "2016-12-20T10:07:11+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\Promise\\": "src/"
- },
- "files": [
- "src/functions_include.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "description": "Guzzle promises library",
- "keywords": [
- "promise"
- ]
- },
- {
- "name": "guzzlehttp/psr7",
- "version": "1.5.2",
- "version_normalized": "1.5.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/psr7.git",
- "reference": "9f83dded91781a01c63574e387eaa769be769115"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
- "reference": "9f83dded91781a01c63574e387eaa769be769115",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5"
- },
- "provide": {
- "psr/http-message-implementation": "1.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
- },
- "time": "2018-12-04T20:46:45+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.5-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\Psr7\\": "src/"
- },
- "files": [
- "src/functions_include.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- },
- {
- "name": "Tobias Schultze",
- "homepage": "https://github.com/Tobion"
- }
- ],
- "description": "PSR-7 message implementation that also provides common utility methods",
- "keywords": [
- "http",
- "message",
- "psr-7",
- "request",
- "response",
- "stream",
- "uri",
- "url"
- ]
- },
- {
- "name": "psr/http-message",
- "version": "1.0.1",
- "version_normalized": "1.0.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/http-message.git",
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "time": "2016-08-06T14:39:51+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for HTTP messages",
- "homepage": "https://github.com/php-fig/http-message",
- "keywords": [
- "http",
- "http-message",
- "psr",
- "psr-7",
- "request",
- "response"
- ]
- },
- {
- "name": "psr/log",
- "version": "1.0.2",
- "version_normalized": "1.0.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "time": "2016-10-10T12:19:37+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ]
- },
- {
- "name": "ralouphie/getallheaders",
- "version": "2.0.5",
- "version_normalized": "2.0.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/ralouphie/getallheaders.git",
- "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
- "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~3.7.0",
- "satooshi/php-coveralls": ">=1.0"
- },
- "time": "2016-02-11T07:05:27+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "files": [
- "src/getallheaders.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ralph Khattar",
- "email": "ralph.khattar@gmail.com"
- }
- ],
- "description": "A polyfill for getallheaders."
- },
- {
- "name": "symfony/class-loader",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/class-loader.git",
- "reference": "87cd4e69435d98de01d0162c5f9c0ac017075c63"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/class-loader/zipball/87cd4e69435d98de01d0162c5f9c0ac017075c63",
- "reference": "87cd4e69435d98de01d0162c5f9c0ac017075c63",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "require-dev": {
- "symfony/finder": "~2.8|~3.0",
- "symfony/polyfill-apcu": "~1.1"
- },
- "suggest": {
- "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM"
- },
- "time": "2016-11-29T08:26:13+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\ClassLoader\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony ClassLoader Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/config",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/config.git",
- "reference": "b4ec9f099599cfc5b7f4d07bb2e910781a2be5e4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/b4ec9f099599cfc5b7f4d07bb2e910781a2be5e4",
- "reference": "b4ec9f099599cfc5b7f4d07bb2e910781a2be5e4",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9",
- "symfony/filesystem": "~2.8|~3.0"
- },
- "require-dev": {
- "symfony/yaml": "~3.0"
- },
- "suggest": {
- "symfony/yaml": "To use the yaml reference dumper"
- },
- "time": "2016-12-09T07:45:17+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Config\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Config Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/console",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "d12aa9ca20f4db83ec58410978dab6afcb9d6aaa"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/d12aa9ca20f4db83ec58410978dab6afcb9d6aaa",
- "reference": "d12aa9ca20f4db83ec58410978dab6afcb9d6aaa",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9",
- "symfony/debug": "~2.8|~3.0",
- "symfony/polyfill-mbstring": "~1.0"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/filesystem": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0"
- },
- "suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/filesystem": "",
- "symfony/process": ""
- },
- "time": "2016-12-11T14:34:22+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Console Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/debug",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
- "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9",
- "psr/log": "~1.0"
- },
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
- },
- "require-dev": {
- "symfony/class-loader": "~2.8|~3.0",
- "symfony/http-kernel": "~2.8|~3.0"
- },
- "time": "2016-11-16T22:18:16+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Debug\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Debug Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/dependency-injection",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/dependency-injection.git",
- "reference": "037054501c41007c93b6de1b5c7a7acb83523593"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/037054501c41007c93b6de1b5c7a7acb83523593",
- "reference": "037054501c41007c93b6de1b5c7a7acb83523593",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "conflict": {
- "symfony/yaml": "<3.2"
- },
- "require-dev": {
- "symfony/config": "~2.8|~3.0",
- "symfony/expression-language": "~2.8|~3.0",
- "symfony/yaml": "~3.2"
- },
- "suggest": {
- "symfony/config": "",
- "symfony/expression-language": "For using expressions in service container configuration",
- "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
- "symfony/yaml": ""
- },
- "time": "2016-12-08T15:27:33+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\DependencyInjection\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony DependencyInjection Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/event-dispatcher",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
- "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~2.8|~3.0",
- "symfony/dependency-injection": "~2.8|~3.0",
- "symfony/expression-language": "~2.8|~3.0",
- "symfony/stopwatch": "~2.8|~3.0"
- },
- "suggest": {
- "symfony/dependency-injection": "",
- "symfony/http-kernel": ""
- },
- "time": "2016-10-13T06:29:04+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\EventDispatcher\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony EventDispatcher Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/filesystem",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/filesystem.git",
- "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4",
- "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "time": "2016-11-24T00:46:43+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Filesystem\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Filesystem Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/polyfill-mbstring",
- "version": "v1.3.0",
- "version_normalized": "1.3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
- "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "suggest": {
- "ext-mbstring": "For best performance"
- },
- "time": "2016-11-14T01:06:16+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- },
- "files": [
- "bootstrap.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for the Mbstring extension",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "mbstring",
- "polyfill",
- "portable",
- "shim"
- ]
- },
- {
- "name": "symfony/translation",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/translation.git",
- "reference": "5fd18eca88f4d187807a1eba083bc99feaa8635b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/5fd18eca88f4d187807a1eba083bc99feaa8635b",
- "reference": "5fd18eca88f4d187807a1eba083bc99feaa8635b",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9",
- "symfony/polyfill-mbstring": "~1.0"
- },
- "conflict": {
- "symfony/config": "<2.8"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~2.8|~3.0",
- "symfony/intl": "~2.8|~3.0",
- "symfony/yaml": "~2.8|~3.0"
- },
- "suggest": {
- "psr/log": "To use logging capability in translator",
- "symfony/config": "",
- "symfony/yaml": ""
- },
- "time": "2016-11-30T14:40:17+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Translation\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Translation Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/yaml",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/yaml.git",
- "reference": "a7095af4b97a0955f85c8989106c249fa649011f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/a7095af4b97a0955f85c8989106c249fa649011f",
- "reference": "a7095af4b97a0955f85c8989106c249fa649011f",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "require-dev": {
- "symfony/console": "~2.8|~3.0"
- },
- "suggest": {
- "symfony/console": "For validating YAML files using the lint command"
- },
- "time": "2016-12-10T10:07:06+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Yaml\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Yaml Component",
- "homepage": "https://symfony.com"
- }
-]
+{
+ "packages": [
+ {
+ "name": "behat/behat",
+ "version": "v3.10.0",
+ "version_normalized": "3.10.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Behat/Behat.git",
+ "reference": "a55661154079cf881ef643b303bfaf67bae3a09f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Behat/Behat/zipball/a55661154079cf881ef643b303bfaf67bae3a09f",
+ "reference": "a55661154079cf881ef643b303bfaf67bae3a09f",
+ "shasum": ""
+ },
+ "require": {
+ "behat/gherkin": "^4.9.0",
+ "behat/transliterator": "^1.2",
+ "ext-mbstring": "*",
+ "php": "^7.2 || ^8.0",
+ "psr/container": "^1.0",
+ "symfony/config": "^4.4 || ^5.0 || ^6.0",
+ "symfony/console": "^4.4 || ^5.0 || ^6.0",
+ "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
+ "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
+ "symfony/translation": "^4.4 || ^5.0 || ^6.0",
+ "symfony/yaml": "^4.4 || ^5.0 || ^6.0"
+ },
+ "require-dev": {
+ "container-interop/container-interop": "^1.2",
+ "herrera-io/box": "~1.6.1",
+ "phpunit/phpunit": "^8.5 || ^9.0",
+ "symfony/process": "^4.4 || ^5.0 || ^6.0",
+ "vimeo/psalm": "^4.8"
+ },
+ "suggest": {
+ "ext-dom": "Needed to output test results in JUnit format."
+ },
+ "time": "2021-11-02T20:09:40+00:00",
+ "bin": [
+ "bin/behat"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Behat\\Hook\\": "src/Behat/Hook/",
+ "Behat\\Step\\": "src/Behat/Step/",
+ "Behat\\Behat\\": "src/Behat/Behat/",
+ "Behat\\Testwork\\": "src/Behat/Testwork/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ }
+ ],
+ "description": "Scenario-oriented BDD framework for PHP",
+ "homepage": "http://behat.org/",
+ "keywords": [
+ "Agile",
+ "BDD",
+ "ScenarioBDD",
+ "Scrum",
+ "StoryBDD",
+ "User story",
+ "business",
+ "development",
+ "documentation",
+ "examples",
+ "symfony",
+ "testing"
+ ],
+ "support": {
+ "issues": "https://github.com/Behat/Behat/issues",
+ "source": "https://github.com/Behat/Behat/tree/v3.10.0"
+ },
+ "install-path": "../behat/behat"
+ },
+ {
+ "name": "behat/gherkin",
+ "version": "v4.9.0",
+ "version_normalized": "4.9.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Behat/Gherkin.git",
+ "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4",
+ "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~7.2|~8.0"
+ },
+ "require-dev": {
+ "cucumber/cucumber": "dev-gherkin-22.0.0",
+ "phpunit/phpunit": "~8|~9",
+ "symfony/yaml": "~3|~4|~5"
+ },
+ "suggest": {
+ "symfony/yaml": "If you want to parse features, represented in YAML files"
+ },
+ "time": "2021-10-12T13:05:09+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Behat\\Gherkin": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ }
+ ],
+ "description": "Gherkin DSL parser for PHP",
+ "homepage": "http://behat.org/",
+ "keywords": [
+ "BDD",
+ "Behat",
+ "Cucumber",
+ "DSL",
+ "gherkin",
+ "parser"
+ ],
+ "support": {
+ "issues": "https://github.com/Behat/Gherkin/issues",
+ "source": "https://github.com/Behat/Gherkin/tree/v4.9.0"
+ },
+ "install-path": "../behat/gherkin"
+ },
+ {
+ "name": "behat/transliterator",
+ "version": "v1.3.0",
+ "version_normalized": "1.3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Behat/Transliterator.git",
+ "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc",
+ "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "chuyskywalker/rolling-curl": "^3.1",
+ "php-yaoi/php-yaoi": "^1.0",
+ "phpunit/phpunit": "^4.8.36|^6.3"
+ },
+ "time": "2020-01-14T16:39:13+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Behat\\Transliterator\\": "src/Behat/Transliterator"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Artistic-1.0"
+ ],
+ "description": "String transliterator",
+ "keywords": [
+ "i18n",
+ "slug",
+ "transliterator"
+ ],
+ "install-path": "../behat/transliterator"
+ },
+ {
+ "name": "guzzlehttp/guzzle",
+ "version": "7.4.1",
+ "version_normalized": "7.4.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/guzzle.git",
+ "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
+ "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "guzzlehttp/promises": "^1.5",
+ "guzzlehttp/psr7": "^1.8.3 || ^2.1",
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ },
+ "provide": {
+ "psr/http-client-implementation": "1.0"
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "ext-curl": "*",
+ "php-http/client-integration-tests": "^3.0",
+ "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
+ },
+ "suggest": {
+ "ext-curl": "Required for CURL handler support",
+ "ext-intl": "Required for Internationalized Domain Name (IDN) support",
+ "psr/log": "Required for using the Log middleware"
+ },
+ "time": "2021-12-06T18:43:05+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "7.4-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
+ }
+ ],
+ "description": "Guzzle is a PHP HTTP client library",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "psr-18",
+ "psr-7",
+ "rest",
+ "web service"
+ ],
+ "support": {
+ "issues": "https://github.com/guzzle/guzzle/issues",
+ "source": "https://github.com/guzzle/guzzle/tree/7.4.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../guzzlehttp/guzzle"
+ },
+ {
+ "name": "guzzlehttp/promises",
+ "version": "1.5.1",
+ "version_normalized": "1.5.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/promises.git",
+ "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
+ "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "symfony/phpunit-bridge": "^4.4 || ^5.1"
+ },
+ "time": "2021-10-22T20:56:57+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.5-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
+ }
+ ],
+ "description": "Guzzle promises library",
+ "keywords": [
+ "promise"
+ ],
+ "support": {
+ "issues": "https://github.com/guzzle/promises/issues",
+ "source": "https://github.com/guzzle/promises/tree/1.5.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../guzzlehttp/promises"
+ },
+ {
+ "name": "guzzlehttp/psr7",
+ "version": "2.1.0",
+ "version_normalized": "2.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/psr7.git",
+ "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
+ "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.0",
+ "ralouphie/getallheaders": "^3.0"
+ },
+ "provide": {
+ "psr/http-factory-implementation": "1.0",
+ "psr/http-message-implementation": "1.0"
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "http-interop/http-factory-tests": "^0.9",
+ "phpunit/phpunit": "^8.5.8 || ^9.3.10"
+ },
+ "suggest": {
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
+ },
+ "time": "2021-10-06T17:43:30+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.1-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Psr7\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
+ }
+ ],
+ "description": "PSR-7 message implementation that also provides common utility methods",
+ "keywords": [
+ "http",
+ "message",
+ "psr-7",
+ "request",
+ "response",
+ "stream",
+ "uri",
+ "url"
+ ],
+ "support": {
+ "issues": "https://github.com/guzzle/psr7/issues",
+ "source": "https://github.com/guzzle/psr7/tree/2.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../guzzlehttp/psr7"
+ },
+ {
+ "name": "psr/container",
+ "version": "1.0.0",
+ "version_normalized": "1.0.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"
+ },
+ "time": "2017-02-14T16:28:37+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "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"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/master"
+ },
+ "install-path": "../psr/container"
+ },
+ {
+ "name": "psr/event-dispatcher",
+ "version": "1.0.0",
+ "version_normalized": "1.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/event-dispatcher.git",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.0"
+ },
+ "time": "2019-01-08T18:20:26+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\EventDispatcher\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Standard interfaces for event handling.",
+ "keywords": [
+ "events",
+ "psr",
+ "psr-14"
+ ],
+ "install-path": "../psr/event-dispatcher"
+ },
+ {
+ "name": "psr/http-client",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-client.git",
+ "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+ "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0"
+ },
+ "time": "2020-06-29T06:28:15+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Client\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP clients",
+ "homepage": "https://github.com/php-fig/http-client",
+ "keywords": [
+ "http",
+ "http-client",
+ "psr",
+ "psr-18"
+ ],
+ "install-path": "../psr/http-client"
+ },
+ {
+ "name": "psr/http-factory",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
+ "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.0.0",
+ "psr/http-message": "^1.0"
+ },
+ "time": "2019-04-30T12:38:16+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory/tree/master"
+ },
+ "install-path": "../psr/http-factory"
+ },
+ {
+ "name": "psr/http-message",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2016-08-06T14:39:51+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
+ "keywords": [
+ "http",
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "install-path": "../psr/http-message"
+ },
+ {
+ "name": "ralouphie/getallheaders",
+ "version": "3.0.3",
+ "version_normalized": "3.0.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ralouphie/getallheaders.git",
+ "reference": "120b605dfeb996808c31b6477290a714d356e822"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
+ "reference": "120b605dfeb996808c31b6477290a714d356e822",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6"
+ },
+ "require-dev": {
+ "php-coveralls/php-coveralls": "^2.1",
+ "phpunit/phpunit": "^5 || ^6.5"
+ },
+ "time": "2019-03-08T08:55:37+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "src/getallheaders.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ralph Khattar",
+ "email": "ralph.khattar@gmail.com"
+ }
+ ],
+ "description": "A polyfill for getallheaders.",
+ "install-path": "../ralouphie/getallheaders"
+ },
+ {
+ "name": "symfony/config",
+ "version": "v5.4.3",
+ "version_normalized": "5.4.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/config.git",
+ "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/config/zipball/d65e1bd990c740e31feb07d2b0927b8d4df9956f",
+ "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/filesystem": "^4.4|^5.0|^6.0",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/polyfill-php81": "^1.22"
+ },
+ "conflict": {
+ "symfony/finder": "<4.4"
+ },
+ "require-dev": {
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/messenger": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/yaml": "^4.4|^5.0|^6.0"
+ },
+ "suggest": {
+ "symfony/yaml": "To use the yaml reference dumper"
+ },
+ "time": "2022-01-03T09:50:52+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Config\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/config/tree/v5.4.3"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/config"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v5.4.5",
+ "version_normalized": "5.4.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/d8111acc99876953f52fe16d4c50eb60940d49ad",
+ "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php73": "^1.9",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/string": "^5.1|^6.0"
+ },
+ "conflict": {
+ "psr/log": ">=3",
+ "symfony/dependency-injection": "<4.4",
+ "symfony/dotenv": "<5.1",
+ "symfony/event-dispatcher": "<4.4",
+ "symfony/lock": "<4.4",
+ "symfony/process": "<4.4"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/lock": "^4.4|^5.0|^6.0",
+ "symfony/process": "^4.4|^5.0|^6.0",
+ "symfony/var-dumper": "^4.4|^5.0|^6.0"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/lock": "",
+ "symfony/process": ""
+ },
+ "time": "2022-02-24T12:45:35+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Eases the creation of beautiful and testable command line interfaces",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "cli",
+ "command line",
+ "console",
+ "terminal"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v5.4.5"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/console"
+ },
+ {
+ "name": "symfony/dependency-injection",
+ "version": "v5.2.12",
+ "version_normalized": "5.2.12.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/dependency-injection.git",
+ "reference": "2f0326ab0e142a3600b1b435cb3e852bc96264b6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2f0326ab0e142a3600b1b435cb3e852bc96264b6",
+ "reference": "2f0326ab0e142a3600b1b435cb3e852bc96264b6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.0",
+ "symfony/deprecation-contracts": "^2.1",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1.6|^2"
+ },
+ "conflict": {
+ "symfony/config": "<5.1",
+ "symfony/finder": "<4.4",
+ "symfony/proxy-manager-bridge": "<4.4",
+ "symfony/yaml": "<4.4"
+ },
+ "provide": {
+ "psr/container-implementation": "1.0",
+ "symfony/service-implementation": "1.0|2.0"
+ },
+ "require-dev": {
+ "symfony/config": "^5.1",
+ "symfony/expression-language": "^4.4|^5.0",
+ "symfony/yaml": "^4.4|^5.0"
+ },
+ "suggest": {
+ "symfony/config": "",
+ "symfony/expression-language": "For using expressions in service container configuration",
+ "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
+ "symfony/yaml": ""
+ },
+ "time": "2021-07-23T15:54:19+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\DependencyInjection\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Allows you to standardize and centralize the way objects are constructed in your application",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/dependency-injection/tree/v5.2.12"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/dependency-injection"
+ },
+ {
+ "name": "symfony/deprecation-contracts",
+ "version": "v2.5.0",
+ "version_normalized": "2.5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
+ "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "time": "2021-07-12T14:48:14+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "function.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/deprecation-contracts"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v5.4.3",
+ "version_normalized": "5.4.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d",
+ "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/event-dispatcher-contracts": "^2|^3",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<4.4"
+ },
+ "provide": {
+ "psr/event-dispatcher-implementation": "1.0",
+ "symfony/event-dispatcher-implementation": "2.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/expression-language": "^4.4|^5.0|^6.0",
+ "symfony/http-foundation": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/stopwatch": "^4.4|^5.0|^6.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "time": "2022-01-02T09:53:40+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/event-dispatcher"
+ },
+ {
+ "name": "symfony/event-dispatcher-contracts",
+ "version": "v2.5.0",
+ "version_normalized": "2.5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher-contracts.git",
+ "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a",
+ "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/event-dispatcher": "^1"
+ },
+ "suggest": {
+ "symfony/event-dispatcher-implementation": ""
+ },
+ "time": "2021-07-12T14:48:14+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\EventDispatcher\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to dispatching event",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/event-dispatcher-contracts"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v5.4.6",
+ "version_normalized": "5.4.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "d53a45039974952af7f7ebc461ccdd4295e29440"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/d53a45039974952af7f7ebc461ccdd4295e29440",
+ "reference": "d53a45039974952af7f7ebc461ccdd4295e29440",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "time": "2022-03-02T12:42:23+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides basic utilities for the filesystem",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v5.4.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/filesystem"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-ctype": "*"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "time": "2021-10-20T20:35:02+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-ctype"
+ },
+ {
+ "name": "symfony/polyfill-intl-grapheme",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+ "reference": "81b86b50cf841a64252b439e738e97f4a34e2783"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783",
+ "reference": "81b86b50cf841a64252b439e738e97f4a34e2783",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "time": "2021-11-23T21:10:46+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's grapheme_* functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "grapheme",
+ "intl",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-intl-grapheme"
+ },
+ {
+ "name": "symfony/polyfill-intl-normalizer",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+ "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
+ "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "time": "2021-02-19T12:13:01+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "intl",
+ "normalizer",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-intl-normalizer"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-mbstring": "*"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "time": "2021-11-30T18:21:41+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-mbstring"
+ },
+ {
+ "name": "symfony/polyfill-php73",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php73.git",
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "time": "2021-06-05T21:20:04+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-php73"
+ },
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
+ "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "time": "2022-03-04T08:16:47+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-php80"
+ },
+ {
+ "name": "symfony/polyfill-php81",
+ "version": "v1.25.0",
+ "version_normalized": "1.25.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "time": "2021-09-13T13:58:11+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.23-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php81\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/polyfill-php81"
+ },
+ {
+ "name": "symfony/service-contracts",
+ "version": "v2.2.0",
+ "version_normalized": "2.2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
+ "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.0"
+ },
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
+ "time": "2020-09-07T11:33:47+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Service\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to writing services",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/master"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/service-contracts"
+ },
+ {
+ "name": "symfony/string",
+ "version": "v5.4.3",
+ "version_normalized": "5.4.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/string.git",
+ "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10",
+ "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-intl-grapheme": "~1.0",
+ "symfony/polyfill-intl-normalizer": "~1.0",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php80": "~1.15"
+ },
+ "conflict": {
+ "symfony/translation-contracts": ">=3.0"
+ },
+ "require-dev": {
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/http-client": "^4.4|^5.0|^6.0",
+ "symfony/translation-contracts": "^1.1|^2",
+ "symfony/var-exporter": "^4.4|^5.0|^6.0"
+ },
+ "time": "2022-01-02T09:53:40+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "Resources/functions.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\String\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "grapheme",
+ "i18n",
+ "string",
+ "unicode",
+ "utf-8",
+ "utf8"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/string/tree/v5.4.3"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/string"
+ },
+ {
+ "name": "symfony/translation",
+ "version": "v5.4.6",
+ "version_normalized": "5.4.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/translation.git",
+ "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/a7ca9fdfffb0174209440c2ffa1dee228e15d95b",
+ "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/translation-contracts": "^2.3"
+ },
+ "conflict": {
+ "symfony/config": "<4.4",
+ "symfony/console": "<5.3",
+ "symfony/dependency-injection": "<5.0",
+ "symfony/http-kernel": "<5.0",
+ "symfony/twig-bundle": "<5.0",
+ "symfony/yaml": "<4.4"
+ },
+ "provide": {
+ "symfony/translation-implementation": "2.3"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/console": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.0|^6.0",
+ "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/http-client-contracts": "^1.1|^2.0|^3.0",
+ "symfony/http-kernel": "^5.0|^6.0",
+ "symfony/intl": "^4.4|^5.0|^6.0",
+ "symfony/polyfill-intl-icu": "^1.21",
+ "symfony/service-contracts": "^1.1.2|^2|^3",
+ "symfony/yaml": "^4.4|^5.0|^6.0"
+ },
+ "suggest": {
+ "psr/log-implementation": "To use logging capability in translator",
+ "symfony/config": "",
+ "symfony/yaml": ""
+ },
+ "time": "2022-03-02T12:56:28+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "Resources/functions.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\Translation\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides tools to internationalize your application",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/translation/tree/v5.4.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/translation"
+ },
+ {
+ "name": "symfony/translation-contracts",
+ "version": "v2.5.0",
+ "version_normalized": "2.5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/translation-contracts.git",
+ "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e",
+ "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5"
+ },
+ "suggest": {
+ "symfony/translation-implementation": ""
+ },
+ "time": "2021-08-17T14:20:01+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Translation\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to translation",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/translation-contracts"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v5.4.3",
+ "version_normalized": "5.4.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "e80f87d2c9495966768310fc531b487ce64237a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2",
+ "reference": "e80f87d2c9495966768310fc531b487ce64237a2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-ctype": "^1.8"
+ },
+ "conflict": {
+ "symfony/console": "<5.3"
+ },
+ "require-dev": {
+ "symfony/console": "^5.3|^6.0"
+ },
+ "suggest": {
+ "symfony/console": "For validating YAML files using the lint command"
+ },
+ "time": "2022-01-26T16:32:32+00:00",
+ "bin": [
+ "Resources/bin/yaml-lint"
+ ],
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Loads and dumps YAML files",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/yaml/tree/v5.4.3"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "../symfony/yaml"
+ }
+ ],
+ "dev": true,
+ "dev-package-names": [
+ "behat/behat",
+ "behat/gherkin",
+ "behat/transliterator",
+ "guzzlehttp/guzzle",
+ "guzzlehttp/promises",
+ "guzzlehttp/psr7",
+ "psr/container",
+ "psr/event-dispatcher",
+ "psr/http-client",
+ "psr/http-factory",
+ "psr/http-message",
+ "ralouphie/getallheaders",
+ "symfony/config",
+ "symfony/console",
+ "symfony/dependency-injection",
+ "symfony/deprecation-contracts",
+ "symfony/event-dispatcher",
+ "symfony/event-dispatcher-contracts",
+ "symfony/filesystem",
+ "symfony/polyfill-ctype",
+ "symfony/polyfill-intl-grapheme",
+ "symfony/polyfill-intl-normalizer",
+ "symfony/polyfill-mbstring",
+ "symfony/polyfill-php73",
+ "symfony/polyfill-php80",
+ "symfony/polyfill-php81",
+ "symfony/service-contracts",
+ "symfony/string",
+ "symfony/translation",
+ "symfony/translation-contracts",
+ "symfony/yaml"
+ ]
+}
diff --git a/tests/integration/vendor/composer/installed.php b/tests/integration/vendor/composer/installed.php
new file mode 100644
index 000000000..8f7263632
--- /dev/null
+++ b/tests/integration/vendor/composer/installed.php
@@ -0,0 +1,356 @@
+ array(
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => 'cbc480eadc87e4f8dcb722ba76e7fe78903b9e60',
+ 'name' => '__root__',
+ 'dev' => true,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => 'cbc480eadc87e4f8dcb722ba76e7fe78903b9e60',
+ 'dev_requirement' => false,
+ ),
+ 'behat/behat' => array(
+ 'pretty_version' => 'v3.10.0',
+ 'version' => '3.10.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../behat/behat',
+ 'aliases' => array(),
+ 'reference' => 'a55661154079cf881ef643b303bfaf67bae3a09f',
+ 'dev_requirement' => true,
+ ),
+ 'behat/gherkin' => array(
+ 'pretty_version' => 'v4.9.0',
+ 'version' => '4.9.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../behat/gherkin',
+ 'aliases' => array(),
+ 'reference' => '0bc8d1e30e96183e4f36db9dc79caead300beff4',
+ 'dev_requirement' => true,
+ ),
+ 'behat/transliterator' => array(
+ 'pretty_version' => 'v1.3.0',
+ 'version' => '1.3.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../behat/transliterator',
+ 'aliases' => array(),
+ 'reference' => '3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc',
+ 'dev_requirement' => true,
+ ),
+ 'guzzlehttp/guzzle' => array(
+ 'pretty_version' => '7.4.1',
+ 'version' => '7.4.1.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
+ 'aliases' => array(),
+ 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79',
+ 'dev_requirement' => true,
+ ),
+ 'guzzlehttp/promises' => array(
+ 'pretty_version' => '1.5.1',
+ 'version' => '1.5.1.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../guzzlehttp/promises',
+ 'aliases' => array(),
+ 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da',
+ 'dev_requirement' => true,
+ ),
+ 'guzzlehttp/psr7' => array(
+ 'pretty_version' => '2.1.0',
+ 'version' => '2.1.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../guzzlehttp/psr7',
+ 'aliases' => array(),
+ 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72',
+ 'dev_requirement' => true,
+ ),
+ 'psr/container' => array(
+ 'pretty_version' => '1.0.0',
+ 'version' => '1.0.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/container',
+ 'aliases' => array(),
+ 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f',
+ 'dev_requirement' => true,
+ ),
+ 'psr/container-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0',
+ ),
+ ),
+ 'psr/event-dispatcher' => array(
+ 'pretty_version' => '1.0.0',
+ 'version' => '1.0.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/event-dispatcher',
+ 'aliases' => array(),
+ 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0',
+ 'dev_requirement' => true,
+ ),
+ 'psr/event-dispatcher-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0',
+ ),
+ ),
+ 'psr/http-client' => array(
+ 'pretty_version' => '1.0.1',
+ 'version' => '1.0.1.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-client',
+ 'aliases' => array(),
+ 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
+ 'dev_requirement' => true,
+ ),
+ 'psr/http-client-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0',
+ ),
+ ),
+ 'psr/http-factory' => array(
+ 'pretty_version' => '1.0.1',
+ 'version' => '1.0.1.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-factory',
+ 'aliases' => array(),
+ 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
+ 'dev_requirement' => true,
+ ),
+ 'psr/http-factory-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0',
+ ),
+ ),
+ 'psr/http-message' => array(
+ 'pretty_version' => '1.0.1',
+ 'version' => '1.0.1.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-message',
+ 'aliases' => array(),
+ 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
+ 'dev_requirement' => true,
+ ),
+ 'psr/http-message-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0',
+ ),
+ ),
+ 'psr/log-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0|2.0',
+ ),
+ ),
+ 'ralouphie/getallheaders' => array(
+ 'pretty_version' => '3.0.3',
+ 'version' => '3.0.3.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../ralouphie/getallheaders',
+ 'aliases' => array(),
+ 'reference' => '120b605dfeb996808c31b6477290a714d356e822',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/config' => array(
+ 'pretty_version' => 'v5.4.3',
+ 'version' => '5.4.3.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/config',
+ 'aliases' => array(),
+ 'reference' => 'd65e1bd990c740e31feb07d2b0927b8d4df9956f',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/console' => array(
+ 'pretty_version' => 'v5.4.5',
+ 'version' => '5.4.5.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/console',
+ 'aliases' => array(),
+ 'reference' => 'd8111acc99876953f52fe16d4c50eb60940d49ad',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/dependency-injection' => array(
+ 'pretty_version' => 'v5.2.12',
+ 'version' => '5.2.12.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/dependency-injection',
+ 'aliases' => array(),
+ 'reference' => '2f0326ab0e142a3600b1b435cb3e852bc96264b6',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/deprecation-contracts' => array(
+ 'pretty_version' => 'v2.5.0',
+ 'version' => '2.5.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
+ 'aliases' => array(),
+ 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/event-dispatcher' => array(
+ 'pretty_version' => 'v5.4.3',
+ 'version' => '5.4.3.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/event-dispatcher',
+ 'aliases' => array(),
+ 'reference' => 'dec8a9f58d20df252b9cd89f1c6c1530f747685d',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/event-dispatcher-contracts' => array(
+ 'pretty_version' => 'v2.5.0',
+ 'version' => '2.5.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts',
+ 'aliases' => array(),
+ 'reference' => '66bea3b09be61613cd3b4043a65a8ec48cfa6d2a',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/event-dispatcher-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '2.0',
+ ),
+ ),
+ 'symfony/filesystem' => array(
+ 'pretty_version' => 'v5.4.6',
+ 'version' => '5.4.6.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/filesystem',
+ 'aliases' => array(),
+ 'reference' => 'd53a45039974952af7f7ebc461ccdd4295e29440',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-ctype' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
+ 'aliases' => array(),
+ 'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-intl-grapheme' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
+ 'aliases' => array(),
+ 'reference' => '81b86b50cf841a64252b439e738e97f4a34e2783',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-intl-normalizer' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
+ 'aliases' => array(),
+ 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-mbstring' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
+ 'aliases' => array(),
+ 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-php73' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-php73',
+ 'aliases' => array(),
+ 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-php80' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-php80',
+ 'aliases' => array(),
+ 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/polyfill-php81' => array(
+ 'pretty_version' => 'v1.25.0',
+ 'version' => '1.25.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-php81',
+ 'aliases' => array(),
+ 'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/service-contracts' => array(
+ 'pretty_version' => 'v2.2.0',
+ 'version' => '2.2.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/service-contracts',
+ 'aliases' => array(),
+ 'reference' => 'd15da7ba4957ffb8f1747218be9e1a121fd298a1',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/service-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '1.0|2.0',
+ ),
+ ),
+ 'symfony/string' => array(
+ 'pretty_version' => 'v5.4.3',
+ 'version' => '5.4.3.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/string',
+ 'aliases' => array(),
+ 'reference' => '92043b7d8383e48104e411bc9434b260dbeb5a10',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/translation' => array(
+ 'pretty_version' => 'v5.4.6',
+ 'version' => '5.4.6.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/translation',
+ 'aliases' => array(),
+ 'reference' => 'a7ca9fdfffb0174209440c2ffa1dee228e15d95b',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/translation-contracts' => array(
+ 'pretty_version' => 'v2.5.0',
+ 'version' => '2.5.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/translation-contracts',
+ 'aliases' => array(),
+ 'reference' => 'd28150f0f44ce854e942b671fc2620a98aae1b1e',
+ 'dev_requirement' => true,
+ ),
+ 'symfony/translation-implementation' => array(
+ 'dev_requirement' => true,
+ 'provided' => array(
+ 0 => '2.3',
+ ),
+ ),
+ 'symfony/yaml' => array(
+ 'pretty_version' => 'v5.4.3',
+ 'version' => '5.4.3.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/yaml',
+ 'aliases' => array(),
+ 'reference' => 'e80f87d2c9495966768310fc531b487ce64237a2',
+ 'dev_requirement' => true,
+ ),
+ ),
+);
diff --git a/tests/integration/vendor/composer/platform_check.php b/tests/integration/vendor/composer/platform_check.php
new file mode 100644
index 000000000..92370c5a0
--- /dev/null
+++ b/tests/integration/vendor/composer/platform_check.php
@@ -0,0 +1,26 @@
+= 70300)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/tests/integration/vendor/container-interop/container-interop/LICENSE b/tests/integration/vendor/container-interop/container-interop/LICENSE
deleted file mode 100644
index 7671d9020..000000000
--- a/tests/integration/vendor/container-interop/container-interop/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 container-interop
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tests/integration/vendor/container-interop/container-interop/README.md b/tests/integration/vendor/container-interop/container-interop/README.md
deleted file mode 100644
index ec434d0f2..000000000
--- a/tests/integration/vendor/container-interop/container-interop/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# Container Interoperability
-
-[](https://packagist.org/packages/container-interop/container-interop)
-
-*container-interop* tries to identify and standardize features in *container* objects (service locators,
-dependency injection containers, etc.) to achieve interopererability.
-
-Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.
-
-If PHP projects that provide container implementations begin to adopt these common standards, then PHP
-applications and projects that use containers can depend on the common interfaces instead of specific
-implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume
-*any* container implementation that can be adapted to these interfaces.
-
-The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being
-worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope
-this project will pave the way for one or more future PSRs.
-
-
-## Installation
-
-You can install this package through Composer:
-
-```json
-{
- "require": {
- "container-interop/container-interop": "~1.0"
- }
-}
-```
-
-The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility
-between minor versions.
-
-## Standards
-
-### Available
-
-- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php).
-[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md).
-Describes the interface of a container that exposes methods to read its entries.
-- [*Delegate lookup feature*](docs/Delegate-lookup.md).
-[Meta Document](docs/Delegate-lookup-meta.md).
-Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This
-feature lets several containers work together in a single application.
-
-### Proposed
-
-View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC)
-
-## Compatible projects
-
-### Projects implementing `ContainerInterface`
-
-- [Acclimate](https://github.com/jeremeamia/acclimate-container)
-- [dcp-di](https://github.com/estelsmith/dcp-di)
-- [Mouf](http://mouf-php.com)
-- [Njasm Container](https://github.com/njasm/container)
-- [PHP-DI](http://php-di.org)
-- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
-- [XStatic](https://github.com/jeremeamia/xstatic)
-
-### Projects implementing the *delegate lookup* feature
-
-- [Mouf](http://mouf-php.com)
-- [PHP-DI](http://php-di.org)
-- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
-
-## Workflow
-
-Everyone is welcome to join and contribute.
-
-The general workflow looks like this:
-
-1. Someone opens a discussion (GitHub issue) to suggest an interface
-1. Feedback is gathered
-1. The interface is added to a development branch
-1. We release alpha versions so that the interface can be experimented with
-1. Discussions and edits ensue until the interface is deemed stable by a general consensus
-1. A new minor version of the package is released
-
-We try to not break BC by creating new interfaces instead of editing existing ones.
-
-While we currently work on interfaces, we are open to anything that might help towards interoperability, may that
-be code, best practices, etc.
diff --git a/tests/integration/vendor/container-interop/container-interop/composer.json b/tests/integration/vendor/container-interop/container-interop/composer.json
deleted file mode 100644
index 84f387528..000000000
--- a/tests/integration/vendor/container-interop/container-interop/composer.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "container-interop/container-interop",
- "type": "library",
- "description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
- "license": "MIT",
- "autoload": {
- "psr-4": {
- "Interop\\Container\\": "src/Interop/Container/"
- }
- }
-}
diff --git a/tests/integration/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md b/tests/integration/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md
deleted file mode 100644
index 90711c905..000000000
--- a/tests/integration/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md
+++ /dev/null
@@ -1,114 +0,0 @@
-# ContainerInterface Meta Document
-
-## Introduction
-
-This document describes the process and discussions that lead to the `ContainerInterface`.
-Its goal is to explain the reasons behind each decision.
-
-## Goal
-
-The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a
-container to obtain objects and parameters.
-
-By standardizing such a behavior, frameworks and libraries using the `ContainerInterface`
-could work with any compatible container.
-That would allow end users to choose their own container based on their own preferences.
-
-It is important to distinguish the two usages of a container:
-
-- configuring entries
-- fetching entries
-
-Most of the time, those two sides are not used by the same party.
-While it is often end users who tend to configure entries, it is generally the framework that fetch
-entries to build the application.
-
-This is why this interface focuses only on how entries can be fetched from a container.
-
-## Interface name
-
-The interface name has been thoroughly discussed and was decided by a vote.
-
-The list of options considered with their respective votes are:
-
-- `ContainerInterface`: +8
-- `ProviderInterface`: +2
-- `LocatorInterface`: 0
-- `ReadableContainerInterface`: -5
-- `ServiceLocatorInterface`: -6
-- `ObjectFactory`: -6
-- `ObjectStore`: -8
-- `ConsumerInterface`: -9
-
-[Full results of the vote](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote)
-
-The complete discussion can be read in [the issue #1](https://github.com/container-interop/container-interop/issues/1).
-
-## Interface methods
-
-The choice of which methods the interface would contain was made after a statistical analysis of existing containers.
-The results of this analysis are available [in this document](https://gist.github.com/mnapoli/6159681).
-
-The summary of the analysis showed that:
-
-- all containers offer a method to get an entry by its id
-- a large majority name such method `get()`
-- for all containers, the `get()` method has 1 mandatory parameter of type string
-- some containers have an optional additional argument for `get()`, but it doesn't same the same purpose between containers
-- a large majority of the containers offer a method to test if it can return an entry by its id
-- a majority name such method `has()`
-- for all containers offering `has()`, the method has exactly 1 parameter of type string
-- a large majority of the containers throw an exception rather than returning null when an entry is not found in `get()`
-- a large majority of the containers don't implement `ArrayAccess`
-
-The question of whether to include methods to define entries has been discussed in
-[issue #1](https://github.com/container-interop/container-interop/issues/1).
-It has been judged that such methods do not belong in the interface described here because it is out of its scope
-(see the "Goal" section).
-
-As a result, the `ContainerInterface` contains two methods:
-
-- `get()`, returning anything, with one mandatory string parameter. Should throw an exception if the entry is not found.
-- `has()`, returning a boolean, with one mandatory string parameter.
-
-### Number of parameters in `get()` method
-
-While `ContainerInterface` only defines one mandatory parameter in `get()`, it is not incompatible with
-existing containers that have additional optional parameters. PHP allows an implementation to offer more parameters
-as long as they are optional, because the implementation *does* satisfy the interface.
-
-This issue has been discussed in [issue #6](https://github.com/container-interop/container-interop/issues/6).
-
-### Type of the `$id` parameter
-
-The type of the `$id` parameter in `get()` and `has()` has been discussed in
-[issue #6](https://github.com/container-interop/container-interop/issues/6).
-While `string` is used in all the containers that were analyzed, it was suggested that allowing
-anything (such as objects) could allow containers to offer a more advanced query API.
-
-An example given was to use the container as an object builder. The `$id` parameter would then be an
-object that would describe how to create an instance.
-
-The conclusion of the discussion was that this was beyond the scope of getting entries from a container without
-knowing how the container provided them, and it was more fit for a factory.
-
-## Contributors
-
-Are listed here all people that contributed in the discussions or votes, by alphabetical order:
-
-- [Amy Stephen](https://github.com/AmyStephen)
-- [David Négrier](https://github.com/moufmouf)
-- [Don Gilbert](https://github.com/dongilbert)
-- [Jason Judge](https://github.com/judgej)
-- [Jeremy Lindblom](https://github.com/jeremeamia)
-- [Marco Pivetta](https://github.com/Ocramius)
-- [Matthieu Napoli](https://github.com/mnapoli)
-- [Paul M. Jones](https://github.com/pmjones)
-- [Stephan Hochdörfer](https://github.com/shochdoerfer)
-- [Taylor Otwell](https://github.com/taylorotwell)
-
-## Relevant links
-
-- [`ContainerInterface.php`](https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php)
-- [List of all issues](https://github.com/container-interop/container-interop/issues?labels=ContainerInterface&milestone=&page=1&state=closed)
-- [Vote for the interface name](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote)
diff --git a/tests/integration/vendor/container-interop/container-interop/docs/ContainerInterface.md b/tests/integration/vendor/container-interop/container-interop/docs/ContainerInterface.md
deleted file mode 100644
index 9f609674c..000000000
--- a/tests/integration/vendor/container-interop/container-interop/docs/ContainerInterface.md
+++ /dev/null
@@ -1,153 +0,0 @@
-Container interface
-===================
-
-This document describes a common interface for dependency injection containers.
-
-The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a
-container to obtain objects and parameters (called *entries* in the rest of this document).
-
-The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
-"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
-interpreted as described in [RFC 2119][].
-
-The word `implementor` in this document is to be interpreted as someone
-implementing the `ContainerInterface` in a depency injection-related library or framework.
-Users of dependency injections containers (DIC) are refered to as `user`.
-
-[RFC 2119]: http://tools.ietf.org/html/rfc2119
-
-1. Specification
------------------
-
-### 1.1 Basics
-
-- The `Interop\Container\ContainerInterface` exposes two methods : `get` and `has`.
-
-- `get` takes one mandatory parameter: an entry identifier. It MUST be a string.
- A call to `get` can return anything (a *mixed* value), or throws an exception if the identifier
- is not known to the container. Two successive calls to `get` with the same
- identifier SHOULD return the same value. However, depending on the `implementor`
- design and/or `user` configuration, different values might be returned, so
- `user` SHOULD NOT rely on getting the same value on 2 successive calls.
- While `ContainerInterface` only defines one mandatory parameter in `get()`, implementations
- MAY accept additional optional parameters.
-
-- `has` takes one unique parameter: an entry identifier. It MUST return `true`
- if an entry identifier is known to the container and `false` if it is not.
-
-### 1.2 Exceptions
-
-Exceptions directly thrown by the container MUST implement the
-[`Interop\Container\Exception\ContainerException`](../src/Interop/Container/Exception/ContainerException.php).
-
-A call to the `get` method with a non-existing id should throw a
-[`Interop\Container\Exception\NotFoundException`](../src/Interop/Container/Exception/NotFoundException.php).
-
-### 1.3 Additional features
-
-This section describes additional features that MAY be added to a container. Containers are not
-required to implement these features to respect the ContainerInterface.
-
-#### 1.3.1 Delegate lookup feature
-
-The goal of the *delegate lookup* feature is to allow several containers to share entries.
-Containers implementing this feature can perform dependency lookups in other containers.
-
-Containers implementing this feature will offer a greater lever of interoperability
-with other containers. Implementation of this feature is therefore RECOMMENDED.
-
-A container implementing this feature:
-
-- MUST implement the `ContainerInterface`
-- MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
- or any possible way). The delegate container MUST implement the `ContainerInterface`.
-
-When a container is configured to use a delegate container for dependencies:
-
-- Calls to the `get` method should only return an entry if the entry is part of the container.
- If the entry is not part of the container, an exception should be thrown
- (as requested by the `ContainerInterface`).
-- Calls to the `has` method should only return `true` if the entry is part of the container.
- If the entry is not part of the container, `false` should be returned.
-- If the fetched entry has dependencies, **instead** of performing
- the dependency lookup in the container, the lookup is performed on the *delegate container*.
-
-Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself.
-
-It is however allowed for containers to provide exception cases for special entries, and a way to lookup
-into the same container (or another container) instead of the delegate container.
-
-2. Package
-----------
-
-The interfaces and classes described as well as relevant exception are provided as part of the
-[container-interop/container-interop](https://packagist.org/packages/container-interop/container-interop) package.
-
-3. `Interop\Container\ContainerInterface`
------------------------------------------
-
-```php
-setParentContainer($this);
- }
- }
- ...
- }
-}
-
-```
-
-**Cons:**
-
-Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777).
-Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments,
-and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface.
-
-### 4.4 Alternative: no exception case for delegate lookups
-
-Originally, the proposed wording for delegate lookup calls was:
-
-> Important! The lookup MUST be performed on the delegate container **only**, not on the container itself.
-
-This was later replaced by:
-
-> Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself.
->
-> It is however allowed for containers to provide exception cases for special entries, and a way to lookup
-> into the same container (or another container) instead of the delegate container.
-
-Exception cases have been allowed to avoid breaking dependencies with some services that must be provided
-by the container (on @njasm proposal). This was proposed here: https://github.com/container-interop/container-interop/pull/20#issuecomment-56597235
-
-### 4.5 Alternative: having one of the containers act as the composite container
-
-In real-life scenarios, we usually have a big framework (Symfony 2, Zend Framework 2, etc...) and we want to
-add another DI container to this container. Most of the time, the "big" framework will be responsible for
-creating the controller's instances, using it's own DI container. Until *container-interop* is fully adopted,
-the "big" framework will not be aware of the existence of a composite container that it should use instead
-of its own container.
-
-For this real-life use cases, @mnapoli and @moufmouf proposed to extend the "big" framework's DI container
-to make it act as a composite container.
-
-This has been discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-40367194)
-and [here](http://mouf-php.com/container-interop-whats-next#solution4).
-
-This was implemented in Symfony 2 using:
-
-- [interop.symfony.di](https://github.com/thecodingmachine/interop.symfony.di/tree/v0.1.0)
-- [framework interop](https://github.com/mnapoli/framework-interop/)
-
-This was implemented in Silex using:
-
-- [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di)
-
-Having a container act as the composite container is not part of the delegate lookup standard because it is
-simply a temporary design pattern used to make existing frameworks that do not support yet ContainerInterop
-play nice with other DI containers.
-
-
-5. Implementations
-------------------
-
-The following projects already implement the delegate lookup feature:
-
-- [Mouf](http://mouf-php.com), through the [`setDelegateLookupContainer` method](https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/MoufManager.php#L2120)
-- [PHP-DI](http://php-di.org/), through the [`$wrapperContainer` parameter of the constructor](https://github.com/mnapoli/PHP-DI/blob/master/src/DI/Container.php#L72)
-- [pimple-interop](https://github.com/moufmouf/pimple-interop), through the [`$container` parameter of the constructor](https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php#L62)
-
-6. People
----------
-
-Are listed here all people that contributed in the discussions, by alphabetical order:
-
-- [Alexandru Pătrănescu](https://github.com/drealecs)
-- [Ben Peachey](https://github.com/potherca)
-- [David Négrier](https://github.com/moufmouf)
-- [Jeremy Lindblom](https://github.com/jeremeamia)
-- [Marco Pivetta](https://github.com/Ocramius)
-- [Matthieu Napoli](https://github.com/mnapoli)
-- [Nelson J Morais](https://github.com/njasm)
-- [Phil Sturgeon](https://github.com/philsturgeon)
-- [Stephan Hochdörfer](https://github.com/shochdoerfer)
-
-7. Relevant Links
------------------
-
-_**Note:** Order descending chronologically._
-
-- [Pull request on the delegate lookup feature](https://github.com/container-interop/container-interop/pull/20)
-- [Pull request on the interface idea](https://github.com/container-interop/container-interop/pull/8)
-- [Original article exposing the delegate lookup idea along many others](http://mouf-php.com/container-interop-whats-next)
-
diff --git a/tests/integration/vendor/container-interop/container-interop/docs/Delegate-lookup.md b/tests/integration/vendor/container-interop/container-interop/docs/Delegate-lookup.md
deleted file mode 100644
index 04eb3aea0..000000000
--- a/tests/integration/vendor/container-interop/container-interop/docs/Delegate-lookup.md
+++ /dev/null
@@ -1,60 +0,0 @@
-Delegate lookup feature
-=======================
-
-This document describes a standard for dependency injection containers.
-
-The goal set by the *delegate lookup* feature is to allow several containers to share entries.
-Containers implementing this feature can perform dependency lookups in other containers.
-
-Containers implementing this feature will offer a greater lever of interoperability
-with other containers. Implementation of this feature is therefore RECOMMENDED.
-
-The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
-"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
-interpreted as described in [RFC 2119][].
-
-The word `implementor` in this document is to be interpreted as someone
-implementing the delegate lookup feature in a dependency injection-related library or framework.
-Users of dependency injections containers (DIC) are refered to as `user`.
-
-[RFC 2119]: http://tools.ietf.org/html/rfc2119
-
-1. Vocabulary
--------------
-
-In a dependency injection container, the container is used to fetch entries.
-Entries can have dependencies on other entries. Usually, these other entries are fetched by the container.
-
-The *delegate lookup* feature is the ability for a container to fetch dependencies in
-another container. In the rest of the document, the word "container" will reference the container
-implemented by the implementor. The word "delegate container" will reference the container we are
-fetching the dependencies from.
-
-2. Specification
-----------------
-
-A container implementing the *delegate lookup* feature:
-
-- MUST implement the [`ContainerInterface`](ContainerInterface.md)
-- MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
- or any possible way). The delegate container MUST implement the [`ContainerInterface`](ContainerInterface.md).
-
-When a container is configured to use a delegate container for dependencies:
-
-- Calls to the `get` method should only return an entry if the entry is part of the container.
- If the entry is not part of the container, an exception should be thrown
- (as requested by the [`ContainerInterface`](ContainerInterface.md)).
-- Calls to the `has` method should only return `true` if the entry is part of the container.
- If the entry is not part of the container, `false` should be returned.
-- If the fetched entry has dependencies, **instead** of performing
- the dependency lookup in the container, the lookup is performed on the *delegate container*.
-
-Important: By default, the dependency lookups SHOULD be performed on the delegate container **only**, not on the container itself.
-
-It is however allowed for containers to provide exception cases for special entries, and a way to lookup
-into the same container (or another container) instead of the delegate container.
-
-3. Package / Interface
-----------------------
-
-This feature is not tied to any code, interface or package.
diff --git a/tests/integration/vendor/container-interop/container-interop/docs/images/interoperating_containers.png b/tests/integration/vendor/container-interop/container-interop/docs/images/interoperating_containers.png
deleted file mode 100644
index 9c672e16c..000000000
Binary files a/tests/integration/vendor/container-interop/container-interop/docs/images/interoperating_containers.png and /dev/null differ
diff --git a/tests/integration/vendor/container-interop/container-interop/docs/images/priority.png b/tests/integration/vendor/container-interop/container-interop/docs/images/priority.png
deleted file mode 100644
index 5760dc71b..000000000
Binary files a/tests/integration/vendor/container-interop/container-interop/docs/images/priority.png and /dev/null differ
diff --git a/tests/integration/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png b/tests/integration/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png
deleted file mode 100644
index 24ca03c7c..000000000
Binary files a/tests/integration/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png and /dev/null differ
diff --git a/tests/integration/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php b/tests/integration/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php
deleted file mode 100644
index dee5ffa7a..000000000
--- a/tests/integration/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
+The MIT License (MIT)
+
+Copyright (c) 2011 Michael Dowling
+Copyright (c) 2012 Jeremy Lindblom
+Copyright (c) 2014 Graham Campbell
+Copyright (c) 2015 Márk Sági-Kazár
+Copyright (c) 2015 Tobias Schultze
+Copyright (c) 2016 Tobias Nyholm
+Copyright (c) 2016 George Mponos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/README.md b/tests/integration/vendor/guzzlehttp/guzzle/README.md
index bcd18b8e7..0025aa7a1 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/README.md
+++ b/tests/integration/vendor/guzzlehttp/guzzle/README.md
@@ -1,8 +1,9 @@
-Guzzle, PHP HTTP client
-=======================
+
+
+# Guzzle, PHP HTTP client
[](https://github.com/guzzle/guzzle/releases)
-[](https://travis-ci.org/guzzle/guzzle)
+[](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI)
[](https://packagist.org/packages/guzzlehttp/guzzle)
Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
@@ -14,6 +15,7 @@ trivial to integrate with web services.
- Can send both synchronous and asynchronous requests using the same interface.
- Uses PSR-7 interfaces for requests, responses, and streams. This allows you
to utilize other PSR-7 compatible libraries with Guzzle.
+- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients.
- Abstracts away the underlying HTTP transport, allowing you to write
environment and transport agnostic code; i.e., no hard dependency on cURL,
PHP streams, sockets, or non-blocking event loops.
@@ -21,57 +23,40 @@ trivial to integrate with web services.
```php
$client = new \GuzzleHttp\Client();
-$res = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
-echo $res->getStatusCode();
-// 200
-echo $res->getHeaderLine('content-type');
-// 'application/json; charset=utf8'
-echo $res->getBody();
-// '{"id": 1420053, "name": "guzzle", ...}'
+$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
+
+echo $response->getStatusCode(); // 200
+echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
+echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}'
// Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
echo 'I completed! ' . $response->getBody();
});
+
$promise->wait();
```
## Help and docs
+We use GitHub issues only to discuss bugs and new features. For support please refer to:
+
- [Documentation](http://guzzlephp.org/)
- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle)
+- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/)
- [Gitter](https://gitter.im/guzzle/guzzle)
## Installing Guzzle
The recommended way to install Guzzle is through
-[Composer](http://getcomposer.org).
+[Composer](https://getcomposer.org/).
```bash
-# Install Composer
-curl -sS https://getcomposer.org/installer | php
-```
-
-Next, run the Composer command to install the latest stable version of Guzzle:
-
-```bash
-php composer.phar require guzzlehttp/guzzle
-```
-
-After installing, you need to require Composer's autoloader:
-
-```php
-require 'vendor/autoload.php';
+composer require guzzlehttp/guzzle
```
-You can then later update Guzzle using composer:
-
- ```bash
-composer.phar update
- ```
-
## Version Guidance
@@ -79,13 +64,31 @@ composer.phar update
|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------|
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 |
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 |
-| 5.x | Maintained | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 |
-| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 |
+| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 |
+| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 |
+| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >= 7.2 |
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
-[guzzle-6-repo]: https://github.com/guzzle/guzzle
-[guzzle-3-docs]: http://guzzle3.readthedocs.org/en/latest/
-[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/
-[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/
+[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5
+[guzzle-7-repo]: https://github.com/guzzle/guzzle
+[guzzle-3-docs]: http://guzzle3.readthedocs.org
+[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/
+[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/
+[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/
+
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md b/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md
index 91d1dcc99..45417a7e1 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md
+++ b/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md
@@ -1,10 +1,60 @@
Guzzle Upgrade Guide
====================
+6.0 to 7.0
+----------
+
+In order to take advantage of the new features of PHP, Guzzle dropped the support
+of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return
+types for functions and methods have been added wherever possible.
+
+Please make sure:
+- You are calling a function or a method with the correct type.
+- If you extend a class of Guzzle; update all signatures on methods you override.
+
+#### Other backwards compatibility breaking changes
+
+- Class `GuzzleHttp\UriTemplate` is removed.
+- Class `GuzzleHttp\Exception\SeekException` is removed.
+- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`,
+ `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty
+ Response as argument.
+- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException`
+ instead of `GuzzleHttp\Exception\RequestException`.
+- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed.
+- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed.
+- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead.
+- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed.
+ Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative.
+- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed.
+- Request option `exception` is removed. Please use `http_errors`.
+- Request option `save_to` is removed. Please use `sink`.
+- Pool option `pool_size` is removed. Please use `concurrency`.
+- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility.
+- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation.
+- The `log` middleware will log the errors with level `error` instead of `notice`
+- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher).
+
+#### Native functions calls
+
+All internal native functions calls of Guzzle are now prefixed with a slash. This
+change makes it impossible for method overloading by other libraries or applications.
+Example:
+
+```php
+// Before:
+curl_version();
+
+// After:
+\curl_version();
+```
+
+For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master).
+
5.0 to 6.0
----------
-Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages.
+Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages.
Due to the fact that these messages are immutable, this prompted a refactoring
of Guzzle to use a middleware based system rather than an event system. Any
HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be
@@ -167,7 +217,7 @@ passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP
## Removed Fluent Interfaces
-[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil)
+[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/)
from the following classes:
- `GuzzleHttp\Collection`
@@ -820,7 +870,7 @@ HeaderInterface (e.g. toArray(), getAll(), etc.).
3.3 to 3.4
----------
-Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
+Base URLs of a client now follow the rules of https://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
3.2 to 3.3
----------
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/composer.json b/tests/integration/vendor/guzzlehttp/guzzle/composer.json
index 1f328e308..2549f78b2 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/composer.json
+++ b/tests/integration/vendor/guzzlehttp/guzzle/composer.json
@@ -1,44 +1,98 @@
{
"name": "guzzlehttp/guzzle",
- "type": "library",
"description": "Guzzle is a PHP HTTP client library",
- "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"],
- "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "framework",
+ "http",
+ "rest",
+ "web service",
+ "curl",
+ "client",
+ "HTTP client",
+ "PSR-7",
+ "PSR-18"
+ ],
"license": "MIT",
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"require": {
- "php": ">=5.5",
- "guzzlehttp/psr7": "^1.4",
- "guzzlehttp/promises": "^1.0"
+ "php": "^7.2.5 || ^8.0",
+ "ext-json": "*",
+ "guzzlehttp/promises": "^1.5",
+ "guzzlehttp/psr7": "^1.8.3 || ^2.1",
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ },
+ "provide": {
+ "psr/http-client-implementation": "1.0"
},
"require-dev": {
"ext-curl": "*",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
- "psr/log": "^1.0"
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "php-http/client-integration-tests": "^3.0",
+ "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
+ },
+ "suggest": {
+ "ext-curl": "Required for CURL handler support",
+ "ext-intl": "Required for Internationalized Domain Name (IDN) support",
+ "psr/log": "Required for using the Log middleware"
+ },
+ "config": {
+ "preferred-install": "dist",
+ "sort-packages": true
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "7.4-dev"
+ }
},
"autoload": {
- "files": ["src/functions_include.php"],
"psr-4": {
"GuzzleHttp\\": "src/"
- }
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Tests\\": "tests/"
}
- },
- "suggest": {
- "psr/log": "Required for using the Log middleware"
- },
- "extra": {
- "branch-alias": {
- "dev-master": "6.3-dev"
- }
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/tests/integration/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
new file mode 100644
index 000000000..6eca94ef9
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
@@ -0,0 +1,28 @@
+truncateAt = $truncateAt;
+ }
+
+ /**
+ * Returns a summarized message body.
+ */
+ public function summarize(MessageInterface $message): ?string
+ {
+ return $this->truncateAt === null
+ ? \GuzzleHttp\Psr7\Message::bodySummary($message)
+ : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt);
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php
new file mode 100644
index 000000000..3e02e036e
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php
@@ -0,0 +1,13 @@
+configureDefaults($config);
}
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return PromiseInterface|ResponseInterface
+ *
+ * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0.
+ */
public function __call($method, $args)
{
- if (count($args) < 1) {
- throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
+ if (\count($args) < 1) {
+ throw new InvalidArgumentException('Magic request methods require a URI and optional options array');
}
$uri = $args[0];
- $opts = isset($args[1]) ? $args[1] : [];
+ $opts = $args[1] ?? [];
- return substr($method, -5) === 'Async'
- ? $this->requestAsync(substr($method, 0, -5), $uri, $opts)
+ return \substr($method, -5) === 'Async'
+ ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts)
: $this->request($method, $uri, $opts);
}
- public function sendAsync(RequestInterface $request, array $options = [])
+ /**
+ * Asynchronously send an HTTP request.
+ *
+ * @param array $options Request options to apply to the given
+ * request and to the transfer. See \GuzzleHttp\RequestOptions.
+ */
+ public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface
{
// Merge the base URI into the request URI if needed.
$options = $this->prepareDefaults($options);
@@ -100,23 +109,57 @@ public function sendAsync(RequestInterface $request, array $options = [])
);
}
- public function send(RequestInterface $request, array $options = [])
+ /**
+ * Send an HTTP request.
+ *
+ * @param array $options Request options to apply to the given
+ * request and to the transfer. See \GuzzleHttp\RequestOptions.
+ *
+ * @throws GuzzleException
+ */
+ public function send(RequestInterface $request, array $options = []): ResponseInterface
+ {
+ $options[RequestOptions::SYNCHRONOUS] = true;
+ return $this->sendAsync($request, $options)->wait();
+ }
+
+ /**
+ * The HttpClient PSR (PSR-18) specify this method.
+ *
+ * @inheritDoc
+ */
+ public function sendRequest(RequestInterface $request): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
+ $options[RequestOptions::ALLOW_REDIRECTS] = false;
+ $options[RequestOptions::HTTP_ERRORS] = false;
+
return $this->sendAsync($request, $options)->wait();
}
- public function requestAsync($method, $uri = '', array $options = [])
+ /**
+ * Create and send an asynchronous HTTP request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string $method HTTP method
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
+ */
+ public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface
{
$options = $this->prepareDefaults($options);
// Remove request modifying parameter because it can be done up-front.
- $headers = isset($options['headers']) ? $options['headers'] : [];
- $body = isset($options['body']) ? $options['body'] : null;
- $version = isset($options['version']) ? $options['version'] : '1.1';
+ $headers = $options['headers'] ?? [];
+ $body = $options['body'] ?? null;
+ $version = $options['version'] ?? '1.1';
// Merge the URI into the base URI.
- $uri = $this->buildUri($uri, $options);
- if (is_array($body)) {
- $this->invalidBody();
+ $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options);
+ if (\is_array($body)) {
+ throw $this->invalidBody();
}
$request = new Psr7\Request($method, $uri, $headers, $body, $version);
// Remove the option so that they are not doubly-applied.
@@ -125,26 +168,54 @@ public function requestAsync($method, $uri = '', array $options = [])
return $this->transfer($request, $options);
}
- public function request($method, $uri = '', array $options = [])
+ /**
+ * Create and send an HTTP request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string $method HTTP method.
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
+ *
+ * @throws GuzzleException
+ */
+ public function request(string $method, $uri = '', array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->requestAsync($method, $uri, $options)->wait();
}
- public function getConfig($option = null)
+ /**
+ * Get a client configuration option.
+ *
+ * These options include default request options of the client, a "handler"
+ * (if utilized by the concrete client), and a "base_uri" if utilized by
+ * the concrete client.
+ *
+ * @param string|null $option The config option to retrieve.
+ *
+ * @return mixed
+ *
+ * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0.
+ */
+ public function getConfig(?string $option = null)
{
return $option === null
? $this->config
- : (isset($this->config[$option]) ? $this->config[$option] : null);
+ : ($this->config[$option] ?? null);
}
- private function buildUri($uri, array $config)
+ private function buildUri(UriInterface $uri, array $config): UriInterface
{
- // for BC we accept null which would otherwise fail in uri_for
- $uri = Psr7\uri_for($uri === null ? '' : $uri);
-
if (isset($config['base_uri'])) {
- $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
+ $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri);
+ }
+
+ if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
+ $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion'];
+ $uri = Utils::idnUriConvert($uri, $idnOptions);
}
return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
@@ -152,17 +223,16 @@ private function buildUri($uri, array $config)
/**
* Configures the default options for a client.
- *
- * @param array $config
*/
- private function configureDefaults(array $config)
+ private function configureDefaults(array $config): void
{
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => true,
- 'cookies' => false
+ 'cookies' => false,
+ 'idn_conversion' => false,
];
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
@@ -170,17 +240,17 @@ private function configureDefaults(array $config)
// We can only trust the HTTP_PROXY environment variable in a CLI
// process due to the fact that PHP has no reliable mechanism to
// get environment variables that start with "HTTP_".
- if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) {
- $defaults['proxy']['http'] = getenv('HTTP_PROXY');
+ if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) {
+ $defaults['proxy']['http'] = $proxy;
}
- if ($proxy = getenv('HTTPS_PROXY')) {
+ if ($proxy = Utils::getenv('HTTPS_PROXY')) {
$defaults['proxy']['https'] = $proxy;
}
- if ($noProxy = getenv('NO_PROXY')) {
- $cleanedNoProxy = str_replace(' ', '', $noProxy);
- $defaults['proxy']['no'] = explode(',', $cleanedNoProxy);
+ if ($noProxy = Utils::getenv('NO_PROXY')) {
+ $cleanedNoProxy = \str_replace(' ', '', $noProxy);
+ $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy);
}
$this->config = $config + $defaults;
@@ -191,15 +261,15 @@ private function configureDefaults(array $config)
// Add the default user-agent header.
if (!isset($this->config['headers'])) {
- $this->config['headers'] = ['User-Agent' => default_user_agent()];
+ $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()];
} else {
// Add the User-Agent header if one was not already set.
- foreach (array_keys($this->config['headers']) as $name) {
- if (strtolower($name) === 'user-agent') {
+ foreach (\array_keys($this->config['headers']) as $name) {
+ if (\strtolower($name) === 'user-agent') {
return;
}
}
- $this->config['headers']['User-Agent'] = default_user_agent();
+ $this->config['headers']['User-Agent'] = Utils::defaultUserAgent();
}
}
@@ -207,10 +277,8 @@ private function configureDefaults(array $config)
* Merges default options into the array.
*
* @param array $options Options to modify by reference
- *
- * @return array
*/
- private function prepareDefaults($options)
+ private function prepareDefaults(array $options): array
{
$defaults = $this->config;
@@ -222,13 +290,13 @@ private function prepareDefaults($options)
// Special handling for headers is required as they are added as
// conditional headers and as headers passed to a request ctor.
- if (array_key_exists('headers', $options)) {
+ if (\array_key_exists('headers', $options)) {
// Allows default headers to be unset.
if ($options['headers'] === null) {
- $defaults['_conditional'] = null;
+ $defaults['_conditional'] = [];
unset($options['headers']);
- } elseif (!is_array($options['headers'])) {
- throw new \InvalidArgumentException('headers must be an array');
+ } elseif (!\is_array($options['headers'])) {
+ throw new InvalidArgumentException('headers must be an array');
}
}
@@ -251,66 +319,50 @@ private function prepareDefaults($options)
* The URI of the request is not modified and the request options are used
* as-is without merging in default options.
*
- * @param RequestInterface $request
- * @param array $options
- *
- * @return Promise\PromiseInterface
+ * @param array $options See \GuzzleHttp\RequestOptions.
*/
- private function transfer(RequestInterface $request, array $options)
+ private function transfer(RequestInterface $request, array $options): PromiseInterface
{
- // save_to -> sink
- if (isset($options['save_to'])) {
- $options['sink'] = $options['save_to'];
- unset($options['save_to']);
- }
-
- // exceptions -> http_errors
- if (isset($options['exceptions'])) {
- $options['http_errors'] = $options['exceptions'];
- unset($options['exceptions']);
- }
-
$request = $this->applyOptions($request, $options);
+ /** @var HandlerStack $handler */
$handler = $options['handler'];
try {
- return Promise\promise_for($handler($request, $options));
+ return P\Create::promiseFor($handler($request, $options));
} catch (\Exception $e) {
- return Promise\rejection_for($e);
+ return P\Create::rejectionFor($e);
}
}
/**
* Applies the array of request options to a request.
- *
- * @param RequestInterface $request
- * @param array $options
- *
- * @return RequestInterface
*/
- private function applyOptions(RequestInterface $request, array &$options)
+ private function applyOptions(RequestInterface $request, array &$options): RequestInterface
{
$modify = [
'set_headers' => [],
];
if (isset($options['headers'])) {
+ if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) {
+ throw new InvalidArgumentException('The headers array must have header name as keys.');
+ }
$modify['set_headers'] = $options['headers'];
unset($options['headers']);
}
if (isset($options['form_params'])) {
if (isset($options['multipart'])) {
- throw new \InvalidArgumentException('You cannot use '
+ throw new InvalidArgumentException('You cannot use '
. 'form_params and multipart at the same time. Use the '
. 'form_params option if you want to send application/'
. 'x-www-form-urlencoded requests, and the multipart '
. 'option to send multipart/form-data requests.');
}
- $options['body'] = http_build_query($options['form_params'], '', '&');
+ $options['body'] = \http_build_query($options['form_params'], '', '&');
unset($options['form_params']);
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
}
@@ -320,10 +372,10 @@ private function applyOptions(RequestInterface $request, array &$options)
}
if (isset($options['json'])) {
- $options['body'] = \GuzzleHttp\json_encode($options['json']);
+ $options['body'] = Utils::jsonEncode($options['json']);
unset($options['json']);
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'application/json';
}
@@ -331,47 +383,47 @@ private function applyOptions(RequestInterface $request, array &$options)
&& $options['decode_content'] !== true
) {
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']);
$modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
}
if (isset($options['body'])) {
- if (is_array($options['body'])) {
- $this->invalidBody();
+ if (\is_array($options['body'])) {
+ throw $this->invalidBody();
}
- $modify['body'] = Psr7\stream_for($options['body']);
+ $modify['body'] = Psr7\Utils::streamFor($options['body']);
unset($options['body']);
}
- if (!empty($options['auth']) && is_array($options['auth'])) {
+ if (!empty($options['auth']) && \is_array($options['auth'])) {
$value = $options['auth'];
- $type = isset($value[2]) ? strtolower($value[2]) : 'basic';
+ $type = isset($value[2]) ? \strtolower($value[2]) : 'basic';
switch ($type) {
case 'basic':
// Ensure that we don't have the header in different case and set the new value.
- $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']);
+ $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
$modify['set_headers']['Authorization'] = 'Basic '
- . base64_encode("$value[0]:$value[1]");
+ . \base64_encode("$value[0]:$value[1]");
break;
case 'digest':
// @todo: Do not rely on curl
- $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;
- $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
+ $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST;
+ $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
break;
case 'ntlm':
- $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM;
- $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
+ $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM;
+ $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
break;
}
}
if (isset($options['query'])) {
$value = $options['query'];
- if (is_array($value)) {
- $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986);
+ if (\is_array($value)) {
+ $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986);
}
- if (!is_string($value)) {
- throw new \InvalidArgumentException('query must be a string or array');
+ if (!\is_string($value)) {
+ throw new InvalidArgumentException('query must be a string or array');
}
$modify['query'] = $value;
unset($options['query']);
@@ -380,16 +432,16 @@ private function applyOptions(RequestInterface $request, array &$options)
// Ensure that sink is not an invalid value.
if (isset($options['sink'])) {
// TODO: Add more sink validation?
- if (is_bool($options['sink'])) {
- throw new \InvalidArgumentException('sink must not be a boolean');
+ if (\is_bool($options['sink'])) {
+ throw new InvalidArgumentException('sink must not be a boolean');
}
}
- $request = Psr7\modify_request($request, $modify);
+ $request = Psr7\Utils::modifyRequest($request, $modify);
if ($request->getBody() instanceof Psr7\MultipartStream) {
// Use a multipart/form-data POST if a Content-Type is not set.
// Ensure that we don't have the header in different case and set the new value.
- $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
. $request->getBody()->getBoundary();
}
@@ -403,7 +455,7 @@ private function applyOptions(RequestInterface $request, array &$options)
$modify['set_headers'][$k] = $v;
}
}
- $request = Psr7\modify_request($request, $modify);
+ $request = Psr7\Utils::modifyRequest($request, $modify);
// Don't pass this internal value along to middleware/handlers.
unset($options['_conditional']);
}
@@ -411,10 +463,13 @@ private function applyOptions(RequestInterface $request, array &$options)
return $request;
}
- private function invalidBody()
+ /**
+ * Return an InvalidArgumentException with pre-set message.
+ */
+ private function invalidBody(): InvalidArgumentException
{
- throw new \InvalidArgumentException('Passing in the "body" request '
- . 'option as an array to send a POST request has been deprecated. '
+ return new InvalidArgumentException('Passing in the "body" request '
+ . 'option as an array to send a request is not supported. '
. 'Please use the "form_params" request option to send a '
. 'application/x-www-form-urlencoded request, or the "multipart" '
. 'request option to send a multipart/form-data request.');
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php
index 2dbcffa49..6aaee61af 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php
@@ -1,8 +1,9 @@
request('GET', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP HEAD request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function head($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('HEAD', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP PUT request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function put($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('PUT', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP POST request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function post($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('POST', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP PATCH request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function patch($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('PATCH', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP DELETE request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function delete($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('DELETE', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string $method HTTP method
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface;
+
+ /**
+ * Create and send an asynchronous HTTP GET request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function getAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('GET', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP HEAD request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function headAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('HEAD', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP PUT request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function putAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('PUT', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP POST request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function postAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('POST', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP PATCH request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function patchAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('PATCH', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP DELETE request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function deleteAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('DELETE', $uri, $options);
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
index 78f2b79fe..d6757c654 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
@@ -1,4 +1,5 @@
strictMode = $strictMode;
@@ -39,10 +44,8 @@ public function __construct($strictMode = false, $cookieArray = [])
*
* @param array $cookies Cookies to create the jar from
* @param string $domain Domain to set the cookies to
- *
- * @return self
*/
- public static function fromArray(array $cookies, $domain)
+ public static function fromArray(array $cookies, string $domain): self
{
$cookieJar = new self();
foreach ($cookies as $name => $value) {
@@ -57,26 +60,15 @@ public static function fromArray(array $cookies, $domain)
return $cookieJar;
}
- /**
- * @deprecated
- */
- public static function getCookieValue($value)
- {
- return $value;
- }
-
/**
* Evaluate if this cookie should be persisted to storage
* that survives between requests.
*
- * @param SetCookie $cookie Being evaluated.
- * @param bool $allowSessionCookies If we should persist session cookies
- * @return bool
+ * @param SetCookie $cookie Being evaluated.
+ * @param bool $allowSessionCookies If we should persist session cookies
*/
- public static function shouldPersist(
- SetCookie $cookie,
- $allowSessionCookies = false
- ) {
+ public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool
+ {
if ($cookie->getExpires() || $allowSessionCookies) {
if (!$cookie->getDiscard()) {
return true;
@@ -90,52 +82,57 @@ public static function shouldPersist(
* Finds and returns the cookie based on the name
*
* @param string $name cookie name to search for
+ *
* @return SetCookie|null cookie that was found or null if not found
*/
- public function getCookieByName($name)
+ public function getCookieByName(string $name): ?SetCookie
{
- // don't allow a null name
- if ($name === null) {
- return null;
- }
foreach ($this->cookies as $cookie) {
- if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) {
+ if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
return $cookie;
}
}
+
+ return null;
}
- public function toArray()
+ /**
+ * @inheritDoc
+ */
+ public function toArray(): array
{
- return array_map(function (SetCookie $cookie) {
+ return \array_map(static function (SetCookie $cookie): array {
return $cookie->toArray();
}, $this->getIterator()->getArrayCopy());
}
- public function clear($domain = null, $path = null, $name = null)
+ /**
+ * @inheritDoc
+ */
+ public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
{
if (!$domain) {
$this->cookies = [];
return;
} elseif (!$path) {
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) use ($path, $domain) {
+ static function (SetCookie $cookie) use ($domain): bool {
return !$cookie->matchesDomain($domain);
}
);
} elseif (!$name) {
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) use ($path, $domain) {
+ static function (SetCookie $cookie) use ($path, $domain): bool {
return !($cookie->matchesPath($path) &&
$cookie->matchesDomain($domain));
}
);
} else {
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) use ($path, $domain, $name) {
+ static function (SetCookie $cookie) use ($path, $domain, $name) {
return !($cookie->getName() == $name &&
$cookie->matchesPath($path) &&
$cookie->matchesDomain($domain));
@@ -144,17 +141,23 @@ function (SetCookie $cookie) use ($path, $domain, $name) {
}
}
- public function clearSessionCookies()
+ /**
+ * @inheritDoc
+ */
+ public function clearSessionCookies(): void
{
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) {
+ static function (SetCookie $cookie): bool {
return !$cookie->getDiscard() && $cookie->getExpires();
}
);
}
- public function setCookie(SetCookie $cookie)
+ /**
+ * @inheritDoc
+ */
+ public function setCookie(SetCookie $cookie): bool
{
// If the name string is empty (but not 0), ignore the set-cookie
// string entirely.
@@ -168,10 +171,9 @@ public function setCookie(SetCookie $cookie)
if ($result !== true) {
if ($this->strictMode) {
throw new \RuntimeException('Invalid cookie: ' . $result);
- } else {
- $this->removeCookieIfEmpty($cookie);
- return false;
}
+ $this->removeCookieIfEmpty($cookie);
+ return false;
}
// Resolve conflicts with previously set cookies
@@ -215,27 +217,28 @@ public function setCookie(SetCookie $cookie)
return true;
}
- public function count()
+ public function count(): int
{
- return count($this->cookies);
+ return \count($this->cookies);
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new \ArrayIterator(array_values($this->cookies));
+ return new \ArrayIterator(\array_values($this->cookies));
}
- public function extractCookies(
- RequestInterface $request,
- ResponseInterface $response
- ) {
+ public function extractCookies(RequestInterface $request, ResponseInterface $response): void
+ {
if ($cookieHeader = $response->getHeader('Set-Cookie')) {
foreach ($cookieHeader as $cookie) {
$sc = SetCookie::fromString($cookie);
if (!$sc->getDomain()) {
$sc->setDomain($request->getUri()->getHost());
}
- if (0 !== strpos($sc->getPath(), '/')) {
+ if (0 !== \strpos($sc->getPath(), '/')) {
$sc->setPath($this->getCookiePathFromRequest($request));
}
$this->setCookie($sc);
@@ -247,30 +250,28 @@ public function extractCookies(
* Computes cookie path following RFC 6265 section 5.1.4
*
* @link https://tools.ietf.org/html/rfc6265#section-5.1.4
- *
- * @param RequestInterface $request
- * @return string
*/
- private function getCookiePathFromRequest(RequestInterface $request)
+ private function getCookiePathFromRequest(RequestInterface $request): string
{
$uriPath = $request->getUri()->getPath();
- if ('' === $uriPath) {
+ if ('' === $uriPath) {
return '/';
}
- if (0 !== strpos($uriPath, '/')) {
+ if (0 !== \strpos($uriPath, '/')) {
return '/';
}
if ('/' === $uriPath) {
return '/';
}
- if (0 === $lastSlashPos = strrpos($uriPath, '/')) {
+ $lastSlashPos = \strrpos($uriPath, '/');
+ if (0 === $lastSlashPos || false === $lastSlashPos) {
return '/';
}
- return substr($uriPath, 0, $lastSlashPos);
+ return \substr($uriPath, 0, $lastSlashPos);
}
- public function withCookieHeader(RequestInterface $request)
+ public function withCookieHeader(RequestInterface $request): RequestInterface
{
$values = [];
$uri = $request->getUri();
@@ -290,17 +291,15 @@ public function withCookieHeader(RequestInterface $request)
}
return $values
- ? $request->withHeader('Cookie', implode('; ', $values))
+ ? $request->withHeader('Cookie', \implode('; ', $values))
: $request;
}
/**
* If a cookie already exists and the server asks to set it again with a
* null value, the cookie must be deleted.
- *
- * @param SetCookie $cookie
*/
- private function removeCookieIfEmpty(SetCookie $cookie)
+ private function removeCookieIfEmpty(SetCookie $cookie): void
{
$cookieValue = $cookie->getValue();
if ($cookieValue === null || $cookieValue === '') {
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
index 2cf298a86..7df374b5b 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
@@ -1,4 +1,5 @@
*/
interface CookieJarInterface extends \Countable, \IteratorAggregate
{
@@ -26,7 +28,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
*
* @return RequestInterface returns the modified request.
*/
- public function withCookieHeader(RequestInterface $request);
+ public function withCookieHeader(RequestInterface $request): RequestInterface;
/**
* Extract cookies from an HTTP response and store them in the CookieJar.
@@ -34,10 +36,7 @@ public function withCookieHeader(RequestInterface $request);
* @param RequestInterface $request Request that was sent
* @param ResponseInterface $response Response that was received
*/
- public function extractCookies(
- RequestInterface $request,
- ResponseInterface $response
- );
+ public function extractCookies(RequestInterface $request, ResponseInterface $response): void;
/**
* Sets a cookie in the cookie jar.
@@ -46,7 +45,7 @@ public function extractCookies(
*
* @return bool Returns true on success or false on failure
*/
- public function setCookie(SetCookie $cookie);
+ public function setCookie(SetCookie $cookie): bool;
/**
* Remove cookies currently held in the cookie jar.
@@ -58,13 +57,11 @@ public function setCookie(SetCookie $cookie);
* arguments, then the cookie with the specified name, path and domain is
* removed.
*
- * @param string $domain Clears cookies matching a domain
- * @param string $path Clears cookies matching a domain and path
- * @param string $name Clears cookies matching a domain, path, and name
- *
- * @return CookieJarInterface
+ * @param string|null $domain Clears cookies matching a domain
+ * @param string|null $path Clears cookies matching a domain and path
+ * @param string|null $name Clears cookies matching a domain, path, and name
*/
- public function clear($domain = null, $path = null, $name = null);
+ public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void;
/**
* Discard all sessions cookies.
@@ -73,12 +70,10 @@ public function clear($domain = null, $path = null, $name = null);
* field set to true. To be called when the user agent shuts down according
* to RFC 2965.
*/
- public function clearSessionCookies();
+ public function clearSessionCookies(): void;
/**
* Converts the cookie jar to an array.
- *
- * @return array
*/
- public function toArray();
+ public function toArray(): array;
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
index 9887c1d54..290236d54 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
@@ -1,32 +1,40 @@
filename = $cookieFile;
$this->storeSessionCookies = $storeSessionCookies;
- if (file_exists($cookieFile)) {
+ if (\file_exists($cookieFile)) {
$this->load($cookieFile);
}
}
@@ -43,20 +51,21 @@ public function __destruct()
* Saves the cookies to a file.
*
* @param string $filename File to save
+ *
* @throws \RuntimeException if the file cannot be found or created
*/
- public function save($filename)
+ public function save(string $filename): void
{
$json = [];
+ /** @var SetCookie $cookie */
foreach ($this as $cookie) {
- /** @var SetCookie $cookie */
if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
- $jsonStr = \GuzzleHttp\json_encode($json);
- if (false === file_put_contents($filename, $jsonStr)) {
+ $jsonStr = Utils::jsonEncode($json);
+ if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) {
throw new \RuntimeException("Unable to save file {$filename}");
}
}
@@ -67,23 +76,25 @@ public function save($filename)
* Old cookies are kept unless overwritten by newly loaded ones.
*
* @param string $filename Cookie file to load.
+ *
* @throws \RuntimeException if the file cannot be loaded.
*/
- public function load($filename)
+ public function load(string $filename): void
{
- $json = file_get_contents($filename);
+ $json = \file_get_contents($filename);
if (false === $json) {
throw new \RuntimeException("Unable to load file {$filename}");
- } elseif ($json === '') {
+ }
+ if ($json === '') {
return;
}
- $data = \GuzzleHttp\json_decode($json, true);
- if (is_array($data)) {
- foreach (json_decode($json, true) as $cookie) {
+ $data = Utils::jsonDecode($json, true);
+ if (\is_array($data)) {
+ foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
- } elseif (strlen($data)) {
+ } elseif (\is_scalar($data) && !empty($data)) {
throw new \RuntimeException("Invalid cookie file: {$filename}");
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
index 4497bcf03..5d51ca982 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
@@ -1,4 +1,5 @@
sessionKey = $sessionKey;
$this->storeSessionCookies = $storeSessionCookies;
$this->load();
@@ -38,33 +44,33 @@ public function __destruct()
/**
* Save cookies to the client session
*/
- public function save()
+ public function save(): void
{
$json = [];
+ /** @var SetCookie $cookie */
foreach ($this as $cookie) {
- /** @var SetCookie $cookie */
if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
- $_SESSION[$this->sessionKey] = json_encode($json);
+ $_SESSION[$this->sessionKey] = \json_encode($json);
}
/**
* Load the contents of the client session into the data array
*/
- protected function load()
+ protected function load(): void
{
if (!isset($_SESSION[$this->sessionKey])) {
return;
}
- $data = json_decode($_SESSION[$this->sessionKey], true);
- if (is_array($data)) {
+ $data = \json_decode($_SESSION[$this->sessionKey], true);
+ if (\is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
- } elseif (strlen($data)) {
+ } elseif (\strlen($data)) {
throw new \RuntimeException("Invalid cookie data");
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
index f6993943e..7c04034d2 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
@@ -1,4 +1,5 @@
null,
'Value' => null,
@@ -19,42 +22,42 @@ class SetCookie
'HttpOnly' => false
];
- /** @var array Cookie data */
+ /**
+ * @var array Cookie data
+ */
private $data;
/**
- * Create a new SetCookie object from a string
+ * Create a new SetCookie object from a string.
*
* @param string $cookie Set-Cookie header string
- *
- * @return self
*/
- public static function fromString($cookie)
+ public static function fromString(string $cookie): self
{
// Create the default return array
$data = self::$defaults;
// Explode the cookie string using a series of semicolons
- $pieces = array_filter(array_map('trim', explode(';', $cookie)));
+ $pieces = \array_filter(\array_map('trim', \explode(';', $cookie)));
// The name of the cookie (first kvp) must exist and include an equal sign.
- if (empty($pieces[0]) || !strpos($pieces[0], '=')) {
+ if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) {
return new self($data);
}
// Add the cookie pieces into the parsed data array
foreach ($pieces as $part) {
- $cookieParts = explode('=', $part, 2);
- $key = trim($cookieParts[0]);
+ $cookieParts = \explode('=', $part, 2);
+ $key = \trim($cookieParts[0]);
$value = isset($cookieParts[1])
- ? trim($cookieParts[1], " \n\r\t\0\x0B")
+ ? \trim($cookieParts[1], " \n\r\t\0\x0B")
: true;
// Only check for non-cookies when cookies have been found
- if (empty($data['Name'])) {
+ if (!isset($data['Name'])) {
$data['Name'] = $key;
$data['Value'] = $value;
} else {
- foreach (array_keys(self::$defaults) as $search) {
- if (!strcasecmp($search, $key)) {
+ foreach (\array_keys(self::$defaults) as $search) {
+ if (!\strcasecmp($search, $key)) {
$data[$search] = $value;
continue 2;
}
@@ -71,39 +74,45 @@ public static function fromString($cookie)
*/
public function __construct(array $data = [])
{
- $this->data = array_replace(self::$defaults, $data);
+ /** @var array|null $replaced will be null in case of replace error */
+ $replaced = \array_replace(self::$defaults, $data);
+ if ($replaced === null) {
+ throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
+ }
+
+ $this->data = $replaced;
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this->getExpires() && $this->getMaxAge()) {
// Calculate the Expires date
- $this->setExpires(time() + $this->getMaxAge());
- } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
- $this->setExpires($this->getExpires());
+ $this->setExpires(\time() + $this->getMaxAge());
+ } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) {
+ $this->setExpires($expires);
}
}
public function __toString()
{
- $str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
+ $str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; ';
foreach ($this->data as $k => $v) {
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
if ($k === 'Expires') {
- $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
+ $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
} else {
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
}
}
}
- return rtrim($str, '; ');
+ return \rtrim($str, '; ');
}
- public function toArray()
+ public function toArray(): array
{
return $this->data;
}
/**
- * Get the cookie name
+ * Get the cookie name.
*
* @return string
*/
@@ -113,19 +122,23 @@ public function getName()
}
/**
- * Set the cookie name
+ * Set the cookie name.
*
* @param string $name Cookie name
*/
- public function setName($name)
+ public function setName($name): void
{
- $this->data['Name'] = $name;
+ if (!is_string($name)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Name'] = (string) $name;
}
/**
- * Get the cookie value
+ * Get the cookie value.
*
- * @return string
+ * @return string|null
*/
public function getValue()
{
@@ -133,17 +146,21 @@ public function getValue()
}
/**
- * Set the cookie value
+ * Set the cookie value.
*
* @param string $value Cookie value
*/
- public function setValue($value)
+ public function setValue($value): void
{
- $this->data['Value'] = $value;
+ if (!is_string($value)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Value'] = (string) $value;
}
/**
- * Get the domain
+ * Get the domain.
*
* @return string|null
*/
@@ -153,17 +170,21 @@ public function getDomain()
}
/**
- * Set the domain of the cookie
+ * Set the domain of the cookie.
*
- * @param string $domain
+ * @param string|null $domain
*/
- public function setDomain($domain)
+ public function setDomain($domain): void
{
- $this->data['Domain'] = $domain;
+ if (!is_string($domain) && null !== $domain) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Domain'] = null === $domain ? null : (string) $domain;
}
/**
- * Get the path
+ * Get the path.
*
* @return string
*/
@@ -173,39 +194,47 @@ public function getPath()
}
/**
- * Set the path of the cookie
+ * Set the path of the cookie.
*
* @param string $path Path of the cookie
*/
- public function setPath($path)
+ public function setPath($path): void
{
- $this->data['Path'] = $path;
+ if (!is_string($path)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Path'] = (string) $path;
}
/**
- * Maximum lifetime of the cookie in seconds
+ * Maximum lifetime of the cookie in seconds.
*
* @return int|null
*/
public function getMaxAge()
{
- return $this->data['Max-Age'];
+ return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age'];
}
/**
- * Set the max-age of the cookie
+ * Set the max-age of the cookie.
*
- * @param int $maxAge Max age of the cookie in seconds
+ * @param int|null $maxAge Max age of the cookie in seconds
*/
- public function setMaxAge($maxAge)
+ public function setMaxAge($maxAge): void
{
- $this->data['Max-Age'] = $maxAge;
+ if (!is_int($maxAge) && null !== $maxAge) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge;
}
/**
- * The UNIX timestamp when the cookie Expires
+ * The UNIX timestamp when the cookie Expires.
*
- * @return mixed
+ * @return string|int|null
*/
public function getExpires()
{
@@ -213,21 +242,23 @@ public function getExpires()
}
/**
- * Set the unix timestamp for which the cookie will expire
+ * Set the unix timestamp for which the cookie will expire.
*
- * @param int $timestamp Unix timestamp
+ * @param int|string|null $timestamp Unix timestamp or any English textual datetime description.
*/
- public function setExpires($timestamp)
+ public function setExpires($timestamp): void
{
- $this->data['Expires'] = is_numeric($timestamp)
- ? (int) $timestamp
- : strtotime($timestamp);
+ if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp));
}
/**
- * Get whether or not this is a secure cookie
+ * Get whether or not this is a secure cookie.
*
- * @return null|bool
+ * @return bool
*/
public function getSecure()
{
@@ -235,19 +266,23 @@ public function getSecure()
}
/**
- * Set whether or not the cookie is secure
+ * Set whether or not the cookie is secure.
*
* @param bool $secure Set to true or false if secure
*/
- public function setSecure($secure)
+ public function setSecure($secure): void
{
- $this->data['Secure'] = $secure;
+ if (!is_bool($secure)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Secure'] = (bool) $secure;
}
/**
- * Get whether or not this is a session cookie
+ * Get whether or not this is a session cookie.
*
- * @return null|bool
+ * @return bool|null
*/
public function getDiscard()
{
@@ -255,17 +290,21 @@ public function getDiscard()
}
/**
- * Set whether or not this is a session cookie
+ * Set whether or not this is a session cookie.
*
* @param bool $discard Set to true or false if this is a session cookie
*/
- public function setDiscard($discard)
+ public function setDiscard($discard): void
{
- $this->data['Discard'] = $discard;
+ if (!is_bool($discard)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['Discard'] = (bool) $discard;
}
/**
- * Get whether or not this is an HTTP only cookie
+ * Get whether or not this is an HTTP only cookie.
*
* @return bool
*/
@@ -275,13 +314,17 @@ public function getHttpOnly()
}
/**
- * Set whether or not this is an HTTP only cookie
+ * Set whether or not this is an HTTP only cookie.
*
* @param bool $httpOnly Set to true or false if this is HTTP only
*/
- public function setHttpOnly($httpOnly)
+ public function setHttpOnly($httpOnly): void
{
- $this->data['HttpOnly'] = $httpOnly;
+ if (!is_bool($httpOnly)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
+ $this->data['HttpOnly'] = (bool) $httpOnly;
}
/**
@@ -298,10 +341,8 @@ public function setHttpOnly($httpOnly)
* path is a %x2F ("/") character.
*
* @param string $requestPath Path to check against
- *
- * @return bool
*/
- public function matchesPath($requestPath)
+ public function matchesPath(string $requestPath): bool
{
$cookiePath = $this->getPath();
@@ -311,71 +352,71 @@ public function matchesPath($requestPath)
}
// Ensure that the cookie-path is a prefix of the request path.
- if (0 !== strpos($requestPath, $cookiePath)) {
+ if (0 !== \strpos($requestPath, $cookiePath)) {
return false;
}
// Match if the last character of the cookie-path is "/"
- if (substr($cookiePath, -1, 1) === '/') {
+ if (\substr($cookiePath, -1, 1) === '/') {
return true;
}
// Match if the first character not included in cookie path is "/"
- return substr($requestPath, strlen($cookiePath), 1) === '/';
+ return \substr($requestPath, \strlen($cookiePath), 1) === '/';
}
/**
- * Check if the cookie matches a domain value
+ * Check if the cookie matches a domain value.
*
* @param string $domain Domain to check against
- *
- * @return bool
*/
- public function matchesDomain($domain)
+ public function matchesDomain(string $domain): bool
{
+ $cookieDomain = $this->getDomain();
+ if (null === $cookieDomain) {
+ return true;
+ }
+
// Remove the leading '.' as per spec in RFC 6265.
- // http://tools.ietf.org/html/rfc6265#section-5.2.3
- $cookieDomain = ltrim($this->getDomain(), '.');
+ // https://tools.ietf.org/html/rfc6265#section-5.2.3
+ $cookieDomain = \ltrim($cookieDomain, '.');
// Domain not set or exact match.
- if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
+ if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) {
return true;
}
// Matching the subdomain according to RFC 6265.
- // http://tools.ietf.org/html/rfc6265#section-5.1.3
- if (filter_var($domain, FILTER_VALIDATE_IP)) {
+ // https://tools.ietf.org/html/rfc6265#section-5.1.3
+ if (\filter_var($domain, \FILTER_VALIDATE_IP)) {
return false;
}
- return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
+ return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
}
/**
- * Check if the cookie is expired
- *
- * @return bool
+ * Check if the cookie is expired.
*/
- public function isExpired()
+ public function isExpired(): bool
{
- return $this->getExpires() !== null && time() > $this->getExpires();
+ return $this->getExpires() !== null && \time() > $this->getExpires();
}
/**
- * Check if the cookie is valid according to RFC 6265
+ * Check if the cookie is valid according to RFC 6265.
*
* @return bool|string Returns true if valid or an error message if invalid
*/
public function validate()
{
- // Names must not be empty, but can be 0
$name = $this->getName();
- if (empty($name) && !is_numeric($name)) {
+ if ($name === '') {
return 'The cookie name must not be empty';
}
// Check if any of the invalid characters are present in the cookie name
- if (preg_match(
+ if (\preg_match(
'/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
$name
)) {
@@ -384,17 +425,17 @@ public function validate()
. 'following characters: ()<>@,;:\"/?={}';
}
- // Value must not be empty, but can be 0
+ // Value must not be null. 0 and empty string are valid. Empty strings
+ // are technically against RFC 6265, but known to happen in the wild.
$value = $this->getValue();
- if (empty($value) && !is_numeric($value)) {
+ if ($value === null) {
return 'The cookie value must not be empty';
}
- // Domains must not be empty, but can be 0
- // A "0" is not a valid internet domain, but may be used as server name
- // in a private network.
+ // Domains must not be empty, but can be 0. "0" is not a valid internet
+ // domain, but may be used as server name in a private network.
$domain = $this->getDomain();
- if (empty($domain) && !is_numeric($domain)) {
+ if ($domain === null || $domain === '') {
return 'The cookie domain must not be empty';
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
index 427d896fb..a80956c9d 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
@@ -1,4 +1,5 @@
request = $request;
+ $this->handlerContext = $handlerContext;
}
/**
- * @return null
+ * Get the request that caused the exception
*/
- public function getResponse()
+ public function getRequest(): RequestInterface
{
- return null;
+ return $this->request;
}
/**
- * @return bool
+ * Get contextual information about the error from the underlying handler.
+ *
+ * The contents of this array will vary depending on which handler you are
+ * using. It may also be just an empty array. Relying on this data will
+ * couple you to a specific handler, but can give more debug information
+ * when needed.
*/
- public function hasResponse()
+ public function getHandlerContext(): array
{
- return false;
+ return $this->handlerContext;
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
index 510778f6e..fa3ed6998 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
@@ -1,13 +1,9 @@
getStatusCode()
- : 0;
+ $code = $response ? $response->getStatusCode() : 0;
parent::__construct($message, $code, $previous);
$this->request = $request;
$this->response = $response;
@@ -39,46 +46,39 @@ public function __construct(
/**
* Wrap non-RequestExceptions with a RequestException
- *
- * @param RequestInterface $request
- * @param \Exception $e
- *
- * @return RequestException
*/
- public static function wrapException(RequestInterface $request, \Exception $e)
+ public static function wrapException(RequestInterface $request, \Throwable $e): RequestException
{
- return $e instanceof RequestException
- ? $e
- : new RequestException($e->getMessage(), $request, null, $e);
+ return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e);
}
/**
* Factory method to create a new exception with a normalized error message
*
- * @param RequestInterface $request Request
- * @param ResponseInterface $response Response received
- * @param \Exception $previous Previous exception
- * @param array $ctx Optional handler context.
- *
- * @return self
+ * @param RequestInterface $request Request sent
+ * @param ResponseInterface $response Response received
+ * @param \Throwable|null $previous Previous exception
+ * @param array $handlerContext Optional handler context
+ * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer
*/
public static function create(
RequestInterface $request,
ResponseInterface $response = null,
- \Exception $previous = null,
- array $ctx = []
- ) {
+ \Throwable $previous = null,
+ array $handlerContext = [],
+ BodySummarizerInterface $bodySummarizer = null
+ ): self {
if (!$response) {
return new self(
'Error completing request',
$request,
null,
$previous,
- $ctx
+ $handlerContext
);
}
- $level = (int) floor($response->getStatusCode() / 100);
+ $level = (int) \floor($response->getStatusCode() / 100);
if ($level === 4) {
$label = 'Client error';
$className = ClientException::class;
@@ -95,76 +95,33 @@ public static function create(
// Client Error: `GET /` resulted in a `404 Not Found` response:
// ... (truncated)
- $message = sprintf(
+ $message = \sprintf(
'%s: `%s %s` resulted in a `%s %s` response',
$label,
$request->getMethod(),
- $uri,
+ $uri->__toString(),
$response->getStatusCode(),
$response->getReasonPhrase()
);
- $summary = static::getResponseBodySummary($response);
+ $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response);
if ($summary !== null) {
$message .= ":\n{$summary}\n";
}
- return new $className($message, $request, $response, $previous, $ctx);
- }
-
- /**
- * Get a short summary of the response
- *
- * Will return `null` if the response is not printable.
- *
- * @param ResponseInterface $response
- *
- * @return string|null
- */
- public static function getResponseBodySummary(ResponseInterface $response)
- {
- $body = $response->getBody();
-
- if (!$body->isSeekable()) {
- return null;
- }
-
- $size = $body->getSize();
-
- if ($size === 0) {
- return null;
- }
-
- $summary = $body->read(120);
- $body->rewind();
-
- if ($size > 120) {
- $summary .= ' (truncated...)';
- }
-
- // Matches any printable character, including unicode characters:
- // letters, marks, numbers, punctuation, spacing, and separators.
- if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) {
- return null;
- }
-
- return $summary;
+ return new $className($message, $request, $response, $previous, $handlerContext);
}
/**
- * Obfuscates URI if there is an username and a password present
- *
- * @param UriInterface $uri
- *
- * @return UriInterface
+ * Obfuscates URI if there is a username and a password present
*/
- private static function obfuscateUri($uri)
+ private static function obfuscateUri(UriInterface $uri): UriInterface
{
$userInfo = $uri->getUserInfo();
- if (false !== ($pos = strpos($userInfo, ':'))) {
- return $uri->withUserInfo(substr($userInfo, 0, $pos), '***');
+ if (false !== ($pos = \strpos($userInfo, ':'))) {
+ return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
}
return $uri;
@@ -172,30 +129,24 @@ private static function obfuscateUri($uri)
/**
* Get the request that caused the exception
- *
- * @return RequestInterface
*/
- public function getRequest()
+ public function getRequest(): RequestInterface
{
return $this->request;
}
/**
* Get the associated response
- *
- * @return ResponseInterface|null
*/
- public function getResponse()
+ public function getResponse(): ?ResponseInterface
{
return $this->response;
}
/**
* Check if a response was received
- *
- * @return bool
*/
- public function hasResponse()
+ public function hasResponse(): bool
{
return $this->response !== null;
}
@@ -207,10 +158,8 @@ public function hasResponse()
* using. It may also be just an empty array. Relying on this data will
* couple you to a specific handler, but can give more debug information
* when needed.
- *
- * @return array
*/
- public function getHandlerContext()
+ public function getHandlerContext(): array
{
return $this->handlerContext;
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php
deleted file mode 100644
index a77c28926..000000000
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php
+++ /dev/null
@@ -1,27 +0,0 @@
-stream = $stream;
- $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
- parent::__construct($msg);
- }
-
- /**
- * @return StreamInterface
- */
- public function getStream()
- {
- return $this->stream;
- }
-}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php
index 7cdd34086..8055e067c 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php
@@ -1,7 +1,10 @@
maxHandles = $maxHandles;
}
- public function create(RequestInterface $request, array $options)
+ public function create(RequestInterface $request, array $options): EasyHandle
{
if (isset($options['curl']['body_as_string'])) {
$options['_body_as_string'] = $options['curl']['body_as_string'];
@@ -46,35 +62,33 @@ public function create(RequestInterface $request, array $options)
// Add handler options from the request configuration options
if (isset($options['curl'])) {
- $conf = array_replace($conf, $options['curl']);
+ $conf = \array_replace($conf, $options['curl']);
}
- $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
- $easy->handle = $this->handles
- ? array_pop($this->handles)
- : curl_init();
+ $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
+ $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init();
curl_setopt_array($easy->handle, $conf);
return $easy;
}
- public function release(EasyHandle $easy)
+ public function release(EasyHandle $easy): void
{
$resource = $easy->handle;
unset($easy->handle);
- if (count($this->handles) >= $this->maxHandles) {
- curl_close($resource);
+ if (\count($this->handles) >= $this->maxHandles) {
+ \curl_close($resource);
} else {
// Remove all callback functions as they can hold onto references
// and are not cleaned up by curl_reset. Using curl_setopt_array
// does not work for some reason, so removing each one
// individually.
- curl_setopt($resource, CURLOPT_HEADERFUNCTION, null);
- curl_setopt($resource, CURLOPT_READFUNCTION, null);
- curl_setopt($resource, CURLOPT_WRITEFUNCTION, null);
- curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null);
- curl_reset($resource);
+ \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null);
+ \curl_setopt($resource, \CURLOPT_READFUNCTION, null);
+ \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null);
+ \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null);
+ \curl_reset($resource);
$this->handles[] = $resource;
}
}
@@ -83,17 +97,11 @@ public function release(EasyHandle $easy)
* Completes a cURL transaction, either returning a response promise or a
* rejected promise.
*
- * @param callable $handler
- * @param EasyHandle $easy
- * @param CurlFactoryInterface $factory Dictates how the handle is released
- *
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param callable(RequestInterface, array): PromiseInterface $handler
+ * @param CurlFactoryInterface $factory Dictates how the handle is released
*/
- public static function finish(
- callable $handler,
- EasyHandle $easy,
- CurlFactoryInterface $factory
- ) {
+ public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
+ {
if (isset($easy->options['on_stats'])) {
self::invokeStats($easy);
}
@@ -114,9 +122,10 @@ public static function finish(
return new FulfilledPromise($easy->response);
}
- private static function invokeStats(EasyHandle $easy)
+ private static function invokeStats(EasyHandle $easy): void
{
- $curlStats = curl_getinfo($easy->handle);
+ $curlStats = \curl_getinfo($easy->handle);
+ $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME);
$stats = new TransferStats(
$easy->request,
$easy->response,
@@ -124,45 +133,57 @@ private static function invokeStats(EasyHandle $easy)
$easy->errno,
$curlStats
);
- call_user_func($easy->options['on_stats'], $stats);
+ ($easy->options['on_stats'])($stats);
}
- private static function finishError(
- callable $handler,
- EasyHandle $easy,
- CurlFactoryInterface $factory
- ) {
+ /**
+ * @param callable(RequestInterface, array): PromiseInterface $handler
+ */
+ private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
+ {
// Get error information and release the handle to the factory.
$ctx = [
'errno' => $easy->errno,
- 'error' => curl_error($easy->handle),
- ] + curl_getinfo($easy->handle);
+ 'error' => \curl_error($easy->handle),
+ 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME),
+ ] + \curl_getinfo($easy->handle);
+ $ctx[self::CURL_VERSION_STR] = \curl_version()['version'];
$factory->release($easy);
// Retry when nothing is present or when curl failed to rewind.
- if (empty($easy->options['_err_message'])
- && (!$easy->errno || $easy->errno == 65)
- ) {
+ if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
return self::retryFailedRewind($handler, $easy, $ctx);
}
return self::createRejection($easy, $ctx);
}
- private static function createRejection(EasyHandle $easy, array $ctx)
+ private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
{
static $connectionErrors = [
- CURLE_OPERATION_TIMEOUTED => true,
- CURLE_COULDNT_RESOLVE_HOST => true,
- CURLE_COULDNT_CONNECT => true,
- CURLE_SSL_CONNECT_ERROR => true,
- CURLE_GOT_NOTHING => true,
+ \CURLE_OPERATION_TIMEOUTED => true,
+ \CURLE_COULDNT_RESOLVE_HOST => true,
+ \CURLE_COULDNT_CONNECT => true,
+ \CURLE_SSL_CONNECT_ERROR => true,
+ \CURLE_GOT_NOTHING => true,
];
+ if ($easy->createResponseException) {
+ return P\Create::rejectionFor(
+ new RequestException(
+ 'An error was encountered while creating the response',
+ $easy->request,
+ $easy->response,
+ $easy->createResponseException,
+ $ctx
+ )
+ );
+ }
+
// If an exception was encountered during the onHeaders event, then
// return a rejected promise that wraps that exception.
if ($easy->onHeadersException) {
- return \GuzzleHttp\Promise\rejection_for(
+ return P\Create::rejectionFor(
new RequestException(
'An error was encountered during the on_headers event',
$easy->request,
@@ -173,49 +194,56 @@ private static function createRejection(EasyHandle $easy, array $ctx)
);
}
- $message = sprintf(
+ $message = \sprintf(
'cURL error %s: %s (%s)',
$ctx['errno'],
$ctx['error'],
- 'see http://curl.haxx.se/libcurl/c/libcurl-errors.html'
+ 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
);
+ $uriString = (string) $easy->request->getUri();
+ if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) {
+ $message .= \sprintf(' for %s', $uriString);
+ }
// Create a connection exception if it was a specific error code.
$error = isset($connectionErrors[$easy->errno])
? new ConnectException($message, $easy->request, null, $ctx)
: new RequestException($message, $easy->request, $easy->response, null, $ctx);
- return \GuzzleHttp\Promise\rejection_for($error);
+ return P\Create::rejectionFor($error);
}
- private function getDefaultConf(EasyHandle $easy)
+ /**
+ * @return array
+ */
+ private function getDefaultConf(EasyHandle $easy): array
{
$conf = [
- '_headers' => $easy->request->getHeaders(),
- CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
- CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
- CURLOPT_RETURNTRANSFER => false,
- CURLOPT_HEADER => false,
- CURLOPT_CONNECTTIMEOUT => 150,
+ '_headers' => $easy->request->getHeaders(),
+ \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
+ \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
+ \CURLOPT_RETURNTRANSFER => false,
+ \CURLOPT_HEADER => false,
+ \CURLOPT_CONNECTTIMEOUT => 150,
];
- if (defined('CURLOPT_PROTOCOLS')) {
- $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
+ if (\defined('CURLOPT_PROTOCOLS')) {
+ $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS;
}
$version = $easy->request->getProtocolVersion();
if ($version == 1.1) {
- $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
} elseif ($version == 2.0) {
- $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0;
} else {
- $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0;
}
return $conf;
}
- private function applyMethod(EasyHandle $easy, array &$conf)
+ private function applyMethod(EasyHandle $easy, array &$conf): void
{
$body = $easy->request->getBody();
$size = $body->getSize();
@@ -227,22 +255,22 @@ private function applyMethod(EasyHandle $easy, array &$conf)
$method = $easy->request->getMethod();
if ($method === 'PUT' || $method === 'POST') {
- // See http://tools.ietf.org/html/rfc7230#section-3.3.2
+ // See https://tools.ietf.org/html/rfc7230#section-3.3.2
if (!$easy->request->hasHeader('Content-Length')) {
- $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
+ $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
}
} elseif ($method === 'HEAD') {
- $conf[CURLOPT_NOBODY] = true;
+ $conf[\CURLOPT_NOBODY] = true;
unset(
- $conf[CURLOPT_WRITEFUNCTION],
- $conf[CURLOPT_READFUNCTION],
- $conf[CURLOPT_FILE],
- $conf[CURLOPT_INFILE]
+ $conf[\CURLOPT_WRITEFUNCTION],
+ $conf[\CURLOPT_READFUNCTION],
+ $conf[\CURLOPT_FILE],
+ $conf[\CURLOPT_INFILE]
);
}
}
- private function applyBody(RequestInterface $request, array $options, array &$conf)
+ private function applyBody(RequestInterface $request, array $options, array &$conf): void
{
$size = $request->hasHeader('Content-Length')
? (int) $request->getHeaderLine('Content-Length')
@@ -250,40 +278,38 @@ private function applyBody(RequestInterface $request, array $options, array &$co
// Send the body as a string if the size is less than 1MB OR if the
// [curl][body_as_string] request value is set.
- if (($size !== null && $size < 1000000) ||
- !empty($options['_body_as_string'])
- ) {
- $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody();
+ if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) {
+ $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody();
// Don't duplicate the Content-Length header
$this->removeHeader('Content-Length', $conf);
$this->removeHeader('Transfer-Encoding', $conf);
} else {
- $conf[CURLOPT_UPLOAD] = true;
+ $conf[\CURLOPT_UPLOAD] = true;
if ($size !== null) {
- $conf[CURLOPT_INFILESIZE] = $size;
+ $conf[\CURLOPT_INFILESIZE] = $size;
$this->removeHeader('Content-Length', $conf);
}
$body = $request->getBody();
if ($body->isSeekable()) {
$body->rewind();
}
- $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
+ $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) {
return $body->read($length);
};
}
// If the Expect header is not present, prevent curl from adding it
if (!$request->hasHeader('Expect')) {
- $conf[CURLOPT_HTTPHEADER][] = 'Expect:';
+ $conf[\CURLOPT_HTTPHEADER][] = 'Expect:';
}
// cURL sometimes adds a content-type by default. Prevent this.
if (!$request->hasHeader('Content-Type')) {
- $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:';
+ $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:';
}
}
- private function applyHeaders(EasyHandle $easy, array &$conf)
+ private function applyHeaders(EasyHandle $easy, array &$conf): void
{
foreach ($conf['_headers'] as $name => $values) {
foreach ($values as $value) {
@@ -291,16 +317,16 @@ private function applyHeaders(EasyHandle $easy, array &$conf)
if ($value === '') {
// cURL requires a special format for empty headers.
// See https://github.com/guzzle/guzzle/issues/1882 for more details.
- $conf[CURLOPT_HTTPHEADER][] = "$name;";
+ $conf[\CURLOPT_HTTPHEADER][] = "$name;";
} else {
- $conf[CURLOPT_HTTPHEADER][] = "$name: $value";
+ $conf[\CURLOPT_HTTPHEADER][] = "$name: $value";
}
}
}
// Remove the Accept header if one was not set
if (!$easy->request->hasHeader('Accept')) {
- $conf[CURLOPT_HTTPHEADER][] = 'Accept:';
+ $conf[\CURLOPT_HTTPHEADER][] = 'Accept:';
}
}
@@ -310,115 +336,115 @@ private function applyHeaders(EasyHandle $easy, array &$conf)
* @param string $name Case-insensitive header to remove
* @param array $options Array of options to modify
*/
- private function removeHeader($name, array &$options)
+ private function removeHeader(string $name, array &$options): void
{
- foreach (array_keys($options['_headers']) as $key) {
- if (!strcasecmp($key, $name)) {
+ foreach (\array_keys($options['_headers']) as $key) {
+ if (!\strcasecmp($key, $name)) {
unset($options['_headers'][$key]);
return;
}
}
}
- private function applyHandlerOptions(EasyHandle $easy, array &$conf)
+ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void
{
$options = $easy->options;
if (isset($options['verify'])) {
if ($options['verify'] === false) {
- unset($conf[CURLOPT_CAINFO]);
- $conf[CURLOPT_SSL_VERIFYHOST] = 0;
- $conf[CURLOPT_SSL_VERIFYPEER] = false;
+ unset($conf[\CURLOPT_CAINFO]);
+ $conf[\CURLOPT_SSL_VERIFYHOST] = 0;
+ $conf[\CURLOPT_SSL_VERIFYPEER] = false;
} else {
- $conf[CURLOPT_SSL_VERIFYHOST] = 2;
- $conf[CURLOPT_SSL_VERIFYPEER] = true;
- if (is_string($options['verify'])) {
+ $conf[\CURLOPT_SSL_VERIFYHOST] = 2;
+ $conf[\CURLOPT_SSL_VERIFYPEER] = true;
+ if (\is_string($options['verify'])) {
// Throw an error if the file/folder/link path is not valid or doesn't exist.
- if (!file_exists($options['verify'])) {
- throw new \InvalidArgumentException(
- "SSL CA bundle not found: {$options['verify']}"
- );
+ if (!\file_exists($options['verify'])) {
+ throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}");
}
// If it's a directory or a link to a directory use CURLOPT_CAPATH.
// If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
- if (is_dir($options['verify']) ||
- (is_link($options['verify']) && is_dir(readlink($options['verify'])))) {
- $conf[CURLOPT_CAPATH] = $options['verify'];
+ if (
+ \is_dir($options['verify']) ||
+ (
+ \is_link($options['verify']) === true &&
+ ($verifyLink = \readlink($options['verify'])) !== false &&
+ \is_dir($verifyLink)
+ )
+ ) {
+ $conf[\CURLOPT_CAPATH] = $options['verify'];
} else {
- $conf[CURLOPT_CAINFO] = $options['verify'];
+ $conf[\CURLOPT_CAINFO] = $options['verify'];
}
}
}
}
- if (!empty($options['decode_content'])) {
+ if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) {
$accept = $easy->request->getHeaderLine('Accept-Encoding');
if ($accept) {
- $conf[CURLOPT_ENCODING] = $accept;
+ $conf[\CURLOPT_ENCODING] = $accept;
} else {
- $conf[CURLOPT_ENCODING] = '';
- // Don't let curl send the header over the wire
- $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
+ // The empty string enables all available decoders and implicitly
+ // sets a matching 'Accept-Encoding' header.
+ $conf[\CURLOPT_ENCODING] = '';
+ // But as the user did not specify any acceptable encodings we need
+ // to overwrite this implicit header with an empty one.
+ $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
}
}
- if (isset($options['sink'])) {
- $sink = $options['sink'];
- if (!is_string($sink)) {
- $sink = \GuzzleHttp\Psr7\stream_for($sink);
- } elseif (!is_dir(dirname($sink))) {
- // Ensure that the directory exists before failing in curl.
- throw new \RuntimeException(sprintf(
- 'Directory %s does not exist for sink value of %s',
- dirname($sink),
- $sink
- ));
- } else {
- $sink = new LazyOpenStream($sink, 'w+');
- }
- $easy->sink = $sink;
- $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) {
- return $sink->write($write);
- };
- } else {
+ if (!isset($options['sink'])) {
// Use a default temp stream if no sink was set.
- $conf[CURLOPT_FILE] = fopen('php://temp', 'w+');
- $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]);
+ $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+');
+ }
+ $sink = $options['sink'];
+ if (!\is_string($sink)) {
+ $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink);
+ } elseif (!\is_dir(\dirname($sink))) {
+ // Ensure that the directory exists before failing in curl.
+ throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink));
+ } else {
+ $sink = new LazyOpenStream($sink, 'w+');
}
+ $easy->sink = $sink;
+ $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int {
+ return $sink->write($write);
+ };
+
$timeoutRequiresNoSignal = false;
if (isset($options['timeout'])) {
$timeoutRequiresNoSignal |= $options['timeout'] < 1;
- $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
+ $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
}
// CURL default value is CURL_IPRESOLVE_WHATEVER
if (isset($options['force_ip_resolve'])) {
if ('v4' === $options['force_ip_resolve']) {
- $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
+ $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4;
} elseif ('v6' === $options['force_ip_resolve']) {
- $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6;
+ $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6;
}
}
if (isset($options['connect_timeout'])) {
$timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
- $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
+ $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
}
- if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
- $conf[CURLOPT_NOSIGNAL] = true;
+ if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') {
+ $conf[\CURLOPT_NOSIGNAL] = true;
}
if (isset($options['proxy'])) {
- if (!is_array($options['proxy'])) {
- $conf[CURLOPT_PROXY] = $options['proxy'];
+ if (!\is_array($options['proxy'])) {
+ $conf[\CURLOPT_PROXY] = $options['proxy'];
} else {
$scheme = $easy->request->getUri()->getScheme();
if (isset($options['proxy'][$scheme])) {
$host = $easy->request->getUri()->getHost();
- if (!isset($options['proxy']['no']) ||
- !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no'])
- ) {
- $conf[CURLOPT_PROXY] = $options['proxy'][$scheme];
+ if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
+ $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
}
}
}
@@ -426,53 +452,53 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf)
if (isset($options['cert'])) {
$cert = $options['cert'];
- if (is_array($cert)) {
- $conf[CURLOPT_SSLCERTPASSWD] = $cert[1];
+ if (\is_array($cert)) {
+ $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1];
$cert = $cert[0];
}
- if (!file_exists($cert)) {
- throw new \InvalidArgumentException(
- "SSL certificate not found: {$cert}"
- );
+ if (!\file_exists($cert)) {
+ throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
+ }
+ # OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
+ # see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
+ $ext = pathinfo($cert, \PATHINFO_EXTENSION);
+ if (preg_match('#^(der|p12)$#i', $ext)) {
+ $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
}
- $conf[CURLOPT_SSLCERT] = $cert;
+ $conf[\CURLOPT_SSLCERT] = $cert;
}
if (isset($options['ssl_key'])) {
- $sslKey = $options['ssl_key'];
- if (is_array($sslKey)) {
- $conf[CURLOPT_SSLKEYPASSWD] = $sslKey[1];
- $sslKey = $sslKey[0];
+ if (\is_array($options['ssl_key'])) {
+ if (\count($options['ssl_key']) === 2) {
+ [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key'];
+ } else {
+ [$sslKey] = $options['ssl_key'];
+ }
}
- if (!file_exists($sslKey)) {
- throw new \InvalidArgumentException(
- "SSL private key not found: {$sslKey}"
- );
+
+ $sslKey = $sslKey ?? $options['ssl_key'];
+
+ if (!\file_exists($sslKey)) {
+ throw new \InvalidArgumentException("SSL private key not found: {$sslKey}");
}
- $conf[CURLOPT_SSLKEY] = $sslKey;
+ $conf[\CURLOPT_SSLKEY] = $sslKey;
}
if (isset($options['progress'])) {
$progress = $options['progress'];
- if (!is_callable($progress)) {
- throw new \InvalidArgumentException(
- 'progress client option must be callable'
- );
+ if (!\is_callable($progress)) {
+ throw new \InvalidArgumentException('progress client option must be callable');
}
- $conf[CURLOPT_NOPROGRESS] = false;
- $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) {
- $args = func_get_args();
- // PHP 5.5 pushed the handle onto the start of the args
- if (is_resource($args[0])) {
- array_shift($args);
- }
- call_user_func_array($progress, $args);
+ $conf[\CURLOPT_NOPROGRESS] = false;
+ $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) {
+ $progress($downloadSize, $downloaded, $uploadSize, $uploaded);
};
}
if (!empty($options['debug'])) {
- $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']);
- $conf[CURLOPT_VERBOSE] = true;
+ $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']);
+ $conf[\CURLOPT_VERBOSE] = true;
}
}
@@ -484,12 +510,11 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf)
* stream, and then encountered a "necessary data rewind wasn't possible"
* error, causing the request to be sent through curl_multi_info_read()
* without an error status.
+ *
+ * @param callable(RequestInterface, array): PromiseInterface $handler
*/
- private static function retryFailedRewind(
- callable $handler,
- EasyHandle $easy,
- array $ctx
- ) {
+ private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface
+ {
try {
// Only rewind if the body has been read from.
$body = $easy->request->getBody();
@@ -522,27 +547,32 @@ private static function retryFailedRewind(
return $handler($easy->request, $easy->options);
}
- private function createHeaderFn(EasyHandle $easy)
+ private function createHeaderFn(EasyHandle $easy): callable
{
if (isset($easy->options['on_headers'])) {
$onHeaders = $easy->options['on_headers'];
- if (!is_callable($onHeaders)) {
+ if (!\is_callable($onHeaders)) {
throw new \InvalidArgumentException('on_headers must be callable');
}
} else {
$onHeaders = null;
}
- return function ($ch, $h) use (
+ return static function ($ch, $h) use (
$onHeaders,
$easy,
&$startingResponse
) {
- $value = trim($h);
+ $value = \trim($h);
if ($value === '') {
$startingResponse = true;
- $easy->createResponse();
+ try {
+ $easy->createResponse();
+ } catch (\Exception $e) {
+ $easy->createResponseException = $e;
+ return -1;
+ }
if ($onHeaders !== null) {
try {
$onHeaders($easy->response);
@@ -559,7 +589,7 @@ private function createHeaderFn(EasyHandle $easy)
} else {
$easy->headers[] = $value;
}
- return strlen($h);
+ return \strlen($h);
};
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
index b0fc23685..fe57ed5d5 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
@@ -1,4 +1,5 @@
factory = isset($options['handle_factory'])
- ? $options['handle_factory']
- : new CurlFactory(3);
+ $this->factory = $options['handle_factory']
+ ?? new CurlFactory(3);
}
- public function __invoke(RequestInterface $request, array $options)
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
if (isset($options['delay'])) {
- usleep($options['delay'] * 1000);
+ \usleep($options['delay'] * 1000);
}
$easy = $this->factory->create($request, $options);
- curl_exec($easy->handle);
- $easy->errno = curl_errno($easy->handle);
+ \curl_exec($easy->handle);
+ $easy->errno = \curl_errno($easy->handle);
return CurlFactory::finish($this, $easy, $this->factory);
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
index 2754d8e43..9e2e4703e 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
@@ -1,9 +1,11 @@
An array of delay times, indexed by handle id in `addRequest`.
+ *
+ * @see CurlMultiHandler::addRequest
+ */
private $delays = [];
+ /**
+ * @var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt()
+ */
+ private $options = [];
+
/**
* This handler accepts the following options:
*
* - handle_factory: An optional factory used to create curl handles
* - select_timeout: Optional timeout (in seconds) to block before timing
* out while selecting curl handles. Defaults to 1 second.
- *
- * @param array $options
+ * - options: An associative array of CURLMOPT_* options and
+ * corresponding values for curl_multi_setopt()
*/
public function __construct(array $options = [])
{
- $this->factory = isset($options['handle_factory'])
- ? $options['handle_factory'] : new CurlFactory(50);
- $this->selectTimeout = isset($options['select_timeout'])
- ? $options['select_timeout'] : 1;
+ $this->factory = $options['handle_factory'] ?? new CurlFactory(50);
+
+ if (isset($options['select_timeout'])) {
+ $this->selectTimeout = $options['select_timeout'];
+ } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
+ @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED);
+ $this->selectTimeout = (int) $selectTimeout;
+ } else {
+ $this->selectTimeout = 1;
+ }
+
+ $this->options = $options['options'] ?? [];
}
+ /**
+ * @param string $name
+ *
+ * @return resource|\CurlMultiHandle
+ *
+ * @throws \BadMethodCallException when another field as `_mh` will be gotten
+ * @throws \RuntimeException when curl can not initialize a multi handle
+ */
public function __get($name)
{
- if ($name === '_mh') {
- return $this->_mh = curl_multi_init();
+ if ($name !== '_mh') {
+ throw new \BadMethodCallException("Can not get other property as '_mh'.");
}
- throw new \BadMethodCallException();
+ $multiHandle = \curl_multi_init();
+
+ if (false === $multiHandle) {
+ throw new \RuntimeException('Can not initialize curl multi handle.');
+ }
+
+ $this->_mh = $multiHandle;
+
+ foreach ($this->options as $option => $value) {
+ // A warning is raised in case of a wrong option.
+ curl_multi_setopt($this->_mh, $option, $value);
+ }
+
+ return $this->_mh;
}
public function __destruct()
{
if (isset($this->_mh)) {
- curl_multi_close($this->_mh);
+ \curl_multi_close($this->_mh);
unset($this->_mh);
}
}
- public function __invoke(RequestInterface $request, array $options)
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$easy = $this->factory->create($request, $options);
$id = (int) $easy->handle;
@@ -78,15 +138,15 @@ function () use ($id) {
/**
* Ticks the curl event loop.
*/
- public function tick()
+ public function tick(): void
{
// Add any delayed handles if needed.
if ($this->delays) {
- $currentTime = microtime(true);
+ $currentTime = Utils::currentTime();
foreach ($this->delays as $id => $delay) {
if ($currentTime >= $delay) {
unset($this->delays[$id]);
- curl_multi_add_handle(
+ \curl_multi_add_handle(
$this->_mh,
$this->handles[$id]['easy']->handle
);
@@ -95,17 +155,15 @@ public function tick()
}
// Step through the task queue which may add additional requests.
- P\queue()->run();
+ P\Utils::queue()->run();
- if ($this->active &&
- curl_multi_select($this->_mh, $this->selectTimeout) === -1
- ) {
+ if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) {
// Perform a usleep if a select returns -1.
// See: https://bugs.php.net/bug.php?id=61141
- usleep(250);
+ \usleep(250);
}
- while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
+ while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
$this->processMessages();
}
@@ -113,28 +171,28 @@ public function tick()
/**
* Runs until all outstanding connections have completed.
*/
- public function execute()
+ public function execute(): void
{
- $queue = P\queue();
+ $queue = P\Utils::queue();
while ($this->handles || !$queue->isEmpty()) {
// If there are no transfers, then sleep for the next delay
if (!$this->active && $this->delays) {
- usleep($this->timeToNext());
+ \usleep($this->timeToNext());
}
$this->tick();
}
}
- private function addRequest(array $entry)
+ private function addRequest(array $entry): void
{
$easy = $entry['easy'];
$id = (int) $easy->handle;
$this->handles[$id] = $entry;
if (empty($easy->options['delay'])) {
- curl_multi_add_handle($this->_mh, $easy->handle);
+ \curl_multi_add_handle($this->_mh, $easy->handle);
} else {
- $this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000);
+ $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000);
}
}
@@ -145,8 +203,12 @@ private function addRequest(array $entry)
*
* @return bool True on success, false on failure.
*/
- private function cancel($id)
+ private function cancel($id): bool
{
+ if (!is_int($id)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
// Cannot cancel if it has been processed.
if (!isset($this->handles[$id])) {
return false;
@@ -154,17 +216,21 @@ private function cancel($id)
$handle = $this->handles[$id]['easy']->handle;
unset($this->delays[$id], $this->handles[$id]);
- curl_multi_remove_handle($this->_mh, $handle);
- curl_close($handle);
+ \curl_multi_remove_handle($this->_mh, $handle);
+ \curl_close($handle);
return true;
}
- private function processMessages()
+ private function processMessages(): void
{
- while ($done = curl_multi_info_read($this->_mh)) {
+ while ($done = \curl_multi_info_read($this->_mh)) {
+ if ($done['msg'] !== \CURLMSG_DONE) {
+ // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216
+ continue;
+ }
$id = (int) $done['handle'];
- curl_multi_remove_handle($this->_mh, $done['handle']);
+ \curl_multi_remove_handle($this->_mh, $done['handle']);
if (!isset($this->handles[$id])) {
// Probably was cancelled.
@@ -175,25 +241,21 @@ private function processMessages()
unset($this->handles[$id], $this->delays[$id]);
$entry['easy']->errno = $done['result'];
$entry['deferred']->resolve(
- CurlFactory::finish(
- $this,
- $entry['easy'],
- $this->factory
- )
+ CurlFactory::finish($this, $entry['easy'], $this->factory)
);
}
}
- private function timeToNext()
+ private function timeToNext(): int
{
- $currentTime = microtime(true);
- $nextTime = PHP_INT_MAX;
+ $currentTime = Utils::currentTime();
+ $nextTime = \PHP_INT_MAX;
foreach ($this->delays as $time) {
if ($time < $nextTime) {
$nextTime = $time;
}
}
- return max(0, $nextTime - $currentTime) * 1000000;
+ return ((int) \max(0, $nextTime - $currentTime)) * 1000000;
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
index 7754e9111..224344d7c 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
@@ -1,7 +1,9 @@
headers)) {
- throw new \RuntimeException('No headers have been received');
- }
+ [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($this->headers);
- // HTTP-version SP status-code SP reason-phrase
- $startLine = explode(' ', array_shift($this->headers), 3);
- $headers = \GuzzleHttp\headers_from_lines($this->headers);
- $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
+ $normalizedKeys = Utils::normalizeHeaderKeys($headers);
- if (!empty($this->options['decode_content'])
- && isset($normalizedKeys['content-encoding'])
- ) {
- $headers['x-encoded-content-encoding']
- = $headers[$normalizedKeys['content-encoding']];
+ if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) {
+ $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
unset($headers[$normalizedKeys['content-encoding']]);
if (isset($normalizedKeys['content-length'])) {
- $headers['x-encoded-content-length']
- = $headers[$normalizedKeys['content-length']];
+ $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
$bodyLength = (int) $this->sink->getSize();
if ($bodyLength) {
@@ -74,19 +89,24 @@ public function createResponse()
// Attach a response to the easy handle with the parsed headers.
$this->response = new Response(
- $startLine[1],
+ $status,
$headers,
$this->sink,
- substr($startLine[0], 5),
- isset($startLine[2]) ? (string) $startLine[2] : null
+ $ver,
+ $reason
);
}
+ /**
+ * @param string $name
+ *
+ * @return void
+ *
+ * @throws \BadMethodCallException
+ */
public function __get($name)
{
- $msg = $name === 'handle'
- ? 'The EasyHandle has been released'
- : 'Invalid property: ' . $name;
+ $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name;
throw new \BadMethodCallException($msg);
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
new file mode 100644
index 000000000..a0988845f
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
@@ -0,0 +1,42 @@
+|null $queue The parameters to be passed to the append function, as an indexed array.
+ * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
+ * @param callable|null $onRejected Callback to invoke when the return value is rejected.
*/
- public function __construct(
- array $queue = null,
- callable $onFulfilled = null,
- callable $onRejected = null
- ) {
+ public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null)
+ {
$this->onFulfilled = $onFulfilled;
$this->onRejected = $onRejected;
if ($queue) {
- call_user_func_array([$this, 'append'], $queue);
+ // array_values included for BC
+ $this->append(...array_values($queue));
}
}
- public function __invoke(RequestInterface $request, array $options)
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
if (!$this->queue) {
throw new \OutOfBoundsException('Mock queue is empty');
}
- if (isset($options['delay'])) {
- usleep($options['delay'] * 1000);
+ if (isset($options['delay']) && \is_numeric($options['delay'])) {
+ \usleep((int) $options['delay'] * 1000);
}
$this->lastRequest = $request;
$this->lastOptions = $options;
- $response = array_shift($this->queue);
+ $response = \array_shift($this->queue);
if (isset($options['on_headers'])) {
- if (!is_callable($options['on_headers'])) {
+ if (!\is_callable($options['on_headers'])) {
throw new \InvalidArgumentException('on_headers must be callable');
}
try {
@@ -86,29 +103,30 @@ public function __invoke(RequestInterface $request, array $options)
}
}
- if (is_callable($response)) {
- $response = call_user_func($response, $request, $options);
+ if (\is_callable($response)) {
+ $response = $response($request, $options);
}
- $response = $response instanceof \Exception
- ? \GuzzleHttp\Promise\rejection_for($response)
- : \GuzzleHttp\Promise\promise_for($response);
+ $response = $response instanceof \Throwable
+ ? P\Create::rejectionFor($response)
+ : P\Create::promiseFor($response);
return $response->then(
- function ($value) use ($request, $options) {
+ function (?ResponseInterface $value) use ($request, $options) {
$this->invokeStats($request, $options, $value);
if ($this->onFulfilled) {
- call_user_func($this->onFulfilled, $value);
+ ($this->onFulfilled)($value);
}
- if (isset($options['sink'])) {
+
+ if ($value !== null && isset($options['sink'])) {
$contents = (string) $value->getBody();
$sink = $options['sink'];
- if (is_resource($sink)) {
- fwrite($sink, $contents);
- } elseif (is_string($sink)) {
- file_put_contents($sink, $contents);
- } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) {
+ if (\is_resource($sink)) {
+ \fwrite($sink, $contents);
+ } elseif (\is_string($sink)) {
+ \file_put_contents($sink, $contents);
+ } elseif ($sink instanceof StreamInterface) {
$sink->write($contents);
}
}
@@ -118,9 +136,9 @@ function ($value) use ($request, $options) {
function ($reason) use ($request, $options) {
$this->invokeStats($request, $options, null, $reason);
if ($this->onRejected) {
- call_user_func($this->onRejected, $reason);
+ ($this->onRejected)($reason);
}
- return \GuzzleHttp\Promise\rejection_for($reason);
+ return P\Create::rejectionFor($reason);
}
);
}
@@ -128,62 +146,66 @@ function ($reason) use ($request, $options) {
/**
* Adds one or more variadic requests, exceptions, callables, or promises
* to the queue.
+ *
+ * @param mixed ...$values
*/
- public function append()
+ public function append(...$values): void
{
- foreach (func_get_args() as $value) {
+ foreach ($values as $value) {
if ($value instanceof ResponseInterface
- || $value instanceof \Exception
+ || $value instanceof \Throwable
|| $value instanceof PromiseInterface
- || is_callable($value)
+ || \is_callable($value)
) {
$this->queue[] = $value;
} else {
- throw new \InvalidArgumentException('Expected a response or '
- . 'exception. Found ' . \GuzzleHttp\describe_type($value));
+ throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
}
}
}
/**
* Get the last received request.
- *
- * @return RequestInterface
*/
- public function getLastRequest()
+ public function getLastRequest(): ?RequestInterface
{
return $this->lastRequest;
}
/**
* Get the last received request options.
- *
- * @return array
*/
- public function getLastOptions()
+ public function getLastOptions(): array
{
return $this->lastOptions;
}
/**
* Returns the number of remaining items in the queue.
- *
- * @return int
*/
- public function count()
+ public function count(): int
{
- return count($this->queue);
+ return \count($this->queue);
}
+ public function reset(): void
+ {
+ $this->queue = [];
+ }
+
+ /**
+ * @param mixed $reason Promise or reason.
+ */
private function invokeStats(
RequestInterface $request,
array $options,
ResponseInterface $response = null,
$reason = null
- ) {
+ ): void {
if (isset($options['on_stats'])) {
- $stats = new TransferStats($request, $response, 0, $reason);
- call_user_func($options['on_stats'], $stats);
+ $transferTime = $options['transfer_time'] ?? 0;
+ $stats = new TransferStats($request, $response, $transferTime, $reason);
+ ($options['on_stats'])($stats);
}
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
index f8b00be0b..f045b526c 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
@@ -1,11 +1,15 @@
getBody()->getSize()) {
- $request = $request->withHeader('Content-Length', 0);
+ $request = $request->withHeader('Content-Length', '0');
}
return $this->createResponse(
@@ -57,80 +64,80 @@ public function __invoke(RequestInterface $request, array $options)
// Determine if the error was a networking error.
$message = $e->getMessage();
// This list can probably get more comprehensive.
- if (strpos($message, 'getaddrinfo') // DNS lookup failed
- || strpos($message, 'Connection refused')
- || strpos($message, "couldn't connect to host") // error on HHVM
- || strpos($message, "connection attempt failed")
+ if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
+ || false !== \strpos($message, 'Connection refused')
+ || false !== \strpos($message, "couldn't connect to host") // error on HHVM
+ || false !== \strpos($message, "connection attempt failed")
) {
$e = new ConnectException($e->getMessage(), $request, $e);
+ } else {
+ $e = RequestException::wrapException($request, $e);
}
- $e = RequestException::wrapException($request, $e);
$this->invokeStats($options, $request, $startTime, null, $e);
- return \GuzzleHttp\Promise\rejection_for($e);
+ return P\Create::rejectionFor($e);
}
}
private function invokeStats(
array $options,
RequestInterface $request,
- $startTime,
+ ?float $startTime,
ResponseInterface $response = null,
- $error = null
- ) {
+ \Throwable $error = null
+ ): void {
if (isset($options['on_stats'])) {
- $stats = new TransferStats(
- $request,
- $response,
- microtime(true) - $startTime,
- $error,
- []
- );
- call_user_func($options['on_stats'], $stats);
+ $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []);
+ ($options['on_stats'])($stats);
}
}
- private function createResponse(
- RequestInterface $request,
- array $options,
- $stream,
- $startTime
- ) {
+ /**
+ * @param resource $stream
+ */
+ private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface
+ {
$hdrs = $this->lastHeaders;
$this->lastHeaders = [];
- $parts = explode(' ', array_shift($hdrs), 3);
- $ver = explode('/', $parts[0])[1];
- $status = $parts[1];
- $reason = isset($parts[2]) ? $parts[2] : null;
- $headers = \GuzzleHttp\headers_from_lines($hdrs);
- list($stream, $headers) = $this->checkDecode($options, $headers, $stream);
- $stream = Psr7\stream_for($stream);
+
+ try {
+ [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered while creating the response', $request, null, $e)
+ );
+ }
+
+ [$stream, $headers] = $this->checkDecode($options, $headers, $stream);
+ $stream = Psr7\Utils::streamFor($stream);
$sink = $stream;
- if (strcasecmp('HEAD', $request->getMethod())) {
+ if (\strcasecmp('HEAD', $request->getMethod())) {
$sink = $this->createSink($stream, $options);
}
- $response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
+ try {
+ $response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered while creating the response', $request, null, $e)
+ );
+ }
if (isset($options['on_headers'])) {
try {
$options['on_headers']($response);
} catch (\Exception $e) {
- $msg = 'An error was encountered during the on_headers event';
- $ex = new RequestException($msg, $request, $response, $e);
- return \GuzzleHttp\Promise\rejection_for($ex);
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered during the on_headers event', $request, $response, $e)
+ );
}
}
// Do not drain when the request is a HEAD request because they have
// no body.
if ($sink !== $stream) {
- $this->drain(
- $stream,
- $sink,
- $response->getHeaderLine('Content-Length')
- );
+ $this->drain($stream, $sink, $response->getHeaderLine('Content-Length'));
}
$this->invokeStats($options, $request, $startTime, $response, null);
@@ -138,41 +145,37 @@ private function createResponse(
return new FulfilledPromise($response);
}
- private function createSink(StreamInterface $stream, array $options)
+ private function createSink(StreamInterface $stream, array $options): StreamInterface
{
if (!empty($options['stream'])) {
return $stream;
}
- $sink = isset($options['sink'])
- ? $options['sink']
- : fopen('php://temp', 'r+');
+ $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+');
- return is_string($sink)
- ? new Psr7\LazyOpenStream($sink, 'w+')
- : Psr7\stream_for($sink);
+ return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink);
}
- private function checkDecode(array $options, array $headers, $stream)
+ /**
+ * @param resource $stream
+ */
+ private function checkDecode(array $options, array $headers, $stream): array
{
// Automatically decode responses when instructed.
if (!empty($options['decode_content'])) {
- $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
+ $normalizedKeys = Utils::normalizeHeaderKeys($headers);
if (isset($normalizedKeys['content-encoding'])) {
$encoding = $headers[$normalizedKeys['content-encoding']];
if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
- $stream = new Psr7\InflateStream(
- Psr7\stream_for($stream)
- );
- $headers['x-encoded-content-encoding']
- = $headers[$normalizedKeys['content-encoding']];
+ $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream));
+ $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
+
// Remove content-encoding header
unset($headers[$normalizedKeys['content-encoding']]);
+
// Fix content-length header
if (isset($normalizedKeys['content-length'])) {
- $headers['x-encoded-content-length']
- = $headers[$normalizedKeys['content-length']];
-
+ $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
$length = (int) $stream->getSize();
if ($length === 0) {
unset($headers[$normalizedKeys['content-length']]);
@@ -190,27 +193,21 @@ private function checkDecode(array $options, array $headers, $stream)
/**
* Drains the source stream into the "sink" client option.
*
- * @param StreamInterface $source
- * @param StreamInterface $sink
- * @param string $contentLength Header specifying the amount of
- * data to read.
+ * @param string $contentLength Header specifying the amount of
+ * data to read.
*
- * @return StreamInterface
* @throws \RuntimeException when the sink option is invalid.
*/
- private function drain(
- StreamInterface $source,
- StreamInterface $sink,
- $contentLength
- ) {
+ private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface
+ {
// If a content-length header is provided, then stop reading once
// that number of bytes has been read. This can prevent infinitely
// reading from a stream when dealing with servers that do not honor
// Connection: Close headers.
- Psr7\copy_to_stream(
+ Psr7\Utils::copyToStream(
$source,
$sink,
- (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
+ (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
);
$sink->seek(0);
@@ -225,12 +222,13 @@ private function drain(
* @param callable $callback Callable that returns stream resource
*
* @return resource
+ *
* @throws \RuntimeException on error
*/
private function createResource(callable $callback)
{
- $errors = null;
- set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
+ $errors = [];
+ \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
$errors[] = [
'message' => $msg,
'file' => $file,
@@ -239,27 +237,33 @@ private function createResource(callable $callback)
return true;
});
- $resource = $callback();
- restore_error_handler();
+ try {
+ $resource = $callback();
+ } finally {
+ \restore_error_handler();
+ }
if (!$resource) {
$message = 'Error creating resource: ';
foreach ($errors as $err) {
foreach ($err as $key => $value) {
- $message .= "[$key] $value" . PHP_EOL;
+ $message .= "[$key] $value" . \PHP_EOL;
}
}
- throw new \RuntimeException(trim($message));
+ throw new \RuntimeException(\trim($message));
}
return $resource;
}
+ /**
+ * @return resource
+ */
private function createStream(RequestInterface $request, array $options)
{
static $methods;
if (!$methods) {
- $methods = array_flip(get_class_methods(__CLASS__));
+ $methods = \array_flip(\get_class_methods(__CLASS__));
}
// HTTP/1.1 streams using the PHP stream wrapper require a
@@ -278,7 +282,7 @@ private function createStream(RequestInterface $request, array $options)
$params = [];
$context = $this->getDefaultContext($request);
- if (isset($options['on_headers']) && !is_callable($options['on_headers'])) {
+ if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) {
throw new \InvalidArgumentException('on_headers must be callable');
}
@@ -292,42 +296,39 @@ private function createStream(RequestInterface $request, array $options)
}
if (isset($options['stream_context'])) {
- if (!is_array($options['stream_context'])) {
+ if (!\is_array($options['stream_context'])) {
throw new \InvalidArgumentException('stream_context must be an array');
}
- $context = array_replace_recursive(
- $context,
- $options['stream_context']
- );
+ $context = \array_replace_recursive($context, $options['stream_context']);
}
// Microsoft NTLM authentication only supported with curl handler
- if (isset($options['auth'])
- && is_array($options['auth'])
- && isset($options['auth'][2])
- && 'ntlm' == $options['auth'][2]
- ) {
+ if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) {
throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
}
$uri = $this->resolveHost($request, $options);
- $context = $this->createResource(
- function () use ($context, $params) {
- return stream_context_create($context, $params);
+ $contextResource = $this->createResource(
+ static function () use ($context, $params) {
+ return \stream_context_create($context, $params);
}
);
return $this->createResource(
- function () use ($uri, &$http_response_header, $context, $options) {
- $resource = fopen((string) $uri, 'r', null, $context);
+ function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
+ $resource = @\fopen((string) $uri, 'r', false, $contextResource);
$this->lastHeaders = $http_response_header;
+ if (false === $resource) {
+ throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context);
+ }
+
if (isset($options['read_timeout'])) {
$readTimeout = $options['read_timeout'];
$sec = (int) $readTimeout;
$usec = ($readTimeout - $sec) * 100000;
- stream_set_timeout($resource, $sec, $usec);
+ \stream_set_timeout($resource, $sec, $usec);
}
return $resource;
@@ -335,30 +336,31 @@ function () use ($uri, &$http_response_header, $context, $options) {
);
}
- private function resolveHost(RequestInterface $request, array $options)
+ private function resolveHost(RequestInterface $request, array $options): UriInterface
{
$uri = $request->getUri();
- if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) {
+ if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) {
if ('v4' === $options['force_ip_resolve']) {
- $records = dns_get_record($uri->getHost(), DNS_A);
- if (!isset($records[0]['ip'])) {
- throw new ConnectException(sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
+ $records = \dns_get_record($uri->getHost(), \DNS_A);
+ if (false === $records || !isset($records[0]['ip'])) {
+ throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
}
- $uri = $uri->withHost($records[0]['ip']);
- } elseif ('v6' === $options['force_ip_resolve']) {
- $records = dns_get_record($uri->getHost(), DNS_AAAA);
- if (!isset($records[0]['ipv6'])) {
- throw new ConnectException(sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
+ return $uri->withHost($records[0]['ip']);
+ }
+ if ('v6' === $options['force_ip_resolve']) {
+ $records = \dns_get_record($uri->getHost(), \DNS_AAAA);
+ if (false === $records || !isset($records[0]['ipv6'])) {
+ throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
}
- $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']');
+ return $uri->withHost('[' . $records[0]['ipv6'] . ']');
}
}
return $uri;
}
- private function getDefaultContext(RequestInterface $request)
+ private function getDefaultContext(RequestInterface $request): array
{
$headers = '';
foreach ($request->getHeaders() as $name => $value) {
@@ -387,55 +389,100 @@ private function getDefaultContext(RequestInterface $request)
}
}
- $context['http']['header'] = rtrim($context['http']['header']);
+ $context['http']['header'] = \rtrim($context['http']['header']);
return $context;
}
- private function add_proxy(RequestInterface $request, &$options, $value, &$params)
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void
{
- if (!is_array($value)) {
- $options['http']['proxy'] = $value;
+ $uri = null;
+
+ if (!\is_array($value)) {
+ $uri = $value;
} else {
$scheme = $request->getUri()->getScheme();
if (isset($value[$scheme])) {
- if (!isset($value['no'])
- || !\GuzzleHttp\is_host_in_noproxy(
- $request->getUri()->getHost(),
- $value['no']
- )
- ) {
- $options['http']['proxy'] = $value[$scheme];
+ if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) {
+ $uri = $value[$scheme];
}
}
}
+
+ if (!$uri) {
+ return;
+ }
+
+ $parsed = $this->parse_proxy($uri);
+ $options['http']['proxy'] = $parsed['proxy'];
+
+ if ($parsed['auth']) {
+ if (!isset($options['http']['header'])) {
+ $options['http']['header'] = [];
+ }
+ $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}";
+ }
}
- private function add_timeout(RequestInterface $request, &$options, $value, &$params)
+ /**
+ * Parses the given proxy URL to make it compatible with the format PHP's stream context expects.
+ */
+ private function parse_proxy(string $url): array
+ {
+ $parsed = \parse_url($url);
+
+ if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') {
+ if (isset($parsed['host']) && isset($parsed['port'])) {
+ $auth = null;
+ if (isset($parsed['user']) && isset($parsed['pass'])) {
+ $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}");
+ }
+
+ return [
+ 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}",
+ 'auth' => $auth ? "Basic {$auth}" : null,
+ ];
+ }
+ }
+
+ // Return proxy as-is.
+ return [
+ 'proxy' => $url,
+ 'auth' => null,
+ ];
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void
{
if ($value > 0) {
$options['http']['timeout'] = $value;
}
}
- private function add_verify(RequestInterface $request, &$options, $value, &$params)
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void
{
- if ($value === true) {
- // PHP 5.6 or greater will find the system cert by default. When
- // < 5.6, use the Guzzle bundled cacert.
- if (PHP_VERSION_ID < 50600) {
- $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle();
- }
- } elseif (is_string($value)) {
- $options['ssl']['cafile'] = $value;
- if (!file_exists($value)) {
- throw new \RuntimeException("SSL CA bundle not found: $value");
- }
- } elseif ($value === false) {
+ if ($value === false) {
$options['ssl']['verify_peer'] = false;
$options['ssl']['verify_peer_name'] = false;
+
return;
- } else {
+ }
+
+ if (\is_string($value)) {
+ $options['ssl']['cafile'] = $value;
+ if (!\file_exists($value)) {
+ throw new \RuntimeException("SSL CA bundle not found: $value");
+ }
+ } elseif ($value !== true) {
throw new \InvalidArgumentException('Invalid verify request option');
}
@@ -444,88 +491,95 @@ private function add_verify(RequestInterface $request, &$options, $value, &$para
$options['ssl']['allow_self_signed'] = false;
}
- private function add_cert(RequestInterface $request, &$options, $value, &$params)
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void
{
- if (is_array($value)) {
+ if (\is_array($value)) {
$options['ssl']['passphrase'] = $value[1];
$value = $value[0];
}
- if (!file_exists($value)) {
+ if (!\file_exists($value)) {
throw new \RuntimeException("SSL certificate not found: {$value}");
}
$options['ssl']['local_cert'] = $value;
}
- private function add_progress(RequestInterface $request, &$options, $value, &$params)
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void
{
- $this->addNotification(
+ self::addNotification(
$params,
- function ($code, $a, $b, $c, $transferred, $total) use ($value) {
- if ($code == STREAM_NOTIFY_PROGRESS) {
- $value($total, $transferred, null, null);
+ static function ($code, $a, $b, $c, $transferred, $total) use ($value) {
+ if ($code == \STREAM_NOTIFY_PROGRESS) {
+ // The upload progress cannot be determined. Use 0 for cURL compatibility:
+ // https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html
+ $value($total, $transferred, 0, 0);
}
}
);
}
- private function add_debug(RequestInterface $request, &$options, $value, &$params)
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void
{
if ($value === false) {
return;
}
static $map = [
- STREAM_NOTIFY_CONNECT => 'CONNECT',
- STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
- STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
- STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
- STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
- STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
- STREAM_NOTIFY_PROGRESS => 'PROGRESS',
- STREAM_NOTIFY_FAILURE => 'FAILURE',
- STREAM_NOTIFY_COMPLETED => 'COMPLETED',
- STREAM_NOTIFY_RESOLVE => 'RESOLVE',
+ \STREAM_NOTIFY_CONNECT => 'CONNECT',
+ \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
+ \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
+ \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
+ \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
+ \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
+ \STREAM_NOTIFY_PROGRESS => 'PROGRESS',
+ \STREAM_NOTIFY_FAILURE => 'FAILURE',
+ \STREAM_NOTIFY_COMPLETED => 'COMPLETED',
+ \STREAM_NOTIFY_RESOLVE => 'RESOLVE',
];
- static $args = ['severity', 'message', 'message_code',
- 'bytes_transferred', 'bytes_max'];
+ static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
- $value = \GuzzleHttp\debug_resource($value);
+ $value = Utils::debugResource($value);
$ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
- $this->addNotification(
+ self::addNotification(
$params,
- function () use ($ident, $value, $map, $args) {
- $passed = func_get_args();
- $code = array_shift($passed);
- fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
- foreach (array_filter($passed) as $i => $v) {
- fwrite($value, $args[$i] . ': "' . $v . '" ');
+ static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
+ \fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
+ foreach (\array_filter($passed) as $i => $v) {
+ \fwrite($value, $args[$i] . ': "' . $v . '" ');
}
- fwrite($value, "\n");
+ \fwrite($value, "\n");
}
);
}
- private function addNotification(array &$params, callable $notify)
+ private static function addNotification(array &$params, callable $notify): void
{
// Wrap the existing function if needed.
if (!isset($params['notification'])) {
$params['notification'] = $notify;
} else {
- $params['notification'] = $this->callArray([
+ $params['notification'] = self::callArray([
$params['notification'],
$notify
]);
}
}
- private function callArray(array $functions)
+ private static function callArray(array $functions): callable
{
- return function () use ($functions) {
- $args = func_get_args();
+ return static function (...$args) use ($functions) {
foreach ($functions as $fn) {
- call_user_func_array($fn, $args);
+ $fn(...$args);
}
};
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php
index 24c46fd9f..e0a1d1191 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php
@@ -1,21 +1,32 @@
push(Middleware::httpErrors(), 'http_errors');
$stack->push(Middleware::redirect(), 'allow_redirects');
$stack->push(Middleware::cookies(), 'cookies');
@@ -47,7 +56,7 @@ public static function create(callable $handler = null)
}
/**
- * @param callable $handler Underlying HTTP handler.
+ * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler.
*/
public function __construct(callable $handler = null)
{
@@ -57,8 +66,7 @@ public function __construct(callable $handler = null)
/**
* Invokes the handler stack as a composed handler
*
- * @param RequestInterface $request
- * @param array $options
+ * @return ResponseInterface|PromiseInterface
*/
public function __invoke(RequestInterface $request, array $options)
{
@@ -76,12 +84,13 @@ public function __toString()
{
$depth = 0;
$stack = [];
- if ($this->handler) {
+
+ if ($this->handler !== null) {
$stack[] = "0) Handler: " . $this->debugCallable($this->handler);
}
$result = '';
- foreach (array_reverse($this->stack) as $tuple) {
+ foreach (\array_reverse($this->stack) as $tuple) {
$depth++;
$str = "{$depth}) Name: '{$tuple[1]}', ";
$str .= "Function: " . $this->debugCallable($tuple[0]);
@@ -89,7 +98,7 @@ public function __toString()
$stack[] = $str;
}
- foreach (array_keys($stack) as $k) {
+ foreach (\array_keys($stack) as $k) {
$result .= "< {$stack[$k]}\n";
}
@@ -99,10 +108,10 @@ public function __toString()
/**
* Set the HTTP handler that actually returns a promise.
*
- * @param callable $handler Accepts a request and array of options and
- * returns a Promise.
+ * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and
+ * returns a Promise.
*/
- public function setHandler(callable $handler)
+ public function setHandler(callable $handler): void
{
$this->handler = $handler;
$this->cached = null;
@@ -110,33 +119,31 @@ public function setHandler(callable $handler)
/**
* Returns true if the builder has a handler.
- *
- * @return bool
*/
- public function hasHandler()
+ public function hasHandler(): bool
{
- return (bool) $this->handler;
+ return $this->handler !== null ;
}
/**
* Unshift a middleware to the bottom of the stack.
*
- * @param callable $middleware Middleware function
- * @param string $name Name to register for this middleware.
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $name Name to register for this middleware.
*/
- public function unshift(callable $middleware, $name = null)
+ public function unshift(callable $middleware, ?string $name = null): void
{
- array_unshift($this->stack, [$middleware, $name]);
+ \array_unshift($this->stack, [$middleware, $name]);
$this->cached = null;
}
/**
* Push a middleware to the top of the stack.
*
- * @param callable $middleware Middleware function
- * @param string $name Name to register for this middleware.
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $name Name to register for this middleware.
*/
- public function push(callable $middleware, $name = '')
+ public function push(callable $middleware, string $name = ''): void
{
$this->stack[] = [$middleware, $name];
$this->cached = null;
@@ -145,11 +152,11 @@ public function push(callable $middleware, $name = '')
/**
* Add a middleware before another middleware by name.
*
- * @param string $findName Middleware to find
- * @param callable $middleware Middleware function
- * @param string $withName Name to register for this middleware.
+ * @param string $findName Middleware to find
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $withName Name to register for this middleware.
*/
- public function before($findName, callable $middleware, $withName = '')
+ public function before(string $findName, callable $middleware, string $withName = ''): void
{
$this->splice($findName, $withName, $middleware, true);
}
@@ -157,11 +164,11 @@ public function before($findName, callable $middleware, $withName = '')
/**
* Add a middleware after another middleware by name.
*
- * @param string $findName Middleware to find
- * @param callable $middleware Middleware function
- * @param string $withName Name to register for this middleware.
+ * @param string $findName Middleware to find
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $withName Name to register for this middleware.
*/
- public function after($findName, callable $middleware, $withName = '')
+ public function after(string $findName, callable $middleware, string $withName = ''): void
{
$this->splice($findName, $withName, $middleware, false);
}
@@ -171,13 +178,17 @@ public function after($findName, callable $middleware, $withName = '')
*
* @param callable|string $remove Middleware to remove by instance or name.
*/
- public function remove($remove)
+ public function remove($remove): void
{
+ if (!is_string($remove) && !is_callable($remove)) {
+ trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
+ }
+
$this->cached = null;
- $idx = is_callable($remove) ? 0 : 1;
- $this->stack = array_values(array_filter(
+ $idx = \is_callable($remove) ? 0 : 1;
+ $this->stack = \array_values(\array_filter(
$this->stack,
- function ($tuple) use ($idx, $remove) {
+ static function ($tuple) use ($idx, $remove) {
return $tuple[$idx] !== $remove;
}
));
@@ -186,16 +197,17 @@ function ($tuple) use ($idx, $remove) {
/**
* Compose the middleware and handler into a single callable function.
*
- * @return callable
+ * @return callable(RequestInterface, array): PromiseInterface
*/
- public function resolve()
+ public function resolve(): callable
{
- if (!$this->cached) {
- if (!($prev = $this->handler)) {
+ if ($this->cached === null) {
+ if (($prev = $this->handler) === null) {
throw new \LogicException('No handler has been specified');
}
- foreach (array_reverse($this->stack) as $fn) {
+ foreach (\array_reverse($this->stack) as $fn) {
+ /** @var callable(RequestInterface, array): PromiseInterface $prev */
$prev = $fn[0]($prev);
}
@@ -205,11 +217,7 @@ public function resolve()
return $this->cached;
}
- /**
- * @param $name
- * @return int
- */
- private function findByName($name)
+ private function findByName(string $name): int
{
foreach ($this->stack as $k => $v) {
if ($v[1] === $name) {
@@ -222,13 +230,8 @@ private function findByName($name)
/**
* Splices a function into the middleware list at a specific position.
- *
- * @param $findName
- * @param $withName
- * @param callable $middleware
- * @param $before
*/
- private function splice($findName, $withName, callable $middleware, $before)
+ private function splice(string $findName, string $withName, callable $middleware, bool $before): void
{
$this->cached = null;
$idx = $this->findByName($findName);
@@ -236,38 +239,37 @@ private function splice($findName, $withName, callable $middleware, $before)
if ($before) {
if ($idx === 0) {
- array_unshift($this->stack, $tuple);
+ \array_unshift($this->stack, $tuple);
} else {
$replacement = [$tuple, $this->stack[$idx]];
- array_splice($this->stack, $idx, 1, $replacement);
+ \array_splice($this->stack, $idx, 1, $replacement);
}
- } elseif ($idx === count($this->stack) - 1) {
+ } elseif ($idx === \count($this->stack) - 1) {
$this->stack[] = $tuple;
} else {
$replacement = [$this->stack[$idx], $tuple];
- array_splice($this->stack, $idx, 1, $replacement);
+ \array_splice($this->stack, $idx, 1, $replacement);
}
}
/**
* Provides a debug string for a given callable.
*
- * @param array|callable $fn Function to write as a string.
- *
- * @return string
+ * @param callable|string $fn Function to write as a string.
*/
- private function debugCallable($fn)
+ private function debugCallable($fn): string
{
- if (is_string($fn)) {
+ if (\is_string($fn)) {
return "callable({$fn})";
}
- if (is_array($fn)) {
- return is_string($fn[0])
+ if (\is_array($fn)) {
+ return \is_string($fn[0])
? "callable({$fn[0]}::{$fn[1]})"
- : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])";
+ : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
}
- return 'callable(' . spl_object_hash($fn) . ')';
+ /** @var object $fn */
+ return 'callable(' . \spl_object_hash($fn) . ')';
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
index 663ac7391..da499547f 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
@@ -1,4 +1,5 @@
>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
- const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
+ public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
+ public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
+ public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
- /** @var string Template used to format log messages */
+ /**
+ * @var string Template used to format log messages
+ */
private $template;
/**
* @param string $template Log message template
*/
- public function __construct($template = self::CLF)
+ public function __construct(?string $template = self::CLF)
{
$this->template = $template ?: self::CLF;
}
@@ -57,20 +64,16 @@ public function __construct($template = self::CLF)
/**
* Returns a formatted message string.
*
- * @param RequestInterface $request Request that was sent
- * @param ResponseInterface $response Response that was received
- * @param \Exception $error Exception that was received
- *
- * @return string
+ * @param RequestInterface $request Request that was sent
+ * @param ResponseInterface|null $response Response that was received
+ * @param \Throwable|null $error Exception that was received
*/
- public function format(
- RequestInterface $request,
- ResponseInterface $response = null,
- \Exception $error = null
- ) {
+ public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string
+ {
$cache = [];
- return preg_replace_callback(
+ /** @var string */
+ return \preg_replace_callback(
'/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
function (array $matches) use ($request, $response, $error, &$cache) {
if (isset($cache[$matches[1]])) {
@@ -80,20 +83,20 @@ function (array $matches) use ($request, $response, $error, &$cache) {
$result = '';
switch ($matches[1]) {
case 'request':
- $result = Psr7\str($request);
+ $result = Psr7\Message::toString($request);
break;
case 'response':
- $result = $response ? Psr7\str($response) : '';
+ $result = $response ? Psr7\Message::toString($response) : '';
break;
case 'req_headers':
- $result = trim($request->getMethod()
+ $result = \trim($request->getMethod()
. ' ' . $request->getRequestTarget())
. ' HTTP/' . $request->getProtocolVersion() . "\r\n"
. $this->headers($request);
break;
case 'res_headers':
$result = $response ?
- sprintf(
+ \sprintf(
'HTTP/%s %d %s',
$response->getProtocolVersion(),
$response->getStatusCode(),
@@ -102,17 +105,29 @@ function (array $matches) use ($request, $response, $error, &$cache) {
: 'NULL';
break;
case 'req_body':
- $result = $request->getBody();
+ $result = $request->getBody()->__toString();
break;
case 'res_body':
- $result = $response ? $response->getBody() : 'NULL';
+ if (!$response instanceof ResponseInterface) {
+ $result = 'NULL';
+ break;
+ }
+
+ $body = $response->getBody();
+
+ if (!$body->isSeekable()) {
+ $result = 'RESPONSE_NOT_LOGGEABLE';
+ break;
+ }
+
+ $result = $response->getBody()->__toString();
break;
case 'ts':
case 'date_iso_8601':
- $result = gmdate('c');
+ $result = \gmdate('c');
break;
case 'date_common_log':
- $result = date('d/M/Y:H:i:s O');
+ $result = \date('d/M/Y:H:i:s O');
break;
case 'method':
$result = $request->getMethod();
@@ -122,7 +137,7 @@ function (array $matches) use ($request, $response, $error, &$cache) {
break;
case 'uri':
case 'url':
- $result = $request->getUri();
+ $result = $request->getUri()->__toString();
break;
case 'target':
$result = $request->getRequestTarget();
@@ -139,7 +154,7 @@ function (array $matches) use ($request, $response, $error, &$cache) {
$result = $request->getHeaderLine('Host');
break;
case 'hostname':
- $result = gethostname();
+ $result = \gethostname();
break;
case 'code':
$result = $response ? $response->getStatusCode() : 'NULL';
@@ -152,11 +167,11 @@ function (array $matches) use ($request, $response, $error, &$cache) {
break;
default:
// handle prefixed dynamic headers
- if (strpos($matches[1], 'req_header_') === 0) {
- $result = $request->getHeaderLine(substr($matches[1], 11));
- } elseif (strpos($matches[1], 'res_header_') === 0) {
+ if (\strpos($matches[1], 'req_header_') === 0) {
+ $result = $request->getHeaderLine(\substr($matches[1], 11));
+ } elseif (\strpos($matches[1], 'res_header_') === 0) {
$result = $response
- ? $response->getHeaderLine(substr($matches[1], 11))
+ ? $response->getHeaderLine(\substr($matches[1], 11))
: 'NULL';
}
}
@@ -168,13 +183,16 @@ function (array $matches) use ($request, $response, $error, &$cache) {
);
}
- private function headers(MessageInterface $message)
+ /**
+ * Get headers from message as string
+ */
+ private function headers(MessageInterface $message): string
{
$result = '';
foreach ($message->getHeaders() as $name => $values) {
- $result .= $name . ': ' . implode(', ', $values) . "\r\n";
+ $result .= $name . ': ' . \implode(', ', $values) . "\r\n";
}
- return trim($result);
+ return \trim($result);
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
new file mode 100644
index 000000000..a39ac248e
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
@@ -0,0 +1,18 @@
+withCookieHeader($request);
return $handler($request, $options)
->then(
- function ($response) use ($cookieJar, $request) {
+ static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
$cookieJar->extractCookies($request, $response);
return $response;
}
- );
+ );
};
};
}
/**
* Middleware that throws exceptions for 4xx or 5xx responses when the
- * "http_error" request option is set to true.
+ * "http_errors" request option is set to true.
*
- * @return callable Returns a function that accepts the next handler.
+ * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages.
+ *
+ * @return callable(callable): callable Returns a function that accepts the next handler.
*/
- public static function httpErrors()
+ public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable
{
- return function (callable $handler) {
- return function ($request, array $options) use ($handler) {
+ return static function (callable $handler) use ($bodySummarizer): callable {
+ return static function ($request, array $options) use ($handler, $bodySummarizer) {
if (empty($options['http_errors'])) {
return $handler($request, $options);
}
return $handler($request, $options)->then(
- function (ResponseInterface $response) use ($request, $handler) {
+ static function (ResponseInterface $response) use ($request, $bodySummarizer) {
$code = $response->getStatusCode();
if ($code < 400) {
return $response;
}
- throw RequestException::create($request, $response);
+ throw RequestException::create($request, $response, null, [], $bodySummarizer);
}
);
};
@@ -73,21 +76,22 @@ function (ResponseInterface $response) use ($request, $handler) {
/**
* Middleware that pushes history data to an ArrayAccess container.
*
- * @param array|\ArrayAccess $container Container to hold the history (by reference).
+ * @param array|\ArrayAccess $container Container to hold the history (by reference).
+ *
+ * @return callable(callable): callable Returns a function that accepts the next handler.
*
- * @return callable Returns a function that accepts the next handler.
* @throws \InvalidArgumentException if container is not an array or ArrayAccess.
*/
- public static function history(&$container)
+ public static function history(&$container): callable
{
- if (!is_array($container) && !$container instanceof \ArrayAccess) {
+ if (!\is_array($container) && !$container instanceof \ArrayAccess) {
throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
}
- return function (callable $handler) use (&$container) {
- return function ($request, array $options) use ($handler, &$container) {
+ return static function (callable $handler) use (&$container): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, &$container) {
return $handler($request, $options)->then(
- function ($value) use ($request, &$container, $options) {
+ static function ($value) use ($request, &$container, $options) {
$container[] = [
'request' => $request,
'response' => $value,
@@ -96,14 +100,14 @@ function ($value) use ($request, &$container, $options) {
];
return $value;
},
- function ($reason) use ($request, &$container, $options) {
+ static function ($reason) use ($request, &$container, $options) {
$container[] = [
'request' => $request,
'response' => null,
'error' => $reason,
'options' => $options
];
- return \GuzzleHttp\Promise\rejection_for($reason);
+ return P\Create::rejectionFor($reason);
}
);
};
@@ -123,10 +127,10 @@ function ($reason) use ($request, &$container, $options) {
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function tap(callable $before = null, callable $after = null)
+ public static function tap(callable $before = null, callable $after = null): callable
{
- return function (callable $handler) use ($before, $after) {
- return function ($request, array $options) use ($handler, $before, $after) {
+ return static function (callable $handler) use ($before, $after): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, $before, $after) {
if ($before) {
$before($request, $options);
}
@@ -144,9 +148,9 @@ public static function tap(callable $before = null, callable $after = null)
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function redirect()
+ public static function redirect(): callable
{
- return function (callable $handler) {
+ return static function (callable $handler): RedirectMiddleware {
return new RedirectMiddleware($handler);
};
}
@@ -166,9 +170,9 @@ public static function redirect()
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function retry(callable $decider, callable $delay = null)
+ public static function retry(callable $decider, callable $delay = null): callable
{
- return function (callable $handler) use ($decider, $delay) {
+ return static function (callable $handler) use ($decider, $delay): RetryMiddleware {
return new RetryMiddleware($decider, $handler, $delay);
};
}
@@ -177,29 +181,34 @@ public static function retry(callable $decider, callable $delay = null)
* Middleware that logs requests, responses, and errors using a message
* formatter.
*
- * @param LoggerInterface $logger Logs messages.
- * @param MessageFormatter $formatter Formatter used to create message strings.
- * @param string $logLevel Level at which to log requests.
+ * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
+ *
+ * @param LoggerInterface $logger Logs messages.
+ * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
+ * @param string $logLevel Level at which to log requests.
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO)
+ public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable
{
- return function (callable $handler) use ($logger, $formatter, $logLevel) {
- return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
+ // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter
+ if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) {
+ throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class));
+ }
+
+ return static function (callable $handler) use ($logger, $formatter, $logLevel): callable {
+ return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) {
return $handler($request, $options)->then(
- function ($response) use ($logger, $request, $formatter, $logLevel) {
+ static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
$message = $formatter->format($request, $response);
$logger->log($logLevel, $message);
return $response;
},
- function ($reason) use ($logger, $request, $formatter) {
- $response = $reason instanceof RequestException
- ? $reason->getResponse()
- : null;
- $message = $formatter->format($request, $response, $reason);
- $logger->notice($message);
- return \GuzzleHttp\Promise\rejection_for($reason);
+ static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
+ $response = $reason instanceof RequestException ? $reason->getResponse() : null;
+ $message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
+ $logger->error($message);
+ return P\Create::rejectionFor($reason);
}
);
};
@@ -209,12 +218,10 @@ function ($reason) use ($logger, $request, $formatter) {
/**
* This middleware adds a default content-type if possible, a default
* content-length or transfer-encoding header, and the expect header.
- *
- * @return callable
*/
- public static function prepareBody()
+ public static function prepareBody(): callable
{
- return function (callable $handler) {
+ return static function (callable $handler): PrepareBodyMiddleware {
return new PrepareBodyMiddleware($handler);
};
}
@@ -225,12 +232,11 @@ public static function prepareBody()
*
* @param callable $fn Function that accepts a RequestInterface and returns
* a RequestInterface.
- * @return callable
*/
- public static function mapRequest(callable $fn)
+ public static function mapRequest(callable $fn): callable
{
- return function (callable $handler) use ($fn) {
- return function ($request, array $options) use ($handler, $fn) {
+ return static function (callable $handler) use ($fn): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, $fn) {
return $handler($fn($request), $options);
};
};
@@ -242,12 +248,11 @@ public static function mapRequest(callable $fn)
*
* @param callable $fn Function that accepts a ResponseInterface and
* returns a ResponseInterface.
- * @return callable
*/
- public static function mapResponse(callable $fn)
+ public static function mapResponse(callable $fn): callable
{
- return function (callable $handler) use ($fn) {
- return function ($request, array $options) use ($handler, $fn) {
+ return static function (callable $handler) use ($fn): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, $fn) {
return $handler($request, $options)->then($fn);
};
};
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Pool.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Pool.php
index 8f1be33cd..6277c61fb 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/Pool.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Pool.php
@@ -1,12 +1,15 @@
$rfn) {
if ($rfn instanceof RequestInterface) {
yield $key => $client->sendAsync($rfn, $opts);
- } elseif (is_callable($rfn)) {
+ } elseif (\is_callable($rfn)) {
yield $key => $rfn($opts);
} else {
- throw new \InvalidArgumentException('Each value yielded by '
- . 'the iterator must be a Psr7\Http\Message\RequestInterface '
- . 'or a callable that returns a promise that fulfills '
- . 'with a Psr7\Message\Http\ResponseInterface object.');
+ throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.');
}
}
};
@@ -69,7 +67,10 @@ public function __construct(
$this->each = new EachPromise($requests(), $config);
}
- public function promise()
+ /**
+ * Get promise
+ */
+ public function promise(): PromiseInterface
{
return $this->each->promise();
}
@@ -85,36 +86,37 @@ public function promise()
* @param ClientInterface $client Client used to send the requests
* @param array|\Iterator $requests Requests to send concurrently.
* @param array $options Passes through the options available in
- * {@see GuzzleHttp\Pool::__construct}
+ * {@see \GuzzleHttp\Pool::__construct}
*
* @return array Returns an array containing the response or an exception
* in the same order that the requests were sent.
+ *
* @throws \InvalidArgumentException if the event format is incorrect.
*/
- public static function batch(
- ClientInterface $client,
- $requests,
- array $options = []
- ) {
+ public static function batch(ClientInterface $client, $requests, array $options = []): array
+ {
$res = [];
self::cmpCallback($options, 'fulfilled', $res);
self::cmpCallback($options, 'rejected', $res);
$pool = new static($client, $requests, $options);
$pool->promise()->wait();
- ksort($res);
+ \ksort($res);
return $res;
}
- private static function cmpCallback(array &$options, $name, array &$results)
+ /**
+ * Execute callback(s)
+ */
+ private static function cmpCallback(array &$options, string $name, array &$results): void
{
if (!isset($options[$name])) {
- $options[$name] = function ($v, $k) use (&$results) {
+ $options[$name] = static function ($v, $k) use (&$results) {
$results[$k] = $v;
};
} else {
$currentFn = $options[$name];
- $options[$name] = function ($v, $k) use (&$results, $currentFn) {
+ $options[$name] = static function ($v, $k) use (&$results, $currentFn) {
$currentFn($v, $k);
$results[$k] = $v;
};
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
index 2eb95f9b2..7ca628338 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
@@ -1,34 +1,32 @@
nextHandler = $nextHandler;
}
- /**
- * @param RequestInterface $request
- * @param array $options
- *
- * @return PromiseInterface
- */
- public function __invoke(RequestInterface $request, array $options)
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$fn = $this->nextHandler;
@@ -42,7 +40,7 @@ public function __invoke(RequestInterface $request, array $options)
// Add a default content-type if possible.
if (!$request->hasHeader('Content-Type')) {
if ($uri = $request->getBody()->getMetadata('uri')) {
- if ($type = Psr7\mimetype_from_filename($uri)) {
+ if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) {
$modify['set_headers']['Content-Type'] = $type;
}
}
@@ -63,20 +61,20 @@ public function __invoke(RequestInterface $request, array $options)
// Add the expect header if needed.
$this->addExpectHeader($request, $options, $modify);
- return $fn(Psr7\modify_request($request, $modify), $options);
+ return $fn(Psr7\Utils::modifyRequest($request, $modify), $options);
}
- private function addExpectHeader(
- RequestInterface $request,
- array $options,
- array &$modify
- ) {
+ /**
+ * Add expect header
+ */
+ private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void
+ {
// Determine if the Expect header should be used
if ($request->hasHeader('Expect')) {
return;
}
- $expect = isset($options['expect']) ? $options['expect'] : null;
+ $expect = $options['expect'] ?? null;
// Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
if ($expect === false || $request->getProtocolVersion() < 1.1) {
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
index 131b77179..1dd38614f 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
@@ -1,10 +1,10 @@
5,
'protocols' => ['http', 'https'],
@@ -29,24 +34,20 @@ class RedirectMiddleware
'track_redirects' => false,
];
- /** @var callable */
+ /**
+ * @var callable(RequestInterface, array): PromiseInterface
+ */
private $nextHandler;
/**
- * @param callable $nextHandler Next handler to invoke.
+ * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
*/
public function __construct(callable $nextHandler)
{
$this->nextHandler = $nextHandler;
}
- /**
- * @param RequestInterface $request
- * @param array $options
- *
- * @return PromiseInterface
- */
- public function __invoke(RequestInterface $request, array $options)
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$fn = $this->nextHandler;
@@ -56,7 +57,7 @@ public function __invoke(RequestInterface $request, array $options)
if ($options['allow_redirects'] === true) {
$options['allow_redirects'] = self::$defaultSettings;
- } elseif (!is_array($options['allow_redirects'])) {
+ } elseif (!\is_array($options['allow_redirects'])) {
throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
} else {
// Merge the default settings with the provided settings
@@ -74,36 +75,27 @@ public function __invoke(RequestInterface $request, array $options)
}
/**
- * @param RequestInterface $request
- * @param array $options
- * @param ResponseInterface|PromiseInterface $response
- *
* @return ResponseInterface|PromiseInterface
*/
- public function checkRedirect(
- RequestInterface $request,
- array $options,
- ResponseInterface $response
- ) {
- if (substr($response->getStatusCode(), 0, 1) != '3'
+ public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response)
+ {
+ if (\strpos((string) $response->getStatusCode(), '3') !== 0
|| !$response->hasHeader('Location')
) {
return $response;
}
- $this->guardMax($request, $options);
+ $this->guardMax($request, $response, $options);
$nextRequest = $this->modifyRequest($request, $options, $response);
if (isset($options['allow_redirects']['on_redirect'])) {
- call_user_func(
- $options['allow_redirects']['on_redirect'],
+ ($options['allow_redirects']['on_redirect'])(
$request,
$response,
$nextRequest->getUri()
);
}
- /** @var PromiseInterface|ResponseInterface $promise */
$promise = $this($nextRequest, $options);
// Add headers to be able to track history of redirects.
@@ -118,51 +110,46 @@ public function checkRedirect(
return $promise;
}
- private function withTracking(PromiseInterface $promise, $uri, $statusCode)
+ /**
+ * Enable tracking on promise.
+ */
+ private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface
{
return $promise->then(
- function (ResponseInterface $response) use ($uri, $statusCode) {
+ static function (ResponseInterface $response) use ($uri, $statusCode) {
// Note that we are pushing to the front of the list as this
// would be an earlier response than what is currently present
// in the history header.
$historyHeader = $response->getHeader(self::HISTORY_HEADER);
$statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
- array_unshift($historyHeader, $uri);
- array_unshift($statusHeader, $statusCode);
+ \array_unshift($historyHeader, $uri);
+ \array_unshift($statusHeader, (string) $statusCode);
+
return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
}
);
}
- private function guardMax(RequestInterface $request, array &$options)
+ /**
+ * Check for too many redirects
+ *
+ * @throws TooManyRedirectsException Too many redirects.
+ */
+ private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void
{
- $current = isset($options['__redirect_count'])
- ? $options['__redirect_count']
- : 0;
+ $current = $options['__redirect_count']
+ ?? 0;
$options['__redirect_count'] = $current + 1;
$max = $options['allow_redirects']['max'];
if ($options['__redirect_count'] > $max) {
- throw new TooManyRedirectsException(
- "Will not follow more than {$max} redirects",
- $request
- );
+ throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response);
}
}
- /**
- * @param RequestInterface $request
- * @param array $options
- * @param ResponseInterface $response
- *
- * @return RequestInterface
- */
- public function modifyRequest(
- RequestInterface $request,
- array $options,
- ResponseInterface $response
- ) {
+ public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface
+ {
// Request modifications to apply.
$modify = [];
$protocols = $options['allow_redirects']['protocols'];
@@ -172,21 +159,30 @@ public function modifyRequest(
// would do.
$statusCode = $response->getStatusCode();
if ($statusCode == 303 ||
- ($statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict'])
+ ($statusCode <= 302 && !$options['allow_redirects']['strict'])
) {
- $modify['method'] = 'GET';
+ $safeMethods = ['GET', 'HEAD', 'OPTIONS'];
+ $requestMethod = $request->getMethod();
+
+ $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET';
$modify['body'] = '';
}
- $modify['uri'] = $this->redirectUri($request, $response, $protocols);
- Psr7\rewind_body($request);
+ $uri = $this->redirectUri($request, $response, $protocols);
+ if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
+ $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion'];
+ $uri = Utils::idnUriConvert($uri, $idnOptions);
+ }
+
+ $modify['uri'] = $uri;
+ Psr7\Message::rewindBody($request);
// Add the Referer header if it is told to do so and only
// add the header if we are not redirecting from https to http.
if ($options['allow_redirects']['referer']
&& $modify['uri']->getScheme() === $request->getUri()->getScheme()
) {
- $uri = $request->getUri()->withUserInfo('', '');
+ $uri = $request->getUri()->withUserInfo('');
$modify['set_headers']['Referer'] = (string) $uri;
} else {
$modify['remove_headers'][] = 'Referer';
@@ -197,39 +193,22 @@ public function modifyRequest(
$modify['remove_headers'][] = 'Authorization';
}
- return Psr7\modify_request($request, $modify);
+ return Psr7\Utils::modifyRequest($request, $modify);
}
/**
* Set the appropriate URL on the request based on the location header
- *
- * @param RequestInterface $request
- * @param ResponseInterface $response
- * @param array $protocols
- *
- * @return UriInterface
*/
- private function redirectUri(
- RequestInterface $request,
- ResponseInterface $response,
- array $protocols
- ) {
+ private function redirectUri(RequestInterface $request, ResponseInterface $response, array $protocols): UriInterface
+ {
$location = Psr7\UriResolver::resolve(
$request->getUri(),
new Psr7\Uri($response->getHeaderLine('Location'))
);
// Ensure that the redirect URI is allowed based on the protocols.
- if (!in_array($location->getScheme(), $protocols)) {
- throw new BadResponseException(
- sprintf(
- 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s',
- $location,
- implode(', ', $protocols)
- ),
- $request,
- $response
- );
+ if (!\in_array($location->getScheme(), $protocols)) {
+ throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response);
}
return $location;
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php
index c6aacfb15..20b31bc20 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php
@@ -1,4 +1,5 @@
decider = $decider;
$this->nextHandler = $nextHandler;
$this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
@@ -42,22 +50,14 @@ public function __construct(
/**
* Default exponential backoff delay function.
*
- * @param $retries
- *
- * @return int
+ * @return int milliseconds.
*/
- public static function exponentialDelay($retries)
+ public static function exponentialDelay(int $retries): int
{
- return (int) pow(2, $retries - 1);
+ return (int) \pow(2, $retries - 1) * 1000;
}
- /**
- * @param RequestInterface $request
- * @param array $options
- *
- * @return PromiseInterface
- */
- public function __invoke(RequestInterface $request, array $options)
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
if (!isset($options['retries'])) {
$options['retries'] = 0;
@@ -71,41 +71,45 @@ public function __invoke(RequestInterface $request, array $options)
);
}
- private function onFulfilled(RequestInterface $req, array $options)
+ /**
+ * Execute fulfilled closure
+ */
+ private function onFulfilled(RequestInterface $request, array $options): callable
{
- return function ($value) use ($req, $options) {
- if (!call_user_func(
- $this->decider,
+ return function ($value) use ($request, $options) {
+ if (!($this->decider)(
$options['retries'],
- $req,
+ $request,
$value,
null
)) {
return $value;
}
- return $this->doRetry($req, $options, $value);
+ return $this->doRetry($request, $options, $value);
};
}
- private function onRejected(RequestInterface $req, array $options)
+ /**
+ * Execute rejected closure
+ */
+ private function onRejected(RequestInterface $req, array $options): callable
{
return function ($reason) use ($req, $options) {
- if (!call_user_func(
- $this->decider,
+ if (!($this->decider)(
$options['retries'],
$req,
null,
$reason
)) {
- return \GuzzleHttp\Promise\rejection_for($reason);
+ return P\Create::rejectionFor($reason);
}
return $this->doRetry($req, $options);
};
}
- private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
+ private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
{
- $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
+ $options['delay'] = ($this->delay)(++$options['retries'], $response);
return $this($request, $options);
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php b/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php
index 15f717e1e..93fa334c8 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php
@@ -1,4 +1,5 @@
request = $request;
$this->response = $response;
@@ -38,30 +58,23 @@ public function __construct(
$this->handlerStats = $handlerStats;
}
- /**
- * @return RequestInterface
- */
- public function getRequest()
+ public function getRequest(): RequestInterface
{
return $this->request;
}
/**
* Returns the response that was received (if any).
- *
- * @return ResponseInterface|null
*/
- public function getResponse()
+ public function getResponse(): ?ResponseInterface
{
return $this->response;
}
/**
* Returns true if a response was received.
- *
- * @return bool
*/
- public function hasResponse()
+ public function hasResponse(): bool
{
return $this->response !== null;
}
@@ -82,10 +95,8 @@ public function getHandlerErrorData()
/**
* Get the effective URI the request was sent to.
- *
- * @return UriInterface
*/
- public function getEffectiveUri()
+ public function getEffectiveUri(): UriInterface
{
return $this->request->getUri();
}
@@ -93,19 +104,17 @@ public function getEffectiveUri()
/**
* Get the estimated time the request was being transferred by the handler.
*
- * @return float Time in seconds.
+ * @return float|null Time in seconds.
*/
- public function getTransferTime()
+ public function getTransferTime(): ?float
{
return $this->transferTime;
}
/**
* Gets an array of all of the handler specific transfer data.
- *
- * @return array
*/
- public function getHandlerStats()
+ public function getHandlerStats(): array
{
return $this->handlerStats;
}
@@ -117,10 +126,8 @@ public function getHandlerStats()
*
* @return mixed|null
*/
- public function getHandlerStat($stat)
+ public function getHandlerStat(string $stat)
{
- return isset($this->handlerStats[$stat])
- ? $this->handlerStats[$stat]
- : null;
+ return $this->handlerStats[$stat] ?? null;
}
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/tests/integration/vendor/guzzlehttp/guzzle/src/UriTemplate.php
deleted file mode 100644
index 96dcfd09c..000000000
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/UriTemplate.php
+++ /dev/null
@@ -1,237 +0,0 @@
- ['prefix' => '', 'joiner' => ',', 'query' => false],
- '+' => ['prefix' => '', 'joiner' => ',', 'query' => false],
- '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
- '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
- '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
- ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
- '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
- '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]
- ];
-
- /** @var array Delimiters */
- private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$',
- '&', '\'', '(', ')', '*', '+', ',', ';', '='];
-
- /** @var array Percent encoded delimiters */
- private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D',
- '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
- '%3B', '%3D'];
-
- public function expand($template, array $variables)
- {
- if (false === strpos($template, '{')) {
- return $template;
- }
-
- $this->template = $template;
- $this->variables = $variables;
-
- return preg_replace_callback(
- '/\{([^\}]+)\}/',
- [$this, 'expandMatch'],
- $this->template
- );
- }
-
- /**
- * Parse an expression into parts
- *
- * @param string $expression Expression to parse
- *
- * @return array Returns an associative array of parts
- */
- private function parseExpression($expression)
- {
- $result = [];
-
- if (isset(self::$operatorHash[$expression[0]])) {
- $result['operator'] = $expression[0];
- $expression = substr($expression, 1);
- } else {
- $result['operator'] = '';
- }
-
- foreach (explode(',', $expression) as $value) {
- $value = trim($value);
- $varspec = [];
- if ($colonPos = strpos($value, ':')) {
- $varspec['value'] = substr($value, 0, $colonPos);
- $varspec['modifier'] = ':';
- $varspec['position'] = (int) substr($value, $colonPos + 1);
- } elseif (substr($value, -1) === '*') {
- $varspec['modifier'] = '*';
- $varspec['value'] = substr($value, 0, -1);
- } else {
- $varspec['value'] = (string) $value;
- $varspec['modifier'] = '';
- }
- $result['values'][] = $varspec;
- }
-
- return $result;
- }
-
- /**
- * Process an expansion
- *
- * @param array $matches Matches met in the preg_replace_callback
- *
- * @return string Returns the replacement string
- */
- private function expandMatch(array $matches)
- {
- static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
-
- $replacements = [];
- $parsed = self::parseExpression($matches[1]);
- $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
- $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
- $useQuery = self::$operatorHash[$parsed['operator']]['query'];
-
- foreach ($parsed['values'] as $value) {
- if (!isset($this->variables[$value['value']])) {
- continue;
- }
-
- $variable = $this->variables[$value['value']];
- $actuallyUseQuery = $useQuery;
- $expanded = '';
-
- if (is_array($variable)) {
- $isAssoc = $this->isAssoc($variable);
- $kvp = [];
- foreach ($variable as $key => $var) {
- if ($isAssoc) {
- $key = rawurlencode($key);
- $isNestedArray = is_array($var);
- } else {
- $isNestedArray = false;
- }
-
- if (!$isNestedArray) {
- $var = rawurlencode($var);
- if ($parsed['operator'] === '+' ||
- $parsed['operator'] === '#'
- ) {
- $var = $this->decodeReserved($var);
- }
- }
-
- if ($value['modifier'] === '*') {
- if ($isAssoc) {
- if ($isNestedArray) {
- // Nested arrays must allow for deeply nested
- // structures.
- $var = strtr(
- http_build_query([$key => $var]),
- $rfc1738to3986
- );
- } else {
- $var = $key . '=' . $var;
- }
- } elseif ($key > 0 && $actuallyUseQuery) {
- $var = $value['value'] . '=' . $var;
- }
- }
-
- $kvp[$key] = $var;
- }
-
- if (empty($variable)) {
- $actuallyUseQuery = false;
- } elseif ($value['modifier'] === '*') {
- $expanded = implode($joiner, $kvp);
- if ($isAssoc) {
- // Don't prepend the value name when using the explode
- // modifier with an associative array.
- $actuallyUseQuery = false;
- }
- } else {
- if ($isAssoc) {
- // When an associative array is encountered and the
- // explode modifier is not set, then the result must be
- // a comma separated list of keys followed by their
- // respective values.
- foreach ($kvp as $k => &$v) {
- $v = $k . ',' . $v;
- }
- }
- $expanded = implode(',', $kvp);
- }
- } else {
- if ($value['modifier'] === ':') {
- $variable = substr($variable, 0, $value['position']);
- }
- $expanded = rawurlencode($variable);
- if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
- $expanded = $this->decodeReserved($expanded);
- }
- }
-
- if ($actuallyUseQuery) {
- if (!$expanded && $joiner !== '&') {
- $expanded = $value['value'];
- } else {
- $expanded = $value['value'] . '=' . $expanded;
- }
- }
-
- $replacements[] = $expanded;
- }
-
- $ret = implode($joiner, $replacements);
- if ($ret && $prefix) {
- return $prefix . $ret;
- }
-
- return $ret;
- }
-
- /**
- * Determines if an array is associative.
- *
- * This makes the assumption that input arrays are sequences or hashes.
- * This assumption is a tradeoff for accuracy in favor of speed, but it
- * should work in almost every case where input is supplied for a URI
- * template.
- *
- * @param array $array Array to check
- *
- * @return bool
- */
- private function isAssoc(array $array)
- {
- return $array && array_keys($array)[0] !== 0;
- }
-
- /**
- * Removes percent encoding on reserved characters (used with + and #
- * modifiers).
- *
- * @param string $string String to fix
- *
- * @return string
- */
- private function decodeReserved($string)
- {
- return str_replace(self::$delimsPct, self::$delims, $string);
- }
-}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php
new file mode 100644
index 000000000..91591da2e
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php
@@ -0,0 +1,382 @@
+getHost()) {
+ $asciiHost = self::idnToAsci($uri->getHost(), $options, $info);
+ if ($asciiHost === false) {
+ $errorBitSet = $info['errors'] ?? 0;
+
+ $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool {
+ return substr($name, 0, 11) === 'IDNA_ERROR_';
+ });
+
+ $errors = [];
+ foreach ($errorConstants as $errorConstant) {
+ if ($errorBitSet & constant($errorConstant)) {
+ $errors[] = $errorConstant;
+ }
+ }
+
+ $errorMessage = 'IDN conversion failed';
+ if ($errors) {
+ $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
+ }
+
+ throw new InvalidArgumentException($errorMessage);
+ }
+ if ($uri->getHost() !== $asciiHost) {
+ // Replace URI only if the ASCII version is different
+ $uri = $uri->withHost($asciiHost);
+ }
+ }
+
+ return $uri;
+ }
+
+ /**
+ * @internal
+ */
+ public static function getenv(string $name): ?string
+ {
+ if (isset($_SERVER[$name])) {
+ return (string) $_SERVER[$name];
+ }
+
+ if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) {
+ return (string) $value;
+ }
+
+ return null;
+ }
+
+ /**
+ * @return string|false
+ */
+ private static function idnToAsci(string $domain, int $options, ?array &$info = [])
+ {
+ if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) {
+ return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info);
+ }
+
+ throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old');
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php b/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php
index a3ac450db..a70d2cbf3 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php
@@ -1,77 +1,34 @@
expand($template, $variables);
-}
+namespace GuzzleHttp;
/**
* Debug function used to describe the provided value type and class.
*
- * @param mixed $input
+ * @param mixed $input Any type of variable to describe the type of. This
+ * parameter misses a typehint because of that.
*
* @return string Returns a string containing the type of the variable and
* if a class is provided, the class name.
+ *
+ * @deprecated describe_type will be removed in guzzlehttp/guzzle:8.0. Use Utils::describeType instead.
*/
-function describe_type($input)
+function describe_type($input): string
{
- switch (gettype($input)) {
- case 'object':
- return 'object(' . get_class($input) . ')';
- case 'array':
- return 'array(' . count($input) . ')';
- default:
- ob_start();
- var_dump($input);
- // normalize float vs double
- return str_replace('double(', 'float(', rtrim(ob_get_clean()));
- }
+ return Utils::describeType($input);
}
/**
* Parses an array of header lines into an associative array of headers.
*
- * @param array $lines Header lines array of strings in the following
- * format: "Name: Value"
- * @return array
+ * @param iterable $lines Header lines array of strings in the following
+ * format: "Name: Value"
+ *
+ * @deprecated headers_from_lines will be removed in guzzlehttp/guzzle:8.0. Use Utils::headersFromLines instead.
*/
-function headers_from_lines($lines)
+function headers_from_lines(iterable $lines): array
{
- $headers = [];
-
- foreach ($lines as $line) {
- $parts = explode(':', $line, 2);
- $headers[trim($parts[0])][] = isset($parts[1])
- ? trim($parts[1])
- : null;
- }
-
- return $headers;
+ return Utils::headersFromLines($lines);
}
/**
@@ -80,16 +37,12 @@ function headers_from_lines($lines)
* @param mixed $value Optional value
*
* @return resource
+ *
+ * @deprecated debug_resource will be removed in guzzlehttp/guzzle:8.0. Use Utils::debugResource instead.
*/
function debug_resource($value = null)
{
- if (is_resource($value)) {
- return $value;
- } elseif (defined('STDOUT')) {
- return STDOUT;
- }
-
- return fopen('php://output', 'w');
+ return Utils::debugResource($value);
}
/**
@@ -98,49 +51,24 @@ function debug_resource($value = null)
* The returned handler is not wrapped by any default middlewares.
*
* @throws \RuntimeException if no viable Handler is available.
- * @return callable Returns the best handler for the given system.
+ *
+ * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
+ *
+ * @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
*/
-function choose_handler()
+function choose_handler(): callable
{
- $handler = null;
- if (function_exists('curl_multi_exec') && function_exists('curl_exec')) {
- $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
- } elseif (function_exists('curl_exec')) {
- $handler = new CurlHandler();
- } elseif (function_exists('curl_multi_exec')) {
- $handler = new CurlMultiHandler();
- }
-
- if (ini_get('allow_url_fopen')) {
- $handler = $handler
- ? Proxy::wrapStreaming($handler, new StreamHandler())
- : new StreamHandler();
- } elseif (!$handler) {
- throw new \RuntimeException('GuzzleHttp requires cURL, the '
- . 'allow_url_fopen ini setting, or a custom HTTP handler.');
- }
-
- return $handler;
+ return Utils::chooseHandler();
}
/**
- * Get the default User-Agent string to use with Guzzle
+ * Get the default User-Agent string to use with Guzzle.
*
- * @return string
+ * @deprecated default_user_agent will be removed in guzzlehttp/guzzle:8.0. Use Utils::defaultUserAgent instead.
*/
-function default_user_agent()
+function default_user_agent(): string
{
- static $defaultAgent = '';
-
- if (!$defaultAgent) {
- $defaultAgent = 'GuzzleHttp/' . Client::VERSION;
- if (extension_loaded('curl') && function_exists('curl_version')) {
- $defaultAgent .= ' curl/' . \curl_version()['version'];
- }
- $defaultAgent .= ' PHP/' . PHP_VERSION;
- }
-
- return $defaultAgent;
+ return Utils::defaultUserAgent();
}
/**
@@ -154,81 +82,24 @@ function default_user_agent()
*
* Note: the result of this function is cached for subsequent calls.
*
- * @return string
* @throws \RuntimeException if no bundle can be found.
+ *
+ * @deprecated default_ca_bundle will be removed in guzzlehttp/guzzle:8.0. This function is not needed in PHP 5.6+.
*/
-function default_ca_bundle()
+function default_ca_bundle(): string
{
- static $cached = null;
- static $cafiles = [
- // Red Hat, CentOS, Fedora (provided by the ca-certificates package)
- '/etc/pki/tls/certs/ca-bundle.crt',
- // Ubuntu, Debian (provided by the ca-certificates package)
- '/etc/ssl/certs/ca-certificates.crt',
- // FreeBSD (provided by the ca_root_nss package)
- '/usr/local/share/certs/ca-root-nss.crt',
- // SLES 12 (provided by the ca-certificates package)
- '/var/lib/ca-certificates/ca-bundle.pem',
- // OS X provided by homebrew (using the default path)
- '/usr/local/etc/openssl/cert.pem',
- // Google app engine
- '/etc/ca-certificates.crt',
- // Windows?
- 'C:\\windows\\system32\\curl-ca-bundle.crt',
- 'C:\\windows\\curl-ca-bundle.crt',
- ];
-
- if ($cached) {
- return $cached;
- }
-
- if ($ca = ini_get('openssl.cafile')) {
- return $cached = $ca;
- }
-
- if ($ca = ini_get('curl.cainfo')) {
- return $cached = $ca;
- }
-
- foreach ($cafiles as $filename) {
- if (file_exists($filename)) {
- return $cached = $filename;
- }
- }
-
- throw new \RuntimeException(<<< EOT
-No system CA bundle could be found in any of the the common system locations.
-PHP versions earlier than 5.6 are not properly configured to use the system's
-CA bundle by default. In order to verify peer certificates, you will need to
-supply the path on disk to a certificate bundle to the 'verify' request
-option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not
-need a specific certificate bundle, then Mozilla provides a commonly used CA
-bundle which can be downloaded here (provided by the maintainer of cURL):
-https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once
-you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP
-ini setting to point to the path to the file, allowing you to omit the 'verify'
-request option. See http://curl.haxx.se/docs/sslcerts.html for more
-information.
-EOT
- );
+ return Utils::defaultCaBundle();
}
/**
* Creates an associative array of lowercase header names to the actual
* header casing.
*
- * @param array $headers
- *
- * @return array
+ * @deprecated normalize_header_keys will be removed in guzzlehttp/guzzle:8.0. Use Utils::normalizeHeaderKeys instead.
*/
-function normalize_header_keys(array $headers)
+function normalize_header_keys(array $headers): array
{
- $result = [];
- foreach (array_keys($headers) as $key) {
- $result[strtolower($key)] = $key;
- }
-
- return $result;
+ return Utils::normalizeHeaderKeys($headers);
}
/**
@@ -245,89 +116,52 @@ function normalize_header_keys(array $headers)
* 3. The area starts with "." and the area is the last part of the host. e.g.
* '.mit.edu' will match any host that ends with '.mit.edu'.
*
- * @param string $host Host to check against the patterns.
- * @param array $noProxyArray An array of host patterns.
+ * @param string $host Host to check against the patterns.
+ * @param string[] $noProxyArray An array of host patterns.
+ *
+ * @throws Exception\InvalidArgumentException
*
- * @return bool
+ * @deprecated is_host_in_noproxy will be removed in guzzlehttp/guzzle:8.0. Use Utils::isHostInNoProxy instead.
*/
-function is_host_in_noproxy($host, array $noProxyArray)
+function is_host_in_noproxy(string $host, array $noProxyArray): bool
{
- if (strlen($host) === 0) {
- throw new \InvalidArgumentException('Empty host provided');
- }
-
- // Strip port if present.
- if (strpos($host, ':')) {
- $host = explode($host, ':', 2)[0];
- }
-
- foreach ($noProxyArray as $area) {
- // Always match on wildcards.
- if ($area === '*') {
- return true;
- } elseif (empty($area)) {
- // Don't match on empty values.
- continue;
- } elseif ($area === $host) {
- // Exact matches.
- return true;
- } else {
- // Special match if the area when prefixed with ".". Remove any
- // existing leading "." and add a new leading ".".
- $area = '.' . ltrim($area, '.');
- if (substr($host, -(strlen($area))) === $area) {
- return true;
- }
- }
- }
-
- return false;
+ return Utils::isHostInNoProxy($host, $noProxyArray);
}
/**
* Wrapper for json_decode that throws when an error occurs.
*
* @param string $json JSON data to parse
- * @param bool $assoc When true, returned objects will be converted
+ * @param bool $assoc When true, returned objects will be converted
* into associative arrays.
* @param int $depth User specified recursion depth.
* @param int $options Bitmask of JSON decode options.
*
- * @return mixed
- * @throws \InvalidArgumentException if the JSON cannot be decoded.
- * @link http://www.php.net/manual/en/function.json-decode.php
+ * @return object|array|string|int|float|bool|null
+ *
+ * @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
+ *
+ * @link https://www.php.net/manual/en/function.json-decode.php
+ * @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
*/
-function json_decode($json, $assoc = false, $depth = 512, $options = 0)
+function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
- $data = \json_decode($json, $assoc, $depth, $options);
- if (JSON_ERROR_NONE !== json_last_error()) {
- throw new \InvalidArgumentException(
- 'json_decode error: ' . json_last_error_msg()
- );
- }
-
- return $data;
+ return Utils::jsonDecode($json, $assoc, $depth, $options);
}
/**
* Wrapper for JSON encoding that throws when an error occurs.
*
* @param mixed $value The value being encoded
- * @param int $options JSON encode option bitmask
- * @param int $depth Set the maximum depth. Must be greater than zero.
+ * @param int $options JSON encode option bitmask
+ * @param int $depth Set the maximum depth. Must be greater than zero.
*
- * @return string
- * @throws \InvalidArgumentException if the JSON cannot be encoded.
- * @link http://www.php.net/manual/en/function.json-encode.php
+ * @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
+ *
+ * @link https://www.php.net/manual/en/function.json-encode.php
+ * @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
*/
-function json_encode($value, $options = 0, $depth = 512)
+function json_encode($value, int $options = 0, int $depth = 512): string
{
- $json = \json_encode($value, $options, $depth);
- if (JSON_ERROR_NONE !== json_last_error()) {
- throw new \InvalidArgumentException(
- 'json_encode error: ' . json_last_error_msg()
- );
- }
-
- return $json;
+ return Utils::jsonEncode($value, $options, $depth);
}
diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php b/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php
index a93393acc..6636a4224 100644
--- a/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php
+++ b/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php
@@ -1,6 +1,6 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Michael Dowling
+Copyright (c) 2015 Graham Campbell
+Copyright (c) 2017 Tobias Schultze
+Copyright (c) 2020 Tobias Nyholm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tests/integration/vendor/guzzlehttp/promises/README.md b/tests/integration/vendor/guzzlehttp/promises/README.md
index 7b607e28b..c175fec76 100644
--- a/tests/integration/vendor/guzzlehttp/promises/README.md
+++ b/tests/integration/vendor/guzzlehttp/promises/README.md
@@ -26,7 +26,7 @@ for a general introduction to promises.
- Promises can be cancelled.
- Works with any object that has a `then` function.
- C# style async/await coroutine promises using
- `GuzzleHttp\Promise\coroutine()`.
+ `GuzzleHttp\Promise\Coroutine::of()`.
# Quick start
@@ -88,7 +88,7 @@ $promise
});
// Resolving the promise triggers the $onFulfilled callbacks and outputs
-// "Hello, reader".
+// "Hello, reader."
$promise->resolve('reader.');
```
@@ -150,7 +150,7 @@ use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise->then(null, function ($reason) {
- throw new \Exception($reason);
+ throw new Exception($reason);
})->then(null, function ($reason) {
assert($reason->getMessage() === 'Error!');
});
@@ -182,7 +182,6 @@ invoked using the value returned from the `$onRejected` callback.
```php
use GuzzleHttp\Promise\Promise;
-use GuzzleHttp\Promise\RejectedPromise;
$promise = new Promise();
$promise
@@ -220,7 +219,7 @@ the promise is rejected with the exception and the exception is thrown.
```php
$promise = new Promise(function () use (&$promise) {
- throw new \Exception('foo');
+ throw new Exception('foo');
});
$promise->wait(); // throws the exception.
@@ -397,7 +396,7 @@ $deferred = new React\Promise\Deferred();
$reactPromise = $deferred->promise();
// Create a Guzzle promise that is fulfilled with a React promise.
-$guzzlePromise = new \GuzzleHttp\Promise\Promise();
+$guzzlePromise = new GuzzleHttp\Promise\Promise();
$guzzlePromise->then(function ($value) use ($reactPromise) {
// Do something something with the value...
// Return the React promise
@@ -424,7 +423,7 @@ instance.
```php
// Get the global task queue
-$queue = \GuzzleHttp\Promise\queue();
+$queue = GuzzleHttp\Promise\Utils::queue();
$queue->run();
```
@@ -502,3 +501,47 @@ $promise->then(function ($value) { echo $value; });
$promise->resolve('foo');
// prints "foo"
```
+
+
+## Upgrading from Function API
+
+A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
+
+| Original Function | Replacement Method |
+|----------------|----------------|
+| `queue` | `Utils::queue` |
+| `task` | `Utils::task` |
+| `promise_for` | `Create::promiseFor` |
+| `rejection_for` | `Create::rejectionFor` |
+| `exception_for` | `Create::exceptionFor` |
+| `iter_for` | `Create::iterFor` |
+| `inspect` | `Utils::inspect` |
+| `inspect_all` | `Utils::inspectAll` |
+| `unwrap` | `Utils::unwrap` |
+| `all` | `Utils::all` |
+| `some` | `Utils::some` |
+| `any` | `Utils::any` |
+| `settle` | `Utils::settle` |
+| `each` | `Each::of` |
+| `each_limit` | `Each::ofLimit` |
+| `each_limit_all` | `Each::ofLimitAll` |
+| `!is_fulfilled` | `Is::pending` |
+| `is_fulfilled` | `Is::fulfilled` |
+| `is_rejected` | `Is::rejected` |
+| `is_settled` | `Is::settled` |
+| `coroutine` | `Coroutine::of` |
+
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/tests/integration/vendor/guzzlehttp/promises/composer.json b/tests/integration/vendor/guzzlehttp/promises/composer.json
index ec41a61e6..c959fb32b 100644
--- a/tests/integration/vendor/guzzlehttp/promises/composer.json
+++ b/tests/integration/vendor/guzzlehttp/promises/composer.json
@@ -4,17 +4,32 @@
"keywords": ["promise"],
"license": "MIT",
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"require": {
- "php": ">=5.5.0"
+ "php": ">=5.5"
},
"require-dev": {
- "phpunit/phpunit": "^4.0"
+ "symfony/phpunit-bridge": "^4.4 || ^5.1"
},
"autoload": {
"psr-4": {
@@ -22,13 +37,22 @@
},
"files": ["src/functions_include.php"]
},
+ "autoload-dev": {
+ "psr-4": {
+ "GuzzleHttp\\Promise\\Tests\\": "tests/"
+ }
+ },
"scripts": {
- "test": "vendor/bin/phpunit",
- "test-ci": "vendor/bin/phpunit --coverage-text"
+ "test": "vendor/bin/simple-phpunit",
+ "test-ci": "vendor/bin/simple-phpunit --coverage-text"
},
"extra": {
"branch-alias": {
- "dev-master": "1.4-dev"
+ "dev-master": "1.5-dev"
}
+ },
+ "config": {
+ "preferred-install": "dist",
+ "sort-packages": true
}
}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php b/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php
index 6a5690c37..d2b5712b9 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php
@@ -1,4 +1,5 @@
currentPromise->wait();
}
});
- $this->nextCoroutine($this->generator->current());
+ try {
+ $this->nextCoroutine($this->generator->current());
+ } catch (\Exception $exception) {
+ $this->result->reject($exception);
+ } catch (Throwable $throwable) {
+ $this->result->reject($throwable);
+ }
+ }
+
+ /**
+ * Create a new coroutine.
+ *
+ * @return self
+ */
+ public static function of(callable $generatorFn)
+ {
+ return new self($generatorFn);
}
public function then(
@@ -108,7 +126,7 @@ public function cancel()
private function nextCoroutine($yielded)
{
- $this->currentPromise = promise_for($yielded)
+ $this->currentPromise = Create::promiseFor($yielded)
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
}
@@ -139,7 +157,7 @@ public function _handleFailure($reason)
{
unset($this->currentPromise);
try {
- $nextYield = $this->generator->throw(exception_for($reason));
+ $nextYield = $this->generator->throw(Create::exceptionFor($reason));
// The throw was caught, so keep iterating on the coroutine
$this->nextCoroutine($nextYield);
} catch (Exception $exception) {
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Create.php b/tests/integration/vendor/guzzlehttp/promises/src/Create.php
new file mode 100644
index 000000000..8d038e9c1
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/promises/src/Create.php
@@ -0,0 +1,84 @@
+then([$promise, 'resolve'], [$promise, 'reject']);
+ return $promise;
+ }
+
+ return new FulfilledPromise($value);
+ }
+
+ /**
+ * Creates a rejected promise for a reason if the reason is not a promise.
+ * If the provided reason is a promise, then it is returned as-is.
+ *
+ * @param mixed $reason Promise or reason.
+ *
+ * @return PromiseInterface
+ */
+ public static function rejectionFor($reason)
+ {
+ if ($reason instanceof PromiseInterface) {
+ return $reason;
+ }
+
+ return new RejectedPromise($reason);
+ }
+
+ /**
+ * Create an exception for a rejected promise value.
+ *
+ * @param mixed $reason
+ *
+ * @return \Exception|\Throwable
+ */
+ public static function exceptionFor($reason)
+ {
+ if ($reason instanceof \Exception || $reason instanceof \Throwable) {
+ return $reason;
+ }
+
+ return new RejectionException($reason);
+ }
+
+ /**
+ * Returns an iterator for the given value.
+ *
+ * @param mixed $value
+ *
+ * @return \Iterator
+ */
+ public static function iterFor($value)
+ {
+ if ($value instanceof \Iterator) {
+ return $value;
+ }
+
+ if (is_array($value)) {
+ return new \ArrayIterator($value);
+ }
+
+ return new \ArrayIterator([$value]);
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Each.php b/tests/integration/vendor/guzzlehttp/promises/src/Each.php
new file mode 100644
index 000000000..1dda35499
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/promises/src/Each.php
@@ -0,0 +1,90 @@
+ $onFulfilled,
+ 'rejected' => $onRejected
+ ]))->promise();
+ }
+
+ /**
+ * Like of, but only allows a certain number of outstanding promises at any
+ * given time.
+ *
+ * $concurrency may be an integer or a function that accepts the number of
+ * pending promises and returns a numeric concurrency limit value to allow
+ * for dynamic a concurrency size.
+ *
+ * @param mixed $iterable
+ * @param int|callable $concurrency
+ * @param callable $onFulfilled
+ * @param callable $onRejected
+ *
+ * @return PromiseInterface
+ */
+ public static function ofLimit(
+ $iterable,
+ $concurrency,
+ callable $onFulfilled = null,
+ callable $onRejected = null
+ ) {
+ return (new EachPromise($iterable, [
+ 'fulfilled' => $onFulfilled,
+ 'rejected' => $onRejected,
+ 'concurrency' => $concurrency
+ ]))->promise();
+ }
+
+ /**
+ * Like limit, but ensures that no promise in the given $iterable argument
+ * is rejected. If any promise is rejected, then the aggregate promise is
+ * rejected with the encountered rejection.
+ *
+ * @param mixed $iterable
+ * @param int|callable $concurrency
+ * @param callable $onFulfilled
+ *
+ * @return PromiseInterface
+ */
+ public static function ofLimitAll(
+ $iterable,
+ $concurrency,
+ callable $onFulfilled = null
+ ) {
+ return each_limit(
+ $iterable,
+ $concurrency,
+ $onFulfilled,
+ function ($reason, $idx, PromiseInterface $aggregate) {
+ $aggregate->reject($reason);
+ }
+ );
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php b/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php
index d0ddf603f..38ecb59b1 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php
@@ -1,4 +1,5 @@
iterable = iter_for($iterable);
+ $this->iterable = Create::iterFor($iterable);
if (isset($config['concurrency'])) {
$this->concurrency = $config['concurrency'];
@@ -65,6 +68,7 @@ public function __construct($iterable, array $config = [])
}
}
+ /** @psalm-suppress InvalidNullableReturnType */
public function promise()
{
if ($this->aggregate) {
@@ -73,14 +77,27 @@ public function promise()
try {
$this->createPromise();
+ /** @psalm-assert Promise $this->aggregate */
$this->iterable->rewind();
$this->refillPending();
} catch (\Throwable $e) {
+ /**
+ * @psalm-suppress NullReference
+ * @phpstan-ignore-next-line
+ */
$this->aggregate->reject($e);
} catch (\Exception $e) {
+ /**
+ * @psalm-suppress NullReference
+ * @phpstan-ignore-next-line
+ */
$this->aggregate->reject($e);
}
+ /**
+ * @psalm-suppress NullableReturnStatement
+ * @phpstan-ignore-next-line
+ */
return $this->aggregate;
}
@@ -88,18 +105,16 @@ private function createPromise()
{
$this->mutex = false;
$this->aggregate = new Promise(function () {
- reset($this->pending);
- if (empty($this->pending) && !$this->iterable->valid()) {
- $this->aggregate->resolve(null);
+ if ($this->checkIfFinished()) {
return;
}
-
+ reset($this->pending);
// Consume a potentially fluctuating list of promises while
// ensuring that indexes are maintained (precluding array_shift).
while ($promise = current($this->pending)) {
next($this->pending);
$promise->wait();
- if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
+ if (Is::settled($this->aggregate)) {
return;
}
}
@@ -109,6 +124,7 @@ private function createPromise()
$clearFn = function () {
$this->iterable = $this->concurrency = $this->pending = null;
$this->onFulfilled = $this->onRejected = null;
+ $this->nextPendingIndex = 0;
};
$this->aggregate->then($clearFn, $clearFn);
@@ -148,22 +164,32 @@ private function addPending()
return false;
}
- $promise = promise_for($this->iterable->current());
- $idx = $this->iterable->key();
+ $promise = Create::promiseFor($this->iterable->current());
+ $key = $this->iterable->key();
+
+ // Iterable keys may not be unique, so we use a counter to
+ // guarantee uniqueness
+ $idx = $this->nextPendingIndex++;
$this->pending[$idx] = $promise->then(
- function ($value) use ($idx) {
+ function ($value) use ($idx, $key) {
if ($this->onFulfilled) {
call_user_func(
- $this->onFulfilled, $value, $idx, $this->aggregate
+ $this->onFulfilled,
+ $value,
+ $key,
+ $this->aggregate
);
}
$this->step($idx);
},
- function ($reason) use ($idx) {
+ function ($reason) use ($idx, $key) {
if ($this->onRejected) {
call_user_func(
- $this->onRejected, $reason, $idx, $this->aggregate
+ $this->onRejected,
+ $reason,
+ $key,
+ $this->aggregate
);
}
$this->step($idx);
@@ -201,7 +227,7 @@ private function advanceIterator()
private function step($idx)
{
// If the promise was already resolved, then ignore this step.
- if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
+ if (Is::settled($this->aggregate)) {
return;
}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php
index dbbeeb9f7..98f72a62a 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php
@@ -1,4 +1,5 @@
value = $value;
@@ -30,11 +32,11 @@ public function then(
return $this;
}
- $queue = queue();
+ $queue = Utils::queue();
$p = new Promise([$queue, 'run']);
$value = $this->value;
$queue->add(static function () use ($p, $value, $onFulfilled) {
- if ($p->getState() === self::PENDING) {
+ if (Is::pending($p)) {
try {
$p->resolve($onFulfilled($value));
} catch (\Throwable $e) {
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Is.php b/tests/integration/vendor/guzzlehttp/promises/src/Is.php
new file mode 100644
index 000000000..c3ed8d014
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/promises/src/Is.php
@@ -0,0 +1,46 @@
+getState() === PromiseInterface::PENDING;
+ }
+
+ /**
+ * Returns true if a promise is fulfilled or rejected.
+ *
+ * @return bool
+ */
+ public static function settled(PromiseInterface $promise)
+ {
+ return $promise->getState() !== PromiseInterface::PENDING;
+ }
+
+ /**
+ * Returns true if a promise is fulfilled.
+ *
+ * @return bool
+ */
+ public static function fulfilled(PromiseInterface $promise)
+ {
+ return $promise->getState() === PromiseInterface::FULFILLED;
+ }
+
+ /**
+ * Returns true if a promise is rejected.
+ *
+ * @return bool
+ */
+ public static function rejected(PromiseInterface $promise)
+ {
+ return $promise->getState() === PromiseInterface::REJECTED;
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Promise.php b/tests/integration/vendor/guzzlehttp/promises/src/Promise.php
index 844ada073..75939057b 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/Promise.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/Promise.php
@@ -1,4 +1,5 @@
state === self::FULFILLED) {
- return $onFulfilled
- ? promise_for($this->result)->then($onFulfilled)
- : promise_for($this->result);
+ $promise = Create::promiseFor($this->result);
+ return $onFulfilled ? $promise->then($onFulfilled) : $promise;
}
// It's either cancelled or rejected, so return a rejected promise
// and immediately invoke any callbacks.
- $rejection = rejection_for($this->result);
+ $rejection = Create::rejectionFor($this->result);
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
}
@@ -61,19 +61,15 @@ public function wait($unwrap = true)
{
$this->waitIfPending();
- $inner = $this->result instanceof PromiseInterface
- ? $this->result->wait($unwrap)
- : $this->result;
-
+ if ($this->result instanceof PromiseInterface) {
+ return $this->result->wait($unwrap);
+ }
if ($unwrap) {
- if ($this->result instanceof PromiseInterface
- || $this->state === self::FULFILLED
- ) {
- return $inner;
- } else {
- // It's rejected so "unwrap" and throw an exception.
- throw exception_for($inner);
+ if ($this->state === self::FULFILLED) {
+ return $this->result;
}
+ // It's rejected so "unwrap" and throw an exception.
+ throw Create::exceptionFor($this->result);
}
}
@@ -103,6 +99,7 @@ public function cancel()
}
// Reject the promise only if it wasn't rejected in a then callback.
+ /** @psalm-suppress RedundantCondition */
if ($this->state === self::PENDING) {
$this->reject(new CancellationException('Promise has been cancelled'));
}
@@ -148,17 +145,15 @@ private function settle($state, $value)
// If the value was not a settled promise or a thenable, then resolve
// it in the task queue using the correct ID.
- if (!method_exists($value, 'then')) {
+ if (!is_object($value) || !method_exists($value, 'then')) {
$id = $state === self::FULFILLED ? 1 : 2;
// It's a success, so resolve the handlers in the queue.
- queue()->add(static function () use ($id, $value, $handlers) {
+ Utils::queue()->add(static function () use ($id, $value, $handlers) {
foreach ($handlers as $handler) {
self::callHandler($id, $value, $handler);
}
});
- } elseif ($value instanceof Promise
- && $value->getState() === self::PENDING
- ) {
+ } elseif ($value instanceof Promise && Is::pending($value)) {
// We can just merge our handlers onto the next promise.
$value->handlers = array_merge($value->handlers, $handlers);
} else {
@@ -184,8 +179,6 @@ static function ($reason) use ($handlers) {
* @param int $index 1 (resolve) or 2 (reject).
* @param mixed $value Value to pass to the callback.
* @param array $handler Array of handler data (promise and callbacks).
- *
- * @return array Returns the next group to resolve.
*/
private static function callHandler($index, $value, array $handler)
{
@@ -194,13 +187,21 @@ private static function callHandler($index, $value, array $handler)
// The promise may have been cancelled or resolved before placing
// this thunk in the queue.
- if ($promise->getState() !== self::PENDING) {
+ if (Is::settled($promise)) {
return;
}
try {
if (isset($handler[$index])) {
- $promise->resolve($handler[$index]($value));
+ /*
+ * If $f throws an exception, then $handler will be in the exception
+ * stack trace. Since $handler contains a reference to the callable
+ * itself we get a circular reference. We clear the $handler
+ * here to avoid that memory leak.
+ */
+ $f = $handler[$index];
+ unset($handler);
+ $promise->resolve($f($value));
} elseif ($index === 1) {
// Forward resolution values as-is.
$promise->resolve($value);
@@ -224,15 +225,16 @@ private function waitIfPending()
} elseif ($this->waitList) {
$this->invokeWaitList();
} else {
- // If there's not wait function, then reject the promise.
+ // If there's no wait function, then reject the promise.
$this->reject('Cannot wait on a promise that has '
. 'no internal wait function. You must provide a wait '
. 'function when constructing the promise to be able to '
. 'wait on a promise.');
}
- queue()->run();
+ Utils::queue()->run();
+ /** @psalm-suppress RedundantCondition */
if ($this->state === self::PENDING) {
$this->reject('Invoking the wait callback did not resolve the promise');
}
@@ -263,17 +265,13 @@ private function invokeWaitList()
$this->waitList = null;
foreach ($waitList as $result) {
- while (true) {
+ do {
$result->waitIfPending();
+ $result = $result->result;
+ } while ($result instanceof Promise);
- if ($result->result instanceof Promise) {
- $result = $result->result;
- } else {
- if ($result->result instanceof PromiseInterface) {
- $result->result->wait(false);
- }
- break;
- }
+ if ($result instanceof PromiseInterface) {
+ $result->wait(false);
}
}
}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php b/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php
index 8f5f4b99b..e59833143 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php
@@ -1,4 +1,5 @@
reason = $reason;
@@ -30,11 +32,11 @@ public function then(
return $this;
}
- $queue = queue();
+ $queue = Utils::queue();
$reason = $this->reason;
$p = new Promise([$queue, 'run']);
$queue->add(static function () use ($p, $reason, $onRejected) {
- if ($p->getState() === self::PENDING) {
+ if (Is::pending($p)) {
try {
// Return a resolved promise if onRejected does not throw.
$p->resolve($onRejected($reason));
@@ -59,8 +61,10 @@ public function otherwise(callable $onRejected)
public function wait($unwrap = true, $defaultDelivery = null)
{
if ($unwrap) {
- throw exception_for($this->reason);
+ throw Create::exceptionFor($this->reason);
}
+
+ return null;
}
public function getState()
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php b/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php
index 07c1136da..e2f137707 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php
@@ -1,4 +1,5 @@
run();
+ * GuzzleHttp\Promise\Utils::queue()->run();
*/
class TaskQueue implements TaskQueueInterface
{
@@ -42,8 +43,8 @@ public function add(callable $task)
public function run()
{
- /** @var callable $task */
while ($task = array_shift($this->queue)) {
+ /** @var callable $task */
$task();
}
}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
index ac8306e19..723d4d54e 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
@@ -1,4 +1,5 @@
+ * while ($eventLoop->isRunning()) {
+ * GuzzleHttp\Promise\Utils::queue()->run();
+ * }
+ *
+ *
+ * @param TaskQueueInterface $assign Optionally specify a new queue instance.
+ *
+ * @return TaskQueueInterface
+ */
+ public static function queue(TaskQueueInterface $assign = null)
+ {
+ static $queue;
+
+ if ($assign) {
+ $queue = $assign;
+ } elseif (!$queue) {
+ $queue = new TaskQueue();
+ }
+
+ return $queue;
+ }
+
+ /**
+ * Adds a function to run in the task queue when it is next `run()` and
+ * returns a promise that is fulfilled or rejected with the result.
+ *
+ * @param callable $task Task function to run.
+ *
+ * @return PromiseInterface
+ */
+ public static function task(callable $task)
+ {
+ $queue = self::queue();
+ $promise = new Promise([$queue, 'run']);
+ $queue->add(function () use ($task, $promise) {
+ try {
+ if (Is::pending($promise)) {
+ $promise->resolve($task());
+ }
+ } catch (\Throwable $e) {
+ $promise->reject($e);
+ } catch (\Exception $e) {
+ $promise->reject($e);
+ }
+ });
+
+ return $promise;
+ }
+
+ /**
+ * Synchronously waits on a promise to resolve and returns an inspection
+ * state array.
+ *
+ * Returns a state associative array containing a "state" key mapping to a
+ * valid promise state. If the state of the promise is "fulfilled", the
+ * array will contain a "value" key mapping to the fulfilled value of the
+ * promise. If the promise is rejected, the array will contain a "reason"
+ * key mapping to the rejection reason of the promise.
+ *
+ * @param PromiseInterface $promise Promise or value.
+ *
+ * @return array
+ */
+ public static function inspect(PromiseInterface $promise)
+ {
+ try {
+ return [
+ 'state' => PromiseInterface::FULFILLED,
+ 'value' => $promise->wait()
+ ];
+ } catch (RejectionException $e) {
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
+ } catch (\Throwable $e) {
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
+ } catch (\Exception $e) {
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
+ }
+ }
+
+ /**
+ * Waits on all of the provided promises, but does not unwrap rejected
+ * promises as thrown exception.
+ *
+ * Returns an array of inspection state arrays.
+ *
+ * @see inspect for the inspection state array format.
+ *
+ * @param PromiseInterface[] $promises Traversable of promises to wait upon.
+ *
+ * @return array
+ */
+ public static function inspectAll($promises)
+ {
+ $results = [];
+ foreach ($promises as $key => $promise) {
+ $results[$key] = inspect($promise);
+ }
+
+ return $results;
+ }
+
+ /**
+ * Waits on all of the provided promises and returns the fulfilled values.
+ *
+ * Returns an array that contains the value of each promise (in the same
+ * order the promises were provided). An exception is thrown if any of the
+ * promises are rejected.
+ *
+ * @param iterable $promises Iterable of PromiseInterface objects to wait on.
+ *
+ * @return array
+ *
+ * @throws \Exception on error
+ * @throws \Throwable on error in PHP >=7
+ */
+ public static function unwrap($promises)
+ {
+ $results = [];
+ foreach ($promises as $key => $promise) {
+ $results[$key] = $promise->wait();
+ }
+
+ return $results;
+ }
+
+ /**
+ * Given an array of promises, return a promise that is fulfilled when all
+ * the items in the array are fulfilled.
+ *
+ * The promise's fulfillment value is an array with fulfillment values at
+ * respective positions to the original array. If any promise in the array
+ * rejects, the returned promise is rejected with the rejection reason.
+ *
+ * @param mixed $promises Promises or values.
+ * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
+ *
+ * @return PromiseInterface
+ */
+ public static function all($promises, $recursive = false)
+ {
+ $results = [];
+ $promise = Each::of(
+ $promises,
+ function ($value, $idx) use (&$results) {
+ $results[$idx] = $value;
+ },
+ function ($reason, $idx, Promise $aggregate) {
+ $aggregate->reject($reason);
+ }
+ )->then(function () use (&$results) {
+ ksort($results);
+ return $results;
+ });
+
+ if (true === $recursive) {
+ $promise = $promise->then(function ($results) use ($recursive, &$promises) {
+ foreach ($promises as $promise) {
+ if (Is::pending($promise)) {
+ return self::all($promises, $recursive);
+ }
+ }
+ return $results;
+ });
+ }
+
+ return $promise;
+ }
+
+ /**
+ * Initiate a competitive race between multiple promises or values (values
+ * will become immediately fulfilled promises).
+ *
+ * When count amount of promises have been fulfilled, the returned promise
+ * is fulfilled with an array that contains the fulfillment values of the
+ * winners in order of resolution.
+ *
+ * This promise is rejected with a {@see AggregateException} if the number
+ * of fulfilled promises is less than the desired $count.
+ *
+ * @param int $count Total number of promises.
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ */
+ public static function some($count, $promises)
+ {
+ $results = [];
+ $rejections = [];
+
+ return Each::of(
+ $promises,
+ function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
+ if (Is::settled($p)) {
+ return;
+ }
+ $results[$idx] = $value;
+ if (count($results) >= $count) {
+ $p->resolve(null);
+ }
+ },
+ function ($reason) use (&$rejections) {
+ $rejections[] = $reason;
+ }
+ )->then(
+ function () use (&$results, &$rejections, $count) {
+ if (count($results) !== $count) {
+ throw new AggregateException(
+ 'Not enough promises to fulfill count',
+ $rejections
+ );
+ }
+ ksort($results);
+ return array_values($results);
+ }
+ );
+ }
+
+ /**
+ * Like some(), with 1 as count. However, if the promise fulfills, the
+ * fulfillment value is not an array of 1 but the value directly.
+ *
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ */
+ public static function any($promises)
+ {
+ return self::some(1, $promises)->then(function ($values) {
+ return $values[0];
+ });
+ }
+
+ /**
+ * Returns a promise that is fulfilled when all of the provided promises have
+ * been fulfilled or rejected.
+ *
+ * The returned promise is fulfilled with an array of inspection state arrays.
+ *
+ * @see inspect for the inspection state array format.
+ *
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ */
+ public static function settle($promises)
+ {
+ $results = [];
+
+ return Each::of(
+ $promises,
+ function ($value, $idx) use (&$results) {
+ $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
+ },
+ function ($reason, $idx) use (&$results) {
+ $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
+ }
+ )->then(function () use (&$results) {
+ ksort($results);
+ return $results;
+ });
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/promises/src/functions.php b/tests/integration/vendor/guzzlehttp/promises/src/functions.php
index 4e27709af..c03d39d02 100644
--- a/tests/integration/vendor/guzzlehttp/promises/src/functions.php
+++ b/tests/integration/vendor/guzzlehttp/promises/src/functions.php
@@ -1,4 +1,5 @@
add(function () use ($task, $promise) {
- try {
- $promise->resolve($task());
- } catch (\Throwable $e) {
- $promise->reject($e);
- } catch (\Exception $e) {
- $promise->reject($e);
- }
- });
-
- return $promise;
+ return Utils::task($task);
}
/**
@@ -62,23 +47,12 @@ function task(callable $task)
* @param mixed $value Promise or value.
*
* @return PromiseInterface
+ *
+ * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
*/
function promise_for($value)
{
- if ($value instanceof PromiseInterface) {
- return $value;
- }
-
- // Return a Guzzle promise that shadows the given promise.
- if (method_exists($value, 'then')) {
- $wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null;
- $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
- $promise = new Promise($wfn, $cfn);
- $value->then([$promise, 'resolve'], [$promise, 'reject']);
- return $promise;
- }
-
- return new FulfilledPromise($value);
+ return Create::promiseFor($value);
}
/**
@@ -88,14 +62,12 @@ function promise_for($value)
* @param mixed $reason Promise or reason.
*
* @return PromiseInterface
+ *
+ * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
*/
function rejection_for($reason)
{
- if ($reason instanceof PromiseInterface) {
- return $reason;
- }
-
- return new RejectedPromise($reason);
+ return Create::rejectionFor($reason);
}
/**
@@ -104,12 +76,12 @@ function rejection_for($reason)
* @param mixed $reason
*
* @return \Exception|\Throwable
+ *
+ * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
*/
function exception_for($reason)
{
- return $reason instanceof \Exception || $reason instanceof \Throwable
- ? $reason
- : new RejectionException($reason);
+ return Create::exceptionFor($reason);
}
/**
@@ -118,16 +90,12 @@ function exception_for($reason)
* @param mixed $value
*
* @return \Iterator
+ *
+ * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
*/
function iter_for($value)
{
- if ($value instanceof \Iterator) {
- return $value;
- } elseif (is_array($value)) {
- return new \ArrayIterator($value);
- } else {
- return new \ArrayIterator([$value]);
- }
+ return Create::iterFor($value);
}
/**
@@ -143,21 +111,12 @@ function iter_for($value)
* @param PromiseInterface $promise Promise or value.
*
* @return array
+ *
+ * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
*/
function inspect(PromiseInterface $promise)
{
- try {
- return [
- 'state' => PromiseInterface::FULFILLED,
- 'value' => $promise->wait()
- ];
- } catch (RejectionException $e) {
- return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
- } catch (\Throwable $e) {
- return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
- } catch (\Exception $e) {
- return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
- }
+ return Utils::inspect($promise);
}
/**
@@ -166,19 +125,17 @@ function inspect(PromiseInterface $promise)
*
* Returns an array of inspection state arrays.
*
+ * @see inspect for the inspection state array format.
+ *
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
*
* @return array
- * @see GuzzleHttp\Promise\inspect for the inspection state array format.
+ *
+ * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
*/
function inspect_all($promises)
{
- $results = [];
- foreach ($promises as $key => $promise) {
- $results[$key] = inspect($promise);
- }
-
- return $results;
+ return Utils::inspectAll($promises);
}
/**
@@ -188,20 +145,18 @@ function inspect_all($promises)
* the promises were provided). An exception is thrown if any of the promises
* are rejected.
*
- * @param mixed $promises Iterable of PromiseInterface objects to wait on.
+ * @param iterable $promises Iterable of PromiseInterface objects to wait on.
*
* @return array
+ *
* @throws \Exception on error
* @throws \Throwable on error in PHP >=7
+ *
+ * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.
*/
function unwrap($promises)
{
- $results = [];
- foreach ($promises as $key => $promise) {
- $results[$key] = $promise->wait();
- }
-
- return $results;
+ return Utils::unwrap($promises);
}
/**
@@ -212,25 +167,16 @@ function unwrap($promises)
* respective positions to the original array. If any promise in the array
* rejects, the returned promise is rejected with the rejection reason.
*
- * @param mixed $promises Promises or values.
+ * @param mixed $promises Promises or values.
+ * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
*
* @return PromiseInterface
+ *
+ * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.
*/
-function all($promises)
+function all($promises, $recursive = false)
{
- $results = [];
- return each(
- $promises,
- function ($value, $idx) use (&$results) {
- $results[$idx] = $value;
- },
- function ($reason, $idx, Promise $aggregate) {
- $aggregate->reject($reason);
- }
- )->then(function () use (&$results) {
- ksort($results);
- return $results;
- });
+ return Utils::all($promises, $recursive);
}
/**
@@ -241,45 +187,19 @@ function ($reason, $idx, Promise $aggregate) {
* fulfilled with an array that contains the fulfillment values of the winners
* in order of resolution.
*
- * This prommise is rejected with a {@see GuzzleHttp\Promise\AggregateException}
- * if the number of fulfilled promises is less than the desired $count.
+ * This promise is rejected with a {@see AggregateException} if the number of
+ * fulfilled promises is less than the desired $count.
*
* @param int $count Total number of promises.
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
+ *
+ * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
*/
function some($count, $promises)
{
- $results = [];
- $rejections = [];
-
- return each(
- $promises,
- function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
- if ($p->getState() !== PromiseInterface::PENDING) {
- return;
- }
- $results[$idx] = $value;
- if (count($results) >= $count) {
- $p->resolve(null);
- }
- },
- function ($reason) use (&$rejections) {
- $rejections[] = $reason;
- }
- )->then(
- function () use (&$results, &$rejections, $count) {
- if (count($results) !== $count) {
- throw new AggregateException(
- 'Not enough promises to fulfill count',
- $rejections
- );
- }
- ksort($results);
- return array_values($results);
- }
- );
+ return Utils::some($count, $promises);
}
/**
@@ -289,10 +209,12 @@ function () use (&$results, &$rejections, $count) {
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
+ *
+ * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
*/
function any($promises)
{
- return some(1, $promises)->then(function ($values) { return $values[0]; });
+ return Utils::any($promises);
}
/**
@@ -301,27 +223,17 @@ function any($promises)
*
* The returned promise is fulfilled with an array of inspection state arrays.
*
+ * @see inspect for the inspection state array format.
+ *
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
- * @see GuzzleHttp\Promise\inspect for the inspection state array format.
+ *
+ * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
*/
function settle($promises)
{
- $results = [];
-
- return each(
- $promises,
- function ($value, $idx) use (&$results) {
- $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
- },
- function ($reason, $idx) use (&$results) {
- $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
- }
- )->then(function () use (&$results) {
- ksort($results);
- return $results;
- });
+ return Utils::settle($promises);
}
/**
@@ -329,29 +241,28 @@ function ($reason, $idx) use (&$results) {
* fulfilled with a null value when the iterator has been consumed or the
* aggregate promise has been fulfilled or rejected.
*
- * $onFulfilled is a function that accepts the fulfilled value, iterator
- * index, and the aggregate promise. The callback can invoke any necessary side
- * effects and choose to resolve or reject the aggregate promise if needed.
+ * $onFulfilled is a function that accepts the fulfilled value, iterator index,
+ * and the aggregate promise. The callback can invoke any necessary side
+ * effects and choose to resolve or reject the aggregate if needed.
*
- * $onRejected is a function that accepts the rejection reason, iterator
- * index, and the aggregate promise. The callback can invoke any necessary side
- * effects and choose to resolve or reject the aggregate promise if needed.
+ * $onRejected is a function that accepts the rejection reason, iterator index,
+ * and the aggregate promise. The callback can invoke any necessary side
+ * effects and choose to resolve or reject the aggregate if needed.
*
* @param mixed $iterable Iterator or array to iterate over.
* @param callable $onFulfilled
* @param callable $onRejected
*
* @return PromiseInterface
+ *
+ * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
*/
function each(
$iterable,
callable $onFulfilled = null,
callable $onRejected = null
) {
- return (new EachPromise($iterable, [
- 'fulfilled' => $onFulfilled,
- 'rejected' => $onRejected
- ]))->promise();
+ return Each::of($iterable, $onFulfilled, $onRejected);
}
/**
@@ -368,6 +279,8 @@ function each(
* @param callable $onRejected
*
* @return PromiseInterface
+ *
+ * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
*/
function each_limit(
$iterable,
@@ -375,11 +288,7 @@ function each_limit(
callable $onFulfilled = null,
callable $onRejected = null
) {
- return (new EachPromise($iterable, [
- 'fulfilled' => $onFulfilled,
- 'rejected' => $onRejected,
- 'concurrency' => $concurrency
- ]))->promise();
+ return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
}
/**
@@ -392,66 +301,63 @@ function each_limit(
* @param callable $onFulfilled
*
* @return PromiseInterface
+ *
+ * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
*/
function each_limit_all(
$iterable,
$concurrency,
callable $onFulfilled = null
) {
- return each_limit(
- $iterable,
- $concurrency,
- $onFulfilled,
- function ($reason, $idx, PromiseInterface $aggregate) {
- $aggregate->reject($reason);
- }
- );
+ return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
}
/**
* Returns true if a promise is fulfilled.
*
- * @param PromiseInterface $promise
- *
* @return bool
+ *
+ * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
*/
function is_fulfilled(PromiseInterface $promise)
{
- return $promise->getState() === PromiseInterface::FULFILLED;
+ return Is::fulfilled($promise);
}
/**
* Returns true if a promise is rejected.
*
- * @param PromiseInterface $promise
- *
* @return bool
+ *
+ * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
*/
function is_rejected(PromiseInterface $promise)
{
- return $promise->getState() === PromiseInterface::REJECTED;
+ return Is::rejected($promise);
}
/**
* Returns true if a promise is fulfilled or rejected.
*
- * @param PromiseInterface $promise
- *
* @return bool
+ *
+ * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
*/
function is_settled(PromiseInterface $promise)
{
- return $promise->getState() !== PromiseInterface::PENDING;
+ return Is::settled($promise);
}
/**
- * @see Coroutine
+ * Create a new coroutine.
*
- * @param callable $generatorFn
+ * @see Coroutine
*
* @return PromiseInterface
+ *
+ * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
*/
function coroutine(callable $generatorFn)
{
- return new Coroutine($generatorFn);
+ return Coroutine::of($generatorFn);
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/.editorconfig b/tests/integration/vendor/guzzlehttp/psr7/.editorconfig
deleted file mode 100644
index 677e36e29..000000000
--- a/tests/integration/vendor/guzzlehttp/psr7/.editorconfig
+++ /dev/null
@@ -1,9 +0,0 @@
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-indent_size = 4
-indent_style = space
-insert_final_newline = true
-trim_trailing_whitespace = true
diff --git a/tests/integration/vendor/guzzlehttp/psr7/CHANGELOG.md b/tests/integration/vendor/guzzlehttp/psr7/CHANGELOG.md
index 27b65f095..740b2877b 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/CHANGELOG.md
+++ b/tests/integration/vendor/guzzlehttp/psr7/CHANGELOG.md
@@ -1,13 +1,114 @@
# Change Log
-
All notable changes to this project will be documented in this file.
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## Unreleased
+
+## 2.1.0 - 2021-10-06
+
+### Changed
+
+- Attempting to create a `Uri` object from a malformed URI will no longer throw a generic
+ `InvalidArgumentException`, but rather a `MalformedUriException`, which inherits from the former
+ for backwards compatibility. Callers relying on the exception being thrown to detect invalid
+ URIs should catch the new exception.
+
+### Fixed
+
+- Return `null` in caching stream size if remote size is `null`
+
+## 2.0.0 - 2021-06-30
+
+Identical to the RC release.
+
+## 2.0.0@RC-1 - 2021-04-29
+
+### Fixed
+
+- Handle possibly unset `url` in `stream_get_meta_data`
+## 2.0.0@beta-1 - 2021-03-21
+
+### Added
+
+- PSR-17 factories
+- Made classes final
+- PHP7 type hints
+
+### Changed
+
+- When building a query string, booleans are represented as 1 and 0.
+
+### Removed
+
+- PHP < 7.2 support
+- All functions in the Guzzle\Psr7 namespace
+
+## 1.8.1 - 2021-03-21
+
+### Fixed
+
+- Issue parsing IPv6 URLs
+- Issue modifying ServerRequest lost all its attributes
+
+## 1.8.0 - 2021-03-21
+
+### Added
+
+- Locale independent URL parsing
+- Most classes got a `@final` annotation to prepare for 2.0
+
+### Fixed
+
+- Issue when creating stream from `php://input` and curl-ext is not installed
+- Broken `Utils::tryFopen()` on PHP 8
+
+## 1.7.0 - 2020-09-30
+
+### Added
+
+- Replaced functions by static methods
+
+### Fixed
+
+- Converting a non-seekable stream to a string
+- Handle multiple Set-Cookie correctly
+- Ignore array keys in header values when merging
+- Allow multibyte characters to be parsed in `Message:bodySummary()`
+
+### Changed
+
+- Restored partial HHVM 3 support
+
+
+## [1.6.1] - 2019-07-02
+
+### Fixed
+
+- Accept null and bool header values again
+
+
+## [1.6.0] - 2019-06-30
+
+### Added
+
+- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244)
+- Added MIME type for WEBP image format (#246)
+- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272)
+
+### Changed
+
+- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262)
+- Accept port number 0 to be valid (#270)
+
+### Fixed
-## [Unreleased]
+- Fixed subsequent reads from `php://input` in ServerRequest (#247)
+- Fixed readable/writable detection for certain stream modes (#248)
+- Fixed encoding of special characters in the `userInfo` component of an URI (#253)
## [1.5.2] - 2018-12-04
@@ -209,7 +310,7 @@ Currently unsupported:
-[Unreleased]: https://github.com/guzzle/psr7/compare/1.5.2...HEAD
+[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0
[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2
[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1
[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0
diff --git a/tests/integration/vendor/guzzlehttp/psr7/LICENSE b/tests/integration/vendor/guzzlehttp/psr7/LICENSE
index 581d95f92..51c7ec81c 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/LICENSE
+++ b/tests/integration/vendor/guzzlehttp/psr7/LICENSE
@@ -1,4 +1,11 @@
-Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling
+The MIT License (MIT)
+
+Copyright (c) 2015 Michael Dowling
+Copyright (c) 2015 Márk Sági-Kazár
+Copyright (c) 2015 Graham Campbell
+Copyright (c) 2016 Tobias Schultze
+Copyright (c) 2016 George Mponos
+Copyright (c) 2018 Tobias Nyholm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tests/integration/vendor/guzzlehttp/psr7/README.md b/tests/integration/vendor/guzzlehttp/psr7/README.md
index c60a6a38d..ed81c927e 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/README.md
+++ b/tests/integration/vendor/guzzlehttp/psr7/README.md
@@ -4,8 +4,8 @@ This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/)
message implementation, several stream decorators, and some helpful
functionality like query string parsing.
-
-[](https://travis-ci.org/guzzle/psr7)
+
+
# Stream implementation
@@ -23,11 +23,11 @@ Reads from multiple streams, one after the other.
```php
use GuzzleHttp\Psr7;
-$a = Psr7\stream_for('abc, ');
-$b = Psr7\stream_for('123.');
+$a = Psr7\Utils::streamFor('abc, ');
+$b = Psr7\Utils::streamFor('123.');
$composed = new Psr7\AppendStream([$a, $b]);
-$composed->addStream(Psr7\stream_for(' Above all listen to me'));
+$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me'));
echo $composed; // abc, 123. Above all listen to me.
```
@@ -65,7 +65,7 @@ then on disk.
```php
use GuzzleHttp\Psr7;
-$original = Psr7\stream_for(fopen('http://www.google.com', 'r'));
+$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r'));
$stream = new Psr7\CachingStream($original);
$stream->read(1024);
@@ -89,7 +89,7 @@ stream becomes too full.
use GuzzleHttp\Psr7;
// Create an empty stream
-$stream = Psr7\stream_for();
+$stream = Psr7\Utils::streamFor();
// Start dropping data when the stream has more than 10 bytes
$dropping = new Psr7\DroppingStream($stream, 10);
@@ -112,7 +112,7 @@ to create a concrete class for a simple extension point.
use GuzzleHttp\Psr7;
-$stream = Psr7\stream_for('hi');
+$stream = Psr7\Utils::streamFor('hi');
$fnStream = Psr7\FnStream::decorate($stream, [
'rewind' => function () use ($stream) {
echo 'About to rewind - ';
@@ -130,10 +130,9 @@ $fnStream->rewind();
`GuzzleHttp\Psr7\InflateStream`
-Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
+Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content.
-This stream decorator skips the first 10 bytes of the given stream to remove
-the gzip header, converts the provided stream to a PHP stream resource,
+This stream decorator converts the provided stream to a PHP stream resource,
then appends the zlib.inflate filter. The stream is then converted back
to a Guzzle stream resource to be used as a Guzzle stream.
@@ -167,7 +166,7 @@ chunks (e.g. Amazon S3's multipart upload API).
```php
use GuzzleHttp\Psr7;
-$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+'));
+$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+'));
echo $original->getSize();
// >>> 1048576
@@ -197,7 +196,7 @@ NoSeekStream wraps a stream and does not allow seeking.
```php
use GuzzleHttp\Psr7;
-$original = Psr7\stream_for('foo');
+$original = Psr7\Utils::streamFor('foo');
$noSeek = new Psr7\NoSeekStream($original);
echo $noSeek->read(3);
@@ -271,7 +270,7 @@ This decorator could be added to any existing stream and used like so:
```php
use GuzzleHttp\Psr7;
-$original = Psr7\stream_for('foo');
+$original = Psr7\Utils::streamFor('foo');
$eofStream = new EofCallbackStream($original, function () {
echo 'EOF!';
@@ -297,228 +296,292 @@ stream from a PSR-7 stream.
```php
use GuzzleHttp\Psr7\StreamWrapper;
-$stream = GuzzleHttp\Psr7\stream_for('hello!');
+$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!');
$resource = StreamWrapper::getResource($stream);
echo fread($resource, 6); // outputs hello!
```
-# Function API
+# Static API
-There are various functions available under the `GuzzleHttp\Psr7` namespace.
+There are various static methods available under the `GuzzleHttp\Psr7` namespace.
-## `function str`
+## `GuzzleHttp\Psr7\Message::toString`
-`function str(MessageInterface $message)`
+`public static function toString(MessageInterface $message): string`
Returns the string representation of an HTTP message.
```php
$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
-echo GuzzleHttp\Psr7\str($request);
+echo GuzzleHttp\Psr7\Message::toString($request);
```
-## `function uri_for`
+## `GuzzleHttp\Psr7\Message::bodySummary`
-`function uri_for($uri)`
+`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null`
-This function accepts a string or `Psr\Http\Message\UriInterface` and returns a
-UriInterface for the given value. If the value is already a `UriInterface`, it
-is returned as-is.
+Get a short summary of the message body.
-```php
-$uri = GuzzleHttp\Psr7\uri_for('http://example.com');
-assert($uri === GuzzleHttp\Psr7\uri_for($uri));
-```
+Will return `null` if the response is not printable.
-## `function stream_for`
+## `GuzzleHttp\Psr7\Message::rewindBody`
-`function stream_for($resource = '', array $options = [])`
+`public static function rewindBody(MessageInterface $message): void`
-Create a new stream based on the input type.
+Attempts to rewind a message body and throws an exception on failure.
-Options is an associative array that can contain the following keys:
+The body of the message will only be rewound if a call to `tell()`
+returns a value other than `0`.
-* - metadata: Array of custom metadata.
-* - size: Size of the stream.
-This method accepts the following `$resource` types:
+## `GuzzleHttp\Psr7\Message::parseMessage`
-- `Psr\Http\Message\StreamInterface`: Returns the value as-is.
-- `string`: Creates a stream object that uses the given string as the contents.
-- `resource`: Creates a stream object that wraps the given PHP stream resource.
-- `Iterator`: If the provided value implements `Iterator`, then a read-only
- stream object will be created that wraps the given iterable. Each time the
- stream is read from, data from the iterator will fill a buffer and will be
- continuously called until the buffer is equal to the requested read size.
- Subsequent read calls will first read from the buffer and then call `next`
- on the underlying iterator until it is exhausted.
-- `object` with `__toString()`: If the object has the `__toString()` method,
- the object will be cast to a string and then a stream will be returned that
- uses the string value.
-- `NULL`: When `null` is passed, an empty stream object is returned.
-- `callable` When a callable is passed, a read-only stream object will be
- created that invokes the given callable. The callable is invoked with the
- number of suggested bytes to read. The callable can return any number of
- bytes, but MUST return `false` when there is no more data to return. The
- stream object that wraps the callable will invoke the callable until the
- number of requested bytes are available. Any additional bytes will be
- buffered and used in subsequent reads.
+`public static function parseMessage(string $message): array`
-```php
-$stream = GuzzleHttp\Psr7\stream_for('foo');
-$stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r'));
+Parses an HTTP message into an associative array.
-$generator = function ($bytes) {
- for ($i = 0; $i < $bytes; $i++) {
- yield ' ';
- }
-}
+The array contains the "start-line" key containing the start line of
+the message, "headers" key containing an associative array of header
+array values, and a "body" key containing the body of the message.
-$stream = GuzzleHttp\Psr7\stream_for($generator(100));
-```
+## `GuzzleHttp\Psr7\Message::parseRequestUri`
-## `function parse_header`
+`public static function parseRequestUri(string $path, array $headers): string`
-`function parse_header($header)`
+Constructs a URI for an HTTP request message.
-Parse an array of header values containing ";" separated data into an array of
-associative arrays representing the header key value pair data of the header.
-When a parameter does not contain a value, but just contains a key, this
-function will inject a key with a '' string value.
+## `GuzzleHttp\Psr7\Message::parseRequest`
-## `function normalize_header`
+`public static function parseRequest(string $message): Request`
-`function normalize_header($header)`
+Parses a request message string into a request object.
-Converts an array of header values that may contain comma separated headers
-into an array of headers with no comma separated values.
+## `GuzzleHttp\Psr7\Message::parseResponse`
-## `function modify_request`
+`public static function parseResponse(string $message): Response`
-`function modify_request(RequestInterface $request, array $changes)`
+Parses a response message string into a response object.
-Clone and modify a request with the given changes. This method is useful for
-reducing the number of clones needed to mutate a message.
-The changes can be one of:
+## `GuzzleHttp\Psr7\Header::parse`
-- method: (string) Changes the HTTP method.
-- set_headers: (array) Sets the given headers.
-- remove_headers: (array) Remove the given headers.
-- body: (mixed) Sets the given body.
-- uri: (UriInterface) Set the URI.
-- query: (string) Set the query string value of the URI.
-- version: (string) Set the protocol version.
+`public static function parse(string|array $header): array`
+Parse an array of header values containing ";" separated data into an
+array of associative arrays representing the header key value pair data
+of the header. When a parameter does not contain a value, but just
+contains a key, this function will inject a key with a '' string value.
-## `function rewind_body`
-`function rewind_body(MessageInterface $message)`
+## `GuzzleHttp\Psr7\Header::normalize`
-Attempts to rewind a message body and throws an exception on failure. The body
-of the message will only be rewound if a call to `tell()` returns a value other
-than `0`.
+`public static function normalize(string|array $header): array`
+Converts an array of header values that may contain comma separated
+headers into an array of headers with no comma separated values.
-## `function try_fopen`
-`function try_fopen($filename, $mode)`
+## `GuzzleHttp\Psr7\Query::parse`
-Safely opens a PHP stream resource using a filename.
+`public static function parse(string $str, int|bool $urlEncoding = true): array`
-When fopen fails, PHP normally raises a warning. This function adds an error
-handler that checks for errors and throws an exception instead.
+Parse a query string into an associative array.
+If multiple values are found for the same key, the value of that key
+value pair will become an array. This function does not parse nested
+PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2`
+will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
-## `function copy_to_string`
-`function copy_to_string(StreamInterface $stream, $maxLen = -1)`
+## `GuzzleHttp\Psr7\Query::build`
-Copy the contents of a stream into a string until the given number of bytes
-have been read.
+`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string`
+Build a query string from an array of key value pairs.
-## `function copy_to_stream`
+This function can use the return value of `parse()` to build a query
+string. This function does not modify the provided keys when an array is
+encountered (like `http_build_query()` would).
-`function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)`
-Copy the contents of a stream into another stream until the given number of
+## `GuzzleHttp\Psr7\Utils::caselessRemove`
+
+`public static function caselessRemove(iterable $keys, $keys, array $data): array`
+
+Remove the items given by the keys, case insensitively from the data.
+
+
+## `GuzzleHttp\Psr7\Utils::copyToStream`
+
+`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void`
+
+Copy the contents of a stream into another stream until the given number
+of bytes have been read.
+
+
+## `GuzzleHttp\Psr7\Utils::copyToString`
+
+`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string`
+
+Copy the contents of a stream into a string until the given number of
bytes have been read.
-## `function hash`
+## `GuzzleHttp\Psr7\Utils::hash`
+
+`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string`
-`function hash(StreamInterface $stream, $algo, $rawOutput = false)`
+Calculate a hash of a stream.
-Calculate a hash of a Stream. This method reads the entire stream to calculate
-a rolling hash (based on PHP's hash_init functions).
+This method reads the entire stream to calculate a rolling hash, based on
+PHP's `hash_init` functions.
-## `function readline`
+## `GuzzleHttp\Psr7\Utils::modifyRequest`
-`function readline(StreamInterface $stream, $maxLength = null)`
+`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface`
+
+Clone and modify a request with the given changes.
+
+This method is useful for reducing the number of clones needed to mutate
+a message.
+
+- method: (string) Changes the HTTP method.
+- set_headers: (array) Sets the given headers.
+- remove_headers: (array) Remove the given headers.
+- body: (mixed) Sets the given body.
+- uri: (UriInterface) Set the URI.
+- query: (string) Set the query string value of the URI.
+- version: (string) Set the protocol version.
+
+
+## `GuzzleHttp\Psr7\Utils::readLine`
+
+`public static function readLine(StreamInterface $stream, int $maxLength = null): string`
Read a line from the stream up to the maximum allowed buffer length.
-## `function parse_request`
+## `GuzzleHttp\Psr7\Utils::streamFor`
-`function parse_request($message)`
+`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface`
-Parses a request message string into a request object.
+Create a new stream based on the input type.
+Options is an associative array that can contain the following keys:
-## `function parse_response`
+- metadata: Array of custom metadata.
+- size: Size of the stream.
-`function parse_response($message)`
+This method accepts the following `$resource` types:
-Parses a response message string into a response object.
+- `Psr\Http\Message\StreamInterface`: Returns the value as-is.
+- `string`: Creates a stream object that uses the given string as the contents.
+- `resource`: Creates a stream object that wraps the given PHP stream resource.
+- `Iterator`: If the provided value implements `Iterator`, then a read-only
+ stream object will be created that wraps the given iterable. Each time the
+ stream is read from, data from the iterator will fill a buffer and will be
+ continuously called until the buffer is equal to the requested read size.
+ Subsequent read calls will first read from the buffer and then call `next`
+ on the underlying iterator until it is exhausted.
+- `object` with `__toString()`: If the object has the `__toString()` method,
+ the object will be cast to a string and then a stream will be returned that
+ uses the string value.
+- `NULL`: When `null` is passed, an empty stream object is returned.
+- `callable` When a callable is passed, a read-only stream object will be
+ created that invokes the given callable. The callable is invoked with the
+ number of suggested bytes to read. The callable can return any number of
+ bytes, but MUST return `false` when there is no more data to return. The
+ stream object that wraps the callable will invoke the callable until the
+ number of requested bytes are available. Any additional bytes will be
+ buffered and used in subsequent reads.
+```php
+$stream = GuzzleHttp\Psr7\Utils::streamFor('foo');
+$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r'));
-## `function parse_query`
+$generator = function ($bytes) {
+ for ($i = 0; $i < $bytes; $i++) {
+ yield ' ';
+ }
+}
-`function parse_query($str, $urlEncoding = true)`
+$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100));
+```
-Parse a query string into an associative array.
-If multiple values are found for the same key, the value of that key value pair
-will become an array. This function does not parse nested PHP style arrays into
-an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed into
-`['foo[a]' => '1', 'foo[b]' => '2']`).
+## `GuzzleHttp\Psr7\Utils::tryFopen`
+`public static function tryFopen(string $filename, string $mode): resource`
-## `function build_query`
+Safely opens a PHP stream resource using a filename.
-`function build_query(array $params, $encoding = PHP_QUERY_RFC3986)`
+When fopen fails, PHP normally raises a warning. This function adds an
+error handler that checks for errors and throws an exception instead.
-Build a query string from an array of key value pairs.
-This function can use the return value of parse_query() to build a query string.
-This function does not modify the provided keys when an array is encountered
-(like http_build_query would).
+## `GuzzleHttp\Psr7\Utils::uriFor`
+
+`public static function uriFor(string|UriInterface $uri): UriInterface`
+
+Returns a UriInterface for the given value.
+
+This function accepts a string or UriInterface and returns a
+UriInterface for the given value. If the value is already a
+UriInterface, it is returned as-is.
-## `function mimetype_from_filename`
+## `GuzzleHttp\Psr7\MimeType::fromFilename`
-`function mimetype_from_filename($filename)`
+`public static function fromFilename(string $filename): string|null`
Determines the mimetype of a file by looking at its extension.
-## `function mimetype_from_extension`
+## `GuzzleHttp\Psr7\MimeType::fromExtension`
-`function mimetype_from_extension($extension)`
+`public static function fromExtension(string $extension): string|null`
Maps a file extensions to a mimetype.
+## Upgrading from Function API
+
+The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API was removed in 2.0.0. A migration table has been provided here for your convenience:
+
+| Original Function | Replacement Method |
+|----------------|----------------|
+| `str` | `Message::toString` |
+| `uri_for` | `Utils::uriFor` |
+| `stream_for` | `Utils::streamFor` |
+| `parse_header` | `Header::parse` |
+| `normalize_header` | `Header::normalize` |
+| `modify_request` | `Utils::modifyRequest` |
+| `rewind_body` | `Message::rewindBody` |
+| `try_fopen` | `Utils::tryFopen` |
+| `copy_to_string` | `Utils::copyToString` |
+| `copy_to_stream` | `Utils::copyToStream` |
+| `hash` | `Utils::hash` |
+| `readline` | `Utils::readLine` |
+| `parse_request` | `Message::parseRequest` |
+| `parse_response` | `Message::parseResponse` |
+| `parse_query` | `Query::parse` |
+| `build_query` | `Query::build` |
+| `mimetype_from_filename` | `MimeType::fromFilename` |
+| `mimetype_from_extension` | `MimeType::fromExtension` |
+| `_parse_message` | `Message::parseMessage` |
+| `_parse_request_uri` | `Message::parseRequestUri` |
+| `get_message_body_summary` | `Message::bodySummary` |
+| `_caseless_remove` | `Utils::caselessRemove` |
+
+
# Additional URI Methods
Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class,
@@ -743,3 +806,18 @@ Whether two URIs can be considered equivalent. Both URIs are normalized automati
`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
equivalence or difference of relative references does not mean anything.
+
+
+## Security
+
+If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information.
+
+## License
+
+Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
+## For Enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/tests/integration/vendor/guzzlehttp/psr7/composer.json b/tests/integration/vendor/guzzlehttp/psr7/composer.json
index 2add153ec..885aa1da0 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/composer.json
+++ b/tests/integration/vendor/guzzlehttp/psr7/composer.json
@@ -1,36 +1,76 @@
{
"name": "guzzlehttp/psr7",
- "type": "library",
"description": "PSR-7 message implementation that also provides common utility methods",
- "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"],
+ "keywords": [
+ "request",
+ "response",
+ "message",
+ "stream",
+ "http",
+ "uri",
+ "url",
+ "psr-7"
+ ],
"license": "MIT",
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
{
"name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.0",
+ "ralouphie/getallheaders": "^3.0"
},
"provide": {
+ "psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "http-interop/http-factory-tests": "^0.9",
+ "phpunit/phpunit": "^8.5.8 || ^9.3.10"
+ },
+ "suggest": {
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
+ },
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
- },
- "files": ["src/functions_include.php"]
+ }
},
"autoload-dev": {
"psr-4": {
@@ -39,7 +79,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.5-dev"
+ "dev-master": "2.1-dev"
}
+ },
+ "config": {
+ "preferred-install": "dist",
+ "sort-packages": true
}
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php
index 472a0d61b..967925f3f 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php
@@ -1,4 +1,7 @@
rewind();
return $this->getContents();
- } catch (\Exception $e) {
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
@@ -45,7 +57,7 @@ public function __toString()
*
* @throws \InvalidArgumentException if the stream is not readable
*/
- public function addStream(StreamInterface $stream)
+ public function addStream(StreamInterface $stream): void
{
if (!$stream->isReadable()) {
throw new \InvalidArgumentException('Each stream must be readable');
@@ -59,17 +71,15 @@ public function addStream(StreamInterface $stream)
$this->streams[] = $stream;
}
- public function getContents()
+ public function getContents(): string
{
- return copy_to_string($this);
+ return Utils::copyToString($this);
}
/**
* Closes each attached stream.
- *
- * {@inheritdoc}
*/
- public function close()
+ public function close(): void
{
$this->pos = $this->current = 0;
$this->seekable = true;
@@ -85,8 +95,6 @@ public function close()
* Detaches each attached stream.
*
* Returns null as it's not clear which underlying stream resource to return.
- *
- * {@inheritdoc}
*/
public function detach()
{
@@ -98,9 +106,11 @@ public function detach()
}
$this->streams = [];
+
+ return null;
}
- public function tell()
+ public function tell(): int
{
return $this->pos;
}
@@ -110,10 +120,8 @@ public function tell()
*
* If any of the streams do not return a valid number, then the size of the
* append stream cannot be determined and null is returned.
- *
- * {@inheritdoc}
*/
- public function getSize()
+ public function getSize(): ?int
{
$size = 0;
@@ -128,24 +136,22 @@ public function getSize()
return $size;
}
- public function eof()
+ public function eof(): bool
{
return !$this->streams ||
($this->current >= count($this->streams) - 1 &&
$this->streams[$this->current]->eof());
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
/**
* Attempts to seek to the given position. Only supports SEEK_SET.
- *
- * {@inheritdoc}
*/
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
if (!$this->seekable) {
throw new \RuntimeException('This AppendStream is not seekable');
@@ -176,10 +182,8 @@ public function seek($offset, $whence = SEEK_SET)
/**
* Reads from all of the appended streams until the length is met or EOF.
- *
- * {@inheritdoc}
*/
- public function read($length)
+ public function read($length): string
{
$buffer = '';
$total = count($this->streams) - 1;
@@ -199,8 +203,7 @@ public function read($length)
$result = $this->streams[$this->current]->read($remaining);
- // Using a loose comparison here to match on '', false, and null
- if ($result == null) {
+ if ($result === '') {
$progressToNext = true;
continue;
}
@@ -214,26 +217,31 @@ public function read($length)
return $buffer;
}
- public function isReadable()
+ public function isReadable(): bool
{
return true;
}
- public function isWritable()
+ public function isWritable(): bool
{
return false;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return $this->seekable;
}
- public function write($string)
+ public function write($string): int
{
throw new \RuntimeException('Cannot write to an AppendStream');
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
return $key ? null : [];
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php
index af4d4c227..21be8c0a9 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php
@@ -1,4 +1,7 @@
hwm = $hwm;
}
- public function __toString()
+ public function __toString(): string
{
return $this->getContents();
}
- public function getContents()
+ public function getContents(): string
{
$buffer = $this->buffer;
$this->buffer = '';
@@ -41,7 +47,7 @@ public function getContents()
return $buffer;
}
- public function close()
+ public function close(): void
{
$this->buffer = '';
}
@@ -49,44 +55,46 @@ public function close()
public function detach()
{
$this->close();
+
+ return null;
}
- public function getSize()
+ public function getSize(): ?int
{
return strlen($this->buffer);
}
- public function isReadable()
+ public function isReadable(): bool
{
return true;
}
- public function isWritable()
+ public function isWritable(): bool
{
return true;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return false;
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
throw new \RuntimeException('Cannot seek a BufferStream');
}
- public function eof()
+ public function eof(): bool
{
return strlen($this->buffer) === 0;
}
- public function tell()
+ public function tell(): int
{
throw new \RuntimeException('Cannot determine the position of a BufferStream');
}
@@ -94,7 +102,7 @@ public function tell()
/**
* Reads data from the buffer.
*/
- public function read($length)
+ public function read($length): string
{
$currentLength = strlen($this->buffer);
@@ -114,21 +122,25 @@ public function read($length)
/**
* Writes data to the buffer.
*/
- public function write($string)
+ public function write($string): int
{
$this->buffer .= $string;
- // TODO: What should happen here?
if (strlen($this->buffer) >= $this->hwm) {
- return false;
+ return 0;
}
return strlen($string);
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
- if ($key == 'hwm') {
+ if ($key === 'hwm') {
return $this->hwm;
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php
index ed68f0861..7a70ee942 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php
@@ -1,4 +1,7 @@
remoteStream = $stream;
- $this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
+ $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+'));
}
- public function getSize()
+ public function getSize(): ?int
{
- return max($this->stream->getSize(), $this->remoteStream->getSize());
+ $remoteSize = $this->remoteStream->getSize();
+
+ if (null === $remoteSize) {
+ return null;
+ }
+
+ return max($this->stream->getSize(), $remoteSize);
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
- if ($whence == SEEK_SET) {
+ if ($whence === SEEK_SET) {
$byte = $offset;
- } elseif ($whence == SEEK_CUR) {
+ } elseif ($whence === SEEK_CUR) {
$byte = $offset + $this->tell();
- } elseif ($whence == SEEK_END) {
+ } elseif ($whence === SEEK_END) {
$size = $this->remoteStream->getSize();
if ($size === null) {
$size = $this->cacheEntireStream();
@@ -72,7 +81,7 @@ public function seek($offset, $whence = SEEK_SET)
}
}
- public function read($length)
+ public function read($length): string
{
// Perform a regular read on any previously read data from the buffer
$data = $this->stream->read($length);
@@ -101,7 +110,7 @@ public function read($length)
return $data;
}
- public function write($string)
+ public function write($string): int
{
// When appending to the end of the currently read stream, you'll want
// to skip bytes from being read from the remote stream to emulate
@@ -115,7 +124,7 @@ public function write($string)
return $this->stream->write($string);
}
- public function eof()
+ public function eof(): bool
{
return $this->stream->eof() && $this->remoteStream->eof();
}
@@ -123,15 +132,16 @@ public function eof()
/**
* Close both the remote stream and buffer stream
*/
- public function close()
+ public function close(): void
{
- $this->remoteStream->close() && $this->stream->close();
+ $this->remoteStream->close();
+ $this->stream->close();
}
- private function cacheEntireStream()
+ private function cacheEntireStream(): int
{
$target = new FnStream(['write' => 'strlen']);
- copy_to_stream($this, $target);
+ Utils::copyToStream($this, $target);
return $this->tell();
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php
index 8935c80d7..d78070ae2 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php
@@ -1,4 +1,7 @@
stream = $stream;
$this->maxLength = $maxLength;
}
- public function write($string)
+ public function write($string): int
{
$diff = $this->maxLength - $this->stream->getSize();
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/tests/integration/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php
new file mode 100644
index 000000000..3a084779a
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php
@@ -0,0 +1,14 @@
+ */
+ private $methods;
/**
- * @param array $methods Hash of method name to a callable.
+ * @param array $methods Hash of method name to a callable.
*/
public function __construct(array $methods)
{
@@ -34,9 +38,10 @@ public function __construct(array $methods)
/**
* Lazily determine which methods are not implemented.
+ *
* @throws \BadMethodCallException
*/
- public function __get($name)
+ public function __get(string $name): void
{
throw new \BadMethodCallException(str_replace('_fn_', '', $name)
. '() is not implemented in the FnStream');
@@ -54,9 +59,10 @@ public function __destruct()
/**
* An unserialize would allow the __destruct to run when the unserialized value goes out of scope.
+ *
* @throws \LogicException
*/
- public function __wakeup()
+ public function __wakeup(): void
{
throw new \LogicException('FnStream should never be unserialized');
}
@@ -65,8 +71,8 @@ public function __wakeup()
* Adds custom functionality to an underlying stream by intercepting
* specific method calls.
*
- * @param StreamInterface $stream Stream to decorate
- * @param array $methods Hash of method name to a closure
+ * @param StreamInterface $stream Stream to decorate
+ * @param array $methods Hash of method name to a closure
*
* @return FnStream
*/
@@ -74,21 +80,31 @@ public static function decorate(StreamInterface $stream, array $methods)
{
// If any of the required methods were not provided, then simply
// proxy to the decorated stream.
- foreach (array_diff(self::$slots, array_keys($methods)) as $diff) {
- $methods[$diff] = [$stream, $diff];
+ foreach (array_diff(self::SLOTS, array_keys($methods)) as $diff) {
+ /** @var callable $callable */
+ $callable = [$stream, $diff];
+ $methods[$diff] = $callable;
}
return new self($methods);
}
- public function __toString()
+ public function __toString(): string
{
- return call_user_func($this->_fn___toString);
+ try {
+ return call_user_func($this->_fn___toString);
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
+ return '';
+ }
}
- public function close()
+ public function close(): void
{
- return call_user_func($this->_fn_close);
+ call_user_func($this->_fn_close);
}
public function detach()
@@ -96,61 +112,66 @@ public function detach()
return call_user_func($this->_fn_detach);
}
- public function getSize()
+ public function getSize(): ?int
{
return call_user_func($this->_fn_getSize);
}
- public function tell()
+ public function tell(): int
{
return call_user_func($this->_fn_tell);
}
- public function eof()
+ public function eof(): bool
{
return call_user_func($this->_fn_eof);
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return call_user_func($this->_fn_isSeekable);
}
- public function rewind()
+ public function rewind(): void
{
call_user_func($this->_fn_rewind);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
call_user_func($this->_fn_seek, $offset, $whence);
}
- public function isWritable()
+ public function isWritable(): bool
{
return call_user_func($this->_fn_isWritable);
}
- public function write($string)
+ public function write($string): int
{
return call_user_func($this->_fn_write, $string);
}
- public function isReadable()
+ public function isReadable(): bool
{
return call_user_func($this->_fn_isReadable);
}
- public function read($length)
+ public function read($length): string
{
return call_user_func($this->_fn_read, $length);
}
- public function getContents()
+ public function getContents(): string
{
return call_user_func($this->_fn_getContents);
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
return call_user_func($this->_fn_getMetadata, $key);
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Header.php b/tests/integration/vendor/guzzlehttp/psr7/src/Header.php
new file mode 100644
index 000000000..0e79a71a8
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Header.php
@@ -0,0 +1,69 @@
+]+>|[^=]+/', $kvp, $matches)) {
+ $m = $matches[0];
+ if (isset($m[1])) {
+ $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
+ } else {
+ $part[] = trim($m[0], $trimmed);
+ }
+ }
+ }
+ if ($part) {
+ $params[] = $part;
+ }
+ }
+
+ return $params;
+ }
+
+ /**
+ * Converts an array of header values that may contain comma separated
+ * headers into an array of headers with no comma separated values.
+ *
+ * @param string|array $header Header to normalize.
+ */
+ public static function normalize($header): array
+ {
+ if (!is_array($header)) {
+ return array_map('trim', explode(',', $header));
+ }
+
+ $result = [];
+ foreach ($header as $value) {
+ foreach ((array) $value as $v) {
+ if (strpos($v, ',') === false) {
+ $result[] = $v;
+ continue;
+ }
+ foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
+ $result[] = trim($vv);
+ }
+ }
+ }
+
+ return $result;
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/HttpFactory.php b/tests/integration/vendor/guzzlehttp/psr7/src/HttpFactory.php
new file mode 100644
index 000000000..30be222fc
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/HttpFactory.php
@@ -0,0 +1,100 @@
+getSize();
+ }
+
+ return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType);
+ }
+
+ public function createStream(string $content = ''): StreamInterface
+ {
+ return Utils::streamFor($content);
+ }
+
+ public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface
+ {
+ try {
+ $resource = Utils::tryFopen($file, $mode);
+ } catch (\RuntimeException $e) {
+ if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) {
+ throw new \InvalidArgumentException(sprintf('Invalid file opening mode "%s"', $mode), 0, $e);
+ }
+
+ throw $e;
+ }
+
+ return Utils::streamFor($resource);
+ }
+
+ public function createStreamFromResource($resource): StreamInterface
+ {
+ return Utils::streamFor($resource);
+ }
+
+ public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
+ {
+ if (empty($method)) {
+ if (!empty($serverParams['REQUEST_METHOD'])) {
+ $method = $serverParams['REQUEST_METHOD'];
+ } else {
+ throw new \InvalidArgumentException('Cannot determine HTTP method');
+ }
+ }
+
+ return new ServerRequest($method, $uri, [], null, '1.1', $serverParams);
+ }
+
+ public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
+ {
+ return new Response($code, [], null, '1.1', $reasonPhrase);
+ }
+
+ public function createRequest(string $method, $uri): RequestInterface
+ {
+ return new Request($method, $uri);
+ }
+
+ public function createUri(string $uri = ''): UriInterface
+ {
+ return new Uri($uri);
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php
index 5e4f6028c..8e3cf1717 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php
@@ -1,52 +1,34 @@
read(10);
- $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
- // Skip the header, that is 10 + length of filename + 1 (nil) bytes
- $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
$resource = StreamWrapper::getResource($stream);
- stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
+ // Specify window=15+32, so zlib will use header detection to both gzip (with header) and zlib data
+ // See http://www.zlib.net/manual.html#Advanced definition of inflateInit2
+ // "Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection"
+ // Default window size is 15.
+ stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 15 + 32]);
$this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));
}
-
- /**
- * @param StreamInterface $stream
- * @param $header
- * @return int
- */
- private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
- {
- $filename_header_length = 0;
-
- if (substr(bin2hex($header), 6, 2) === '08') {
- // we have a filename, read until nil
- $filename_header_length = 1;
- while ($stream->read(1) !== chr(0)) {
- $filename_header_length++;
- }
- }
-
- return $filename_header_length;
- }
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php
index 02cec3af4..6b6042963 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php
@@ -1,4 +1,7 @@
filename = $filename;
$this->mode = $mode;
@@ -29,11 +32,9 @@ public function __construct($filename, $mode)
/**
* Creates the underlying stream lazily when required.
- *
- * @return StreamInterface
*/
- protected function createStream()
+ protected function createStream(): StreamInterface
{
- return stream_for(try_fopen($this->filename, $this->mode));
+ return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode));
}
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php
index 3c13d4f41..9762d38aa 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php
@@ -1,13 +1,15 @@
stream = $stream;
$this->setLimit($limit);
$this->setOffset($offset);
}
- public function eof()
+ public function eof(): bool
{
// Always return true if the underlying stream is EOF
if ($this->stream->eof()) {
@@ -42,7 +44,7 @@ public function eof()
}
// No limit and the underlying stream is not at EOF
- if ($this->limit == -1) {
+ if ($this->limit === -1) {
return false;
}
@@ -51,13 +53,12 @@ public function eof()
/**
* Returns the size of the limited subset of data
- * {@inheritdoc}
*/
- public function getSize()
+ public function getSize(): ?int
{
if (null === ($length = $this->stream->getSize())) {
return null;
- } elseif ($this->limit == -1) {
+ } elseif ($this->limit === -1) {
return $length - $this->offset;
} else {
return min($this->limit, $length - $this->offset);
@@ -66,13 +67,12 @@ public function getSize()
/**
* Allow for a bounded seek on the read limited stream
- * {@inheritdoc}
*/
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
if ($whence !== SEEK_SET || $offset < 0) {
throw new \RuntimeException(sprintf(
- 'Cannot seek to offset % with whence %s',
+ 'Cannot seek to offset %s with whence %s',
$offset,
$whence
));
@@ -91,9 +91,8 @@ public function seek($offset, $whence = SEEK_SET)
/**
* Give a relative tell()
- * {@inheritdoc}
*/
- public function tell()
+ public function tell(): int
{
return $this->stream->tell() - $this->offset;
}
@@ -105,7 +104,7 @@ public function tell()
*
* @throws \RuntimeException if the stream cannot be seeked.
*/
- public function setOffset($offset)
+ public function setOffset(int $offset): void
{
$current = $this->stream->tell();
@@ -130,14 +129,14 @@ public function setOffset($offset)
* @param int $limit Number of bytes to allow to be read from the stream.
* Use -1 for no limit.
*/
- public function setLimit($limit)
+ public function setLimit(int $limit): void
{
$this->limit = $limit;
}
- public function read($length)
+ public function read($length): string
{
- if ($this->limit == -1) {
+ if ($this->limit === -1) {
return $this->stream->read($length);
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Message.php b/tests/integration/vendor/guzzlehttp/psr7/src/Message.php
new file mode 100644
index 000000000..9b825b300
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Message.php
@@ -0,0 +1,242 @@
+getMethod() . ' '
+ . $message->getRequestTarget())
+ . ' HTTP/' . $message->getProtocolVersion();
+ if (!$message->hasHeader('host')) {
+ $msg .= "\r\nHost: " . $message->getUri()->getHost();
+ }
+ } elseif ($message instanceof ResponseInterface) {
+ $msg = 'HTTP/' . $message->getProtocolVersion() . ' '
+ . $message->getStatusCode() . ' '
+ . $message->getReasonPhrase();
+ } else {
+ throw new \InvalidArgumentException('Unknown message type');
+ }
+
+ foreach ($message->getHeaders() as $name => $values) {
+ if (strtolower($name) === 'set-cookie') {
+ foreach ($values as $value) {
+ $msg .= "\r\n{$name}: " . $value;
+ }
+ } else {
+ $msg .= "\r\n{$name}: " . implode(', ', $values);
+ }
+ }
+
+ return "{$msg}\r\n\r\n" . $message->getBody();
+ }
+
+ /**
+ * Get a short summary of the message body.
+ *
+ * Will return `null` if the response is not printable.
+ *
+ * @param MessageInterface $message The message to get the body summary
+ * @param int $truncateAt The maximum allowed size of the summary
+ */
+ public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string
+ {
+ $body = $message->getBody();
+
+ if (!$body->isSeekable() || !$body->isReadable()) {
+ return null;
+ }
+
+ $size = $body->getSize();
+
+ if ($size === 0) {
+ return null;
+ }
+
+ $summary = $body->read($truncateAt);
+ $body->rewind();
+
+ if ($size > $truncateAt) {
+ $summary .= ' (truncated...)';
+ }
+
+ // Matches any printable character, including unicode characters:
+ // letters, marks, numbers, punctuation, spacing, and separators.
+ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
+ return null;
+ }
+
+ return $summary;
+ }
+
+ /**
+ * Attempts to rewind a message body and throws an exception on failure.
+ *
+ * The body of the message will only be rewound if a call to `tell()`
+ * returns a value other than `0`.
+ *
+ * @param MessageInterface $message Message to rewind
+ *
+ * @throws \RuntimeException
+ */
+ public static function rewindBody(MessageInterface $message): void
+ {
+ $body = $message->getBody();
+
+ if ($body->tell()) {
+ $body->rewind();
+ }
+ }
+
+ /**
+ * Parses an HTTP message into an associative array.
+ *
+ * The array contains the "start-line" key containing the start line of
+ * the message, "headers" key containing an associative array of header
+ * array values, and a "body" key containing the body of the message.
+ *
+ * @param string $message HTTP request or response to parse.
+ */
+ public static function parseMessage(string $message): array
+ {
+ if (!$message) {
+ throw new \InvalidArgumentException('Invalid message');
+ }
+
+ $message = ltrim($message, "\r\n");
+
+ $messageParts = preg_split("/\r?\n\r?\n/", $message, 2);
+
+ if ($messageParts === false || count($messageParts) !== 2) {
+ throw new \InvalidArgumentException('Invalid message: Missing header delimiter');
+ }
+
+ [$rawHeaders, $body] = $messageParts;
+ $rawHeaders .= "\r\n"; // Put back the delimiter we split previously
+ $headerParts = preg_split("/\r?\n/", $rawHeaders, 2);
+
+ if ($headerParts === false || count($headerParts) !== 2) {
+ throw new \InvalidArgumentException('Invalid message: Missing status line');
+ }
+
+ [$startLine, $rawHeaders] = $headerParts;
+
+ if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') {
+ // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0
+ $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders);
+ }
+
+ /** @var array[] $headerLines */
+ $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER);
+
+ // If these aren't the same, then one line didn't match and there's an invalid header.
+ if ($count !== substr_count($rawHeaders, "\n")) {
+ // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4
+ if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) {
+ throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding');
+ }
+
+ throw new \InvalidArgumentException('Invalid header syntax');
+ }
+
+ $headers = [];
+
+ foreach ($headerLines as $headerLine) {
+ $headers[$headerLine[1]][] = $headerLine[2];
+ }
+
+ return [
+ 'start-line' => $startLine,
+ 'headers' => $headers,
+ 'body' => $body,
+ ];
+ }
+
+ /**
+ * Constructs a URI for an HTTP request message.
+ *
+ * @param string $path Path from the start-line
+ * @param array $headers Array of headers (each value an array).
+ */
+ public static function parseRequestUri(string $path, array $headers): string
+ {
+ $hostKey = array_filter(array_keys($headers), function ($k) {
+ return strtolower($k) === 'host';
+ });
+
+ // If no host is found, then a full URI cannot be constructed.
+ if (!$hostKey) {
+ return $path;
+ }
+
+ $host = $headers[reset($hostKey)][0];
+ $scheme = substr($host, -4) === ':443' ? 'https' : 'http';
+
+ return $scheme . '://' . $host . '/' . ltrim($path, '/');
+ }
+
+ /**
+ * Parses a request message string into a request object.
+ *
+ * @param string $message Request message string.
+ */
+ public static function parseRequest(string $message): RequestInterface
+ {
+ $data = self::parseMessage($message);
+ $matches = [];
+ if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
+ throw new \InvalidArgumentException('Invalid request string');
+ }
+ $parts = explode(' ', $data['start-line'], 3);
+ $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
+
+ $request = new Request(
+ $parts[0],
+ $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1],
+ $data['headers'],
+ $data['body'],
+ $version
+ );
+
+ return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
+ }
+
+ /**
+ * Parses a response message string into a response object.
+ *
+ * @param string $message Response message string.
+ */
+ public static function parseResponse(string $message): ResponseInterface
+ {
+ $data = self::parseMessage($message);
+ // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
+ // between status-code and reason-phrase is required. But browsers accept
+ // responses without space and reason as well.
+ if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
+ throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']);
+ }
+ $parts = explode(' ', $data['start-line'], 3);
+
+ return new Response(
+ (int) $parts[1],
+ $data['headers'],
+ $data['body'],
+ explode('/', $parts[0])[1],
+ $parts[2] ?? null
+ );
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php b/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php
index 1e4da649a..503c280be 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php
@@ -1,6 +1,10 @@
array of values */
+ /** @var array Map of all registered headers, as original name => array of values */
private $headers = [];
- /** @var array Map of lowercase header name => original name at registration */
+ /** @var array Map of lowercase header name => original name at registration */
private $headerNames = [];
/** @var string */
private $protocol = '1.1';
- /** @var StreamInterface */
+ /** @var StreamInterface|null */
private $stream;
- public function getProtocolVersion()
+ public function getProtocolVersion(): string
{
return $this->protocol;
}
- public function withProtocolVersion($version)
+ public function withProtocolVersion($version): MessageInterface
{
if ($this->protocol === $version) {
return $this;
@@ -36,17 +40,17 @@ public function withProtocolVersion($version)
return $new;
}
- public function getHeaders()
+ public function getHeaders(): array
{
return $this->headers;
}
- public function hasHeader($header)
+ public function hasHeader($header): bool
{
return isset($this->headerNames[strtolower($header)]);
}
- public function getHeader($header)
+ public function getHeader($header): array
{
$header = strtolower($header);
@@ -59,18 +63,15 @@ public function getHeader($header)
return $this->headers[$header];
}
- public function getHeaderLine($header)
+ public function getHeaderLine($header): string
{
return implode(', ', $this->getHeader($header));
}
- public function withHeader($header, $value)
+ public function withHeader($header, $value): MessageInterface
{
- if (!is_array($value)) {
- $value = [$value];
- }
-
- $value = $this->trimHeaderValues($value);
+ $this->assertHeader($header);
+ $value = $this->normalizeHeaderValue($value);
$normalized = strtolower($header);
$new = clone $this;
@@ -83,13 +84,10 @@ public function withHeader($header, $value)
return $new;
}
- public function withAddedHeader($header, $value)
+ public function withAddedHeader($header, $value): MessageInterface
{
- if (!is_array($value)) {
- $value = [$value];
- }
-
- $value = $this->trimHeaderValues($value);
+ $this->assertHeader($header);
+ $value = $this->normalizeHeaderValue($value);
$normalized = strtolower($header);
$new = clone $this;
@@ -104,7 +102,7 @@ public function withAddedHeader($header, $value)
return $new;
}
- public function withoutHeader($header)
+ public function withoutHeader($header): MessageInterface
{
$normalized = strtolower($header);
@@ -120,16 +118,16 @@ public function withoutHeader($header)
return $new;
}
- public function getBody()
+ public function getBody(): StreamInterface
{
if (!$this->stream) {
- $this->stream = stream_for('');
+ $this->stream = Utils::streamFor('');
}
return $this->stream;
}
- public function withBody(StreamInterface $body)
+ public function withBody(StreamInterface $body): MessageInterface
{
if ($body === $this->stream) {
return $this;
@@ -140,15 +138,20 @@ public function withBody(StreamInterface $body)
return $new;
}
- private function setHeaders(array $headers)
+ /**
+ * @param array $headers
+ */
+ private function setHeaders(array $headers): void
{
$this->headerNames = $this->headers = [];
foreach ($headers as $header => $value) {
- if (!is_array($value)) {
- $value = [$value];
+ if (is_int($header)) {
+ // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec
+ // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass.
+ $header = (string) $header;
}
-
- $value = $this->trimHeaderValues($value);
+ $this->assertHeader($header);
+ $value = $this->normalizeHeaderValue($value);
$normalized = strtolower($header);
if (isset($this->headerNames[$normalized])) {
$header = $this->headerNames[$normalized];
@@ -160,6 +163,24 @@ private function setHeaders(array $headers)
}
}
+ /**
+ * @param mixed $value
+ *
+ * @return string[]
+ */
+ private function normalizeHeaderValue($value): array
+ {
+ if (!is_array($value)) {
+ return $this->trimHeaderValues([$value]);
+ }
+
+ if (count($value) === 0) {
+ throw new \InvalidArgumentException('Header value can not be an empty array.');
+ }
+
+ return $this->trimHeaderValues($value);
+ }
+
/**
* Trims whitespace from the header values.
*
@@ -168,16 +189,47 @@ private function setHeaders(array $headers)
* header-field = field-name ":" OWS field-value OWS
* OWS = *( SP / HTAB )
*
- * @param string[] $values Header values
+ * @param mixed[] $values Header values
*
* @return string[] Trimmed header values
*
* @see https://tools.ietf.org/html/rfc7230#section-3.2.4
*/
- private function trimHeaderValues(array $values)
+ private function trimHeaderValues(array $values): array
{
return array_map(function ($value) {
- return trim($value, " \t");
- }, $values);
+ if (!is_scalar($value) && null !== $value) {
+ throw new \InvalidArgumentException(sprintf(
+ 'Header value must be scalar or null but %s provided.',
+ is_object($value) ? get_class($value) : gettype($value)
+ ));
+ }
+
+ return trim((string) $value, " \t");
+ }, array_values($values));
+ }
+
+ /**
+ * @see https://tools.ietf.org/html/rfc7230#section-3.2
+ *
+ * @param mixed $header
+ */
+ private function assertHeader($header): void
+ {
+ if (!is_string($header)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'Header name must be a string but %s provided.',
+ is_object($header) ? get_class($header) : gettype($header)
+ ));
+ }
+
+ if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ '"%s" is not valid header name',
+ $header
+ )
+ );
+ }
}
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php b/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php
new file mode 100644
index 000000000..dfa94251a
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php
@@ -0,0 +1,130 @@
+ 'video/3gpp',
+ '7z' => 'application/x-7z-compressed',
+ 'aac' => 'audio/x-aac',
+ 'ai' => 'application/postscript',
+ 'aif' => 'audio/x-aiff',
+ 'asc' => 'text/plain',
+ 'asf' => 'video/x-ms-asf',
+ 'atom' => 'application/atom+xml',
+ 'avi' => 'video/x-msvideo',
+ 'bmp' => 'image/bmp',
+ 'bz2' => 'application/x-bzip2',
+ 'cer' => 'application/pkix-cert',
+ 'crl' => 'application/pkix-crl',
+ 'crt' => 'application/x-x509-ca-cert',
+ 'css' => 'text/css',
+ 'csv' => 'text/csv',
+ 'cu' => 'application/cu-seeme',
+ 'deb' => 'application/x-debian-package',
+ 'doc' => 'application/msword',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'dvi' => 'application/x-dvi',
+ 'eot' => 'application/vnd.ms-fontobject',
+ 'eps' => 'application/postscript',
+ 'epub' => 'application/epub+zip',
+ 'etx' => 'text/x-setext',
+ 'flac' => 'audio/flac',
+ 'flv' => 'video/x-flv',
+ 'gif' => 'image/gif',
+ 'gz' => 'application/gzip',
+ 'htm' => 'text/html',
+ 'html' => 'text/html',
+ 'ico' => 'image/x-icon',
+ 'ics' => 'text/calendar',
+ 'ini' => 'text/plain',
+ 'iso' => 'application/x-iso9660-image',
+ 'jar' => 'application/java-archive',
+ 'jpe' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpg' => 'image/jpeg',
+ 'js' => 'text/javascript',
+ 'json' => 'application/json',
+ 'latex' => 'application/x-latex',
+ 'log' => 'text/plain',
+ 'm4a' => 'audio/mp4',
+ 'm4v' => 'video/mp4',
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mov' => 'video/quicktime',
+ 'mkv' => 'video/x-matroska',
+ 'mp3' => 'audio/mpeg',
+ 'mp4' => 'video/mp4',
+ 'mp4a' => 'audio/mp4',
+ 'mp4v' => 'video/mp4',
+ 'mpe' => 'video/mpeg',
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpg4' => 'video/mp4',
+ 'oga' => 'audio/ogg',
+ 'ogg' => 'audio/ogg',
+ 'ogv' => 'video/ogg',
+ 'ogx' => 'application/ogg',
+ 'pbm' => 'image/x-portable-bitmap',
+ 'pdf' => 'application/pdf',
+ 'pgm' => 'image/x-portable-graymap',
+ 'png' => 'image/png',
+ 'pnm' => 'image/x-portable-anymap',
+ 'ppm' => 'image/x-portable-pixmap',
+ 'ppt' => 'application/vnd.ms-powerpoint',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'ps' => 'application/postscript',
+ 'qt' => 'video/quicktime',
+ 'rar' => 'application/x-rar-compressed',
+ 'ras' => 'image/x-cmu-raster',
+ 'rss' => 'application/rss+xml',
+ 'rtf' => 'application/rtf',
+ 'sgm' => 'text/sgml',
+ 'sgml' => 'text/sgml',
+ 'svg' => 'image/svg+xml',
+ 'swf' => 'application/x-shockwave-flash',
+ 'tar' => 'application/x-tar',
+ 'tif' => 'image/tiff',
+ 'tiff' => 'image/tiff',
+ 'torrent' => 'application/x-bittorrent',
+ 'ttf' => 'application/x-font-ttf',
+ 'txt' => 'text/plain',
+ 'wav' => 'audio/x-wav',
+ 'webm' => 'video/webm',
+ 'webp' => 'image/webp',
+ 'wma' => 'audio/x-ms-wma',
+ 'wmv' => 'video/x-ms-wmv',
+ 'woff' => 'application/x-font-woff',
+ 'wsdl' => 'application/wsdl+xml',
+ 'xbm' => 'image/x-xbitmap',
+ 'xls' => 'application/vnd.ms-excel',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xml' => 'application/xml',
+ 'xpm' => 'image/x-xpixmap',
+ 'xwd' => 'image/x-xwindowdump',
+ 'yaml' => 'text/yaml',
+ 'yml' => 'text/yaml',
+ 'zip' => 'application/zip',
+ ];
+
+ /**
+ * Determines the mimetype of a file by looking at its extension.
+ */
+ public static function fromFilename(string $filename): ?string
+ {
+ return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
+ }
+
+ /**
+ * Maps a file extensions to a mimetype.
+ *
+ * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
+ */
+ public static function fromExtension(string $extension): ?string
+ {
+ return self::MIME_TYPES[strtolower($extension)] ?? null;
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php
index c0fd584f7..f76d7c614 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php
@@ -1,4 +1,7 @@
boundary = $boundary ?: sha1(uniqid('', true));
$this->stream = $this->createStream($elements);
}
- /**
- * Get the boundary
- *
- * @return string
- */
- public function getBoundary()
+ public function getBoundary(): string
{
return $this->boundary;
}
- public function isWritable()
+ public function isWritable(): bool
{
return false;
}
/**
* Get the headers needed before transferring the content of a POST file
+ *
+ * @param array $headers
*/
- private function getHeaders(array $headers)
+ private function getHeaders(array $headers): string
{
$str = '';
foreach ($headers as $key => $value) {
@@ -62,7 +63,7 @@ private function getHeaders(array $headers)
/**
* Create the aggregate stream that will be used to upload the POST data
*/
- protected function createStream(array $elements)
+ protected function createStream(array $elements = []): StreamInterface
{
$stream = new AppendStream();
@@ -71,12 +72,12 @@ protected function createStream(array $elements)
}
// Add the trailing boundary with CRLF
- $stream->addStream(stream_for("--{$this->boundary}--\r\n"));
+ $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n"));
return $stream;
}
- private function addElement(AppendStream $stream, array $element)
+ private function addElement(AppendStream $stream, array $element): void
{
foreach (['contents', 'name'] as $key) {
if (!array_key_exists($key, $element)) {
@@ -84,7 +85,7 @@ private function addElement(AppendStream $stream, array $element)
}
}
- $element['contents'] = stream_for($element['contents']);
+ $element['contents'] = Utils::streamFor($element['contents']);
if (empty($element['filename'])) {
$uri = $element['contents']->getMetadata('uri');
@@ -93,30 +94,29 @@ private function addElement(AppendStream $stream, array $element)
}
}
- list($body, $headers) = $this->createElement(
+ [$body, $headers] = $this->createElement(
$element['name'],
$element['contents'],
- isset($element['filename']) ? $element['filename'] : null,
- isset($element['headers']) ? $element['headers'] : []
+ $element['filename'] ?? null,
+ $element['headers'] ?? []
);
- $stream->addStream(stream_for($this->getHeaders($headers)));
+ $stream->addStream(Utils::streamFor($this->getHeaders($headers)));
$stream->addStream($body);
- $stream->addStream(stream_for("\r\n"));
+ $stream->addStream(Utils::streamFor("\r\n"));
}
- /**
- * @return array
- */
- private function createElement($name, StreamInterface $stream, $filename, array $headers)
+ private function createElement(string $name, StreamInterface $stream, ?string $filename, array $headers): array
{
// Set a default content-disposition header if one was no provided
$disposition = $this->getHeader($headers, 'content-disposition');
if (!$disposition) {
$headers['Content-Disposition'] = ($filename === '0' || $filename)
- ? sprintf('form-data; name="%s"; filename="%s"',
+ ? sprintf(
+ 'form-data; name="%s"; filename="%s"',
$name,
- basename($filename))
+ basename($filename)
+ )
: "form-data; name=\"{$name}\"";
}
@@ -131,7 +131,7 @@ private function createElement($name, StreamInterface $stream, $filename, array
// Set a default Content-Type if one was not supplied
$type = $this->getHeader($headers, 'content-type');
if (!$type && ($filename === '0' || $filename)) {
- if ($type = mimetype_from_filename($filename)) {
+ if ($type = MimeType::fromFilename($filename)) {
$headers['Content-Type'] = $type;
}
}
@@ -139,7 +139,7 @@ private function createElement($name, StreamInterface $stream, $filename, array
return [$stream, $headers];
}
- private function getHeader(array $headers, $key)
+ private function getHeader(array $headers, string $key)
{
$lowercaseHeader = strtolower($key);
foreach ($headers as $k => $v) {
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php
index 233221805..99e25b9e3 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php
@@ -1,21 +1,24 @@
source = $source;
- $this->size = isset($options['size']) ? $options['size'] : null;
- $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];
+ $this->size = $options['size'] ?? null;
+ $this->metadata = $options['metadata'] ?? [];
$this->buffer = new BufferStream();
}
- public function __toString()
+ public function __toString(): string
{
try {
- return copy_to_string($this);
- } catch (\Exception $e) {
+ return Utils::copyToString($this);
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
- public function close()
+ public function close(): void
{
$this->detach();
}
public function detach()
{
- $this->tellPos = false;
+ $this->tellPos = 0;
$this->source = null;
+
+ return null;
}
- public function getSize()
+ public function getSize(): ?int
{
return $this->size;
}
- public function tell()
+ public function tell(): int
{
return $this->tellPos;
}
- public function eof()
+ public function eof(): bool
{
- return !$this->source;
+ return $this->source === null;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return false;
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
throw new \RuntimeException('Cannot seek a PumpStream');
}
- public function isWritable()
+ public function isWritable(): bool
{
return false;
}
- public function write($string)
+ public function write($string): int
{
throw new \RuntimeException('Cannot write to a PumpStream');
}
- public function isReadable()
+ public function isReadable(): bool
{
return true;
}
- public function read($length)
+ public function read($length): string
{
$data = $this->buffer->read($length);
$readLen = strlen($data);
@@ -129,7 +138,7 @@ public function read($length)
return $data;
}
- public function getContents()
+ public function getContents(): string
{
$result = '';
while (!$this->eof()) {
@@ -139,16 +148,21 @@ public function getContents()
return $result;
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
if (!$key) {
return $this->metadata;
}
- return isset($this->metadata[$key]) ? $this->metadata[$key] : null;
+ return $this->metadata[$key] ?? null;
}
- private function pump($length)
+ private function pump(int $length): void
{
if ($this->source) {
do {
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Query.php b/tests/integration/vendor/guzzlehttp/psr7/src/Query.php
new file mode 100644
index 000000000..4fd0ca96d
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Query.php
@@ -0,0 +1,113 @@
+ '1', 'foo[b]' => '2'])`.
+ *
+ * @param string $str Query string to parse
+ * @param int|bool $urlEncoding How the query string is encoded
+ */
+ public static function parse(string $str, $urlEncoding = true): array
+ {
+ $result = [];
+
+ if ($str === '') {
+ return $result;
+ }
+
+ if ($urlEncoding === true) {
+ $decoder = function ($value) {
+ return rawurldecode(str_replace('+', ' ', (string) $value));
+ };
+ } elseif ($urlEncoding === PHP_QUERY_RFC3986) {
+ $decoder = 'rawurldecode';
+ } elseif ($urlEncoding === PHP_QUERY_RFC1738) {
+ $decoder = 'urldecode';
+ } else {
+ $decoder = function ($str) {
+ return $str;
+ };
+ }
+
+ foreach (explode('&', $str) as $kvp) {
+ $parts = explode('=', $kvp, 2);
+ $key = $decoder($parts[0]);
+ $value = isset($parts[1]) ? $decoder($parts[1]) : null;
+ if (!isset($result[$key])) {
+ $result[$key] = $value;
+ } else {
+ if (!is_array($result[$key])) {
+ $result[$key] = [$result[$key]];
+ }
+ $result[$key][] = $value;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Build a query string from an array of key value pairs.
+ *
+ * This function can use the return value of `parse()` to build a query
+ * string. This function does not modify the provided keys when an array is
+ * encountered (like `http_build_query()` would).
+ *
+ * @param array $params Query string parameters.
+ * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
+ * to encode using RFC3986, or PHP_QUERY_RFC1738
+ * to encode using RFC1738.
+ */
+ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string
+ {
+ if (!$params) {
+ return '';
+ }
+
+ if ($encoding === false) {
+ $encoder = function (string $str): string {
+ return $str;
+ };
+ } elseif ($encoding === PHP_QUERY_RFC3986) {
+ $encoder = 'rawurlencode';
+ } elseif ($encoding === PHP_QUERY_RFC1738) {
+ $encoder = 'urlencode';
+ } else {
+ throw new \InvalidArgumentException('Invalid type');
+ }
+
+ $qs = '';
+ foreach ($params as $k => $v) {
+ $k = $encoder((string) $k);
+ if (!is_array($v)) {
+ $qs .= $k;
+ $v = is_bool($v) ? (int) $v : $v;
+ if ($v !== null) {
+ $qs .= '=' . $encoder((string) $v);
+ }
+ $qs .= '&';
+ } else {
+ foreach ($v as $vv) {
+ $qs .= $k;
+ $vv = is_bool($vv) ? (int) $vv : $vv;
+ if ($vv !== null) {
+ $qs .= '=' . $encoder((string) $vv);
+ }
+ $qs .= '&';
+ }
+ }
+ }
+
+ return $qs ? (string) substr($qs, 0, -1) : '';
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Request.php b/tests/integration/vendor/guzzlehttp/psr7/src/Request.php
index 000664240..b17af66a2 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/Request.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Request.php
@@ -1,4 +1,7 @@
$headers Request headers
+ * @param string|resource|StreamInterface|null $body Request body
* @param string $version Protocol version
*/
public function __construct(
- $method,
+ string $method,
$uri,
array $headers = [],
$body = null,
- $version = '1.1'
+ string $version = '1.1'
) {
+ $this->assertMethod($method);
if (!($uri instanceof UriInterface)) {
$uri = new Uri($uri);
}
@@ -50,18 +54,18 @@ public function __construct(
}
if ($body !== '' && $body !== null) {
- $this->stream = stream_for($body);
+ $this->stream = Utils::streamFor($body);
}
}
- public function getRequestTarget()
+ public function getRequestTarget(): string
{
if ($this->requestTarget !== null) {
return $this->requestTarget;
}
$target = $this->uri->getPath();
- if ($target == '') {
+ if ($target === '') {
$target = '/';
}
if ($this->uri->getQuery() != '') {
@@ -71,7 +75,7 @@ public function getRequestTarget()
return $target;
}
- public function withRequestTarget($requestTarget)
+ public function withRequestTarget($requestTarget): RequestInterface
{
if (preg_match('#\s#', $requestTarget)) {
throw new InvalidArgumentException(
@@ -84,24 +88,25 @@ public function withRequestTarget($requestTarget)
return $new;
}
- public function getMethod()
+ public function getMethod(): string
{
return $this->method;
}
- public function withMethod($method)
+ public function withMethod($method): RequestInterface
{
+ $this->assertMethod($method);
$new = clone $this;
$new->method = strtoupper($method);
return $new;
}
- public function getUri()
+ public function getUri(): UriInterface
{
return $this->uri;
}
- public function withUri(UriInterface $uri, $preserveHost = false)
+ public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
{
if ($uri === $this->uri) {
return $this;
@@ -117,7 +122,7 @@ public function withUri(UriInterface $uri, $preserveHost = false)
return $new;
}
- private function updateHostFromUri()
+ private function updateHostFromUri(): void
{
$host = $this->uri->getHost();
@@ -139,4 +144,14 @@ private function updateHostFromUri()
// See: http://tools.ietf.org/html/rfc7230#section-5.4
$this->headers = [$header => [$host]] + $this->headers;
}
+
+ /**
+ * @param mixed $method
+ */
+ private function assertMethod($method): void
+ {
+ if (!is_string($method) || $method === '') {
+ throw new InvalidArgumentException('Method must be a non-empty string.');
+ }
+ }
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Response.php b/tests/integration/vendor/guzzlehttp/psr7/src/Response.php
index 6e72c06b8..4c6ee6f03 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/Response.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Response.php
@@ -1,4 +1,7 @@
'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
@@ -33,6 +36,7 @@ class Response implements ResponseInterface
305 => 'Use Proxy',
306 => 'Switch Proxy',
307 => 'Temporary Redirect',
+ 308 => 'Permanent Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
@@ -70,42 +74,41 @@ class Response implements ResponseInterface
506 => 'Variant Also Negotiates',
507 => 'Insufficient Storage',
508 => 'Loop Detected',
+ 510 => 'Not Extended',
511 => 'Network Authentication Required',
];
/** @var string */
- private $reasonPhrase = '';
+ private $reasonPhrase;
/** @var int */
- private $statusCode = 200;
+ private $statusCode;
/**
* @param int $status Status code
- * @param array $headers Response headers
- * @param string|null|resource|StreamInterface $body Response body
+ * @param array $headers Response headers
+ * @param string|resource|StreamInterface|null $body Response body
* @param string $version Protocol version
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
*/
public function __construct(
- $status = 200,
+ int $status = 200,
array $headers = [],
$body = null,
- $version = '1.1',
- $reason = null
+ string $version = '1.1',
+ string $reason = null
) {
- if (filter_var($status, FILTER_VALIDATE_INT) === false) {
- throw new \InvalidArgumentException('Status code must be an integer value.');
- }
+ $this->assertStatusCodeRange($status);
- $this->statusCode = (int) $status;
+ $this->statusCode = $status;
if ($body !== '' && $body !== null) {
- $this->stream = stream_for($body);
+ $this->stream = Utils::streamFor($body);
}
$this->setHeaders($headers);
- if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
- $this->reasonPhrase = self::$phrases[$this->statusCode];
+ if ($reason == '' && isset(self::PHRASES[$this->statusCode])) {
+ $this->reasonPhrase = self::PHRASES[$this->statusCode];
} else {
$this->reasonPhrase = (string) $reason;
}
@@ -113,24 +116,45 @@ public function __construct(
$this->protocol = $version;
}
- public function getStatusCode()
+ public function getStatusCode(): int
{
return $this->statusCode;
}
- public function getReasonPhrase()
+ public function getReasonPhrase(): string
{
return $this->reasonPhrase;
}
- public function withStatus($code, $reasonPhrase = '')
+ public function withStatus($code, $reasonPhrase = ''): ResponseInterface
{
+ $this->assertStatusCodeIsInteger($code);
+ $code = (int) $code;
+ $this->assertStatusCodeRange($code);
+
$new = clone $this;
- $new->statusCode = (int) $code;
- if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
- $reasonPhrase = self::$phrases[$new->statusCode];
+ $new->statusCode = $code;
+ if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) {
+ $reasonPhrase = self::PHRASES[$new->statusCode];
}
- $new->reasonPhrase = $reasonPhrase;
+ $new->reasonPhrase = (string) $reasonPhrase;
return $new;
}
+
+ /**
+ * @param mixed $statusCode
+ */
+ private function assertStatusCodeIsInteger($statusCode): void
+ {
+ if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) {
+ throw new \InvalidArgumentException('Status code must be an integer value.');
+ }
+ }
+
+ private function assertStatusCodeRange(int $statusCode): void
+ {
+ if ($statusCode < 100 || $statusCode >= 600) {
+ throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.');
+ }
+ }
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php b/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php
index 505e4742b..30224018d 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php
@@ -1,18 +1,23 @@
@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
- const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)";
+ public const HEADER_REGEX = "(^([^()<>@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
+ public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)";
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php b/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php
index 99f453a51..6ae3f9beb 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php
@@ -1,12 +1,14 @@
$headers Request headers
+ * @param string|resource|StreamInterface|null $body Request body
* @param string $version Protocol version
* @param array $serverParams Typically the $_SERVER superglobal
*/
public function __construct(
- $method,
+ string $method,
$uri,
array $headers = [],
$body = null,
- $version = '1.1',
+ string $version = '1.1',
array $serverParams = []
) {
$this->serverParams = $serverParams;
@@ -79,10 +81,10 @@ public function __construct(
* Return an UploadedFile instance array.
*
* @param array $files A array which respect $_FILES structure
+ *
* @throws InvalidArgumentException for unrecognized values
- * @return array
*/
- public static function normalizeFiles(array $files)
+ public static function normalizeFiles(array $files): array
{
$normalized = [];
@@ -109,7 +111,8 @@ public static function normalizeFiles(array $files)
* delegate to normalizeNestedFileSpec() and return that return value.
*
* @param array $value $_FILES struct
- * @return array|UploadedFileInterface
+ *
+ * @return UploadedFileInterface|UploadedFileInterface[]
*/
private static function createUploadedFileFromSpec(array $value)
{
@@ -132,10 +135,9 @@ private static function createUploadedFileFromSpec(array $value)
* Loops through all nested files and returns a normalized array of
* UploadedFileInterface instances.
*
- * @param array $files
* @return UploadedFileInterface[]
*/
- private static function normalizeNestedFileSpec(array $files = [])
+ private static function normalizeNestedFileSpec(array $files = []): array
{
$normalizedFiles = [];
@@ -160,15 +162,13 @@ private static function normalizeNestedFileSpec(array $files = [])
* $_COOKIE
* $_FILES
* $_SERVER
- *
- * @return ServerRequestInterface
*/
- public static function fromGlobals()
+ public static function fromGlobals(): ServerRequestInterface
{
- $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
+ $method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
$headers = getallheaders();
$uri = self::getUriFromGlobals();
- $body = new LazyOpenStream('php://input', 'r+');
+ $body = new CachingStream(new LazyOpenStream('php://input', 'r+'));
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
$serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
@@ -180,26 +180,24 @@ public static function fromGlobals()
->withUploadedFiles(self::normalizeFiles($_FILES));
}
- private static function extractHostAndPortFromAuthority($authority)
+ private static function extractHostAndPortFromAuthority(string $authority): array
{
- $uri = 'http://'.$authority;
+ $uri = 'http://' . $authority;
$parts = parse_url($uri);
if (false === $parts) {
return [null, null];
}
- $host = isset($parts['host']) ? $parts['host'] : null;
- $port = isset($parts['port']) ? $parts['port'] : null;
+ $host = $parts['host'] ?? null;
+ $port = $parts['port'] ?? null;
return [$host, $port];
}
/**
* Get a Uri populated with values from $_SERVER.
- *
- * @return UriInterface
*/
- public static function getUriFromGlobals()
+ public static function getUriFromGlobals(): UriInterface
{
$uri = new Uri('');
@@ -207,7 +205,7 @@ public static function getUriFromGlobals()
$hasPort = false;
if (isset($_SERVER['HTTP_HOST'])) {
- list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']);
+ [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']);
if ($host !== null) {
$uri = $uri->withHost($host);
}
@@ -243,27 +241,17 @@ public static function getUriFromGlobals()
return $uri;
}
-
- /**
- * {@inheritdoc}
- */
- public function getServerParams()
+ public function getServerParams(): array
{
return $this->serverParams;
}
- /**
- * {@inheritdoc}
- */
- public function getUploadedFiles()
+ public function getUploadedFiles(): array
{
return $this->uploadedFiles;
}
- /**
- * {@inheritdoc}
- */
- public function withUploadedFiles(array $uploadedFiles)
+ public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface
{
$new = clone $this;
$new->uploadedFiles = $uploadedFiles;
@@ -271,18 +259,12 @@ public function withUploadedFiles(array $uploadedFiles)
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function getCookieParams()
+ public function getCookieParams(): array
{
return $this->cookieParams;
}
- /**
- * {@inheritdoc}
- */
- public function withCookieParams(array $cookies)
+ public function withCookieParams(array $cookies): ServerRequestInterface
{
$new = clone $this;
$new->cookieParams = $cookies;
@@ -290,18 +272,12 @@ public function withCookieParams(array $cookies)
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function getQueryParams()
+ public function getQueryParams(): array
{
return $this->queryParams;
}
- /**
- * {@inheritdoc}
- */
- public function withQueryParams(array $query)
+ public function withQueryParams(array $query): ServerRequestInterface
{
$new = clone $this;
$new->queryParams = $query;
@@ -311,16 +287,15 @@ public function withQueryParams(array $query)
/**
* {@inheritdoc}
+ *
+ * @return array|object|null
*/
public function getParsedBody()
{
return $this->parsedBody;
}
- /**
- * {@inheritdoc}
- */
- public function withParsedBody($data)
+ public function withParsedBody($data): ServerRequestInterface
{
$new = clone $this;
$new->parsedBody = $data;
@@ -328,16 +303,15 @@ public function withParsedBody($data)
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function getAttributes()
+ public function getAttributes(): array
{
return $this->attributes;
}
/**
* {@inheritdoc}
+ *
+ * @return mixed
*/
public function getAttribute($attribute, $default = null)
{
@@ -348,10 +322,7 @@ public function getAttribute($attribute, $default = null)
return $this->attributes[$attribute];
}
- /**
- * {@inheritdoc}
- */
- public function withAttribute($attribute, $value)
+ public function withAttribute($attribute, $value): ServerRequestInterface
{
$new = clone $this;
$new->attributes[$attribute] = $value;
@@ -359,10 +330,7 @@ public function withAttribute($attribute, $value)
return $new;
}
- /**
- * {@inheritdoc}
- */
- public function withoutAttribute($attribute)
+ public function withoutAttribute($attribute): ServerRequestInterface
{
if (false === array_key_exists($attribute, $this->attributes)) {
return $this;
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php b/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php
index 111795eb0..d389427c6 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php
@@ -1,39 +1,38 @@
[
- 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
- 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true,
- 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true,
- 'x+t' => true, 'c+t' => true, 'a+' => true, 'rb+' => true,
- ],
- 'write' => [
- 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true,
- 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, 'rb+' => true,
- 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true,
- 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true
- ]
- ];
-
/**
* This constructor accepts an associative array of options.
*
@@ -43,12 +42,12 @@ class Stream implements StreamInterface
* - metadata: (array) Any additional metadata to return when the metadata
* of the stream is accessed.
*
- * @param resource $stream Stream resource to wrap.
- * @param array $options Associative array of options.
+ * @param resource $stream Stream resource to wrap.
+ * @param array{size?: int, metadata?: array} $options Associative array of options.
*
* @throws \InvalidArgumentException if the stream is not a stream resource
*/
- public function __construct($stream, $options = [])
+ public function __construct($stream, array $options = [])
{
if (!is_resource($stream)) {
throw new \InvalidArgumentException('Stream must be a resource');
@@ -58,15 +57,12 @@ public function __construct($stream, $options = [])
$this->size = $options['size'];
}
- $this->customMetadata = isset($options['metadata'])
- ? $options['metadata']
- : [];
-
+ $this->customMetadata = $options['metadata'] ?? [];
$this->stream = $stream;
$meta = stream_get_meta_data($this->stream);
$this->seekable = $meta['seekable'];
- $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]);
- $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]);
+ $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']);
+ $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']);
$this->uri = $this->getMetadata('uri');
}
@@ -78,17 +74,23 @@ public function __destruct()
$this->close();
}
- public function __toString()
+ public function __toString(): string
{
try {
- $this->seek(0);
- return (string) stream_get_contents($this->stream);
- } catch (\Exception $e) {
+ if ($this->isSeekable()) {
+ $this->seek(0);
+ }
+ return $this->getContents();
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
- public function getContents()
+ public function getContents(): string
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -103,7 +105,7 @@ public function getContents()
return $contents;
}
- public function close()
+ public function close(): void
{
if (isset($this->stream)) {
if (is_resource($this->stream)) {
@@ -127,7 +129,7 @@ public function detach()
return $result;
}
- public function getSize()
+ public function getSize(): ?int
{
if ($this->size !== null) {
return $this->size;
@@ -143,7 +145,7 @@ public function getSize()
}
$stats = fstat($this->stream);
- if (isset($stats['size'])) {
+ if (is_array($stats) && isset($stats['size'])) {
$this->size = $stats['size'];
return $this->size;
}
@@ -151,22 +153,22 @@ public function getSize()
return null;
}
- public function isReadable()
+ public function isReadable(): bool
{
return $this->readable;
}
- public function isWritable()
+ public function isWritable(): bool
{
return $this->writable;
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return $this->seekable;
}
- public function eof()
+ public function eof(): bool
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -175,7 +177,7 @@ public function eof()
return feof($this->stream);
}
- public function tell()
+ public function tell(): int
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -190,13 +192,15 @@ public function tell()
return $result;
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
+ $whence = (int) $whence;
+
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
}
@@ -209,7 +213,7 @@ public function seek($offset, $whence = SEEK_SET)
}
}
- public function read($length)
+ public function read($length): string
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -233,7 +237,7 @@ public function read($length)
return $string;
}
- public function write($string)
+ public function write($string): int
{
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
@@ -253,6 +257,11 @@ public function write($string)
return $result;
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
if (!isset($this->stream)) {
@@ -265,6 +274,6 @@ public function getMetadata($key = null)
$meta = stream_get_meta_data($this->stream);
- return isset($meta[$key]) ? $meta[$key] : null;
+ return $meta[$key] ?? null;
}
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
index daec6f52e..56d4104d4 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
@@ -1,11 +1,15 @@
stream = $this->createStream();
return $this->stream;
}
@@ -35,47 +37,52 @@ public function __get($name)
throw new \UnexpectedValueException("$name not found on class");
}
- public function __toString()
+ public function __toString(): string
{
try {
if ($this->isSeekable()) {
$this->seek(0);
}
return $this->getContents();
- } catch (\Exception $e) {
- // Really, PHP? https://bugs.php.net/bug.php?id=53648
- trigger_error('StreamDecorator::__toString exception: '
- . (string) $e, E_USER_ERROR);
+ } catch (\Throwable $e) {
+ if (\PHP_VERSION_ID >= 70400) {
+ throw $e;
+ }
+ trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
return '';
}
}
- public function getContents()
+ public function getContents(): string
{
- return copy_to_string($this);
+ return Utils::copyToString($this);
}
/**
* Allow decorators to implement custom methods
*
- * @param string $method Missing method name
- * @param array $args Method arguments
- *
* @return mixed
*/
- public function __call($method, array $args)
+ public function __call(string $method, array $args)
{
- $result = call_user_func_array([$this->stream, $method], $args);
+ /** @var callable $callable */
+ $callable = [$this->stream, $method];
+ $result = call_user_func_array($callable, $args);
// Always return the wrapped object if the result is a return $this
return $result === $this->stream ? $this : $result;
}
- public function close()
+ public function close(): void
{
$this->stream->close();
}
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
public function getMetadata($key = null)
{
return $this->stream->getMetadata($key);
@@ -86,52 +93,52 @@ public function detach()
return $this->stream->detach();
}
- public function getSize()
+ public function getSize(): ?int
{
return $this->stream->getSize();
}
- public function eof()
+ public function eof(): bool
{
return $this->stream->eof();
}
- public function tell()
+ public function tell(): int
{
return $this->stream->tell();
}
- public function isReadable()
+ public function isReadable(): bool
{
return $this->stream->isReadable();
}
- public function isWritable()
+ public function isWritable(): bool
{
return $this->stream->isWritable();
}
- public function isSeekable()
+ public function isSeekable(): bool
{
return $this->stream->isSeekable();
}
- public function rewind()
+ public function rewind(): void
{
$this->seek(0);
}
- public function seek($offset, $whence = SEEK_SET)
+ public function seek($offset, $whence = SEEK_SET): void
{
$this->stream->seek($offset, $whence);
}
- public function read($length)
+ public function read($length): string
{
return $this->stream->read($length);
}
- public function write($string)
+ public function write($string): int
{
return $this->stream->write($string);
}
@@ -139,10 +146,9 @@ public function write($string)
/**
* Implement in subclasses to dynamically create streams when requested.
*
- * @return StreamInterface
* @throws \BadMethodCallException
*/
- protected function createStream()
+ protected function createStream(): StreamInterface
{
throw new \BadMethodCallException('Not implemented');
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php
index 0f3a2856a..2a9346403 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php
@@ -1,12 +1,17 @@
context);
@@ -79,41 +83,48 @@ public function stream_open($path, $mode, $options, &$opened_path)
return true;
}
- public function stream_read($count)
+ public function stream_read(int $count): string
{
return $this->stream->read($count);
}
- public function stream_write($data)
+ public function stream_write(string $data): int
{
- return (int) $this->stream->write($data);
+ return $this->stream->write($data);
}
- public function stream_tell()
+ public function stream_tell(): int
{
return $this->stream->tell();
}
- public function stream_eof()
+ public function stream_eof(): bool
{
return $this->stream->eof();
}
- public function stream_seek($offset, $whence)
+ public function stream_seek(int $offset, int $whence): bool
{
$this->stream->seek($offset, $whence);
return true;
}
- public function stream_cast($cast_as)
+ /**
+ * @return resource|false
+ */
+ public function stream_cast(int $cast_as)
{
$stream = clone($this->stream);
+ $resource = $stream->detach();
- return $stream->detach();
+ return $resource ?? false;
}
- public function stream_stat()
+ /**
+ * @return array
+ */
+ public function stream_stat(): array
{
static $modeMap = [
'r' => 33060,
@@ -140,7 +151,10 @@ public function stream_stat()
];
}
- public function url_stat($path, $flags)
+ /**
+ * @return array
+ */
+ public function url_stat(string $path, int $flags): array
{
return [
'dev' => 0,
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/UploadedFile.php b/tests/integration/vendor/guzzlehttp/psr7/src/UploadedFile.php
index e62bd5c80..b1521bcf8 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/UploadedFile.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/UploadedFile.php
@@ -1,4 +1,7 @@
setError($errorStatus);
- $this->setSize($size);
- $this->setClientFilename($clientFilename);
- $this->setClientMediaType($clientMediaType);
+ $this->size = $size;
+ $this->clientFilename = $clientFilename;
+ $this->clientMediaType = $clientMediaType;
if ($this->isOk()) {
$this->setStreamOrFile($streamOrFile);
@@ -84,10 +80,11 @@ public function __construct(
/**
* Depending on the value set file or stream variable
*
- * @param mixed $streamOrFile
+ * @param StreamInterface|string|resource $streamOrFile
+ *
* @throws InvalidArgumentException
*/
- private function setStreamOrFile($streamOrFile)
+ private function setStreamOrFile($streamOrFile): void
{
if (is_string($streamOrFile)) {
$this->file = $streamOrFile;
@@ -103,18 +100,11 @@ private function setStreamOrFile($streamOrFile)
}
/**
- * @param int $error
* @throws InvalidArgumentException
*/
- private function setError($error)
+ private function setError(int $error): void
{
- if (false === is_int($error)) {
- throw new InvalidArgumentException(
- 'Upload file error status must be an integer'
- );
- }
-
- if (false === in_array($error, UploadedFile::$errors)) {
+ if (false === in_array($error, UploadedFile::ERRORS, true)) {
throw new InvalidArgumentException(
'Invalid error status for UploadedFile'
);
@@ -123,83 +113,20 @@ private function setError($error)
$this->error = $error;
}
- /**
- * @param int $size
- * @throws InvalidArgumentException
- */
- private function setSize($size)
- {
- if (false === is_int($size)) {
- throw new InvalidArgumentException(
- 'Upload file size must be an integer'
- );
- }
-
- $this->size = $size;
- }
-
- /**
- * @param mixed $param
- * @return boolean
- */
- private function isStringOrNull($param)
- {
- return in_array(gettype($param), ['string', 'NULL']);
- }
-
- /**
- * @param mixed $param
- * @return boolean
- */
- private function isStringNotEmpty($param)
+ private function isStringNotEmpty($param): bool
{
return is_string($param) && false === empty($param);
}
- /**
- * @param string|null $clientFilename
- * @throws InvalidArgumentException
- */
- private function setClientFilename($clientFilename)
- {
- if (false === $this->isStringOrNull($clientFilename)) {
- throw new InvalidArgumentException(
- 'Upload file client filename must be a string or null'
- );
- }
-
- $this->clientFilename = $clientFilename;
- }
-
- /**
- * @param string|null $clientMediaType
- * @throws InvalidArgumentException
- */
- private function setClientMediaType($clientMediaType)
- {
- if (false === $this->isStringOrNull($clientMediaType)) {
- throw new InvalidArgumentException(
- 'Upload file client media type must be a string or null'
- );
- }
-
- $this->clientMediaType = $clientMediaType;
- }
-
/**
* Return true if there is no upload error
- *
- * @return boolean
*/
- private function isOk()
+ private function isOk(): bool
{
return $this->error === UPLOAD_ERR_OK;
}
- /**
- * @return boolean
- */
- public function isMoved()
+ public function isMoved(): bool
{
return $this->moved;
}
@@ -207,7 +134,7 @@ public function isMoved()
/**
* @throws RuntimeException if is moved or not ok
*/
- private function validateActive()
+ private function validateActive(): void
{
if (false === $this->isOk()) {
throw new RuntimeException('Cannot retrieve stream due to upload error');
@@ -218,11 +145,7 @@ private function validateActive()
}
}
- /**
- * {@inheritdoc}
- * @throws RuntimeException if the upload was not successful.
- */
- public function getStream()
+ public function getStream(): StreamInterface
{
$this->validateActive();
@@ -230,21 +153,13 @@ public function getStream()
return $this->stream;
}
- return new LazyOpenStream($this->file, 'r+');
+ /** @var string $file */
+ $file = $this->file;
+
+ return new LazyOpenStream($file, 'r+');
}
- /**
- * {@inheritdoc}
- *
- * @see http://php.net/is_uploaded_file
- * @see http://php.net/move_uploaded_file
- * @param string $targetPath Path to which to move the uploaded file.
- * @throws RuntimeException if the upload was not successful.
- * @throws InvalidArgumentException if the $path specified is invalid.
- * @throws RuntimeException on any error during the move operation, or on
- * the second or subsequent call to the method.
- */
- public function moveTo($targetPath)
+ public function moveTo($targetPath): void
{
$this->validateActive();
@@ -255,11 +170,11 @@ public function moveTo($targetPath)
}
if ($this->file) {
- $this->moved = php_sapi_name() == 'cli'
+ $this->moved = PHP_SAPI === 'cli'
? rename($this->file, $targetPath)
: move_uploaded_file($this->file, $targetPath);
} else {
- copy_to_stream(
+ Utils::copyToStream(
$this->getStream(),
new LazyOpenStream($targetPath, 'w')
);
@@ -274,42 +189,22 @@ public function moveTo($targetPath)
}
}
- /**
- * {@inheritdoc}
- *
- * @return int|null The file size in bytes or null if unknown.
- */
- public function getSize()
+ public function getSize(): ?int
{
return $this->size;
}
- /**
- * {@inheritdoc}
- *
- * @see http://php.net/manual/en/features.file-upload.errors.php
- * @return int One of PHP's UPLOAD_ERR_XXX constants.
- */
- public function getError()
+ public function getError(): int
{
return $this->error;
}
- /**
- * {@inheritdoc}
- *
- * @return string|null The filename sent by the client or null if none
- * was provided.
- */
- public function getClientFilename()
+ public function getClientFilename(): ?string
{
return $this->clientFilename;
}
- /**
- * {@inheritdoc}
- */
- public function getClientMediaType()
+ public function getClientMediaType(): ?string
{
return $this->clientMediaType;
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php b/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php
index 36219568c..3898f7830 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php
@@ -1,6 +1,10 @@
80,
'https' => 443,
'ftp' => 21,
@@ -34,9 +38,20 @@ class Uri implements UriInterface
'ldap' => 389,
];
- private static $charUnreserved = 'a-zA-Z0-9_\-\.~';
- private static $charSubDelims = '!\$&\'\(\)\*\+,;=';
- private static $replaceQuery = ['=' => '%3D', '&' => '%26'];
+ /**
+ * Unreserved characters for use in a regex.
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-2.3
+ */
+ private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
+
+ /**
+ * Sub-delims for use in a regex.
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-2.2
+ */
+ private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
+ private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26'];
/** @var string Uri scheme. */
private $scheme = '';
@@ -59,30 +74,75 @@ class Uri implements UriInterface
/** @var string Uri fragment. */
private $fragment = '';
- /**
- * @param string $uri URI to parse
- */
- public function __construct($uri = '')
+ /** @var string|null String representation */
+ private $composedComponents;
+
+ public function __construct(string $uri = '')
{
- // weak type check to also accept null until we can add scalar type hints
- if ($uri != '') {
- $parts = parse_url($uri);
+ if ($uri !== '') {
+ $parts = self::parse($uri);
if ($parts === false) {
- throw new \InvalidArgumentException("Unable to parse URI: $uri");
+ throw new MalformedUriException("Unable to parse URI: $uri");
}
$this->applyParts($parts);
}
}
+ /**
+ * UTF-8 aware \parse_url() replacement.
+ *
+ * The internal function produces broken output for non ASCII domain names
+ * (IDN) when used with locales other than "C".
+ *
+ * On the other hand, cURL understands IDN correctly only when UTF-8 locale
+ * is configured ("C.UTF-8", "en_US.UTF-8", etc.).
+ *
+ * @see https://bugs.php.net/bug.php?id=52923
+ * @see https://www.php.net/manual/en/function.parse-url.php#114817
+ * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING
+ *
+ * @return array|false
+ */
+ private static function parse(string $url)
+ {
+ // If IPv6
+ $prefix = '';
+ if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
+ /** @var array{0:string, 1:string, 2:string} $matches */
+ $prefix = $matches[1];
+ $url = $matches[2];
+ }
- public function __toString()
- {
- return self::composeComponents(
- $this->scheme,
- $this->getAuthority(),
- $this->path,
- $this->query,
- $this->fragment
+ /** @var string */
+ $encodedUrl = preg_replace_callback(
+ '%[^:/@?&=#]+%usD',
+ static function ($matches) {
+ return urlencode($matches[0]);
+ },
+ $url
);
+
+ $result = parse_url($prefix . $encodedUrl);
+
+ if ($result === false) {
+ return false;
+ }
+
+ return array_map('urldecode', $result);
+ }
+
+ public function __toString(): string
+ {
+ if ($this->composedComponents === null) {
+ $this->composedComponents = self::composeComponents(
+ $this->scheme,
+ $this->getAuthority(),
+ $this->path,
+ $this->query,
+ $this->fragment
+ );
+ }
+
+ return $this->composedComponents;
}
/**
@@ -101,17 +161,9 @@ public function __toString()
* `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to
* that format).
*
- * @param string $scheme
- * @param string $authority
- * @param string $path
- * @param string $query
- * @param string $fragment
- *
- * @return string
- *
* @link https://tools.ietf.org/html/rfc3986#section-5.3
*/
- public static function composeComponents($scheme, $authority, $path, $query, $fragment)
+ public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string
{
$uri = '';
@@ -142,15 +194,11 @@ public static function composeComponents($scheme, $authority, $path, $query, $fr
*
* `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used
* independently of the implementation.
- *
- * @param UriInterface $uri
- *
- * @return bool
*/
- public static function isDefaultPort(UriInterface $uri)
+ public static function isDefaultPort(UriInterface $uri): bool
{
return $uri->getPort() === null
- || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]);
+ || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]);
}
/**
@@ -163,15 +211,12 @@ public static function isDefaultPort(UriInterface $uri)
* - absolute-path references, e.g. '/path'
* - relative-path references, e.g. 'subpath'
*
- * @param UriInterface $uri
- *
- * @return bool
* @see Uri::isNetworkPathReference
* @see Uri::isAbsolutePathReference
* @see Uri::isRelativePathReference
* @link https://tools.ietf.org/html/rfc3986#section-4
*/
- public static function isAbsolute(UriInterface $uri)
+ public static function isAbsolute(UriInterface $uri): bool
{
return $uri->getScheme() !== '';
}
@@ -181,12 +226,9 @@ public static function isAbsolute(UriInterface $uri)
*
* A relative reference that begins with two slash characters is termed an network-path reference.
*
- * @param UriInterface $uri
- *
- * @return bool
* @link https://tools.ietf.org/html/rfc3986#section-4.2
*/
- public static function isNetworkPathReference(UriInterface $uri)
+ public static function isNetworkPathReference(UriInterface $uri): bool
{
return $uri->getScheme() === '' && $uri->getAuthority() !== '';
}
@@ -196,12 +238,9 @@ public static function isNetworkPathReference(UriInterface $uri)
*
* A relative reference that begins with a single slash character is termed an absolute-path reference.
*
- * @param UriInterface $uri
- *
- * @return bool
* @link https://tools.ietf.org/html/rfc3986#section-4.2
*/
- public static function isAbsolutePathReference(UriInterface $uri)
+ public static function isAbsolutePathReference(UriInterface $uri): bool
{
return $uri->getScheme() === ''
&& $uri->getAuthority() === ''
@@ -214,12 +253,9 @@ public static function isAbsolutePathReference(UriInterface $uri)
*
* A relative reference that does not begin with a slash character is termed a relative-path reference.
*
- * @param UriInterface $uri
- *
- * @return bool
* @link https://tools.ietf.org/html/rfc3986#section-4.2
*/
- public static function isRelativePathReference(UriInterface $uri)
+ public static function isRelativePathReference(UriInterface $uri): bool
{
return $uri->getScheme() === ''
&& $uri->getAuthority() === ''
@@ -236,10 +272,9 @@ public static function isRelativePathReference(UriInterface $uri)
* @param UriInterface $uri The URI to check
* @param UriInterface|null $base An optional base URI to compare against
*
- * @return bool
* @link https://tools.ietf.org/html/rfc3986#section-4.4
*/
- public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
+ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool
{
if ($base !== null) {
$uri = UriResolver::resolve($base, $uri);
@@ -253,41 +288,6 @@ public static function isSameDocumentReference(UriInterface $uri, UriInterface $
return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === '';
}
- /**
- * Removes dot segments from a path and returns the new path.
- *
- * @param string $path
- *
- * @return string
- *
- * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead.
- * @see UriResolver::removeDotSegments
- */
- public static function removeDotSegments($path)
- {
- return UriResolver::removeDotSegments($path);
- }
-
- /**
- * Converts the relative URI into a new URI that is resolved against the base URI.
- *
- * @param UriInterface $base Base URI
- * @param string|UriInterface $rel Relative URI
- *
- * @return UriInterface
- *
- * @deprecated since version 1.4. Use UriResolver::resolve instead.
- * @see UriResolver::resolve
- */
- public static function resolve(UriInterface $base, $rel)
- {
- if (!($rel instanceof UriInterface)) {
- $rel = new self($rel);
- }
-
- return UriResolver::resolve($base, $rel);
- }
-
/**
* Creates a new URI with a specific query string value removed.
*
@@ -296,10 +296,8 @@ public static function resolve(UriInterface $base, $rel)
*
* @param UriInterface $uri URI to use as a base.
* @param string $key Query string key to remove.
- *
- * @return UriInterface
*/
- public static function withoutQueryValue(UriInterface $uri, $key)
+ public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface
{
$result = self::getFilteredQueryString($uri, [$key]);
@@ -318,10 +316,8 @@ public static function withoutQueryValue(UriInterface $uri, $key)
* @param UriInterface $uri URI to use as a base.
* @param string $key Key to set.
* @param string|null $value Value to set
- *
- * @return UriInterface
*/
- public static function withQueryValue(UriInterface $uri, $key, $value)
+ public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface
{
$result = self::getFilteredQueryString($uri, [$key]);
@@ -335,17 +331,15 @@ public static function withQueryValue(UriInterface $uri, $key, $value)
*
* It has the same behavior as withQueryValue() but for an associative array of key => value.
*
- * @param UriInterface $uri URI to use as a base.
- * @param array $keyValueArray Associative array of key and values
- *
- * @return UriInterface
+ * @param UriInterface $uri URI to use as a base.
+ * @param array $keyValueArray Associative array of key and values
*/
- public static function withQueryValues(UriInterface $uri, array $keyValueArray)
+ public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface
{
$result = self::getFilteredQueryString($uri, array_keys($keyValueArray));
foreach ($keyValueArray as $key => $value) {
- $result[] = self::generateQueryString($key, $value);
+ $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null);
}
return $uri->withQuery(implode('&', $result));
@@ -354,14 +348,11 @@ public static function withQueryValues(UriInterface $uri, array $keyValueArray)
/**
* Creates a URI from a hash of `parse_url` components.
*
- * @param array $parts
- *
- * @return UriInterface
* @link http://php.net/manual/en/function.parse-url.php
*
- * @throws \InvalidArgumentException If the components do not form a valid URI.
+ * @throws MalformedUriException If the components do not form a valid URI.
*/
- public static function fromParts(array $parts)
+ public static function fromParts(array $parts): UriInterface
{
$uri = new self();
$uri->applyParts($parts);
@@ -370,12 +361,12 @@ public static function fromParts(array $parts)
return $uri;
}
- public function getScheme()
+ public function getScheme(): string
{
return $this->scheme;
}
- public function getAuthority()
+ public function getAuthority(): string
{
$authority = $this->host;
if ($this->userInfo !== '') {
@@ -389,37 +380,37 @@ public function getAuthority()
return $authority;
}
- public function getUserInfo()
+ public function getUserInfo(): string
{
return $this->userInfo;
}
- public function getHost()
+ public function getHost(): string
{
return $this->host;
}
- public function getPort()
+ public function getPort(): ?int
{
return $this->port;
}
- public function getPath()
+ public function getPath(): string
{
return $this->path;
}
- public function getQuery()
+ public function getQuery(): string
{
return $this->query;
}
- public function getFragment()
+ public function getFragment(): string
{
return $this->fragment;
}
- public function withScheme($scheme)
+ public function withScheme($scheme): UriInterface
{
$scheme = $this->filterScheme($scheme);
@@ -429,17 +420,18 @@ public function withScheme($scheme)
$new = clone $this;
$new->scheme = $scheme;
+ $new->composedComponents = null;
$new->removeDefaultPort();
$new->validateState();
return $new;
}
- public function withUserInfo($user, $password = null)
+ public function withUserInfo($user, $password = null): UriInterface
{
- $info = $user;
- if ($password != '') {
- $info .= ':' . $password;
+ $info = $this->filterUserInfoComponent($user);
+ if ($password !== null) {
+ $info .= ':' . $this->filterUserInfoComponent($password);
}
if ($this->userInfo === $info) {
@@ -448,12 +440,13 @@ public function withUserInfo($user, $password = null)
$new = clone $this;
$new->userInfo = $info;
+ $new->composedComponents = null;
$new->validateState();
return $new;
}
- public function withHost($host)
+ public function withHost($host): UriInterface
{
$host = $this->filterHost($host);
@@ -463,12 +456,13 @@ public function withHost($host)
$new = clone $this;
$new->host = $host;
+ $new->composedComponents = null;
$new->validateState();
return $new;
}
- public function withPort($port)
+ public function withPort($port): UriInterface
{
$port = $this->filterPort($port);
@@ -478,13 +472,14 @@ public function withPort($port)
$new = clone $this;
$new->port = $port;
+ $new->composedComponents = null;
$new->removeDefaultPort();
$new->validateState();
return $new;
}
- public function withPath($path)
+ public function withPath($path): UriInterface
{
$path = $this->filterPath($path);
@@ -494,12 +489,13 @@ public function withPath($path)
$new = clone $this;
$new->path = $path;
+ $new->composedComponents = null;
$new->validateState();
return $new;
}
- public function withQuery($query)
+ public function withQuery($query): UriInterface
{
$query = $this->filterQueryAndFragment($query);
@@ -509,11 +505,12 @@ public function withQuery($query)
$new = clone $this;
$new->query = $query;
+ $new->composedComponents = null;
return $new;
}
- public function withFragment($fragment)
+ public function withFragment($fragment): UriInterface
{
$fragment = $this->filterQueryAndFragment($fragment);
@@ -523,6 +520,7 @@ public function withFragment($fragment)
$new = clone $this;
$new->fragment = $fragment;
+ $new->composedComponents = null;
return $new;
}
@@ -532,12 +530,14 @@ public function withFragment($fragment)
*
* @param array $parts Array of parse_url parts to apply.
*/
- private function applyParts(array $parts)
+ private function applyParts(array $parts): void
{
$this->scheme = isset($parts['scheme'])
? $this->filterScheme($parts['scheme'])
: '';
- $this->userInfo = isset($parts['user']) ? $parts['user'] : '';
+ $this->userInfo = isset($parts['user'])
+ ? $this->filterUserInfoComponent($parts['user'])
+ : '';
$this->host = isset($parts['host'])
? $this->filterHost($parts['host'])
: '';
@@ -554,61 +554,73 @@ private function applyParts(array $parts)
? $this->filterQueryAndFragment($parts['fragment'])
: '';
if (isset($parts['pass'])) {
- $this->userInfo .= ':' . $parts['pass'];
+ $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']);
}
$this->removeDefaultPort();
}
/**
- * @param string $scheme
- *
- * @return string
+ * @param mixed $scheme
*
* @throws \InvalidArgumentException If the scheme is invalid.
*/
- private function filterScheme($scheme)
+ private function filterScheme($scheme): string
{
if (!is_string($scheme)) {
throw new \InvalidArgumentException('Scheme must be a string');
}
- return strtolower($scheme);
+ return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
}
/**
- * @param string $host
+ * @param mixed $component
*
- * @return string
+ * @throws \InvalidArgumentException If the user info is invalid.
+ */
+ private function filterUserInfoComponent($component): string
+ {
+ if (!is_string($component)) {
+ throw new \InvalidArgumentException('User info must be a string');
+ }
+
+ return preg_replace_callback(
+ '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/',
+ [$this, 'rawurlencodeMatchZero'],
+ $component
+ );
+ }
+
+ /**
+ * @param mixed $host
*
* @throws \InvalidArgumentException If the host is invalid.
*/
- private function filterHost($host)
+ private function filterHost($host): string
{
if (!is_string($host)) {
throw new \InvalidArgumentException('Host must be a string');
}
- return strtolower($host);
+ return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
}
/**
- * @param int|null $port
- *
- * @return int|null
+ * @param mixed $port
*
* @throws \InvalidArgumentException If the port is invalid.
*/
- private function filterPort($port)
+ private function filterPort($port): ?int
{
if ($port === null) {
return null;
}
$port = (int) $port;
- if (1 > $port || 0xffff < $port) {
+ if (0 > $port || 0xffff < $port) {
throw new \InvalidArgumentException(
- sprintf('Invalid port: %d. Must be between 1 and 65535', $port)
+ sprintf('Invalid port: %d. Must be between 0 and 65535', $port)
);
}
@@ -616,12 +628,11 @@ private function filterPort($port)
}
/**
- * @param UriInterface $uri
- * @param array $keys
- *
- * @return array
+ * @param string[] $keys
+ *
+ * @return string[]
*/
- private static function getFilteredQueryString(UriInterface $uri, array $keys)
+ private static function getFilteredQueryString(UriInterface $uri, array $keys): array
{
$current = $uri->getQuery();
@@ -636,27 +647,21 @@ private static function getFilteredQueryString(UriInterface $uri, array $keys)
});
}
- /**
- * @param string $key
- * @param string|null $value
- *
- * @return string
- */
- private static function generateQueryString($key, $value)
+ private static function generateQueryString(string $key, ?string $value): string
{
// Query string separators ("=", "&") within the key or value need to be encoded
// (while preventing double-encoding) before setting the query string. All other
// chars that need percent-encoding will be encoded by withQuery().
- $queryString = strtr($key, self::$replaceQuery);
+ $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT);
if ($value !== null) {
- $queryString .= '=' . strtr($value, self::$replaceQuery);
+ $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT);
}
return $queryString;
}
- private function removeDefaultPort()
+ private function removeDefaultPort(): void
{
if ($this->port !== null && self::isDefaultPort($this)) {
$this->port = null;
@@ -666,20 +671,18 @@ private function removeDefaultPort()
/**
* Filters the path of a URI
*
- * @param string $path
- *
- * @return string
+ * @param mixed $path
*
* @throws \InvalidArgumentException If the path is invalid.
*/
- private function filterPath($path)
+ private function filterPath($path): string
{
if (!is_string($path)) {
throw new \InvalidArgumentException('Path must be a string');
}
return preg_replace_callback(
- '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
+ '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$path
);
@@ -688,31 +691,29 @@ private function filterPath($path)
/**
* Filters the query string or fragment of a URI.
*
- * @param string $str
- *
- * @return string
+ * @param mixed $str
*
* @throws \InvalidArgumentException If the query or fragment is invalid.
*/
- private function filterQueryAndFragment($str)
+ private function filterQueryAndFragment($str): string
{
if (!is_string($str)) {
throw new \InvalidArgumentException('Query and fragment must be a string');
}
return preg_replace_callback(
- '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
+ '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$str
);
}
- private function rawurlencodeMatchZero(array $match)
+ private function rawurlencodeMatchZero(array $match): string
{
return rawurlencode($match[0]);
}
- private function validateState()
+ private function validateState(): void
{
if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) {
$this->host = self::HTTP_DEFAULT_HOST;
@@ -720,19 +721,13 @@ private function validateState()
if ($this->getAuthority() === '') {
if (0 === strpos($this->path, '//')) {
- throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
+ throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"');
}
if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
- throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon');
+ throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon');
}
} elseif (isset($this->path[0]) && $this->path[0] !== '/') {
- @trigger_error(
- 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' .
- 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.',
- E_USER_DEPRECATED
- );
- $this->path = '/'. $this->path;
- //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty');
+ throw new MalformedUriException('The path of a URI with an authority must start with a slash "/" or be empty');
}
}
}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php
index 384c29e50..e12971edd 100644
--- a/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php
@@ -1,4 +1,7 @@
getScheme() !== '' &&
($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')
@@ -171,6 +162,7 @@ public static function relativize(UriInterface $base, UriInterface $target)
// inherit the base query component when resolving.
if ($target->getQuery() === '') {
$segments = explode('/', $target->getPath());
+ /** @var string $lastSegment */
$lastSegment = end($segments);
return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment);
@@ -179,7 +171,7 @@ public static function relativize(UriInterface $base, UriInterface $target)
return $emptyPathUri;
}
- private static function getRelativePath(UriInterface $base, UriInterface $target)
+ private static function getRelativePath(UriInterface $base, UriInterface $target): string
{
$sourceSegments = explode('/', $base->getPath());
$targetSegments = explode('/', $target->getPath());
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php b/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php
new file mode 100644
index 000000000..6cc04ee4f
--- /dev/null
+++ b/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php
@@ -0,0 +1,412 @@
+ $v) {
+ if (!is_string($k) || !in_array(strtolower($k), $keys)) {
+ $result[$k] = $v;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Copy the contents of a stream into another stream until the given number
+ * of bytes have been read.
+ *
+ * @param StreamInterface $source Stream to read from
+ * @param StreamInterface $dest Stream to write to
+ * @param int $maxLen Maximum number of bytes to read. Pass -1
+ * to read the entire stream.
+ *
+ * @throws \RuntimeException on error.
+ */
+ public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void
+ {
+ $bufferSize = 8192;
+
+ if ($maxLen === -1) {
+ while (!$source->eof()) {
+ if (!$dest->write($source->read($bufferSize))) {
+ break;
+ }
+ }
+ } else {
+ $remaining = $maxLen;
+ while ($remaining > 0 && !$source->eof()) {
+ $buf = $source->read(min($bufferSize, $remaining));
+ $len = strlen($buf);
+ if (!$len) {
+ break;
+ }
+ $remaining -= $len;
+ $dest->write($buf);
+ }
+ }
+ }
+
+ /**
+ * Copy the contents of a stream into a string until the given number of
+ * bytes have been read.
+ *
+ * @param StreamInterface $stream Stream to read
+ * @param int $maxLen Maximum number of bytes to read. Pass -1
+ * to read the entire stream.
+ *
+ * @throws \RuntimeException on error.
+ */
+ public static function copyToString(StreamInterface $stream, int $maxLen = -1): string
+ {
+ $buffer = '';
+
+ if ($maxLen === -1) {
+ while (!$stream->eof()) {
+ $buf = $stream->read(1048576);
+ if ($buf === '') {
+ break;
+ }
+ $buffer .= $buf;
+ }
+ return $buffer;
+ }
+
+ $len = 0;
+ while (!$stream->eof() && $len < $maxLen) {
+ $buf = $stream->read($maxLen - $len);
+ if ($buf === '') {
+ break;
+ }
+ $buffer .= $buf;
+ $len = strlen($buffer);
+ }
+
+ return $buffer;
+ }
+
+ /**
+ * Calculate a hash of a stream.
+ *
+ * This method reads the entire stream to calculate a rolling hash, based
+ * on PHP's `hash_init` functions.
+ *
+ * @param StreamInterface $stream Stream to calculate the hash for
+ * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
+ * @param bool $rawOutput Whether or not to use raw output
+ *
+ * @throws \RuntimeException on error.
+ */
+ public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string
+ {
+ $pos = $stream->tell();
+
+ if ($pos > 0) {
+ $stream->rewind();
+ }
+
+ $ctx = hash_init($algo);
+ while (!$stream->eof()) {
+ hash_update($ctx, $stream->read(1048576));
+ }
+
+ $out = hash_final($ctx, (bool) $rawOutput);
+ $stream->seek($pos);
+
+ return $out;
+ }
+
+ /**
+ * Clone and modify a request with the given changes.
+ *
+ * This method is useful for reducing the number of clones needed to mutate
+ * a message.
+ *
+ * The changes can be one of:
+ * - method: (string) Changes the HTTP method.
+ * - set_headers: (array) Sets the given headers.
+ * - remove_headers: (array) Remove the given headers.
+ * - body: (mixed) Sets the given body.
+ * - uri: (UriInterface) Set the URI.
+ * - query: (string) Set the query string value of the URI.
+ * - version: (string) Set the protocol version.
+ *
+ * @param RequestInterface $request Request to clone and modify.
+ * @param array $changes Changes to apply.
+ */
+ public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface
+ {
+ if (!$changes) {
+ return $request;
+ }
+
+ $headers = $request->getHeaders();
+
+ if (!isset($changes['uri'])) {
+ $uri = $request->getUri();
+ } else {
+ // Remove the host header if one is on the URI
+ if ($host = $changes['uri']->getHost()) {
+ $changes['set_headers']['Host'] = $host;
+
+ if ($port = $changes['uri']->getPort()) {
+ $standardPorts = ['http' => 80, 'https' => 443];
+ $scheme = $changes['uri']->getScheme();
+ if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
+ $changes['set_headers']['Host'] .= ':' . $port;
+ }
+ }
+ }
+ $uri = $changes['uri'];
+ }
+
+ if (!empty($changes['remove_headers'])) {
+ $headers = self::caselessRemove($changes['remove_headers'], $headers);
+ }
+
+ if (!empty($changes['set_headers'])) {
+ $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers);
+ $headers = $changes['set_headers'] + $headers;
+ }
+
+ if (isset($changes['query'])) {
+ $uri = $uri->withQuery($changes['query']);
+ }
+
+ if ($request instanceof ServerRequestInterface) {
+ $new = (new ServerRequest(
+ $changes['method'] ?? $request->getMethod(),
+ $uri,
+ $headers,
+ $changes['body'] ?? $request->getBody(),
+ $changes['version'] ?? $request->getProtocolVersion(),
+ $request->getServerParams()
+ ))
+ ->withParsedBody($request->getParsedBody())
+ ->withQueryParams($request->getQueryParams())
+ ->withCookieParams($request->getCookieParams())
+ ->withUploadedFiles($request->getUploadedFiles());
+
+ foreach ($request->getAttributes() as $key => $value) {
+ $new = $new->withAttribute($key, $value);
+ }
+
+ return $new;
+ }
+
+ return new Request(
+ $changes['method'] ?? $request->getMethod(),
+ $uri,
+ $headers,
+ $changes['body'] ?? $request->getBody(),
+ $changes['version'] ?? $request->getProtocolVersion()
+ );
+ }
+
+ /**
+ * Read a line from the stream up to the maximum allowed buffer length.
+ *
+ * @param StreamInterface $stream Stream to read from
+ * @param int|null $maxLength Maximum buffer length
+ */
+ public static function readLine(StreamInterface $stream, ?int $maxLength = null): string
+ {
+ $buffer = '';
+ $size = 0;
+
+ while (!$stream->eof()) {
+ if ('' === ($byte = $stream->read(1))) {
+ return $buffer;
+ }
+ $buffer .= $byte;
+ // Break when a new line is found or the max length - 1 is reached
+ if ($byte === "\n" || ++$size === $maxLength - 1) {
+ break;
+ }
+ }
+
+ return $buffer;
+ }
+
+ /**
+ * Create a new stream based on the input type.
+ *
+ * Options is an associative array that can contain the following keys:
+ * - metadata: Array of custom metadata.
+ * - size: Size of the stream.
+ *
+ * This method accepts the following `$resource` types:
+ * - `Psr\Http\Message\StreamInterface`: Returns the value as-is.
+ * - `string`: Creates a stream object that uses the given string as the contents.
+ * - `resource`: Creates a stream object that wraps the given PHP stream resource.
+ * - `Iterator`: If the provided value implements `Iterator`, then a read-only
+ * stream object will be created that wraps the given iterable. Each time the
+ * stream is read from, data from the iterator will fill a buffer and will be
+ * continuously called until the buffer is equal to the requested read size.
+ * Subsequent read calls will first read from the buffer and then call `next`
+ * on the underlying iterator until it is exhausted.
+ * - `object` with `__toString()`: If the object has the `__toString()` method,
+ * the object will be cast to a string and then a stream will be returned that
+ * uses the string value.
+ * - `NULL`: When `null` is passed, an empty stream object is returned.
+ * - `callable` When a callable is passed, a read-only stream object will be
+ * created that invokes the given callable. The callable is invoked with the
+ * number of suggested bytes to read. The callable can return any number of
+ * bytes, but MUST return `false` when there is no more data to return. The
+ * stream object that wraps the callable will invoke the callable until the
+ * number of requested bytes are available. Any additional bytes will be
+ * buffered and used in subsequent reads.
+ *
+ * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data
+ * @param array{size?: int, metadata?: array} $options Additional options
+ *
+ * @throws \InvalidArgumentException if the $resource arg is not valid.
+ */
+ public static function streamFor($resource = '', array $options = []): StreamInterface
+ {
+ if (is_scalar($resource)) {
+ $stream = self::tryFopen('php://temp', 'r+');
+ if ($resource !== '') {
+ fwrite($stream, (string) $resource);
+ fseek($stream, 0);
+ }
+ return new Stream($stream, $options);
+ }
+
+ switch (gettype($resource)) {
+ case 'resource':
+ /*
+ * The 'php://input' is a special stream with quirks and inconsistencies.
+ * We avoid using that stream by reading it into php://temp
+ */
+
+ /** @var resource $resource */
+ if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') {
+ $stream = self::tryFopen('php://temp', 'w+');
+ fwrite($stream, stream_get_contents($resource));
+ fseek($stream, 0);
+ $resource = $stream;
+ }
+ return new Stream($resource, $options);
+ case 'object':
+ /** @var object $resource */
+ if ($resource instanceof StreamInterface) {
+ return $resource;
+ } elseif ($resource instanceof \Iterator) {
+ return new PumpStream(function () use ($resource) {
+ if (!$resource->valid()) {
+ return false;
+ }
+ $result = $resource->current();
+ $resource->next();
+ return $result;
+ }, $options);
+ } elseif (method_exists($resource, '__toString')) {
+ return self::streamFor((string) $resource, $options);
+ }
+ break;
+ case 'NULL':
+ return new Stream(self::tryFopen('php://temp', 'r+'), $options);
+ }
+
+ if (is_callable($resource)) {
+ return new PumpStream($resource, $options);
+ }
+
+ throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
+ }
+
+ /**
+ * Safely opens a PHP stream resource using a filename.
+ *
+ * When fopen fails, PHP normally raises a warning. This function adds an
+ * error handler that checks for errors and throws an exception instead.
+ *
+ * @param string $filename File to open
+ * @param string $mode Mode used to open the file
+ *
+ * @return resource
+ *
+ * @throws \RuntimeException if the file cannot be opened
+ */
+ public static function tryFopen(string $filename, string $mode)
+ {
+ $ex = null;
+ set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool {
+ $ex = new \RuntimeException(sprintf(
+ 'Unable to open "%s" using mode "%s": %s',
+ $filename,
+ $mode,
+ $errstr
+ ));
+
+ return true;
+ });
+
+ try {
+ /** @var resource $handle */
+ $handle = fopen($filename, $mode);
+ } catch (\Throwable $e) {
+ $ex = new \RuntimeException(sprintf(
+ 'Unable to open "%s" using mode "%s": %s',
+ $filename,
+ $mode,
+ $e->getMessage()
+ ), 0, $e);
+ }
+
+ restore_error_handler();
+
+ if ($ex) {
+ /** @var $ex \RuntimeException */
+ throw $ex;
+ }
+
+ return $handle;
+ }
+
+ /**
+ * Returns a UriInterface for the given value.
+ *
+ * This function accepts a string or UriInterface and returns a
+ * UriInterface for the given value. If the value is already a
+ * UriInterface, it is returned as-is.
+ *
+ * @param string|UriInterface $uri
+ *
+ * @throws \InvalidArgumentException
+ */
+ public static function uriFor($uri): UriInterface
+ {
+ if ($uri instanceof UriInterface) {
+ return $uri;
+ }
+
+ if (is_string($uri)) {
+ return new Uri($uri);
+ }
+
+ throw new \InvalidArgumentException('URI must be a string or UriInterface');
+ }
+}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/functions.php b/tests/integration/vendor/guzzlehttp/psr7/src/functions.php
deleted file mode 100644
index 957bfb42a..000000000
--- a/tests/integration/vendor/guzzlehttp/psr7/src/functions.php
+++ /dev/null
@@ -1,898 +0,0 @@
-getMethod() . ' '
- . $message->getRequestTarget())
- . ' HTTP/' . $message->getProtocolVersion();
- if (!$message->hasHeader('host')) {
- $msg .= "\r\nHost: " . $message->getUri()->getHost();
- }
- } elseif ($message instanceof ResponseInterface) {
- $msg = 'HTTP/' . $message->getProtocolVersion() . ' '
- . $message->getStatusCode() . ' '
- . $message->getReasonPhrase();
- } else {
- throw new \InvalidArgumentException('Unknown message type');
- }
-
- foreach ($message->getHeaders() as $name => $values) {
- $msg .= "\r\n{$name}: " . implode(', ', $values);
- }
-
- return "{$msg}\r\n\r\n" . $message->getBody();
-}
-
-/**
- * Returns a UriInterface for the given value.
- *
- * This function accepts a string or {@see Psr\Http\Message\UriInterface} and
- * returns a UriInterface for the given value. If the value is already a
- * `UriInterface`, it is returned as-is.
- *
- * @param string|UriInterface $uri
- *
- * @return UriInterface
- * @throws \InvalidArgumentException
- */
-function uri_for($uri)
-{
- if ($uri instanceof UriInterface) {
- return $uri;
- } elseif (is_string($uri)) {
- return new Uri($uri);
- }
-
- throw new \InvalidArgumentException('URI must be a string or UriInterface');
-}
-
-/**
- * Create a new stream based on the input type.
- *
- * Options is an associative array that can contain the following keys:
- * - metadata: Array of custom metadata.
- * - size: Size of the stream.
- *
- * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
- * @param array $options Additional options
- *
- * @return StreamInterface
- * @throws \InvalidArgumentException if the $resource arg is not valid.
- */
-function stream_for($resource = '', array $options = [])
-{
- if (is_scalar($resource)) {
- $stream = fopen('php://temp', 'r+');
- if ($resource !== '') {
- fwrite($stream, $resource);
- fseek($stream, 0);
- }
- return new Stream($stream, $options);
- }
-
- switch (gettype($resource)) {
- case 'resource':
- return new Stream($resource, $options);
- case 'object':
- if ($resource instanceof StreamInterface) {
- return $resource;
- } elseif ($resource instanceof \Iterator) {
- return new PumpStream(function () use ($resource) {
- if (!$resource->valid()) {
- return false;
- }
- $result = $resource->current();
- $resource->next();
- return $result;
- }, $options);
- } elseif (method_exists($resource, '__toString')) {
- return stream_for((string) $resource, $options);
- }
- break;
- case 'NULL':
- return new Stream(fopen('php://temp', 'r+'), $options);
- }
-
- if (is_callable($resource)) {
- return new PumpStream($resource, $options);
- }
-
- throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
-}
-
-/**
- * Parse an array of header values containing ";" separated data into an
- * array of associative arrays representing the header key value pair
- * data of the header. When a parameter does not contain a value, but just
- * contains a key, this function will inject a key with a '' string value.
- *
- * @param string|array $header Header to parse into components.
- *
- * @return array Returns the parsed header values.
- */
-function parse_header($header)
-{
- static $trimmed = "\"' \n\t\r";
- $params = $matches = [];
-
- foreach (normalize_header($header) as $val) {
- $part = [];
- foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
- if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
- $m = $matches[0];
- if (isset($m[1])) {
- $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
- } else {
- $part[] = trim($m[0], $trimmed);
- }
- }
- }
- if ($part) {
- $params[] = $part;
- }
- }
-
- return $params;
-}
-
-/**
- * Converts an array of header values that may contain comma separated
- * headers into an array of headers with no comma separated values.
- *
- * @param string|array $header Header to normalize.
- *
- * @return array Returns the normalized header field values.
- */
-function normalize_header($header)
-{
- if (!is_array($header)) {
- return array_map('trim', explode(',', $header));
- }
-
- $result = [];
- foreach ($header as $value) {
- foreach ((array) $value as $v) {
- if (strpos($v, ',') === false) {
- $result[] = $v;
- continue;
- }
- foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
- $result[] = trim($vv);
- }
- }
- }
-
- return $result;
-}
-
-/**
- * Clone and modify a request with the given changes.
- *
- * The changes can be one of:
- * - method: (string) Changes the HTTP method.
- * - set_headers: (array) Sets the given headers.
- * - remove_headers: (array) Remove the given headers.
- * - body: (mixed) Sets the given body.
- * - uri: (UriInterface) Set the URI.
- * - query: (string) Set the query string value of the URI.
- * - version: (string) Set the protocol version.
- *
- * @param RequestInterface $request Request to clone and modify.
- * @param array $changes Changes to apply.
- *
- * @return RequestInterface
- */
-function modify_request(RequestInterface $request, array $changes)
-{
- if (!$changes) {
- return $request;
- }
-
- $headers = $request->getHeaders();
-
- if (!isset($changes['uri'])) {
- $uri = $request->getUri();
- } else {
- // Remove the host header if one is on the URI
- if ($host = $changes['uri']->getHost()) {
- $changes['set_headers']['Host'] = $host;
-
- if ($port = $changes['uri']->getPort()) {
- $standardPorts = ['http' => 80, 'https' => 443];
- $scheme = $changes['uri']->getScheme();
- if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
- $changes['set_headers']['Host'] .= ':'.$port;
- }
- }
- }
- $uri = $changes['uri'];
- }
-
- if (!empty($changes['remove_headers'])) {
- $headers = _caseless_remove($changes['remove_headers'], $headers);
- }
-
- if (!empty($changes['set_headers'])) {
- $headers = _caseless_remove(array_keys($changes['set_headers']), $headers);
- $headers = $changes['set_headers'] + $headers;
- }
-
- if (isset($changes['query'])) {
- $uri = $uri->withQuery($changes['query']);
- }
-
- if ($request instanceof ServerRequestInterface) {
- return (new ServerRequest(
- isset($changes['method']) ? $changes['method'] : $request->getMethod(),
- $uri,
- $headers,
- isset($changes['body']) ? $changes['body'] : $request->getBody(),
- isset($changes['version'])
- ? $changes['version']
- : $request->getProtocolVersion(),
- $request->getServerParams()
- ))
- ->withParsedBody($request->getParsedBody())
- ->withQueryParams($request->getQueryParams())
- ->withCookieParams($request->getCookieParams())
- ->withUploadedFiles($request->getUploadedFiles());
- }
-
- return new Request(
- isset($changes['method']) ? $changes['method'] : $request->getMethod(),
- $uri,
- $headers,
- isset($changes['body']) ? $changes['body'] : $request->getBody(),
- isset($changes['version'])
- ? $changes['version']
- : $request->getProtocolVersion()
- );
-}
-
-/**
- * Attempts to rewind a message body and throws an exception on failure.
- *
- * The body of the message will only be rewound if a call to `tell()` returns a
- * value other than `0`.
- *
- * @param MessageInterface $message Message to rewind
- *
- * @throws \RuntimeException
- */
-function rewind_body(MessageInterface $message)
-{
- $body = $message->getBody();
-
- if ($body->tell()) {
- $body->rewind();
- }
-}
-
-/**
- * Safely opens a PHP stream resource using a filename.
- *
- * When fopen fails, PHP normally raises a warning. This function adds an
- * error handler that checks for errors and throws an exception instead.
- *
- * @param string $filename File to open
- * @param string $mode Mode used to open the file
- *
- * @return resource
- * @throws \RuntimeException if the file cannot be opened
- */
-function try_fopen($filename, $mode)
-{
- $ex = null;
- set_error_handler(function () use ($filename, $mode, &$ex) {
- $ex = new \RuntimeException(sprintf(
- 'Unable to open %s using mode %s: %s',
- $filename,
- $mode,
- func_get_args()[1]
- ));
- });
-
- $handle = fopen($filename, $mode);
- restore_error_handler();
-
- if ($ex) {
- /** @var $ex \RuntimeException */
- throw $ex;
- }
-
- return $handle;
-}
-
-/**
- * Copy the contents of a stream into a string until the given number of
- * bytes have been read.
- *
- * @param StreamInterface $stream Stream to read
- * @param int $maxLen Maximum number of bytes to read. Pass -1
- * to read the entire stream.
- * @return string
- * @throws \RuntimeException on error.
- */
-function copy_to_string(StreamInterface $stream, $maxLen = -1)
-{
- $buffer = '';
-
- if ($maxLen === -1) {
- while (!$stream->eof()) {
- $buf = $stream->read(1048576);
- // Using a loose equality here to match on '' and false.
- if ($buf == null) {
- break;
- }
- $buffer .= $buf;
- }
- return $buffer;
- }
-
- $len = 0;
- while (!$stream->eof() && $len < $maxLen) {
- $buf = $stream->read($maxLen - $len);
- // Using a loose equality here to match on '' and false.
- if ($buf == null) {
- break;
- }
- $buffer .= $buf;
- $len = strlen($buffer);
- }
-
- return $buffer;
-}
-
-/**
- * Copy the contents of a stream into another stream until the given number
- * of bytes have been read.
- *
- * @param StreamInterface $source Stream to read from
- * @param StreamInterface $dest Stream to write to
- * @param int $maxLen Maximum number of bytes to read. Pass -1
- * to read the entire stream.
- *
- * @throws \RuntimeException on error.
- */
-function copy_to_stream(
- StreamInterface $source,
- StreamInterface $dest,
- $maxLen = -1
-) {
- $bufferSize = 8192;
-
- if ($maxLen === -1) {
- while (!$source->eof()) {
- if (!$dest->write($source->read($bufferSize))) {
- break;
- }
- }
- } else {
- $remaining = $maxLen;
- while ($remaining > 0 && !$source->eof()) {
- $buf = $source->read(min($bufferSize, $remaining));
- $len = strlen($buf);
- if (!$len) {
- break;
- }
- $remaining -= $len;
- $dest->write($buf);
- }
- }
-}
-
-/**
- * Calculate a hash of a Stream
- *
- * @param StreamInterface $stream Stream to calculate the hash for
- * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
- * @param bool $rawOutput Whether or not to use raw output
- *
- * @return string Returns the hash of the stream
- * @throws \RuntimeException on error.
- */
-function hash(
- StreamInterface $stream,
- $algo,
- $rawOutput = false
-) {
- $pos = $stream->tell();
-
- if ($pos > 0) {
- $stream->rewind();
- }
-
- $ctx = hash_init($algo);
- while (!$stream->eof()) {
- hash_update($ctx, $stream->read(1048576));
- }
-
- $out = hash_final($ctx, (bool) $rawOutput);
- $stream->seek($pos);
-
- return $out;
-}
-
-/**
- * Read a line from the stream up to the maximum allowed buffer length
- *
- * @param StreamInterface $stream Stream to read from
- * @param int $maxLength Maximum buffer length
- *
- * @return string
- */
-function readline(StreamInterface $stream, $maxLength = null)
-{
- $buffer = '';
- $size = 0;
-
- while (!$stream->eof()) {
- // Using a loose equality here to match on '' and false.
- if (null == ($byte = $stream->read(1))) {
- return $buffer;
- }
- $buffer .= $byte;
- // Break when a new line is found or the max length - 1 is reached
- if ($byte === "\n" || ++$size === $maxLength - 1) {
- break;
- }
- }
-
- return $buffer;
-}
-
-/**
- * Parses a request message string into a request object.
- *
- * @param string $message Request message string.
- *
- * @return Request
- */
-function parse_request($message)
-{
- $data = _parse_message($message);
- $matches = [];
- if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
- throw new \InvalidArgumentException('Invalid request string');
- }
- $parts = explode(' ', $data['start-line'], 3);
- $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
-
- $request = new Request(
- $parts[0],
- $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1],
- $data['headers'],
- $data['body'],
- $version
- );
-
- return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
-}
-
-/**
- * Parses a response message string into a response object.
- *
- * @param string $message Response message string.
- *
- * @return Response
- */
-function parse_response($message)
-{
- $data = _parse_message($message);
- // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
- // between status-code and reason-phrase is required. But browsers accept
- // responses without space and reason as well.
- if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
- throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']);
- }
- $parts = explode(' ', $data['start-line'], 3);
-
- return new Response(
- $parts[1],
- $data['headers'],
- $data['body'],
- explode('/', $parts[0])[1],
- isset($parts[2]) ? $parts[2] : null
- );
-}
-
-/**
- * Parse a query string into an associative array.
- *
- * If multiple values are found for the same key, the value of that key
- * value pair will become an array. This function does not parse nested
- * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will
- * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).
- *
- * @param string $str Query string to parse
- * @param int|bool $urlEncoding How the query string is encoded
- *
- * @return array
- */
-function parse_query($str, $urlEncoding = true)
-{
- $result = [];
-
- if ($str === '') {
- return $result;
- }
-
- if ($urlEncoding === true) {
- $decoder = function ($value) {
- return rawurldecode(str_replace('+', ' ', $value));
- };
- } elseif ($urlEncoding === PHP_QUERY_RFC3986) {
- $decoder = 'rawurldecode';
- } elseif ($urlEncoding === PHP_QUERY_RFC1738) {
- $decoder = 'urldecode';
- } else {
- $decoder = function ($str) { return $str; };
- }
-
- foreach (explode('&', $str) as $kvp) {
- $parts = explode('=', $kvp, 2);
- $key = $decoder($parts[0]);
- $value = isset($parts[1]) ? $decoder($parts[1]) : null;
- if (!isset($result[$key])) {
- $result[$key] = $value;
- } else {
- if (!is_array($result[$key])) {
- $result[$key] = [$result[$key]];
- }
- $result[$key][] = $value;
- }
- }
-
- return $result;
-}
-
-/**
- * Build a query string from an array of key value pairs.
- *
- * This function can use the return value of parse_query() to build a query
- * string. This function does not modify the provided keys when an array is
- * encountered (like http_build_query would).
- *
- * @param array $params Query string parameters.
- * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
- * to encode using RFC3986, or PHP_QUERY_RFC1738
- * to encode using RFC1738.
- * @return string
- */
-function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
-{
- if (!$params) {
- return '';
- }
-
- if ($encoding === false) {
- $encoder = function ($str) { return $str; };
- } elseif ($encoding === PHP_QUERY_RFC3986) {
- $encoder = 'rawurlencode';
- } elseif ($encoding === PHP_QUERY_RFC1738) {
- $encoder = 'urlencode';
- } else {
- throw new \InvalidArgumentException('Invalid type');
- }
-
- $qs = '';
- foreach ($params as $k => $v) {
- $k = $encoder($k);
- if (!is_array($v)) {
- $qs .= $k;
- if ($v !== null) {
- $qs .= '=' . $encoder($v);
- }
- $qs .= '&';
- } else {
- foreach ($v as $vv) {
- $qs .= $k;
- if ($vv !== null) {
- $qs .= '=' . $encoder($vv);
- }
- $qs .= '&';
- }
- }
- }
-
- return $qs ? (string) substr($qs, 0, -1) : '';
-}
-
-/**
- * Determines the mimetype of a file by looking at its extension.
- *
- * @param $filename
- *
- * @return null|string
- */
-function mimetype_from_filename($filename)
-{
- return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION));
-}
-
-/**
- * Maps a file extensions to a mimetype.
- *
- * @param $extension string The file extension.
- *
- * @return string|null
- * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
- */
-function mimetype_from_extension($extension)
-{
- static $mimetypes = [
- '3gp' => 'video/3gpp',
- '7z' => 'application/x-7z-compressed',
- 'aac' => 'audio/x-aac',
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'asc' => 'text/plain',
- 'asf' => 'video/x-ms-asf',
- 'atom' => 'application/atom+xml',
- 'avi' => 'video/x-msvideo',
- 'bmp' => 'image/bmp',
- 'bz2' => 'application/x-bzip2',
- 'cer' => 'application/pkix-cert',
- 'crl' => 'application/pkix-crl',
- 'crt' => 'application/x-x509-ca-cert',
- 'css' => 'text/css',
- 'csv' => 'text/csv',
- 'cu' => 'application/cu-seeme',
- 'deb' => 'application/x-debian-package',
- 'doc' => 'application/msword',
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'dvi' => 'application/x-dvi',
- 'eot' => 'application/vnd.ms-fontobject',
- 'eps' => 'application/postscript',
- 'epub' => 'application/epub+zip',
- 'etx' => 'text/x-setext',
- 'flac' => 'audio/flac',
- 'flv' => 'video/x-flv',
- 'gif' => 'image/gif',
- 'gz' => 'application/gzip',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'ico' => 'image/x-icon',
- 'ics' => 'text/calendar',
- 'ini' => 'text/plain',
- 'iso' => 'application/x-iso9660-image',
- 'jar' => 'application/java-archive',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'js' => 'text/javascript',
- 'json' => 'application/json',
- 'latex' => 'application/x-latex',
- 'log' => 'text/plain',
- 'm4a' => 'audio/mp4',
- 'm4v' => 'video/mp4',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mov' => 'video/quicktime',
- 'mkv' => 'video/x-matroska',
- 'mp3' => 'audio/mpeg',
- 'mp4' => 'video/mp4',
- 'mp4a' => 'audio/mp4',
- 'mp4v' => 'video/mp4',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpg4' => 'video/mp4',
- 'oga' => 'audio/ogg',
- 'ogg' => 'audio/ogg',
- 'ogv' => 'video/ogg',
- 'ogx' => 'application/ogg',
- 'pbm' => 'image/x-portable-bitmap',
- 'pdf' => 'application/pdf',
- 'pgm' => 'image/x-portable-graymap',
- 'png' => 'image/png',
- 'pnm' => 'image/x-portable-anymap',
- 'ppm' => 'image/x-portable-pixmap',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'ps' => 'application/postscript',
- 'qt' => 'video/quicktime',
- 'rar' => 'application/x-rar-compressed',
- 'ras' => 'image/x-cmu-raster',
- 'rss' => 'application/rss+xml',
- 'rtf' => 'application/rtf',
- 'sgm' => 'text/sgml',
- 'sgml' => 'text/sgml',
- 'svg' => 'image/svg+xml',
- 'swf' => 'application/x-shockwave-flash',
- 'tar' => 'application/x-tar',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'torrent' => 'application/x-bittorrent',
- 'ttf' => 'application/x-font-ttf',
- 'txt' => 'text/plain',
- 'wav' => 'audio/x-wav',
- 'webm' => 'video/webm',
- 'wma' => 'audio/x-ms-wma',
- 'wmv' => 'video/x-ms-wmv',
- 'woff' => 'application/x-font-woff',
- 'wsdl' => 'application/wsdl+xml',
- 'xbm' => 'image/x-xbitmap',
- 'xls' => 'application/vnd.ms-excel',
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'xml' => 'application/xml',
- 'xpm' => 'image/x-xpixmap',
- 'xwd' => 'image/x-xwindowdump',
- 'yaml' => 'text/yaml',
- 'yml' => 'text/yaml',
- 'zip' => 'application/zip',
- ];
-
- $extension = strtolower($extension);
-
- return isset($mimetypes[$extension])
- ? $mimetypes[$extension]
- : null;
-}
-
-/**
- * Parses an HTTP message into an associative array.
- *
- * The array contains the "start-line" key containing the start line of
- * the message, "headers" key containing an associative array of header
- * array values, and a "body" key containing the body of the message.
- *
- * @param string $message HTTP request or response to parse.
- *
- * @return array
- * @internal
- */
-function _parse_message($message)
-{
- if (!$message) {
- throw new \InvalidArgumentException('Invalid message');
- }
-
- $message = ltrim($message, "\r\n");
-
- $messageParts = preg_split("/\r?\n\r?\n/", $message, 2);
-
- if ($messageParts === false || count($messageParts) !== 2) {
- throw new \InvalidArgumentException('Invalid message: Missing header delimiter');
- }
-
- list($rawHeaders, $body) = $messageParts;
- $rawHeaders .= "\r\n"; // Put back the delimiter we split previously
- $headerParts = preg_split("/\r?\n/", $rawHeaders, 2);
-
- if ($headerParts === false || count($headerParts) !== 2) {
- throw new \InvalidArgumentException('Invalid message: Missing status line');
- }
-
- list($startLine, $rawHeaders) = $headerParts;
-
- if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') {
- // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0
- $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders);
- }
-
- /** @var array[] $headerLines */
- $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER);
-
- // If these aren't the same, then one line didn't match and there's an invalid header.
- if ($count !== substr_count($rawHeaders, "\n")) {
- // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4
- if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) {
- throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding');
- }
-
- throw new \InvalidArgumentException('Invalid header syntax');
- }
-
- $headers = [];
-
- foreach ($headerLines as $headerLine) {
- $headers[$headerLine[1]][] = $headerLine[2];
- }
-
- return [
- 'start-line' => $startLine,
- 'headers' => $headers,
- 'body' => $body,
- ];
-}
-
-/**
- * Constructs a URI for an HTTP request message.
- *
- * @param string $path Path from the start-line
- * @param array $headers Array of headers (each value an array).
- *
- * @return string
- * @internal
- */
-function _parse_request_uri($path, array $headers)
-{
- $hostKey = array_filter(array_keys($headers), function ($k) {
- return strtolower($k) === 'host';
- });
-
- // If no host is found, then a full URI cannot be constructed.
- if (!$hostKey) {
- return $path;
- }
-
- $host = $headers[reset($hostKey)][0];
- $scheme = substr($host, -4) === ':443' ? 'https' : 'http';
-
- return $scheme . '://' . $host . '/' . ltrim($path, '/');
-}
-
-/**
- * Get a short summary of the message body
- *
- * Will return `null` if the response is not printable.
- *
- * @param MessageInterface $message The message to get the body summary
- * @param int $truncateAt The maximum allowed size of the summary
- *
- * @return null|string
- */
-function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
-{
- $body = $message->getBody();
-
- if (!$body->isSeekable() || !$body->isReadable()) {
- return null;
- }
-
- $size = $body->getSize();
-
- if ($size === 0) {
- return null;
- }
-
- $summary = $body->read($truncateAt);
- $body->rewind();
-
- if ($size > $truncateAt) {
- $summary .= ' (truncated...)';
- }
-
- // Matches any printable character, including unicode characters:
- // letters, marks, numbers, punctuation, spacing, and separators.
- if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) {
- return null;
- }
-
- return $summary;
-}
-
-/** @internal */
-function _caseless_remove($keys, array $data)
-{
- $result = [];
-
- foreach ($keys as &$key) {
- $key = strtolower($key);
- }
-
- foreach ($data as $k => $v) {
- if (!in_array(strtolower($k), $keys)) {
- $result[$k] = $v;
- }
- }
-
- return $result;
-}
diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/functions_include.php b/tests/integration/vendor/guzzlehttp/psr7/src/functions_include.php
deleted file mode 100644
index 96a4a83a0..000000000
--- a/tests/integration/vendor/guzzlehttp/psr7/src/functions_include.php
+++ /dev/null
@@ -1,6 +0,0 @@
-=5.3.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/tests/integration/vendor/psr/container/src/ContainerExceptionInterface.php b/tests/integration/vendor/psr/container/src/ContainerExceptionInterface.php
new file mode 100644
index 000000000..d35c6b4d8
--- /dev/null
+++ b/tests/integration/vendor/psr/container/src/ContainerExceptionInterface.php
@@ -0,0 +1,13 @@
+=7.2.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\EventDispatcher\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/tests/integration/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php b/tests/integration/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php
new file mode 100644
index 000000000..4306fa915
--- /dev/null
+++ b/tests/integration/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php
@@ -0,0 +1,21 @@
+=7.0.0",
+ "psr/http-message": "^1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/tests/integration/vendor/psr/http-factory/src/RequestFactoryInterface.php b/tests/integration/vendor/psr/http-factory/src/RequestFactoryInterface.php
new file mode 100644
index 000000000..cb39a08bf
--- /dev/null
+++ b/tests/integration/vendor/psr/http-factory/src/RequestFactoryInterface.php
@@ -0,0 +1,18 @@
+log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/tests/integration/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/tests/integration/vendor/psr/log/Psr/Log/InvalidArgumentException.php
deleted file mode 100644
index 67f852d1d..000000000
--- a/tests/integration/vendor/psr/log/Psr/Log/InvalidArgumentException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-logger = $logger;
- }
-}
diff --git a/tests/integration/vendor/psr/log/Psr/Log/LoggerInterface.php b/tests/integration/vendor/psr/log/Psr/Log/LoggerInterface.php
deleted file mode 100644
index 5ea72438b..000000000
--- a/tests/integration/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ /dev/null
@@ -1,123 +0,0 @@
-log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- abstract public function log($level, $message, array $context = array());
-}
diff --git a/tests/integration/vendor/psr/log/Psr/Log/NullLogger.php b/tests/integration/vendor/psr/log/Psr/Log/NullLogger.php
deleted file mode 100644
index d8cd682c8..000000000
--- a/tests/integration/vendor/psr/log/Psr/Log/NullLogger.php
+++ /dev/null
@@ -1,28 +0,0 @@
-logger) { }`
- * blocks.
- */
-class NullLogger extends AbstractLogger
-{
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function log($level, $message, array $context = array())
- {
- // noop
- }
-}
diff --git a/tests/integration/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/tests/integration/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
deleted file mode 100644
index a0391a52b..000000000
--- a/tests/integration/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
- ".
- *
- * Example ->error('Foo') would yield "error Foo".
- *
- * @return string[]
- */
- abstract public function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException \Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- if (method_exists($this, 'createPartialMock')) {
- $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString'));
- } else {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- }
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
-
- $expected = array('warning DUMMY');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextCanContainAnything()
- {
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
-
- $expected = array('warning Crazy context data');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $logger = $this->getLogger();
- $logger->warning('Random message', array('exception' => 'oops'));
- $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
-
- $expected = array(
- 'warning Random message',
- 'critical Uncaught Exception!'
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-}
-
-class DummyTest
-{
- public function __toString()
- {
- }
-}
diff --git a/tests/integration/vendor/psr/log/README.md b/tests/integration/vendor/psr/log/README.md
deleted file mode 100644
index 574bc1cb2..000000000
--- a/tests/integration/vendor/psr/log/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-PSR Log
-=======
-
-This repository holds all interfaces/classes/traits related to
-[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).
-
-Note that this is not a logger of its own. It is merely an interface that
-describes a logger. See the specification for more details.
-
-Usage
------
-
-If you need a logger, you can use the interface like this:
-
-```php
-logger = $logger;
- }
-
- public function doSomething()
- {
- if ($this->logger) {
- $this->logger->info('Doing work');
- }
-
- // do something useful
- }
-}
-```
-
-You can then pick one of the implementations of the interface to get a logger.
-
-If you want to implement the interface, you can require this package and
-implement `Psr\Log\LoggerInterface` in your code. Please read the
-[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
-for details.
diff --git a/tests/integration/vendor/psr/log/composer.json b/tests/integration/vendor/psr/log/composer.json
deleted file mode 100644
index 87934d707..000000000
--- a/tests/integration/vendor/psr/log/composer.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "psr/log",
- "description": "Common interface for logging libraries",
- "keywords": ["psr", "psr-3", "log"],
- "homepage": "https://github.com/php-fig/log",
- "license": "MIT",
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "require": {
- "php": ">=5.3.0"
- },
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- }
-}
diff --git a/tests/integration/vendor/ralouphie/getallheaders/.gitignore b/tests/integration/vendor/ralouphie/getallheaders/.gitignore
deleted file mode 100644
index 1324e7d3e..000000000
--- a/tests/integration/vendor/ralouphie/getallheaders/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.idea
-.DS_store
-/vendor/
-composer.phar
-composer.lock
diff --git a/tests/integration/vendor/ralouphie/getallheaders/.travis.yml b/tests/integration/vendor/ralouphie/getallheaders/.travis.yml
deleted file mode 100644
index f45b55fa0..000000000
--- a/tests/integration/vendor/ralouphie/getallheaders/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: php
-
-php:
- - 5.3
- - 5.4
- - 5.5
- - 5.6
- - 7.0
-
-before_script:
- - composer install
-
-script:
- - mkdir -p build/logs
- - php vendor/bin/phpunit -c phpunit.xml
-
-after_script:
- - php vendor/bin/coveralls -v
\ No newline at end of file
diff --git a/tests/integration/vendor/ralouphie/getallheaders/README.md b/tests/integration/vendor/ralouphie/getallheaders/README.md
index f3329d663..9430d76bb 100644
--- a/tests/integration/vendor/ralouphie/getallheaders/README.md
+++ b/tests/integration/vendor/ralouphie/getallheaders/README.md
@@ -14,6 +14,14 @@ This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/f
## Install
+For PHP version **`>= 5.6`**:
+
```
composer require ralouphie/getallheaders
```
+
+For PHP version **`< 5.6`**:
+
+```
+composer require ralouphie/getallheaders "^2"
+```
diff --git a/tests/integration/vendor/ralouphie/getallheaders/composer.json b/tests/integration/vendor/ralouphie/getallheaders/composer.json
index 5a0d595c9..de8ce62e4 100644
--- a/tests/integration/vendor/ralouphie/getallheaders/composer.json
+++ b/tests/integration/vendor/ralouphie/getallheaders/composer.json
@@ -9,13 +9,18 @@
}
],
"require": {
- "php": ">=5.3"
+ "php": ">=5.6"
},
"require-dev": {
- "phpunit/phpunit": "~3.7.0",
- "satooshi/php-coveralls": ">=1.0"
+ "phpunit/phpunit": "^5 || ^6.5",
+ "php-coveralls/php-coveralls": "^2.1"
},
"autoload": {
"files": ["src/getallheaders.php"]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "getallheaders\\Tests\\": "tests/"
+ }
}
-}
\ No newline at end of file
+}
diff --git a/tests/integration/vendor/ralouphie/getallheaders/phpunit.xml b/tests/integration/vendor/ralouphie/getallheaders/phpunit.xml
deleted file mode 100644
index 7255b23d9..000000000
--- a/tests/integration/vendor/ralouphie/getallheaders/phpunit.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- ./tests
-
-
-
-
- src
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/integration/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php b/tests/integration/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php
deleted file mode 100644
index 8e3d1790a..000000000
--- a/tests/integration/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
- $val) {
- $_SERVER[$key] = $val;
- }
- $result = getallheaders();
- $this->assertEquals($expected, $result, "Error testing $test_type works.");
- }
-
- public function testWorksData()
- {
- return array(
- array(
- 'normal case',
- array(
- 'Key-One' => 'foo',
- 'Key-Two' => 'bar',
- 'Another-Key-For-Testing' => 'baz'
- ),
- array(
- 'HTTP_KEY_ONE' => 'foo',
- 'HTTP_KEY_TWO' => 'bar',
- 'HTTP_ANOTHER_KEY_FOR_TESTING' => 'baz'
- )
- ),
- array(
- 'Content-Type',
- array(
- 'Content-Type' => 'two'
- ),
- array(
- 'HTTP_CONTENT_TYPE' => 'one',
- 'CONTENT_TYPE' => 'two'
- )
- ),
- array(
- 'Content-Length',
- array(
- 'Content-Length' => '222'
- ),
- array(
- 'CONTENT_LENGTH' => '222',
- 'HTTP_CONTENT_LENGTH' => '111'
- )
- ),
- array(
- 'Content-Length (HTTP_CONTENT_LENGTH only)',
- array(
- 'Content-Length' => '111'
- ),
- array(
- 'HTTP_CONTENT_LENGTH' => '111'
- )
- ),
- array(
- 'Content-MD5',
- array(
- 'Content-Md5' => 'aef123'
- ),
- array(
- 'CONTENT_MD5' => 'aef123',
- 'HTTP_CONTENT_MD5' => 'fea321'
- )
- ),
- array(
- 'Content-MD5 (HTTP_CONTENT_MD5 only)',
- array(
- 'Content-Md5' => 'f123'
- ),
- array(
- 'HTTP_CONTENT_MD5' => 'f123'
- )
- ),
- array(
- 'Authorization (normal)',
- array(
- 'Authorization' => 'testing'
- ),
- array(
- 'HTTP_AUTHORIZATION' => 'testing',
- )
- ),
- array(
- 'Authorization (redirect)',
- array(
- 'Authorization' => 'testing redirect'
- ),
- array(
- 'REDIRECT_HTTP_AUTHORIZATION' => 'testing redirect',
- )
- ),
- array(
- 'Authorization (PHP_AUTH_USER + PHP_AUTH_PW)',
- array(
- 'Authorization' => 'Basic ' . base64_encode('foo:bar')
- ),
- array(
- 'PHP_AUTH_USER' => 'foo',
- 'PHP_AUTH_PW' => 'bar'
- )
- ),
- array(
- 'Authorization (PHP_AUTH_DIGEST)',
- array(
- 'Authorization' => 'example-digest'
- ),
- array(
- 'PHP_AUTH_DIGEST' => 'example-digest'
- )
- )
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/ApcClassLoader.php b/tests/integration/vendor/symfony/class-loader/ApcClassLoader.php
deleted file mode 100644
index 5500e3628..000000000
--- a/tests/integration/vendor/symfony/class-loader/ApcClassLoader.php
+++ /dev/null
@@ -1,141 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3.
- *
- * It expects an object implementing a findFile method to find the file. This
- * allows using it as a wrapper around the other loaders of the component (the
- * ClassLoader for instance) but also around any other autoloaders following
- * this convention (the Composer one for instance).
- *
- * // with a Symfony autoloader
- * use Symfony\Component\ClassLoader\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // or with a Composer autoloader
- * use Composer\Autoload\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * $cachedLoader = new ApcClassLoader('my_prefix', $loader);
- *
- * // activate the cached autoloader
- * $cachedLoader->register();
- *
- * // eventually deactivate the non-cached loader if it was registered previously
- * // to be sure to use the cached one.
- * $loader->unregister();
- *
- * @author Fabien Potencier
- * @author Kris Wallsmith
- */
-class ApcClassLoader
-{
- private $prefix;
-
- /**
- * A class loader object that implements the findFile() method.
- *
- * @var object
- */
- protected $decorated;
-
- /**
- * Constructor.
- *
- * @param string $prefix The APC namespace prefix to use
- * @param object $decorated A class loader object that implements the findFile() method
- *
- * @throws \RuntimeException
- * @throws \InvalidArgumentException
- */
- public function __construct($prefix, $decorated)
- {
- if (!function_exists('apcu_fetch')) {
- throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
- }
-
- if (!method_exists($decorated, 'findFile')) {
- throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
- }
-
- $this->prefix = $prefix;
- $this->decorated = $decorated;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds a file by class name while caching lookups to APC.
- *
- * @param string $class A class name to resolve to file
- *
- * @return string|null
- */
- public function findFile($class)
- {
- $file = apcu_fetch($this->prefix.$class, $success);
-
- if (!$success) {
- apcu_store($this->prefix.$class, $file = $this->decorated->findFile($class) ?: null);
- }
-
- return $file;
- }
-
- /**
- * Passes through all unknown calls onto the decorated object.
- */
- public function __call($method, $args)
- {
- return call_user_func_array(array($this->decorated, $method), $args);
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/CHANGELOG.md b/tests/integration/vendor/symfony/class-loader/CHANGELOG.md
deleted file mode 100644
index 64ef8d9c9..000000000
--- a/tests/integration/vendor/symfony/class-loader/CHANGELOG.md
+++ /dev/null
@@ -1,36 +0,0 @@
-CHANGELOG
-=========
-
-3.0.0
------
-
- * The DebugClassLoader class has been removed
- * The DebugUniversalClassLoader class has been removed
- * The UniversalClassLoader class has been removed
- * The ApcUniversalClassLoader class has been removed
-
-2.4.0
------
-
- * deprecated the UniversalClassLoader in favor of the ClassLoader class instead
- * deprecated the ApcUniversalClassLoader in favor of the ApcClassLoader class instead
- * deprecated the DebugUniversalClassLoader in favor of the DebugClassLoader class from the Debug component
- * deprecated the DebugClassLoader as it has been moved to the Debug component instead
-
-2.3.0
------
-
- * added a WinCacheClassLoader for WinCache
-
-2.1.0
------
-
- * added a DebugClassLoader able to wrap any autoloader providing a findFile
- method
- * added a new ApcClassLoader and XcacheClassLoader using composition to wrap
- other loaders
- * added a new ClassLoader which does not distinguish between namespaced and
- pear-like classes (as the PEAR convention is a subset of PSR-0) and
- supports using Composer's namespace maps
- * added a class map generator
- * added support for loading globally-installed PEAR packages
diff --git a/tests/integration/vendor/symfony/class-loader/ClassCollectionLoader.php b/tests/integration/vendor/symfony/class-loader/ClassCollectionLoader.php
deleted file mode 100644
index 9f6e33edb..000000000
--- a/tests/integration/vendor/symfony/class-loader/ClassCollectionLoader.php
+++ /dev/null
@@ -1,438 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ClassCollectionLoader.
- *
- * @author Fabien Potencier
- */
-class ClassCollectionLoader
-{
- private static $loaded;
- private static $seen;
- private static $useTokenizer = true;
-
- /**
- * Loads a list of classes and caches them in one big file.
- *
- * @param array $classes An array of classes to load
- * @param string $cacheDir A cache directory
- * @param string $name The cache name prefix
- * @param bool $autoReload Whether to flush the cache when the cache is stale or not
- * @param bool $adaptive Whether to remove already declared classes or not
- * @param string $extension File extension of the resulting file
- *
- * @throws \InvalidArgumentException When class can't be loaded
- */
- public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
- {
- // each $name can only be loaded once per PHP process
- if (isset(self::$loaded[$name])) {
- return;
- }
-
- self::$loaded[$name] = true;
-
- if ($adaptive) {
- $declared = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
-
- // don't include already declared classes
- $classes = array_diff($classes, $declared);
-
- // the cache is different depending on which classes are already declared
- $name = $name.'-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
- }
-
- $classes = array_unique($classes);
-
- // cache the core classes
- if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
- throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
- }
- $cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.DIRECTORY_SEPARATOR);
- $cache = $cacheDir.'/'.$name.$extension;
-
- // auto-reload
- $reload = false;
- if ($autoReload) {
- $metadata = $cache.'.meta';
- if (!is_file($metadata) || !is_file($cache)) {
- $reload = true;
- } else {
- $time = filemtime($cache);
- $meta = unserialize(file_get_contents($metadata));
-
- sort($meta[1]);
- sort($classes);
-
- if ($meta[1] != $classes) {
- $reload = true;
- } else {
- foreach ($meta[0] as $resource) {
- if (!is_file($resource) || filemtime($resource) > $time) {
- $reload = true;
-
- break;
- }
- }
- }
- }
- }
-
- if (!$reload && file_exists($cache)) {
- require_once $cache;
-
- return;
- }
- if (!$adaptive) {
- $declared = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
- }
-
- $files = self::inline($classes, $cache, $declared);
-
- if ($autoReload) {
- // save the resources
- self::writeCacheFile($metadata, serialize(array(array_values($files), $classes)));
- }
- }
-
- /**
- * Generates a file where classes and their parents are inlined.
- *
- * @param array $classes An array of classes to load
- * @param string $cache The file where classes are inlined
- * @param array $excluded An array of classes that won't be inlined
- *
- * @return array The source map of inlined classes, with classes as keys and files as values
- *
- * @throws \RuntimeException When class can't be loaded
- */
- public static function inline($classes, $cache, array $excluded)
- {
- $declared = array();
- foreach (self::getOrderedClasses($excluded) as $class) {
- $declared[$class->getName()] = true;
- }
-
- // cache the core classes
- $cacheDir = dirname($cache);
- if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
- throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
- }
-
- $spacesRegex = '(?:\s*+(?:(?:\#|//)[^\n]*+\n|/\*(?:(?getName()])) {
- continue;
- }
- $declared[$class->getName()] = true;
-
- $files[$class->getName()] = $file = $class->getFileName();
- $c = file_get_contents($file);
-
- if (preg_match($dontInlineRegex, $c)) {
- $file = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $file));
-
- for ($i = 0; isset($file[$i], $cacheDir[$i]); ++$i) {
- if ($file[$i] !== $cacheDir[$i]) {
- break;
- }
- }
- if (1 >= $i) {
- $file = var_export(implode('/', $file), true);
- } else {
- $file = array_slice($file, $i);
- $file = str_repeat('../', count($cacheDir) - $i).implode('/', $file);
- $file = '__DIR__.'.var_export('/'.$file, true);
- }
-
- $c = "\nnamespace {require $file;}";
- } else {
- $c = preg_replace(array('/^\s*<\?php/', '/\?>\s*$/'), '', $c);
-
- // fakes namespace declaration for global code
- if (!$class->inNamespace()) {
- $c = "\nnamespace\n{\n".$c."\n}\n";
- }
-
- $c = self::fixNamespaceDeclarations('= 70000) {
- // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098
- unset($tokens, $rawChunk);
- gc_mem_caches();
- }
-
- return $output;
- }
-
- /**
- * This method is only useful for testing.
- */
- public static function enableTokenizer($bool)
- {
- self::$useTokenizer = (bool) $bool;
- }
-
- /**
- * Strips leading & trailing ws, multiple EOL, multiple ws.
- *
- * @param string $code Original PHP code
- *
- * @return string compressed code
- */
- private static function compressCode($code)
- {
- return preg_replace(
- array('/^\s+/m', '/\s+$/m', '/([\n\r]+ *[\n\r]+)+/', '/[ \t]+/'),
- array('', '', "\n", ' '),
- $code
- );
- }
-
- /**
- * Writes a cache file.
- *
- * @param string $file Filename
- * @param string $content Temporary file content
- *
- * @throws \RuntimeException when a cache file cannot be written
- */
- private static function writeCacheFile($file, $content)
- {
- $tmpFile = tempnam(dirname($file), basename($file));
- if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
- @chmod($file, 0666 & ~umask());
-
- return;
- }
-
- throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file));
- }
-
- /**
- * Gets an ordered array of passed classes including all their dependencies.
- *
- * @param array $classes
- *
- * @return \ReflectionClass[] An array of sorted \ReflectionClass instances (dependencies added if needed)
- *
- * @throws \InvalidArgumentException When a class can't be loaded
- */
- private static function getOrderedClasses(array $classes)
- {
- $map = array();
- self::$seen = array();
- foreach ($classes as $class) {
- try {
- $reflectionClass = new \ReflectionClass($class);
- } catch (\ReflectionException $e) {
- throw new \InvalidArgumentException(sprintf('Unable to load class "%s"', $class));
- }
-
- $map = array_merge($map, self::getClassHierarchy($reflectionClass));
- }
-
- return $map;
- }
-
- private static function getClassHierarchy(\ReflectionClass $class)
- {
- if (isset(self::$seen[$class->getName()])) {
- return array();
- }
-
- self::$seen[$class->getName()] = true;
-
- $classes = array($class);
- $parent = $class;
- while (($parent = $parent->getParentClass()) && $parent->isUserDefined() && !isset(self::$seen[$parent->getName()])) {
- self::$seen[$parent->getName()] = true;
-
- array_unshift($classes, $parent);
- }
-
- $traits = array();
-
- foreach ($classes as $c) {
- foreach (self::resolveDependencies(self::computeTraitDeps($c), $c) as $trait) {
- if ($trait !== $c) {
- $traits[] = $trait;
- }
- }
- }
-
- return array_merge(self::getInterfaces($class), $traits, $classes);
- }
-
- private static function getInterfaces(\ReflectionClass $class)
- {
- $classes = array();
-
- foreach ($class->getInterfaces() as $interface) {
- $classes = array_merge($classes, self::getInterfaces($interface));
- }
-
- if ($class->isUserDefined() && $class->isInterface() && !isset(self::$seen[$class->getName()])) {
- self::$seen[$class->getName()] = true;
-
- $classes[] = $class;
- }
-
- return $classes;
- }
-
- private static function computeTraitDeps(\ReflectionClass $class)
- {
- $traits = $class->getTraits();
- $deps = array($class->getName() => $traits);
- while ($trait = array_pop($traits)) {
- if ($trait->isUserDefined() && !isset(self::$seen[$trait->getName()])) {
- self::$seen[$trait->getName()] = true;
- $traitDeps = $trait->getTraits();
- $deps[$trait->getName()] = $traitDeps;
- $traits = array_merge($traits, $traitDeps);
- }
- }
-
- return $deps;
- }
-
- /**
- * Dependencies resolution.
- *
- * This function does not check for circular dependencies as it should never
- * occur with PHP traits.
- *
- * @param array $tree The dependency tree
- * @param \ReflectionClass $node The node
- * @param \ArrayObject $resolved An array of already resolved dependencies
- * @param \ArrayObject $unresolved An array of dependencies to be resolved
- *
- * @return \ArrayObject The dependencies for the given node
- *
- * @throws \RuntimeException if a circular dependency is detected
- */
- private static function resolveDependencies(array $tree, $node, \ArrayObject $resolved = null, \ArrayObject $unresolved = null)
- {
- if (null === $resolved) {
- $resolved = new \ArrayObject();
- }
- if (null === $unresolved) {
- $unresolved = new \ArrayObject();
- }
- $nodeName = $node->getName();
-
- if (isset($tree[$nodeName])) {
- $unresolved[$nodeName] = $node;
- foreach ($tree[$nodeName] as $dependency) {
- if (!$resolved->offsetExists($dependency->getName())) {
- self::resolveDependencies($tree, $dependency, $resolved, $unresolved);
- }
- }
- $resolved[$nodeName] = $node;
- unset($unresolved[$nodeName]);
- }
-
- return $resolved;
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/ClassLoader.php b/tests/integration/vendor/symfony/class-loader/ClassLoader.php
deleted file mode 100644
index a506dc094..000000000
--- a/tests/integration/vendor/symfony/class-loader/ClassLoader.php
+++ /dev/null
@@ -1,203 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ClassLoader implements an PSR-0 class loader.
- *
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
- *
- * $loader = new ClassLoader();
- *
- * // register classes with namespaces
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // activate the autoloader
- * $loader->register();
- *
- * // to enable searching the include path (e.g. for PEAR packages)
- * $loader->setUseIncludePath(true);
- *
- * In this example, if you try to use a class in the Symfony\Component
- * namespace or one of its children (Symfony\Component\Console for instance),
- * the autoloader will first look for the class under the component/
- * directory, and it will then fallback to the framework/ directory if not
- * found before giving up.
- *
- * @author Fabien Potencier
- * @author Jordi Boggiano
- */
-class ClassLoader
-{
- private $prefixes = array();
- private $fallbackDirs = array();
- private $useIncludePath = false;
-
- /**
- * Returns prefixes.
- *
- * @return array
- */
- public function getPrefixes()
- {
- return $this->prefixes;
- }
-
- /**
- * Returns fallback directories.
- *
- * @return array
- */
- public function getFallbackDirs()
- {
- return $this->fallbackDirs;
- }
-
- /**
- * Adds prefixes.
- *
- * @param array $prefixes Prefixes to add
- */
- public function addPrefixes(array $prefixes)
- {
- foreach ($prefixes as $prefix => $path) {
- $this->addPrefix($prefix, $path);
- }
- }
-
- /**
- * Registers a set of classes.
- *
- * @param string $prefix The classes prefix
- * @param array|string $paths The location(s) of the classes
- */
- public function addPrefix($prefix, $paths)
- {
- if (!$prefix) {
- foreach ((array) $paths as $path) {
- $this->fallbackDirs[] = $path;
- }
-
- return;
- }
- if (isset($this->prefixes[$prefix])) {
- if (is_array($paths)) {
- $this->prefixes[$prefix] = array_unique(array_merge(
- $this->prefixes[$prefix],
- $paths
- ));
- } elseif (!in_array($paths, $this->prefixes[$prefix])) {
- $this->prefixes[$prefix][] = $paths;
- }
- } else {
- $this->prefixes[$prefix] = array_unique((array) $paths);
- }
- }
-
- /**
- * Turns on searching the include for class files.
- *
- * @param bool $useIncludePath
- */
- public function setUseIncludePath($useIncludePath)
- {
- $this->useIncludePath = (bool) $useIncludePath;
- }
-
- /**
- * Can be used to check if the autoloader uses the include path to check
- * for classes.
- *
- * @return bool
- */
- public function getUseIncludePath()
- {
- return $this->useIncludePath;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds the path to the file where the class is defined.
- *
- * @param string $class The name of the class
- *
- * @return string|null The path, if found
- */
- public function findFile($class)
- {
- if (false !== $pos = strrpos($class, '\\')) {
- // namespaced class name
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
- $className = substr($class, $pos + 1);
- } else {
- // PEAR-like class name
- $classPath = null;
- $className = $class;
- }
-
- $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
-
- foreach ($this->prefixes as $prefix => $dirs) {
- if ($class === strstr($class, $prefix)) {
- foreach ($dirs as $dir) {
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
- return $dir.DIRECTORY_SEPARATOR.$classPath;
- }
- }
- }
- }
-
- foreach ($this->fallbackDirs as $dir) {
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
- return $dir.DIRECTORY_SEPARATOR.$classPath;
- }
- }
-
- if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
- return $file;
- }
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/ClassMapGenerator.php b/tests/integration/vendor/symfony/class-loader/ClassMapGenerator.php
deleted file mode 100644
index 810a70b6d..000000000
--- a/tests/integration/vendor/symfony/class-loader/ClassMapGenerator.php
+++ /dev/null
@@ -1,156 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ClassMapGenerator.
- *
- * @author Gyula Sallai
- */
-class ClassMapGenerator
-{
- /**
- * Generate a class map file.
- *
- * @param array|string $dirs Directories or a single path to search in
- * @param string $file The name of the class map file
- */
- public static function dump($dirs, $file)
- {
- $dirs = (array) $dirs;
- $maps = array();
-
- foreach ($dirs as $dir) {
- $maps = array_merge($maps, static::createMap($dir));
- }
-
- file_put_contents($file, sprintf('isFile()) {
- continue;
- }
-
- $path = $file->getRealPath() ?: $file->getPathname();
-
- if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') {
- continue;
- }
-
- $classes = self::findClasses($path);
-
- if (PHP_VERSION_ID >= 70000) {
- // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098
- gc_mem_caches();
- }
-
- foreach ($classes as $class) {
- $map[$class] = $path;
- }
- }
-
- return $map;
- }
-
- /**
- * Extract the classes in the given file.
- *
- * @param string $path The file to check
- *
- * @return array The found classes
- */
- private static function findClasses($path)
- {
- $contents = file_get_contents($path);
- $tokens = token_get_all($contents);
-
- $classes = array();
-
- $namespace = '';
- for ($i = 0; isset($tokens[$i]); ++$i) {
- $token = $tokens[$i];
-
- if (!isset($token[1])) {
- continue;
- }
-
- $class = '';
-
- switch ($token[0]) {
- case T_NAMESPACE:
- $namespace = '';
- // If there is a namespace, extract it
- while (isset($tokens[++$i][1])) {
- if (in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) {
- $namespace .= $tokens[$i][1];
- }
- }
- $namespace .= '\\';
- break;
- case T_CLASS:
- case T_INTERFACE:
- case T_TRAIT:
- // Skip usage of ::class constant
- $isClassConstant = false;
- for ($j = $i - 1; $j > 0; --$j) {
- if (!isset($tokens[$j][1])) {
- break;
- }
-
- if (T_DOUBLE_COLON === $tokens[$j][0]) {
- $isClassConstant = true;
- break;
- } elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
- break;
- }
- }
-
- if ($isClassConstant) {
- break;
- }
-
- // Find the classname
- while (isset($tokens[++$i][1])) {
- $t = $tokens[$i];
- if (T_STRING === $t[0]) {
- $class .= $t[1];
- } elseif ('' !== $class && T_WHITESPACE === $t[0]) {
- break;
- }
- }
-
- $classes[] = ltrim($namespace.$class, '\\');
- break;
- default:
- break;
- }
- }
-
- return $classes;
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/LICENSE b/tests/integration/vendor/symfony/class-loader/LICENSE
deleted file mode 100644
index 12a74531e..000000000
--- a/tests/integration/vendor/symfony/class-loader/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2004-2016 Fabien Potencier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/tests/integration/vendor/symfony/class-loader/MapClassLoader.php b/tests/integration/vendor/symfony/class-loader/MapClassLoader.php
deleted file mode 100644
index 1d8bcc2a0..000000000
--- a/tests/integration/vendor/symfony/class-loader/MapClassLoader.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * A class loader that uses a mapping file to look up paths.
- *
- * @author Fabien Potencier
- */
-class MapClassLoader
-{
- private $map = array();
-
- /**
- * Constructor.
- *
- * @param array $map A map where keys are classes and values the absolute file path
- */
- public function __construct(array $map)
- {
- $this->map = $map;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- */
- public function loadClass($class)
- {
- if (isset($this->map[$class])) {
- require $this->map[$class];
- }
- }
-
- /**
- * Finds the path to the file where the class is defined.
- *
- * @param string $class The name of the class
- *
- * @return string|null The path, if found
- */
- public function findFile($class)
- {
- if (isset($this->map[$class])) {
- return $this->map[$class];
- }
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Psr4ClassLoader.php b/tests/integration/vendor/symfony/class-loader/Psr4ClassLoader.php
deleted file mode 100644
index 84647b758..000000000
--- a/tests/integration/vendor/symfony/class-loader/Psr4ClassLoader.php
+++ /dev/null
@@ -1,93 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * A PSR-4 compatible class loader.
- *
- * See http://www.php-fig.org/psr/psr-4/
- *
- * @author Alexander M. Turek
- */
-class Psr4ClassLoader
-{
- /**
- * @var array
- */
- private $prefixes = array();
-
- /**
- * @param string $prefix
- * @param string $baseDir
- */
- public function addPrefix($prefix, $baseDir)
- {
- $prefix = trim($prefix, '\\').'\\';
- $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
- $this->prefixes[] = array($prefix, $baseDir);
- }
-
- /**
- * @param string $class
- *
- * @return string|null
- */
- public function findFile($class)
- {
- $class = ltrim($class, '\\');
-
- foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) {
- if (0 === strpos($class, $currentPrefix)) {
- $classWithoutPrefix = substr($class, strlen($currentPrefix));
- $file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
- if (file_exists($file)) {
- return $file;
- }
- }
- }
- }
-
- /**
- * @param string $class
- *
- * @return bool
- */
- public function loadClass($class)
- {
- $file = $this->findFile($class);
- if (null !== $file) {
- require $file;
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Removes this instance from the registered autoloaders.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/README.md b/tests/integration/vendor/symfony/class-loader/README.md
deleted file mode 100644
index d61992b6a..000000000
--- a/tests/integration/vendor/symfony/class-loader/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-ClassLoader Component
-=====================
-
-The ClassLoader component provides tools to autoload your classes and cache
-their locations for performance.
-
-Resources
----------
-
- * [Documentation](https://symfony.com/doc/current/components/class_loader/index.html)
- * [Contributing](https://symfony.com/doc/current/contributing/index.html)
- * [Report issues](https://github.com/symfony/symfony/issues) and
- [send Pull Requests](https://github.com/symfony/symfony/pulls)
- in the [main Symfony repository](https://github.com/symfony/symfony)
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/ApcClassLoaderTest.php b/tests/integration/vendor/symfony/class-loader/Tests/ApcClassLoaderTest.php
deleted file mode 100644
index e96ba9540..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/ApcClassLoaderTest.php
+++ /dev/null
@@ -1,196 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use Symfony\Component\ClassLoader\ApcClassLoader;
-use Symfony\Component\ClassLoader\ClassLoader;
-
-class ApcClassLoaderTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
- $this->markTestSkipped('The apc extension is not enabled.');
- } else {
- apcu_clear_cache();
- }
- }
-
- protected function tearDown()
- {
- if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
- apcu_clear_cache();
- }
- }
-
- public function testConstructor()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
-
- $loader = new ApcClassLoader('test.prefix.', $loader);
-
- $this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apcu_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
- }
-
- /**
- * @dataProvider getLoadClassTests
- */
- public function testLoadClass($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
-
- $loader = new ApcClassLoader('test.prefix.', $loader);
- $loader->loadClass($testClassName);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassTests()
- {
- return array(
- array('\\Apc\\Namespaced\\Foo', 'Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'),
- array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'),
- );
- }
-
- /**
- * @dataProvider getLoadClassFromFallbackTests
- */
- public function testLoadClassFromFallback($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback'));
-
- $loader = new ApcClassLoader('test.prefix.fallback', $loader);
- $loader->loadClass($testClassName);
-
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassFromFallbackTests()
- {
- return array(
- array('\\Apc\\Namespaced\\Baz', 'Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'),
- array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'),
- array('\\Apc\\Namespaced\\FooBar', 'Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'),
- array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'),
- );
- }
-
- /**
- * @dataProvider getLoadClassNamespaceCollisionTests
- */
- public function testLoadClassNamespaceCollision($namespaces, $className, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefixes($namespaces);
-
- $loader = new ApcClassLoader('test.prefix.collision.', $loader);
- $loader->loadClass($className);
-
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassNamespaceCollisionTests()
- {
- return array(
- array(
- array(
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- ),
- 'Apc\NamespaceCollision\A\Foo',
- '->loadClass() loads NamespaceCollision\A\Foo from alpha.',
- ),
- array(
- array(
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- ),
- 'Apc\NamespaceCollision\A\Bar',
- '->loadClass() loads NamespaceCollision\A\Bar from alpha.',
- ),
- array(
- array(
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- ),
- 'Apc\NamespaceCollision\A\B\Foo',
- '->loadClass() loads NamespaceCollision\A\B\Foo from beta.',
- ),
- array(
- array(
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- ),
- 'Apc\NamespaceCollision\A\B\Bar',
- '->loadClass() loads NamespaceCollision\A\B\Bar from beta.',
- ),
- );
- }
-
- /**
- * @dataProvider getLoadClassPrefixCollisionTests
- */
- public function testLoadClassPrefixCollision($prefixes, $className, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefixes($prefixes);
-
- $loader = new ApcClassLoader('test.prefix.collision.', $loader);
- $loader->loadClass($className);
-
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassPrefixCollisionTests()
- {
- return array(
- array(
- array(
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- ),
- 'ApcPrefixCollision_A_Foo',
- '->loadClass() loads ApcPrefixCollision_A_Foo from alpha.',
- ),
- array(
- array(
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- ),
- 'ApcPrefixCollision_A_Bar',
- '->loadClass() loads ApcPrefixCollision_A_Bar from alpha.',
- ),
- array(
- array(
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- ),
- 'ApcPrefixCollision_A_B_Foo',
- '->loadClass() loads ApcPrefixCollision_A_B_Foo from beta.',
- ),
- array(
- array(
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- ),
- 'ApcPrefixCollision_A_B_Bar',
- '->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.',
- ),
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php b/tests/integration/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php
deleted file mode 100644
index 4d0234148..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php
+++ /dev/null
@@ -1,315 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use Symfony\Component\ClassLoader\ClassCollectionLoader;
-use Symfony\Component\ClassLoader\Tests\Fixtures\DeclaredClass;
-use Symfony\Component\ClassLoader\Tests\Fixtures\WarmedClass;
-
-require_once __DIR__.'/Fixtures/ClassesWithParents/GInterface.php';
-require_once __DIR__.'/Fixtures/ClassesWithParents/CInterface.php';
-require_once __DIR__.'/Fixtures/ClassesWithParents/B.php';
-require_once __DIR__.'/Fixtures/ClassesWithParents/A.php';
-
-class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase
-{
- public function testTraitDependencies()
- {
- require_once __DIR__.'/Fixtures/deps/traits.php';
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, array('CTFoo'));
-
- $this->assertEquals(
- array('TD', 'TC', 'TB', 'TA', 'TZ', 'CTFoo'),
- array_map(function ($class) { return $class->getName(); }, $ordered)
- );
-
- $ordered = $m->invoke(null, array('CTBar'));
-
- $this->assertEquals(
- array('TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'),
- array_map(function ($class) { return $class->getName(); }, $ordered)
- );
- }
-
- /**
- * @dataProvider getDifferentOrders
- */
- public function testClassReordering(array $classes)
- {
- $expected = array(
- 'ClassesWithParents\\GInterface',
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- );
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, $classes);
-
- $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
- }
-
- public function getDifferentOrders()
- {
- return array(
- array(array(
- 'ClassesWithParents\\A',
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\GInterface',
- 'ClassesWithParents\\B',
- )),
- array(array(
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- 'ClassesWithParents\\CInterface',
- )),
- array(array(
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- )),
- array(array(
- 'ClassesWithParents\\A',
- )),
- );
- }
-
- /**
- * @dataProvider getDifferentOrdersForTraits
- */
- public function testClassWithTraitsReordering(array $classes)
- {
- require_once __DIR__.'/Fixtures/ClassesWithParents/ATrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/D.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/E.php';
-
- $expected = array(
- 'ClassesWithParents\\GInterface',
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\ATrait',
- 'ClassesWithParents\\BTrait',
- 'ClassesWithParents\\CTrait',
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- 'ClassesWithParents\\D',
- 'ClassesWithParents\\E',
- );
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, $classes);
-
- $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
- }
-
- public function getDifferentOrdersForTraits()
- {
- return array(
- array(array(
- 'ClassesWithParents\\E',
- 'ClassesWithParents\\ATrait',
- )),
- array(array(
- 'ClassesWithParents\\E',
- )),
- );
- }
-
- public function testFixClassWithTraitsOrdering()
- {
- require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/F.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/G.php';
-
- $classes = array(
- 'ClassesWithParents\\F',
- 'ClassesWithParents\\G',
- );
-
- $expected = array(
- 'ClassesWithParents\\CTrait',
- 'ClassesWithParents\\F',
- 'ClassesWithParents\\G',
- );
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, $classes);
-
- $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
- }
-
- /**
- * @dataProvider getFixNamespaceDeclarationsData
- */
- public function testFixNamespaceDeclarations($source, $expected)
- {
- $this->assertEquals('assertEquals('assertEquals(<<<'EOF'
-namespace Namespaced
-{
-class WithComments
-{
-public static $loaded = true;
-}
-$string ='string should not be modified {$string}';
-$heredoc = (<<assertTrue(class_exists(WarmedClass::class, true));
-
- @unlink($cache = sys_get_temp_dir().'/inline.php');
-
- $classes = array(WarmedClass::class);
- $excluded = array(DeclaredClass::class);
-
- ClassCollectionLoader::inline($classes, $cache, $excluded);
-
- $this->assertSame(<<<'EOTXT'
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use Symfony\Component\ClassLoader\ClassLoader;
-
-class ClassLoaderTest extends \PHPUnit_Framework_TestCase
-{
- public function testGetPrefixes()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertArrayNotHasKey('Foo1', $prefixes);
- $this->assertArrayHasKey('Bar', $prefixes);
- $this->assertArrayHasKey('Bas', $prefixes);
- }
-
- public function testGetFallbackDirs()
- {
- $loader = new ClassLoader();
- $loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $fallback_dirs = $loader->getFallbackDirs();
- $this->assertCount(2, $fallback_dirs);
- }
-
- /**
- * @dataProvider getLoadClassTests
- */
- public function testLoadClass($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->loadClass($testClassName);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassTests()
- {
- return array(
- array('\\Namespaced2\\Foo', 'Namespaced2\\Foo', '->loadClass() loads Namespaced2\Foo class'),
- array('\\Pearlike2_Foo', 'Pearlike2_Foo', '->loadClass() loads Pearlike2_Foo class'),
- );
- }
-
- /**
- * @dataProvider getLoadNonexistentClassTests
- */
- public function testLoadNonexistentClass($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->loadClass($testClassName);
- $this->assertFalse(class_exists($className), $message);
- }
-
- public function getLoadNonexistentClassTests()
- {
- return array(
- array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non existing Pearlike3_Bar class with a leading slash'),
- );
- }
-
- public function testAddPrefixSingle()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertCount(1, $prefixes['Foo']);
- }
-
- public function testAddPrefixesSingle()
- {
- $loader = new ClassLoader();
- $loader->addPrefixes(array('Foo' => array('foo', 'foo')));
- $loader->addPrefixes(array('Foo' => array('foo')));
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertCount(1, $prefixes['Foo'], print_r($prefixes, true));
- }
-
- public function testAddPrefixMulti()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Foo', 'foo');
- $loader->addPrefix('Foo', 'bar');
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertCount(2, $prefixes['Foo']);
- $this->assertContains('foo', $prefixes['Foo']);
- $this->assertContains('bar', $prefixes['Foo']);
- }
-
- public function testUseIncludePath()
- {
- $loader = new ClassLoader();
- $this->assertFalse($loader->getUseIncludePath());
-
- $this->assertNull($loader->findFile('Foo'));
-
- $includePath = get_include_path();
-
- $loader->setUseIncludePath(true);
- $this->assertTrue($loader->getUseIncludePath());
-
- set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath);
-
- $this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));
-
- set_include_path($includePath);
- }
-
- /**
- * @dataProvider getLoadClassFromFallbackTests
- */
- public function testLoadClassFromFallback($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'));
- $loader->loadClass($testClassName);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassFromFallbackTests()
- {
- return array(
- array('\\Namespaced2\\Baz', 'Namespaced2\\Baz', '->loadClass() loads Namespaced2\Baz class'),
- array('\\Pearlike2_Baz', 'Pearlike2_Baz', '->loadClass() loads Pearlike2_Baz class'),
- array('\\Namespaced2\\FooBar', 'Namespaced2\\FooBar', '->loadClass() loads Namespaced2\Baz class from fallback dir'),
- array('\\Pearlike2_FooBar', 'Pearlike2_FooBar', '->loadClass() loads Pearlike2_Baz class from fallback dir'),
- );
- }
-
- /**
- * @dataProvider getLoadClassNamespaceCollisionTests
- */
- public function testLoadClassNamespaceCollision($namespaces, $className, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefixes($namespaces);
-
- $loader->loadClass($className);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassNamespaceCollisionTests()
- {
- return array(
- array(
- array(
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'NamespaceCollision\C\Foo',
- '->loadClass() loads NamespaceCollision\C\Foo from alpha.',
- ),
- array(
- array(
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'NamespaceCollision\C\Bar',
- '->loadClass() loads NamespaceCollision\C\Bar from alpha.',
- ),
- array(
- array(
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'NamespaceCollision\C\B\Foo',
- '->loadClass() loads NamespaceCollision\C\B\Foo from beta.',
- ),
- array(
- array(
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'NamespaceCollision\C\B\Bar',
- '->loadClass() loads NamespaceCollision\C\B\Bar from beta.',
- ),
- array(
- array(
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'PrefixCollision_C_Foo',
- '->loadClass() loads PrefixCollision_C_Foo from alpha.',
- ),
- array(
- array(
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'PrefixCollision_C_Bar',
- '->loadClass() loads PrefixCollision_C_Bar from alpha.',
- ),
- array(
- array(
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'PrefixCollision_C_B_Foo',
- '->loadClass() loads PrefixCollision_C_B_Foo from beta.',
- ),
- array(
- array(
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'PrefixCollision_C_B_Bar',
- '->loadClass() loads PrefixCollision_C_B_Bar from beta.',
- ),
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php b/tests/integration/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php
deleted file mode 100644
index 5de49d24b..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php
+++ /dev/null
@@ -1,147 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use Symfony\Component\ClassLoader\ClassMapGenerator;
-
-class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var string|null
- */
- private $workspace = null;
-
- public function prepare_workspace()
- {
- $this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
- mkdir($this->workspace, 0777, true);
- $this->workspace = realpath($this->workspace);
- }
-
- /**
- * @param string $file
- */
- private function clean($file)
- {
- if (is_dir($file) && !is_link($file)) {
- $dir = new \FilesystemIterator($file);
- foreach ($dir as $childFile) {
- $this->clean($childFile);
- }
-
- rmdir($file);
- } else {
- unlink($file);
- }
- }
-
- /**
- * @dataProvider getTestCreateMapTests
- */
- public function testDump($directory)
- {
- $this->prepare_workspace();
-
- $file = $this->workspace.'/file';
-
- $generator = new ClassMapGenerator();
- $generator->dump($directory, $file);
- $this->assertFileExists($file);
-
- $this->clean($this->workspace);
- }
-
- /**
- * @dataProvider getTestCreateMapTests
- */
- public function testCreateMap($directory, $expected)
- {
- $this->assertEqualsNormalized($expected, ClassMapGenerator::createMap($directory));
- }
-
- public function getTestCreateMapTests()
- {
- $data = array(
- array(__DIR__.'/Fixtures/Namespaced', array(
- 'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php',
- 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
- 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
- 'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
- 'Namespaced\\WithStrictTypes' => realpath(__DIR__).'/Fixtures/Namespaced/WithStrictTypes.php',
- 'Namespaced\\WithHaltCompiler' => realpath(__DIR__).'/Fixtures/Namespaced/WithHaltCompiler.php',
- 'Namespaced\\WithDirMagic' => realpath(__DIR__).'/Fixtures/Namespaced/WithDirMagic.php',
- 'Namespaced\\WithFileMagic' => realpath(__DIR__).'/Fixtures/Namespaced/WithFileMagic.php',
- )),
- array(__DIR__.'/Fixtures/beta/NamespaceCollision', array(
- 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
- 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php',
- 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php',
- 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php',
- )),
- array(__DIR__.'/Fixtures/Pearlike', array(
- 'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
- 'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
- 'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
- 'Pearlike_WithComments' => realpath(__DIR__).'/Fixtures/Pearlike/WithComments.php',
- )),
- array(__DIR__.'/Fixtures/classmap', array(
- 'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
- 'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
- 'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php',
- 'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
- 'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
- )),
- array(__DIR__.'/Fixtures/php5.4', array(
- 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- )),
- array(__DIR__.'/Fixtures/php5.5', array(
- 'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',
- )),
- );
-
- return $data;
- }
-
- public function testCreateMapFinderSupport()
- {
- $finder = new \Symfony\Component\Finder\Finder();
- $finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision');
-
- $this->assertEqualsNormalized(array(
- 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
- 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php',
- 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php',
- 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php',
- ), ClassMapGenerator::createMap($finder));
- }
-
- protected function assertEqualsNormalized($expected, $actual, $message = null)
- {
- foreach ($expected as $ns => $path) {
- $expected[$ns] = str_replace('\\', '/', $path);
- }
- foreach ($actual as $ns => $path) {
- $actual[$ns] = str_replace('\\', '/', $path);
- }
- $this->assertEquals($expected, $actual, $message);
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php
deleted file mode 100644
index 4259f1451..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php
deleted file mode 100644
index 3ddb595e2..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class Baz
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php
deleted file mode 100644
index cf0a4b741..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php
deleted file mode 100644
index bbbc81515..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class FooBar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php
deleted file mode 100644
index e774cb9bf..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php
deleted file mode 100644
index 184a1b1da..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php
deleted file mode 100644
index 3892f7068..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A\B;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php
deleted file mode 100644
index 450eeb50b..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A\B;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php
deleted file mode 100644
index 96f2f76c6..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class FooBar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php
deleted file mode 100644
index b0f942595..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php
deleted file mode 100644
index 0b0bbd057..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class Baz
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php
deleted file mode 100644
index df5e1f4ce..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php
deleted file mode 100644
index 361e53de1..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class WithComments
-{
- /** @Boolean */
- public static $loaded = true;
-}
-
-$string = 'string should not be modified {$string}';
-
-$heredoc = (<<
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-class Pearlike_WithComments
-{
- /** @Boolean */
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php
deleted file mode 100644
index 7f5f79773..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php
deleted file mode 100644
index aee6a080d..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php
deleted file mode 100644
index c1b8dd65d..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A\B;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php
deleted file mode 100644
index f5f2d727e..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A\B;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php
deleted file mode 100644
index 4bb03dc7f..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace ClassMap;
-
-class SomeClass extends SomeParent implements SomeInterface
-{
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php
deleted file mode 100644
index 1fe5e09aa..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace ClassMap;
-
-interface SomeInterface
-{
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php
deleted file mode 100644
index ce2f9fc6c..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace ClassMap;
-
-abstract class SomeParent
-{
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php
deleted file mode 100644
index c7cec646f..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Foo\Bar;
-
-class A
-{
-}
-class B
-{
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php
deleted file mode 100644
index 82b30a6f9..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class FooBar
-{
- public static $loaded = true;
-}
diff --git a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php b/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php
deleted file mode 100644
index 1036d4359..000000000
--- a/tests/integration/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use Symfony\Component\ClassLoader\Psr4ClassLoader;
-
-class Psr4ClassLoaderTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @param string $className
- * @dataProvider getLoadClassTests
- */
- public function testLoadClass($className)
- {
- $loader = new Psr4ClassLoader();
- $loader->addPrefix(
- 'Acme\\DemoLib',
- __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
- );
- $loader->loadClass($className);
- $this->assertTrue(class_exists($className), sprintf('loadClass() should load %s', $className));
- }
-
- /**
- * @return array
- */
- public function getLoadClassTests()
- {
- return array(
- array('Acme\\DemoLib\\Foo'),
- array('Acme\\DemoLib\\Class_With_Underscores'),
- array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Foo'),
- array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores'),
- );
- }
-
- /**
- * @param string $className
- * @dataProvider getLoadNonexistentClassTests
- */
- public function testLoadNonexistentClass($className)
- {
- $loader = new Psr4ClassLoader();
- $loader->addPrefix(
- 'Acme\\DemoLib',
- __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
- );
- $loader->loadClass($className);
- $this->assertFalse(class_exists($className), sprintf('loadClass() should not load %s', $className));
- }
-
- /**
- * @return array
- */
- public function getLoadNonexistentClassTests()
- {
- return array(
- array('Acme\\DemoLib\\I_Do_Not_Exist'),
- array('UnknownVendor\\SomeLib\\I_Do_Not_Exist'),
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/WinCacheClassLoader.php b/tests/integration/vendor/symfony/class-loader/WinCacheClassLoader.php
deleted file mode 100644
index b95a1d798..000000000
--- a/tests/integration/vendor/symfony/class-loader/WinCacheClassLoader.php
+++ /dev/null
@@ -1,140 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * WinCacheClassLoader implements a wrapping autoloader cached in WinCache.
- *
- * It expects an object implementing a findFile method to find the file. This
- * allow using it as a wrapper around the other loaders of the component (the
- * ClassLoader for instance) but also around any other autoloaders following
- * this convention (the Composer one for instance).
- *
- * // with a Symfony autoloader
- * $loader = new ClassLoader();
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // or with a Composer autoloader
- * use Composer\Autoload\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * $cachedLoader = new WinCacheClassLoader('my_prefix', $loader);
- *
- * // activate the cached autoloader
- * $cachedLoader->register();
- *
- * // eventually deactivate the non-cached loader if it was registered previously
- * // to be sure to use the cached one.
- * $loader->unregister();
- *
- * @author Fabien Potencier
- * @author Kris Wallsmith
- * @author Artem Ryzhkov
- */
-class WinCacheClassLoader
-{
- private $prefix;
-
- /**
- * A class loader object that implements the findFile() method.
- *
- * @var object
- */
- protected $decorated;
-
- /**
- * Constructor.
- *
- * @param string $prefix The WinCache namespace prefix to use
- * @param object $decorated A class loader object that implements the findFile() method
- *
- * @throws \RuntimeException
- * @throws \InvalidArgumentException
- */
- public function __construct($prefix, $decorated)
- {
- if (!extension_loaded('wincache')) {
- throw new \RuntimeException('Unable to use WinCacheClassLoader as WinCache is not enabled.');
- }
-
- if (!method_exists($decorated, 'findFile')) {
- throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
- }
-
- $this->prefix = $prefix;
- $this->decorated = $decorated;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds a file by class name while caching lookups to WinCache.
- *
- * @param string $class A class name to resolve to file
- *
- * @return string|null
- */
- public function findFile($class)
- {
- $file = wincache_ucache_get($this->prefix.$class, $success);
-
- if (!$success) {
- wincache_ucache_set($this->prefix.$class, $file = $this->decorated->findFile($class) ?: null, 0);
- }
-
- return $file;
- }
-
- /**
- * Passes through all unknown calls onto the decorated object.
- */
- public function __call($method, $args)
- {
- return call_user_func_array(array($this->decorated, $method), $args);
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/XcacheClassLoader.php b/tests/integration/vendor/symfony/class-loader/XcacheClassLoader.php
deleted file mode 100644
index bf309a692..000000000
--- a/tests/integration/vendor/symfony/class-loader/XcacheClassLoader.php
+++ /dev/null
@@ -1,141 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * XcacheClassLoader implements a wrapping autoloader cached in XCache for PHP 5.3.
- *
- * It expects an object implementing a findFile method to find the file. This
- * allows using it as a wrapper around the other loaders of the component (the
- * ClassLoader for instance) but also around any other autoloaders following
- * this convention (the Composer one for instance).
- *
- * // with a Symfony autoloader
- * $loader = new ClassLoader();
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // or with a Composer autoloader
- * use Composer\Autoload\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * $cachedLoader = new XcacheClassLoader('my_prefix', $loader);
- *
- * // activate the cached autoloader
- * $cachedLoader->register();
- *
- * // eventually deactivate the non-cached loader if it was registered previously
- * // to be sure to use the cached one.
- * $loader->unregister();
- *
- * @author Fabien Potencier
- * @author Kris Wallsmith
- * @author Kim Hemsø Rasmussen
- */
-class XcacheClassLoader
-{
- private $prefix;
-
- /**
- * A class loader object that implements the findFile() method.
- *
- * @var object
- */
- private $decorated;
-
- /**
- * Constructor.
- *
- * @param string $prefix The XCache namespace prefix to use
- * @param object $decorated A class loader object that implements the findFile() method
- *
- * @throws \RuntimeException
- * @throws \InvalidArgumentException
- */
- public function __construct($prefix, $decorated)
- {
- if (!extension_loaded('xcache')) {
- throw new \RuntimeException('Unable to use XcacheClassLoader as XCache is not enabled.');
- }
-
- if (!method_exists($decorated, 'findFile')) {
- throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
- }
-
- $this->prefix = $prefix;
- $this->decorated = $decorated;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds a file by class name while caching lookups to Xcache.
- *
- * @param string $class A class name to resolve to file
- *
- * @return string|null
- */
- public function findFile($class)
- {
- if (xcache_isset($this->prefix.$class)) {
- $file = xcache_get($this->prefix.$class);
- } else {
- $file = $this->decorated->findFile($class) ?: null;
- xcache_set($this->prefix.$class, $file);
- }
-
- return $file;
- }
-
- /**
- * Passes through all unknown calls onto the decorated object.
- */
- public function __call($method, $args)
- {
- return call_user_func_array(array($this->decorated, $method), $args);
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/composer.json b/tests/integration/vendor/symfony/class-loader/composer.json
deleted file mode 100644
index 634c647ce..000000000
--- a/tests/integration/vendor/symfony/class-loader/composer.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "symfony/class-loader",
- "type": "library",
- "description": "Symfony ClassLoader Component",
- "keywords": [],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "minimum-stability": "dev",
- "require": {
- "php": ">=5.5.9"
- },
- "require-dev": {
- "symfony/finder": "~2.8|~3.0",
- "symfony/polyfill-apcu": "~1.1"
- },
- "suggest": {
- "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM"
- },
- "autoload": {
- "psr-4": { "Symfony\\Component\\ClassLoader\\": "" },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- }
-}
diff --git a/tests/integration/vendor/symfony/class-loader/phpunit.xml.dist b/tests/integration/vendor/symfony/class-loader/phpunit.xml.dist
deleted file mode 100644
index 4856db5be..000000000
--- a/tests/integration/vendor/symfony/class-loader/phpunit.xml.dist
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./Tests/
-
-
-
-
-
- ./
-
- ./Resources
- ./Tests
- ./vendor
-
-
-
-
diff --git a/tests/integration/vendor/symfony/config/Builder/ClassBuilder.php b/tests/integration/vendor/symfony/config/Builder/ClassBuilder.php
new file mode 100644
index 000000000..26fcab400
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Builder/ClassBuilder.php
@@ -0,0 +1,175 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Builder;
+
+/**
+ * Build PHP classes to generate config.
+ *
+ * @internal
+ *
+ * @author Tobias Nyholm
+ */
+class ClassBuilder
+{
+ /** @var string */
+ private $namespace;
+
+ /** @var string */
+ private $name;
+
+ /** @var Property[] */
+ private $properties = [];
+
+ /** @var Method[] */
+ private $methods = [];
+ private $require = [];
+ private $use = [];
+ private $implements = [];
+ private $allowExtraKeys = false;
+
+ public function __construct(string $namespace, string $name)
+ {
+ $this->namespace = $namespace;
+ $this->name = ucfirst($this->camelCase($name)).'Config';
+ }
+
+ public function getDirectory(): string
+ {
+ return str_replace('\\', \DIRECTORY_SEPARATOR, $this->namespace);
+ }
+
+ public function getFilename(): string
+ {
+ return $this->name.'.php';
+ }
+
+ public function build(): string
+ {
+ $rootPath = explode(\DIRECTORY_SEPARATOR, $this->getDirectory());
+ $require = '';
+ foreach ($this->require as $class) {
+ // figure out relative path.
+ $path = explode(\DIRECTORY_SEPARATOR, $class->getDirectory());
+ $path[] = $class->getFilename();
+ foreach ($rootPath as $key => $value) {
+ if ($path[$key] !== $value) {
+ break;
+ }
+ unset($path[$key]);
+ }
+ $require .= sprintf('require_once __DIR__.\DIRECTORY_SEPARATOR.\'%s\';', implode('\'.\DIRECTORY_SEPARATOR.\'', $path))."\n";
+ }
+ $use = '';
+ foreach (array_keys($this->use) as $statement) {
+ $use .= sprintf('use %s;', $statement)."\n";
+ }
+
+ $implements = [] === $this->implements ? '' : 'implements '.implode(', ', $this->implements);
+ $body = '';
+ foreach ($this->properties as $property) {
+ $body .= ' '.$property->getContent()."\n";
+ }
+ foreach ($this->methods as $method) {
+ $lines = explode("\n", $method->getContent());
+ foreach ($lines as $line) {
+ $body .= ' '.$line."\n";
+ }
+ }
+
+ $content = strtr(' $this->namespace, 'REQUIRE' => $require, 'USE' => $use, 'CLASS' => $this->getName(), 'IMPLEMENTS' => $implements, 'BODY' => $body]);
+
+ return $content;
+ }
+
+ public function addRequire(self $class): void
+ {
+ $this->require[] = $class;
+ }
+
+ public function addUse(string $class): void
+ {
+ $this->use[$class] = true;
+ }
+
+ public function addImplements(string $interface): void
+ {
+ $this->implements[] = '\\'.ltrim($interface, '\\');
+ }
+
+ public function addMethod(string $name, string $body, array $params = []): void
+ {
+ $this->methods[] = new Method(strtr($body, ['NAME' => $this->camelCase($name)] + $params));
+ }
+
+ public function addProperty(string $name, string $classType = null): Property
+ {
+ $property = new Property($name, '_' !== $name[0] ? $this->camelCase($name) : $name);
+ if (null !== $classType) {
+ $property->setType($classType);
+ }
+ $this->properties[] = $property;
+ $property->setContent(sprintf('private $%s;', $property->getName()));
+
+ return $property;
+ }
+
+ public function getProperties(): array
+ {
+ return $this->properties;
+ }
+
+ private function camelCase(string $input): string
+ {
+ $output = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $input))));
+
+ return preg_replace('#\W#', '', $output);
+ }
+
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ public function getNamespace(): string
+ {
+ return $this->namespace;
+ }
+
+ public function getFqcn(): string
+ {
+ return '\\'.$this->namespace.'\\'.$this->name;
+ }
+
+ public function setAllowExtraKeys(bool $allowExtraKeys): void
+ {
+ $this->allowExtraKeys = $allowExtraKeys;
+ }
+
+ public function shouldAllowExtraKeys(): bool
+ {
+ return $this->allowExtraKeys;
+ }
+}
diff --git a/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php
new file mode 100644
index 000000000..979c95522
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php
@@ -0,0 +1,458 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Builder;
+
+use Symfony\Component\Config\Definition\ArrayNode;
+use Symfony\Component\Config\Definition\BooleanNode;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+use Symfony\Component\Config\Definition\EnumNode;
+use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
+use Symfony\Component\Config\Definition\FloatNode;
+use Symfony\Component\Config\Definition\IntegerNode;
+use Symfony\Component\Config\Definition\NodeInterface;
+use Symfony\Component\Config\Definition\PrototypedArrayNode;
+use Symfony\Component\Config\Definition\ScalarNode;
+use Symfony\Component\Config\Definition\VariableNode;
+use Symfony\Component\Config\Loader\ParamConfigurator;
+
+/**
+ * Generate ConfigBuilders to help create valid config.
+ *
+ * @author Tobias Nyholm
+ */
+class ConfigBuilderGenerator implements ConfigBuilderGeneratorInterface
+{
+ private $classes;
+ private $outputDir;
+
+ public function __construct(string $outputDir)
+ {
+ $this->outputDir = $outputDir;
+ }
+
+ /**
+ * @return \Closure that will return the root config class
+ */
+ public function build(ConfigurationInterface $configuration): \Closure
+ {
+ $this->classes = [];
+
+ $rootNode = $configuration->getConfigTreeBuilder()->buildTree();
+ $rootClass = new ClassBuilder('Symfony\\Config', $rootNode->getName());
+
+ $path = $this->getFullPath($rootClass);
+ if (!is_file($path)) {
+ // Generate the class if the file not exists
+ $this->classes[] = $rootClass;
+ $this->buildNode($rootNode, $rootClass, $this->getSubNamespace($rootClass));
+ $rootClass->addImplements(ConfigBuilderInterface::class);
+ $rootClass->addMethod('getExtensionAlias', '
+public function NAME(): string
+{
+ return \'ALIAS\';
+}', ['ALIAS' => $rootNode->getPath()]);
+
+ $this->writeClasses();
+ }
+
+ $loader = \Closure::fromCallable(function () use ($path, $rootClass) {
+ require_once $path;
+ $className = $rootClass->getFqcn();
+
+ return new $className();
+ });
+
+ return $loader;
+ }
+
+ private function getFullPath(ClassBuilder $class): string
+ {
+ $directory = $this->outputDir.\DIRECTORY_SEPARATOR.$class->getDirectory();
+ if (!is_dir($directory)) {
+ @mkdir($directory, 0777, true);
+ }
+
+ return $directory.\DIRECTORY_SEPARATOR.$class->getFilename();
+ }
+
+ private function writeClasses(): void
+ {
+ foreach ($this->classes as $class) {
+ $this->buildConstructor($class);
+ $this->buildToArray($class);
+ $this->buildSetExtraKey($class);
+
+ file_put_contents($this->getFullPath($class), $class->build());
+ }
+
+ $this->classes = [];
+ }
+
+ private function buildNode(NodeInterface $node, ClassBuilder $class, string $namespace): void
+ {
+ if (!$node instanceof ArrayNode) {
+ throw new \LogicException('The node was expected to be an ArrayNode. This Configuration includes an edge case not supported yet.');
+ }
+
+ foreach ($node->getChildren() as $child) {
+ switch (true) {
+ case $child instanceof ScalarNode:
+ $this->handleScalarNode($child, $class);
+ break;
+ case $child instanceof PrototypedArrayNode:
+ $this->handlePrototypedArrayNode($child, $class, $namespace);
+ break;
+ case $child instanceof VariableNode:
+ $this->handleVariableNode($child, $class);
+ break;
+ case $child instanceof ArrayNode:
+ $this->handleArrayNode($child, $class, $namespace);
+ break;
+ default:
+ throw new \RuntimeException(sprintf('Unknown node "%s".', \get_class($child)));
+ }
+ }
+ }
+
+ private function handleArrayNode(ArrayNode $node, ClassBuilder $class, string $namespace): void
+ {
+ $childClass = new ClassBuilder($namespace, $node->getName());
+ $childClass->setAllowExtraKeys($node->shouldIgnoreExtraKeys());
+ $class->addRequire($childClass);
+ $this->classes[] = $childClass;
+
+ $property = $class->addProperty($node->getName(), $childClass->getFqcn());
+ $body = '
+public function NAME(array $value = []): CLASS
+{
+ if (null === $this->PROPERTY) {
+ $this->PROPERTY = new CLASS($value);
+ } elseif ([] !== $value) {
+ throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
+ }
+
+ return $this->PROPERTY;
+}';
+ $class->addUse(InvalidConfigurationException::class);
+ $class->addMethod($node->getName(), $body, ['PROPERTY' => $property->getName(), 'CLASS' => $childClass->getFqcn()]);
+
+ $this->buildNode($node, $childClass, $this->getSubNamespace($childClass));
+ }
+
+ private function handleVariableNode(VariableNode $node, ClassBuilder $class): void
+ {
+ $comment = $this->getComment($node);
+ $property = $class->addProperty($node->getName());
+ $class->addUse(ParamConfigurator::class);
+
+ $body = '
+/**
+COMMENT * @return $this
+ */
+public function NAME($valueDEFAULT): self
+{
+ $this->PROPERTY = $value;
+
+ return $this;
+}';
+ $class->addMethod($node->getName(), $body, ['PROPERTY' => $property->getName(), 'COMMENT' => $comment, 'DEFAULT' => $node->hasDefaultValue() ? ' = '.var_export($node->getDefaultValue(), true) : '']);
+ }
+
+ private function handlePrototypedArrayNode(PrototypedArrayNode $node, ClassBuilder $class, string $namespace): void
+ {
+ $name = $this->getSingularName($node);
+ $prototype = $node->getPrototype();
+ $methodName = $name;
+
+ $parameterType = $this->getParameterType($prototype);
+ if (null !== $parameterType || $prototype instanceof ScalarNode) {
+ $class->addUse(ParamConfigurator::class);
+ $property = $class->addProperty($node->getName());
+ if (null === $key = $node->getKeyAttribute()) {
+ // This is an array of values; don't use singular name
+ $body = '
+/**
+ * @param ParamConfigurator|list $value
+ * @return $this
+ */
+public function NAME($value): self
+{
+ $this->PROPERTY = $value;
+
+ return $this;
+}';
+
+ $class->addMethod($node->getName(), $body, ['PROPERTY' => $property->getName(), 'TYPE' => '' === $parameterType ? 'mixed' : $parameterType]);
+ } else {
+ $body = '
+/**
+ * @param ParamConfigurator|TYPE $value
+ * @return $this
+ */
+public function NAME(string $VAR, $VALUE): self
+{
+ $this->PROPERTY[$VAR] = $VALUE;
+
+ return $this;
+}';
+
+ $class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'TYPE' => '' === $parameterType ? 'mixed' : $parameterType, 'VAR' => '' === $key ? 'key' : $key, 'VALUE' => 'value' === $key ? 'data' : 'value']);
+ }
+
+ return;
+ }
+
+ $childClass = new ClassBuilder($namespace, $name);
+ if ($prototype instanceof ArrayNode) {
+ $childClass->setAllowExtraKeys($prototype->shouldIgnoreExtraKeys());
+ }
+ $class->addRequire($childClass);
+ $this->classes[] = $childClass;
+ $property = $class->addProperty($node->getName(), $childClass->getFqcn().'[]');
+
+ if (null === $key = $node->getKeyAttribute()) {
+ $body = '
+public function NAME(array $value = []): CLASS
+{
+ return $this->PROPERTY[] = new CLASS($value);
+}';
+ $class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'CLASS' => $childClass->getFqcn()]);
+ } else {
+ $body = '
+public function NAME(string $VAR, array $VALUE = []): CLASS
+{
+ if (!isset($this->PROPERTY[$VAR])) {
+ return $this->PROPERTY[$VAR] = new CLASS($value);
+ }
+ if ([] === $value) {
+ return $this->PROPERTY[$VAR];
+ }
+
+ throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
+}';
+ $class->addUse(InvalidConfigurationException::class);
+ $class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'CLASS' => $childClass->getFqcn(), 'VAR' => '' === $key ? 'key' : $key, 'VALUE' => 'value' === $key ? 'data' : 'value']);
+ }
+
+ $this->buildNode($prototype, $childClass, $namespace.'\\'.$childClass->getName());
+ }
+
+ private function handleScalarNode(ScalarNode $node, ClassBuilder $class): void
+ {
+ $comment = $this->getComment($node);
+ $property = $class->addProperty($node->getName());
+ $class->addUse(ParamConfigurator::class);
+
+ $body = '
+/**
+COMMENT * @return $this
+ */
+public function NAME($value): self
+{
+ $this->PROPERTY = $value;
+
+ return $this;
+}';
+
+ $class->addMethod($node->getName(), $body, ['PROPERTY' => $property->getName(), 'COMMENT' => $comment]);
+ }
+
+ private function getParameterType(NodeInterface $node): ?string
+ {
+ if ($node instanceof BooleanNode) {
+ return 'bool';
+ }
+
+ if ($node instanceof IntegerNode) {
+ return 'int';
+ }
+
+ if ($node instanceof FloatNode) {
+ return 'float';
+ }
+
+ if ($node instanceof EnumNode) {
+ return '';
+ }
+
+ if ($node instanceof PrototypedArrayNode && $node->getPrototype() instanceof ScalarNode) {
+ // This is just an array of variables
+ return 'array';
+ }
+
+ if ($node instanceof VariableNode) {
+ // mixed
+ return '';
+ }
+
+ return null;
+ }
+
+ private function getComment(VariableNode $node): string
+ {
+ $comment = '';
+ if ('' !== $info = (string) $node->getInfo()) {
+ $comment .= ' * '.$info."\n";
+ }
+
+ foreach ((array) ($node->getExample() ?? []) as $example) {
+ $comment .= ' * @example '.$example."\n";
+ }
+
+ if ('' !== $default = $node->getDefaultValue()) {
+ $comment .= ' * @default '.(null === $default ? 'null' : var_export($default, true))."\n";
+ }
+
+ if ($node instanceof EnumNode) {
+ $comment .= sprintf(' * @param ParamConfigurator|%s $value', implode('|', array_map(function ($a) {
+ return var_export($a, true);
+ }, $node->getValues())))."\n";
+ } else {
+ $parameterType = $this->getParameterType($node);
+ if (null === $parameterType || '' === $parameterType) {
+ $parameterType = 'mixed';
+ }
+ $comment .= ' * @param ParamConfigurator|'.$parameterType.' $value'."\n";
+ }
+
+ if ($node->isDeprecated()) {
+ $comment .= ' * @deprecated '.$node->getDeprecation($node->getName(), $node->getParent()->getName())['message']."\n";
+ }
+
+ return $comment;
+ }
+
+ /**
+ * Pick a good singular name.
+ */
+ private function getSingularName(PrototypedArrayNode $node): string
+ {
+ $name = $node->getName();
+ if ('s' !== substr($name, -1)) {
+ return $name;
+ }
+
+ $parent = $node->getParent();
+ $mappings = $parent instanceof ArrayNode ? $parent->getXmlRemappings() : [];
+ foreach ($mappings as $map) {
+ if ($map[1] === $name) {
+ $name = $map[0];
+ break;
+ }
+ }
+
+ return $name;
+ }
+
+ private function buildToArray(ClassBuilder $class): void
+ {
+ $body = '$output = [];';
+ foreach ($class->getProperties() as $p) {
+ $code = '$this->PROPERTY';
+ if (null !== $p->getType()) {
+ if ($p->isArray()) {
+ $code = 'array_map(function ($v) { return $v->toArray(); }, $this->PROPERTY)';
+ } else {
+ $code = '$this->PROPERTY->toArray()';
+ }
+ }
+
+ $body .= strtr('
+ if (null !== $this->PROPERTY) {
+ $output[\'ORG_NAME\'] = '.$code.';
+ }', ['PROPERTY' => $p->getName(), 'ORG_NAME' => $p->getOriginalName()]);
+ }
+
+ $extraKeys = $class->shouldAllowExtraKeys() ? ' + $this->_extraKeys' : '';
+
+ $class->addMethod('toArray', '
+public function NAME(): array
+{
+ '.$body.'
+
+ return $output'.$extraKeys.';
+}');
+ }
+
+ private function buildConstructor(ClassBuilder $class): void
+ {
+ $body = '';
+ foreach ($class->getProperties() as $p) {
+ $code = '$value[\'ORG_NAME\']';
+ if (null !== $p->getType()) {
+ if ($p->isArray()) {
+ $code = 'array_map(function ($v) { return new '.$p->getType().'($v); }, $value[\'ORG_NAME\'])';
+ } else {
+ $code = 'new '.$p->getType().'($value[\'ORG_NAME\'])';
+ }
+ }
+
+ $body .= strtr('
+ if (isset($value[\'ORG_NAME\'])) {
+ $this->PROPERTY = '.$code.';
+ unset($value[\'ORG_NAME\']);
+ }
+', ['PROPERTY' => $p->getName(), 'ORG_NAME' => $p->getOriginalName()]);
+ }
+
+ if ($class->shouldAllowExtraKeys()) {
+ $body .= '
+ $this->_extraKeys = $value;
+';
+ } else {
+ $body .= '
+ if ([] !== $value) {
+ throw new InvalidConfigurationException(sprintf(\'The following keys are not supported by "%s": \', __CLASS__).implode(\', \', array_keys($value)));
+ }';
+
+ $class->addUse(InvalidConfigurationException::class);
+ }
+
+ $class->addMethod('__construct', '
+public function __construct(array $value = [])
+{
+'.$body.'
+}');
+ }
+
+ private function buildSetExtraKey(ClassBuilder $class): void
+ {
+ if (!$class->shouldAllowExtraKeys()) {
+ return;
+ }
+
+ $class->addUse(ParamConfigurator::class);
+
+ $class->addProperty('_extraKeys');
+
+ $class->addMethod('set', '
+/**
+ * @param ParamConfigurator|mixed $value
+ * @return $this
+ */
+public function NAME(string $key, $value): self
+{
+ if (null === $value) {
+ unset($this->_extraKeys[$key]);
+ } else {
+ $this->_extraKeys[$key] = $value;
+ }
+
+ return $this;
+}');
+ }
+
+ private function getSubNamespace(ClassBuilder $rootClass): string
+ {
+ return sprintf('%s\\%s', $rootClass->getNamespace(), substr($rootClass->getName(), 0, -6));
+ }
+}
diff --git a/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGeneratorInterface.php b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGeneratorInterface.php
new file mode 100644
index 000000000..c52c9e5d5
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGeneratorInterface.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Builder;
+
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+
+/**
+ * Generates ConfigBuilders to help create valid config.
+ *
+ * @author Tobias Nyholm
+ */
+interface ConfigBuilderGeneratorInterface
+{
+ /**
+ * @return \Closure that will return the root config class
+ */
+ public function build(ConfigurationInterface $configuration): \Closure;
+}
diff --git a/tests/integration/vendor/symfony/config/Builder/ConfigBuilderInterface.php b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderInterface.php
new file mode 100644
index 000000000..fd3129c58
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderInterface.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Builder;
+
+/**
+ * A ConfigBuilder provides helper methods to build a large complex array.
+ *
+ * @author Tobias Nyholm
+ */
+interface ConfigBuilderInterface
+{
+ /**
+ * Gets all configuration represented as an array.
+ */
+ public function toArray(): array;
+
+ /**
+ * Gets the alias for the extension which config we are building.
+ */
+ public function getExtensionAlias(): string;
+}
diff --git a/tests/integration/vendor/symfony/config/Builder/Method.php b/tests/integration/vendor/symfony/config/Builder/Method.php
new file mode 100644
index 000000000..3577e3d7a
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Builder/Method.php
@@ -0,0 +1,34 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Builder;
+
+/**
+ * Represents a method when building classes.
+ *
+ * @internal
+ *
+ * @author Tobias Nyholm
+ */
+class Method
+{
+ private $content;
+
+ public function __construct(string $content)
+ {
+ $this->content = $content;
+ }
+
+ public function getContent(): string
+ {
+ return $this->content;
+ }
+}
diff --git a/tests/integration/vendor/symfony/config/Builder/Property.php b/tests/integration/vendor/symfony/config/Builder/Property.php
new file mode 100644
index 000000000..1b24c47cc
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Builder/Property.php
@@ -0,0 +1,75 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Builder;
+
+/**
+ * Represents a property when building classes.
+ *
+ * @internal
+ *
+ * @author Tobias Nyholm
+ */
+class Property
+{
+ private $name;
+ private $originalName;
+ private $array = false;
+ private $type = null;
+ private $content;
+
+ public function __construct(string $originalName, string $name)
+ {
+ $this->name = $name;
+ $this->originalName = $originalName;
+ }
+
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ public function getOriginalName(): string
+ {
+ return $this->originalName;
+ }
+
+ public function setType(string $type): void
+ {
+ $this->array = false;
+ $this->type = $type;
+
+ if ('[]' === substr($type, -2)) {
+ $this->array = true;
+ $this->type = substr($type, 0, -2);
+ }
+ }
+
+ public function getType(): ?string
+ {
+ return $this->type;
+ }
+
+ public function getContent(): ?string
+ {
+ return $this->content;
+ }
+
+ public function setContent(string $content): void
+ {
+ $this->content = $content;
+ }
+
+ public function isArray(): bool
+ {
+ return $this->array;
+ }
+}
diff --git a/tests/integration/vendor/symfony/config/CHANGELOG.md b/tests/integration/vendor/symfony/config/CHANGELOG.md
index b752df6fe..75ef8bc44 100644
--- a/tests/integration/vendor/symfony/config/CHANGELOG.md
+++ b/tests/integration/vendor/symfony/config/CHANGELOG.md
@@ -1,6 +1,73 @@
CHANGELOG
=========
+5.3.0
+-----
+
+ * Add support for generating `ConfigBuilder` for extensions
+
+5.1.0
+-----
+
+ * updated the signature of method `NodeDefinition::setDeprecated()` to `NodeDefinition::setDeprecation(string $package, string $version, string $message)`
+ * updated the signature of method `BaseNode::setDeprecated()` to `BaseNode::setDeprecation(string $package, string $version, string $message)`
+ * deprecated passing a null message to `BaseNode::setDeprecated()` to un-deprecate a node
+ * deprecated `BaseNode::getDeprecationMessage()`, use `BaseNode::getDeprecation()` instead
+
+5.0.0
+-----
+
+ * Dropped support for constructing a `TreeBuilder` without passing root node information.
+ * Removed the `root()` method in `TreeBuilder`, pass the root node information to the constructor instead
+ * Added method `getChildNodeDefinitions()` to ParentNodeDefinitionInterface
+ * Removed `FileLoaderLoadException`, use `LoaderLoadException` instead
+
+4.4.0
+-----
+
+ * added a way to exclude patterns of resources from being imported by the `import()` method
+
+4.3.0
+-----
+
+ * deprecated using environment variables with `cannotBeEmpty()` if the value is validated with `validate()`
+ * made `Resource\*` classes final and not implement `Serializable` anymore
+ * deprecated the `root()` method in `TreeBuilder`, pass the root node information to the constructor instead
+
+4.2.0
+-----
+
+ * deprecated constructing a `TreeBuilder` without passing root node information
+ * renamed `FileLoaderLoadException` to `LoaderLoadException`
+
+4.1.0
+-----
+
+ * added `setPathSeparator` method to `NodeBuilder` class
+ * added third `$pathSeparator` constructor argument to `BaseNode`
+ * the `Processor` class has been made final
+
+4.0.0
+-----
+
+ * removed `ConfigCachePass`
+
+3.4.0
+-----
+
+ * added `setDeprecated()` method to indicate a deprecated node
+ * added `XmlUtils::parse()` method to parse an XML string
+ * deprecated `ConfigCachePass`
+
+3.3.0
+-----
+
+ * added `ReflectionClassResource` class
+ * added second `$exists` constructor argument to `ClassExistenceResource`
+ * made `ClassExistenceResource` work with interfaces and traits
+ * added `ConfigCachePass` (originally in FrameworkBundle)
+ * added `castToArray()` helper to turn any config value into an array
+
3.0.0
-----
@@ -18,7 +85,7 @@ The edge case of defining just one value for nodes of type Enum is now allowed:
$rootNode
->children()
->enumNode('variable')
- ->values(array('value'))
+ ->values(['value'])
->end()
->end()
;
@@ -28,7 +95,7 @@ Before: `InvalidArgumentException` (variable must contain at least two
distinct elements).
After: the code will work as expected and it will restrict the values of the
`variable` option to just `value`.
-
+
* deprecated the `ResourceInterface::isFresh()` method. If you implement custom resource types and they
can be validated that way, make them implement the new `SelfCheckingResourceInterface`.
* deprecated the getResource() method in ResourceInterface. You can still call this method
@@ -41,7 +108,7 @@ After: the code will work as expected and it will restrict the values of the
* added `ConfigCacheInterface`, `ConfigCacheFactoryInterface` and a basic `ConfigCacheFactory`
implementation to delegate creation of ConfigCache instances
-
+
2.2.0
-----
diff --git a/tests/integration/vendor/symfony/config/ConfigCache.php b/tests/integration/vendor/symfony/config/ConfigCache.php
index 591c89bc4..3b090525e 100644
--- a/tests/integration/vendor/symfony/config/ConfigCache.php
+++ b/tests/integration/vendor/symfony/config/ConfigCache.php
@@ -31,13 +31,13 @@ class ConfigCache extends ResourceCheckerConfigCache
* @param string $file The absolute cache path
* @param bool $debug Whether debugging is enabled or not
*/
- public function __construct($file, $debug)
+ public function __construct(string $file, bool $debug)
{
- $this->debug = (bool) $debug;
+ $this->debug = $debug;
- $checkers = array();
+ $checkers = [];
if (true === $this->debug) {
- $checkers = array(new SelfCheckingResourceChecker());
+ $checkers = [new SelfCheckingResourceChecker()];
}
parent::__construct($file, $checkers);
@@ -49,7 +49,7 @@ public function __construct($file, $debug)
* This implementation always returns true when debug is off and the
* cache file exists.
*
- * @return bool true if the cache is fresh, false otherwise
+ * @return bool
*/
public function isFresh()
{
diff --git a/tests/integration/vendor/symfony/config/ConfigCacheFactory.php b/tests/integration/vendor/symfony/config/ConfigCacheFactory.php
index 396536e2d..11fd3cb3a 100644
--- a/tests/integration/vendor/symfony/config/ConfigCacheFactory.php
+++ b/tests/integration/vendor/symfony/config/ConfigCacheFactory.php
@@ -22,15 +22,12 @@
*/
class ConfigCacheFactory implements ConfigCacheFactoryInterface
{
- /**
- * @var bool Debug flag passed to the ConfigCache
- */
private $debug;
/**
* @param bool $debug The debug flag to pass to ConfigCache
*/
- public function __construct($debug)
+ public function __construct(bool $debug)
{
$this->debug = $debug;
}
@@ -38,15 +35,11 @@ public function __construct($debug)
/**
* {@inheritdoc}
*/
- public function cache($file, $callback)
+ public function cache(string $file, callable $callback)
{
- if (!is_callable($callback)) {
- throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', gettype($callback)));
- }
-
$cache = new ConfigCache($file, $this->debug);
if (!$cache->isFresh()) {
- call_user_func($callback, $cache);
+ $callback($cache);
}
return $cache;
diff --git a/tests/integration/vendor/symfony/config/ConfigCacheFactoryInterface.php b/tests/integration/vendor/symfony/config/ConfigCacheFactoryInterface.php
index bd614c4b6..146ee9b56 100644
--- a/tests/integration/vendor/symfony/config/ConfigCacheFactoryInterface.php
+++ b/tests/integration/vendor/symfony/config/ConfigCacheFactoryInterface.php
@@ -26,7 +26,7 @@ interface ConfigCacheFactoryInterface
* @param string $file The absolute cache file path
* @param callable $callable The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback
*
- * @return ConfigCacheInterface $configCache The cache instance
+ * @return ConfigCacheInterface
*/
- public function cache($file, $callable);
+ public function cache(string $file, callable $callable);
}
diff --git a/tests/integration/vendor/symfony/config/ConfigCacheInterface.php b/tests/integration/vendor/symfony/config/ConfigCacheInterface.php
index 7c47ad70a..3cd7a5cc0 100644
--- a/tests/integration/vendor/symfony/config/ConfigCacheInterface.php
+++ b/tests/integration/vendor/symfony/config/ConfigCacheInterface.php
@@ -23,7 +23,7 @@ interface ConfigCacheInterface
/**
* Gets the cache file path.
*
- * @return string The cache file path
+ * @return string
*/
public function getPath();
@@ -32,7 +32,7 @@ public function getPath();
*
* This check should take the metadata passed to the write() method into consideration.
*
- * @return bool Whether the cache is still fresh
+ * @return bool
*/
public function isFresh();
@@ -45,5 +45,5 @@ public function isFresh();
*
* @throws \RuntimeException When the cache file cannot be written
*/
- public function write($content, array $metadata = null);
+ public function write(string $content, array $metadata = null);
}
diff --git a/tests/integration/vendor/symfony/config/Definition/ArrayNode.php b/tests/integration/vendor/symfony/config/Definition/ArrayNode.php
index 457e7a8c9..bd0eae9fd 100644
--- a/tests/integration/vendor/symfony/config/Definition/ArrayNode.php
+++ b/tests/integration/vendor/symfony/config/Definition/ArrayNode.php
@@ -22,8 +22,8 @@
*/
class ArrayNode extends BaseNode implements PrototypeNodeInterface
{
- protected $xmlRemappings = array();
- protected $children = array();
+ protected $xmlRemappings = [];
+ protected $children = [];
protected $allowFalse = false;
protected $allowNewKeys = true;
protected $addIfNotSet = false;
@@ -32,34 +32,30 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
protected $removeExtraKeys = true;
protected $normalizeKeys = true;
- public function setNormalizeKeys($normalizeKeys)
+ public function setNormalizeKeys(bool $normalizeKeys)
{
- $this->normalizeKeys = (bool) $normalizeKeys;
+ $this->normalizeKeys = $normalizeKeys;
}
/**
- * Normalizes keys between the different configuration formats.
+ * {@inheritdoc}
*
* Namely, you mostly have foo_bar in YAML while you have foo-bar in XML.
* After running this method, all keys are normalized to foo_bar.
*
* If you have a mixed key like foo-bar_moo, it will not be altered.
* The key will also not be altered if the target key already exists.
- *
- * @param mixed $value
- *
- * @return array The value with normalized keys
*/
protected function preNormalize($value)
{
- if (!$this->normalizeKeys || !is_array($value)) {
+ if (!$this->normalizeKeys || !\is_array($value)) {
return $value;
}
- $normalized = array();
+ $normalized = [];
foreach ($value as $k => $v) {
- if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
+ if (str_contains($k, '-') && !str_contains($k, '_') && !\array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
$normalized[$normalizedKey] = $v;
} else {
$normalized[$k] = $v;
@@ -72,7 +68,7 @@ protected function preNormalize($value)
/**
* Retrieves the children of this node.
*
- * @return array The children
+ * @return array
*/
public function getChildren()
{
@@ -82,7 +78,7 @@ public function getChildren()
/**
* Sets the xml remappings that should be performed.
*
- * @param array $remappings an array of the form array(array(string, string))
+ * @param array $remappings An array of the form [[string, string]]
*/
public function setXmlRemappings(array $remappings)
{
@@ -92,7 +88,7 @@ public function setXmlRemappings(array $remappings)
/**
* Gets the xml remappings that should be performed.
*
- * @return array $remappings an array of the form array(array(string, string))
+ * @return array an array of the form [[string, string]]
*/
public function getXmlRemappings()
{
@@ -102,70 +98,66 @@ public function getXmlRemappings()
/**
* Sets whether to add default values for this array if it has not been
* defined in any of the configuration files.
- *
- * @param bool $boolean
*/
- public function setAddIfNotSet($boolean)
+ public function setAddIfNotSet(bool $boolean)
{
- $this->addIfNotSet = (bool) $boolean;
+ $this->addIfNotSet = $boolean;
}
/**
* Sets whether false is allowed as value indicating that the array should be unset.
- *
- * @param bool $allow
*/
- public function setAllowFalse($allow)
+ public function setAllowFalse(bool $allow)
{
- $this->allowFalse = (bool) $allow;
+ $this->allowFalse = $allow;
}
/**
* Sets whether new keys can be defined in subsequent configurations.
- *
- * @param bool $allow
*/
- public function setAllowNewKeys($allow)
+ public function setAllowNewKeys(bool $allow)
{
- $this->allowNewKeys = (bool) $allow;
+ $this->allowNewKeys = $allow;
}
/**
* Sets if deep merging should occur.
- *
- * @param bool $boolean
*/
- public function setPerformDeepMerging($boolean)
+ public function setPerformDeepMerging(bool $boolean)
{
- $this->performDeepMerging = (bool) $boolean;
+ $this->performDeepMerging = $boolean;
}
/**
- * Whether extra keys should just be ignore without an exception.
+ * Whether extra keys should just be ignored without an exception.
*
* @param bool $boolean To allow extra keys
* @param bool $remove To remove extra keys
*/
- public function setIgnoreExtraKeys($boolean, $remove = true)
+ public function setIgnoreExtraKeys(bool $boolean, bool $remove = true)
{
- $this->ignoreExtraKeys = (bool) $boolean;
+ $this->ignoreExtraKeys = $boolean;
$this->removeExtraKeys = $this->ignoreExtraKeys && $remove;
}
/**
- * Sets the node Name.
- *
- * @param string $name The node's name
+ * Returns true when extra keys should be ignored without an exception.
+ */
+ public function shouldIgnoreExtraKeys(): bool
+ {
+ return $this->ignoreExtraKeys;
+ }
+
+ /**
+ * {@inheritdoc}
*/
- public function setName($name)
+ public function setName(string $name)
{
$this->name = $name;
}
/**
- * Checks if the node has a default value.
- *
- * @return bool
+ * {@inheritdoc}
*/
public function hasDefaultValue()
{
@@ -173,11 +165,7 @@ public function hasDefaultValue()
}
/**
- * Retrieves the default value.
- *
- * @return array The default value
- *
- * @throws \RuntimeException if the node has no default value
+ * {@inheritdoc}
*/
public function getDefaultValue()
{
@@ -185,7 +173,7 @@ public function getDefaultValue()
throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath()));
}
- $defaults = array();
+ $defaults = [];
foreach ($this->children as $name => $child) {
if ($child->hasDefaultValue()) {
$defaults[$name] = $child->getDefaultValue();
@@ -198,15 +186,13 @@ public function getDefaultValue()
/**
* Adds a child node.
*
- * @param NodeInterface $node The child node to add
- *
* @throws \InvalidArgumentException when the child node has no name
* @throws \InvalidArgumentException when the child node's name is not unique
*/
public function addChild(NodeInterface $node)
{
$name = $node->getName();
- if (!strlen($name)) {
+ if ('' === $name) {
throw new \InvalidArgumentException('Child nodes must be named.');
}
if (isset($this->children[$name])) {
@@ -217,11 +203,7 @@ public function addChild(NodeInterface $node)
}
/**
- * Finalizes the value of this node.
- *
- * @param mixed $value
- *
- * @return mixed The finalised value
+ * {@inheritdoc}
*
* @throws UnsetKeyException
* @throws InvalidConfigurationException if the node doesn't have enough children
@@ -229,15 +211,19 @@ public function addChild(NodeInterface $node)
protected function finalizeValue($value)
{
if (false === $value) {
- $msg = sprintf('Unsetting key for path "%s", value: %s', $this->getPath(), json_encode($value));
- throw new UnsetKeyException($msg);
+ throw new UnsetKeyException(sprintf('Unsetting key for path "%s", value: %s.', $this->getPath(), json_encode($value)));
}
foreach ($this->children as $name => $child) {
- if (!array_key_exists($name, $value)) {
+ if (!\array_key_exists($name, $value)) {
if ($child->isRequired()) {
- $msg = sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath());
- $ex = new InvalidConfigurationException($msg);
+ $message = sprintf('The child config "%s" under "%s" must be configured', $name, $this->getPath());
+ if ($child->getInfo()) {
+ $message .= sprintf(': %s', $child->getInfo());
+ } else {
+ $message .= '.';
+ }
+ $ex = new InvalidConfigurationException($message);
$ex->setPath($this->getPath());
throw $ex;
@@ -250,6 +236,11 @@ protected function finalizeValue($value)
continue;
}
+ if ($child->isDeprecated()) {
+ $deprecation = $child->getDeprecation($name, $this->getPath());
+ trigger_deprecation($deprecation['package'], $deprecation['version'], $deprecation['message']);
+ }
+
try {
$value[$name] = $child->finalize($value[$name]);
} catch (UnsetKeyException $e) {
@@ -261,20 +252,12 @@ protected function finalizeValue($value)
}
/**
- * Validates the type of the value.
- *
- * @param mixed $value
- *
- * @throws InvalidTypeException
+ * {@inheritdoc}
*/
protected function validateType($value)
{
- if (!is_array($value) && (!$this->allowFalse || false !== $value)) {
- $ex = new InvalidTypeException(sprintf(
- 'Invalid type for path "%s". Expected array, but got %s',
- $this->getPath(),
- gettype($value)
- ));
+ if (!\is_array($value) && (!$this->allowFalse || false !== $value)) {
+ $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "array", but got "%s"', $this->getPath(), get_debug_type($value)));
if ($hint = $this->getInfo()) {
$ex->addHint($hint);
}
@@ -285,11 +268,7 @@ protected function validateType($value)
}
/**
- * Normalizes the value.
- *
- * @param mixed $value The value to normalize
- *
- * @return mixed The normalized value
+ * {@inheritdoc}
*
* @throws InvalidConfigurationException
*/
@@ -301,10 +280,13 @@ protected function normalizeValue($value)
$value = $this->remapXml($value);
- $normalized = array();
+ $normalized = [];
foreach ($value as $name => $val) {
if (isset($this->children[$name])) {
- $normalized[$name] = $this->children[$name]->normalize($val);
+ try {
+ $normalized[$name] = $this->children[$name]->normalize($val);
+ } catch (UnsetKeyException $e) {
+ }
unset($value[$name]);
} elseif (!$this->removeExtraKeys) {
$normalized[$name] = $val;
@@ -312,8 +294,31 @@ protected function normalizeValue($value)
}
// if extra fields are present, throw exception
- if (count($value) && !$this->ignoreExtraKeys) {
- $msg = sprintf('Unrecognized option%s "%s" under "%s"', 1 === count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
+ if (\count($value) && !$this->ignoreExtraKeys) {
+ $proposals = array_keys($this->children);
+ sort($proposals);
+ $guesses = [];
+
+ foreach (array_keys($value) as $subject) {
+ $minScore = \INF;
+ foreach ($proposals as $proposal) {
+ $distance = levenshtein($subject, $proposal);
+ if ($distance <= $minScore && $distance < 3) {
+ $guesses[$proposal] = $distance;
+ $minScore = $distance;
+ }
+ }
+ }
+
+ $msg = sprintf('Unrecognized option%s "%s" under "%s"', 1 === \count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
+
+ if (\count($guesses)) {
+ asort($guesses);
+ $msg .= sprintf('. Did you mean "%s"?', implode('", "', array_keys($guesses)));
+ } else {
+ $msg .= sprintf('. Available option%s %s "%s".', 1 === \count($proposals) ? '' : 's', 1 === \count($proposals) ? 'is' : 'are', implode('", "', $proposals));
+ }
+
$ex = new InvalidConfigurationException($msg);
$ex->setPath($this->getPath());
@@ -326,13 +331,11 @@ protected function normalizeValue($value)
/**
* Remaps multiple singular values to a single plural value.
*
- * @param array $value The source values
- *
- * @return array The remapped values
+ * @return array
*/
- protected function remapXml($value)
+ protected function remapXml(array $value)
{
- foreach ($this->xmlRemappings as list($singular, $plural)) {
+ foreach ($this->xmlRemappings as [$singular, $plural]) {
if (!isset($value[$singular])) {
continue;
}
@@ -345,12 +348,7 @@ protected function remapXml($value)
}
/**
- * Merges values together.
- *
- * @param mixed $leftSide The left side to merge
- * @param mixed $rightSide The right side to merge
- *
- * @return mixed The merged values
+ * {@inheritdoc}
*
* @throws InvalidConfigurationException
* @throws \RuntimeException
@@ -369,15 +367,9 @@ protected function mergeValues($leftSide, $rightSide)
foreach ($rightSide as $k => $v) {
// no conflict
- if (!array_key_exists($k, $leftSide)) {
+ if (!\array_key_exists($k, $leftSide)) {
if (!$this->allowNewKeys) {
- $ex = new InvalidConfigurationException(sprintf(
- 'You are not allowed to define new elements for path "%s". '
- .'Please define all elements for this path in one config file. '
- .'If you are trying to overwrite an element, make sure you redefine it '
- .'with the same name.',
- $this->getPath()
- ));
+ $ex = new InvalidConfigurationException(sprintf('You are not allowed to define new elements for path "%s". Please define all elements for this path in one config file. If you are trying to overwrite an element, make sure you redefine it with the same name.', $this->getPath()));
$ex->setPath($this->getPath());
throw $ex;
@@ -388,7 +380,12 @@ protected function mergeValues($leftSide, $rightSide)
}
if (!isset($this->children[$k])) {
- throw new \RuntimeException('merge() expects a normalized config array.');
+ if (!$this->ignoreExtraKeys || $this->removeExtraKeys) {
+ throw new \RuntimeException('merge() expects a normalized config array.');
+ }
+
+ $leftSide[$k] = $v;
+ continue;
}
$leftSide[$k] = $this->children[$k]->merge($leftSide[$k], $v);
@@ -396,4 +393,12 @@ protected function mergeValues($leftSide, $rightSide)
return $leftSide;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function allowPlaceholders(): bool
+ {
+ return false;
+ }
}
diff --git a/tests/integration/vendor/symfony/config/Definition/BaseNode.php b/tests/integration/vendor/symfony/config/Definition/BaseNode.php
index dbf36335b..5ca123925 100644
--- a/tests/integration/vendor/symfony/config/Definition/BaseNode.php
+++ b/tests/integration/vendor/symfony/config/Definition/BaseNode.php
@@ -15,6 +15,7 @@
use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
+use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
/**
* The base node class.
@@ -23,48 +24,103 @@
*/
abstract class BaseNode implements NodeInterface
{
+ public const DEFAULT_PATH_SEPARATOR = '.';
+
+ private static $placeholderUniquePrefixes = [];
+ private static $placeholders = [];
+
protected $name;
protected $parent;
- protected $normalizationClosures = array();
- protected $finalValidationClosures = array();
+ protected $normalizationClosures = [];
+ protected $finalValidationClosures = [];
protected $allowOverwrite = true;
protected $required = false;
- protected $equivalentValues = array();
- protected $attributes = array();
+ protected $deprecation = [];
+ protected $equivalentValues = [];
+ protected $attributes = [];
+ protected $pathSeparator;
+
+ private $handlingPlaceholder;
/**
- * Constructor.
- *
- * @param string $name The name of the node
- * @param NodeInterface $parent The parent of this node
- *
- * @throws \InvalidArgumentException if the name contains a period.
+ * @throws \InvalidArgumentException if the name contains a period
*/
- public function __construct($name, NodeInterface $parent = null)
+ public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR)
{
- if (false !== strpos($name, '.')) {
- throw new \InvalidArgumentException('The name must not contain ".".');
+ if (str_contains($name = (string) $name, $pathSeparator)) {
+ throw new \InvalidArgumentException('The name must not contain ".'.$pathSeparator.'".');
}
$this->name = $name;
$this->parent = $parent;
+ $this->pathSeparator = $pathSeparator;
}
- public function setAttribute($key, $value)
+ /**
+ * Register possible (dummy) values for a dynamic placeholder value.
+ *
+ * Matching configuration values will be processed with a provided value, one by one. After a provided value is
+ * successfully processed the configuration value is returned as is, thus preserving the placeholder.
+ *
+ * @internal
+ */
+ public static function setPlaceholder(string $placeholder, array $values): void
+ {
+ if (!$values) {
+ throw new \InvalidArgumentException('At least one value must be provided.');
+ }
+
+ self::$placeholders[$placeholder] = $values;
+ }
+
+ /**
+ * Adds a common prefix for dynamic placeholder values.
+ *
+ * Matching configuration values will be skipped from being processed and are returned as is, thus preserving the
+ * placeholder. An exact match provided by {@see setPlaceholder()} might take precedence.
+ *
+ * @internal
+ */
+ public static function setPlaceholderUniquePrefix(string $prefix): void
+ {
+ self::$placeholderUniquePrefixes[] = $prefix;
+ }
+
+ /**
+ * Resets all current placeholders available.
+ *
+ * @internal
+ */
+ public static function resetPlaceholders(): void
+ {
+ self::$placeholderUniquePrefixes = [];
+ self::$placeholders = [];
+ }
+
+ public function setAttribute(string $key, $value)
{
$this->attributes[$key] = $value;
}
- public function getAttribute($key, $default = null)
+ /**
+ * @return mixed
+ */
+ public function getAttribute(string $key, $default = null)
{
- return isset($this->attributes[$key]) ? $this->attributes[$key] : $default;
+ return $this->attributes[$key] ?? $default;
}
- public function hasAttribute($key)
+ /**
+ * @return bool
+ */
+ public function hasAttribute(string $key)
{
return isset($this->attributes[$key]);
}
+ /**
+ * @return array
+ */
public function getAttributes()
{
return $this->attributes;
@@ -75,17 +131,15 @@ public function setAttributes(array $attributes)
$this->attributes = $attributes;
}
- public function removeAttribute($key)
+ public function removeAttribute(string $key)
{
unset($this->attributes[$key]);
}
/**
* Sets an info message.
- *
- * @param string $info
*/
- public function setInfo($info)
+ public function setInfo(string $info)
{
$this->setAttribute('info', $info);
}
@@ -93,7 +147,7 @@ public function setInfo($info)
/**
* Returns info message.
*
- * @return string The info text
+ * @return string|null
*/
public function getInfo()
{
@@ -113,7 +167,7 @@ public function setExample($example)
/**
* Retrieves the example configuration for this node.
*
- * @return string|array The example
+ * @return string|array|null
*/
public function getExample()
{
@@ -128,27 +182,63 @@ public function getExample()
*/
public function addEquivalentValue($originalValue, $equivalentValue)
{
- $this->equivalentValues[] = array($originalValue, $equivalentValue);
+ $this->equivalentValues[] = [$originalValue, $equivalentValue];
}
/**
* Set this node as required.
+ */
+ public function setRequired(bool $boolean)
+ {
+ $this->required = $boolean;
+ }
+
+ /**
+ * Sets this node as deprecated.
*
- * @param bool $boolean Required node
+ * @param string $package The name of the composer package that is triggering the deprecation
+ * @param string $version The version of the package that introduced the deprecation
+ * @param string $message the deprecation message to use
+ *
+ * You can use %node% and %path% placeholders in your message to display,
+ * respectively, the node name and its complete path
*/
- public function setRequired($boolean)
+ public function setDeprecated(?string $package/*, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.' */)
{
- $this->required = (bool) $boolean;
+ $args = \func_get_args();
+
+ if (\func_num_args() < 2) {
+ trigger_deprecation('symfony/config', '5.1', 'The signature of method "%s()" requires 3 arguments: "string $package, string $version, string $message", not defining them is deprecated.', __METHOD__);
+
+ if (!isset($args[0])) {
+ trigger_deprecation('symfony/config', '5.1', 'Passing a null message to un-deprecate a node is deprecated.');
+
+ $this->deprecation = [];
+
+ return;
+ }
+
+ $message = (string) $args[0];
+ $package = $version = '';
+ } else {
+ $package = (string) $args[0];
+ $version = (string) $args[1];
+ $message = (string) ($args[2] ?? 'The child node "%node%" at path "%path%" is deprecated.');
+ }
+
+ $this->deprecation = [
+ 'package' => $package,
+ 'version' => $version,
+ 'message' => $message,
+ ];
}
/**
* Sets if this node can be overridden.
- *
- * @param bool $allow
*/
- public function setAllowOverwrite($allow)
+ public function setAllowOverwrite(bool $allow)
{
- $this->allowOverwrite = (bool) $allow;
+ $this->allowOverwrite = $allow;
}
/**
@@ -172,9 +262,7 @@ public function setFinalValidationClosures(array $closures)
}
/**
- * Checks if this node is required.
- *
- * @return bool
+ * {@inheritdoc}
*/
public function isRequired()
{
@@ -182,9 +270,47 @@ public function isRequired()
}
/**
- * Returns the name of this node.
+ * Checks if this node is deprecated.
*
- * @return string The Node's name
+ * @return bool
+ */
+ public function isDeprecated()
+ {
+ return (bool) $this->deprecation;
+ }
+
+ /**
+ * Returns the deprecated message.
+ *
+ * @param string $node the configuration node name
+ * @param string $path the path of the node
+ *
+ * @return string
+ *
+ * @deprecated since Symfony 5.1, use "getDeprecation()" instead.
+ */
+ public function getDeprecationMessage(string $node, string $path)
+ {
+ trigger_deprecation('symfony/config', '5.1', 'The "%s()" method is deprecated, use "getDeprecation()" instead.', __METHOD__);
+
+ return $this->getDeprecation($node, $path)['message'];
+ }
+
+ /**
+ * @param string $node The configuration node name
+ * @param string $path The path of the node
+ */
+ public function getDeprecation(string $node, string $path): array
+ {
+ return [
+ 'package' => $this->deprecation['package'] ?? '',
+ 'version' => $this->deprecation['version'] ?? '',
+ 'message' => strtr($this->deprecation['message'] ?? '', ['%node%' => $node, '%path%' => $path]),
+ ];
+ }
+
+ /**
+ * {@inheritdoc}
*/
public function getName()
{
@@ -192,54 +318,60 @@ public function getName()
}
/**
- * Retrieves the path of this node.
- *
- * @return string The Node's path
+ * {@inheritdoc}
*/
public function getPath()
{
- $path = $this->name;
-
if (null !== $this->parent) {
- $path = $this->parent->getPath().'.'.$path;
+ return $this->parent->getPath().$this->pathSeparator.$this->name;
}
- return $path;
+ return $this->name;
}
/**
- * Merges two values together.
- *
- * @param mixed $leftSide
- * @param mixed $rightSide
- *
- * @return mixed The merged value
- *
- * @throws ForbiddenOverwriteException
+ * {@inheritdoc}
*/
final public function merge($leftSide, $rightSide)
{
if (!$this->allowOverwrite) {
- throw new ForbiddenOverwriteException(sprintf(
- 'Configuration path "%s" cannot be overwritten. You have to '
- .'define all options for this path, and any of its sub-paths in '
- .'one configuration section.',
- $this->getPath()
- ));
+ throw new ForbiddenOverwriteException(sprintf('Configuration path "%s" cannot be overwritten. You have to define all options for this path, and any of its sub-paths in one configuration section.', $this->getPath()));
}
- $this->validateType($leftSide);
- $this->validateType($rightSide);
+ if ($leftSide !== $leftPlaceholders = self::resolvePlaceholderValue($leftSide)) {
+ foreach ($leftPlaceholders as $leftPlaceholder) {
+ $this->handlingPlaceholder = $leftSide;
+ try {
+ $this->merge($leftPlaceholder, $rightSide);
+ } finally {
+ $this->handlingPlaceholder = null;
+ }
+ }
+
+ return $rightSide;
+ }
+
+ if ($rightSide !== $rightPlaceholders = self::resolvePlaceholderValue($rightSide)) {
+ foreach ($rightPlaceholders as $rightPlaceholder) {
+ $this->handlingPlaceholder = $rightSide;
+ try {
+ $this->merge($leftSide, $rightPlaceholder);
+ } finally {
+ $this->handlingPlaceholder = null;
+ }
+ }
+
+ return $rightSide;
+ }
+
+ $this->doValidateType($leftSide);
+ $this->doValidateType($rightSide);
return $this->mergeValues($leftSide, $rightSide);
}
/**
- * Normalizes a value, applying all normalization closures.
- *
- * @param mixed $value Value to normalize
- *
- * @return mixed The normalized value
+ * {@inheritdoc}
*/
final public function normalize($value)
{
@@ -250,6 +382,20 @@ final public function normalize($value)
$value = $closure($value);
}
+ // resolve placeholder value
+ if ($value !== $placeholders = self::resolvePlaceholderValue($value)) {
+ foreach ($placeholders as $placeholder) {
+ $this->handlingPlaceholder = $value;
+ try {
+ $this->normalize($placeholder);
+ } finally {
+ $this->handlingPlaceholder = null;
+ }
+ }
+
+ return $value;
+ }
+
// replace value with their equivalent
foreach ($this->equivalentValues as $data) {
if ($data[0] === $value) {
@@ -258,7 +404,7 @@ final public function normalize($value)
}
// validate type
- $this->validateType($value);
+ $this->doValidateType($value);
// normalize value
return $this->normalizeValue($value);
@@ -267,9 +413,9 @@ final public function normalize($value)
/**
* Normalizes the value before any other normalization is applied.
*
- * @param $value
+ * @param mixed $value
*
- * @return $value The normalized array value
+ * @return mixed
*/
protected function preNormalize($value)
{
@@ -287,18 +433,24 @@ public function getParent()
}
/**
- * Finalizes a value, applying all finalization closures.
- *
- * @param mixed $value The value to finalize
- *
- * @return mixed The finalized value
- *
- * @throws Exception
- * @throws InvalidConfigurationException
+ * {@inheritdoc}
*/
final public function finalize($value)
{
- $this->validateType($value);
+ if ($value !== $placeholders = self::resolvePlaceholderValue($value)) {
+ foreach ($placeholders as $placeholder) {
+ $this->handlingPlaceholder = $value;
+ try {
+ $this->finalize($placeholder);
+ } finally {
+ $this->handlingPlaceholder = null;
+ }
+ }
+
+ return $value;
+ }
+
+ $this->doValidateType($value);
$value = $this->finalizeValue($value);
@@ -308,9 +460,13 @@ final public function finalize($value)
try {
$value = $closure($value);
} catch (Exception $e) {
+ if ($e instanceof UnsetKeyException && null !== $this->handlingPlaceholder) {
+ continue;
+ }
+
throw $e;
} catch (\Exception $e) {
- throw new InvalidConfigurationException(sprintf('Invalid configuration for path "%s": %s', $this->getPath(), $e->getMessage()), $e->getCode(), $e);
+ throw new InvalidConfigurationException(sprintf('Invalid configuration for path "%s": ', $this->getPath()).$e->getMessage(), $e->getCode(), $e);
}
}
@@ -331,7 +487,7 @@ abstract protected function validateType($value);
*
* @param mixed $value The value to normalize
*
- * @return mixed The normalized value
+ * @return mixed
*/
abstract protected function normalizeValue($value);
@@ -341,7 +497,7 @@ abstract protected function normalizeValue($value);
* @param mixed $leftSide
* @param mixed $rightSide
*
- * @return mixed The merged value
+ * @return mixed
*/
abstract protected function mergeValues($leftSide, $rightSide);
@@ -350,7 +506,84 @@ abstract protected function mergeValues($leftSide, $rightSide);
*
* @param mixed $value The value to finalize
*
- * @return mixed The finalized value
+ * @return mixed
*/
abstract protected function finalizeValue($value);
+
+ /**
+ * Tests if placeholder values are allowed for this node.
+ */
+ protected function allowPlaceholders(): bool
+ {
+ return true;
+ }
+
+ /**
+ * Tests if a placeholder is being handled currently.
+ */
+ protected function isHandlingPlaceholder(): bool
+ {
+ return null !== $this->handlingPlaceholder;
+ }
+
+ /**
+ * Gets allowed dynamic types for this node.
+ */
+ protected function getValidPlaceholderTypes(): array
+ {
+ return [];
+ }
+
+ private static function resolvePlaceholderValue($value)
+ {
+ if (\is_string($value)) {
+ if (isset(self::$placeholders[$value])) {
+ return self::$placeholders[$value];
+ }
+
+ foreach (self::$placeholderUniquePrefixes as $placeholderUniquePrefix) {
+ if (str_starts_with($value, $placeholderUniquePrefix)) {
+ return [];
+ }
+ }
+ }
+
+ return $value;
+ }
+
+ private function doValidateType($value): void
+ {
+ if (null !== $this->handlingPlaceholder && !$this->allowPlaceholders()) {
+ $e = new InvalidTypeException(sprintf('A dynamic value is not compatible with a "%s" node type at path "%s".', static::class, $this->getPath()));
+ $e->setPath($this->getPath());
+
+ throw $e;
+ }
+
+ if (null === $this->handlingPlaceholder || null === $value) {
+ $this->validateType($value);
+
+ return;
+ }
+
+ $knownTypes = array_keys(self::$placeholders[$this->handlingPlaceholder]);
+ $validTypes = $this->getValidPlaceholderTypes();
+
+ if ($validTypes && array_diff($knownTypes, $validTypes)) {
+ $e = new InvalidTypeException(sprintf(
+ 'Invalid type for path "%s". Expected %s, but got %s.',
+ $this->getPath(),
+ 1 === \count($validTypes) ? '"'.reset($validTypes).'"' : 'one of "'.implode('", "', $validTypes).'"',
+ 1 === \count($knownTypes) ? '"'.reset($knownTypes).'"' : 'one of "'.implode('", "', $knownTypes).'"'
+ ));
+ if ($hint = $this->getInfo()) {
+ $e->addHint($hint);
+ }
+ $e->setPath($this->getPath());
+
+ throw $e;
+ }
+
+ $this->validateType($value);
+ }
}
diff --git a/tests/integration/vendor/symfony/config/Definition/BooleanNode.php b/tests/integration/vendor/symfony/config/Definition/BooleanNode.php
index 08e1a7730..c64ecb839 100644
--- a/tests/integration/vendor/symfony/config/Definition/BooleanNode.php
+++ b/tests/integration/vendor/symfony/config/Definition/BooleanNode.php
@@ -25,12 +25,8 @@ class BooleanNode extends ScalarNode
*/
protected function validateType($value)
{
- if (!is_bool($value)) {
- $ex = new InvalidTypeException(sprintf(
- 'Invalid type for path "%s". Expected boolean, but got %s.',
- $this->getPath(),
- gettype($value)
- ));
+ if (!\is_bool($value)) {
+ $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "bool", but got "%s".', $this->getPath(), get_debug_type($value)));
if ($hint = $this->getInfo()) {
$ex->addHint($hint);
}
@@ -48,4 +44,12 @@ protected function isValueEmpty($value)
// a boolean value cannot be empty
return false;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getValidPlaceholderTypes(): array
+ {
+ return ['bool'];
+ }
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php
index dc1c2fd8d..eb5b04021 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php
@@ -12,8 +12,8 @@
namespace Symfony\Component\Config\Definition\Builder;
use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
+use Symfony\Component\Config\Definition\PrototypedArrayNode;
/**
* This class provides a fluent interface for defining an array node.
@@ -25,7 +25,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
protected $performDeepMerging = true;
protected $ignoreExtraKeys = false;
protected $removeExtraKeys = true;
- protected $children = array();
+ protected $children = [];
protected $prototype;
protected $atLeastOne = false;
protected $allowNewKeys = true;
@@ -39,18 +39,16 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
/**
* {@inheritdoc}
*/
- public function __construct($name, NodeParentInterface $parent = null)
+ public function __construct(?string $name, NodeParentInterface $parent = null)
{
parent::__construct($name, $parent);
- $this->nullEquivalent = array();
- $this->trueEquivalent = array();
+ $this->nullEquivalent = [];
+ $this->trueEquivalent = [];
}
/**
- * Sets a custom children builder.
- *
- * @param NodeBuilder $builder A custom NodeBuilder
+ * {@inheritdoc}
*/
public function setBuilder(NodeBuilder $builder)
{
@@ -58,9 +56,7 @@ public function setBuilder(NodeBuilder $builder)
}
/**
- * Returns a builder to add children nodes.
- *
- * @return NodeBuilder
+ * {@inheritdoc}
*/
public function children()
{
@@ -70,15 +66,69 @@ public function children()
/**
* Sets a prototype for child nodes.
*
- * @param string $type the type of node
- *
* @return NodeDefinition
*/
- public function prototype($type)
+ public function prototype(string $type)
{
return $this->prototype = $this->getNodeBuilder()->node(null, $type)->setParent($this);
}
+ /**
+ * @return VariableNodeDefinition
+ */
+ public function variablePrototype()
+ {
+ return $this->prototype('variable');
+ }
+
+ /**
+ * @return ScalarNodeDefinition
+ */
+ public function scalarPrototype()
+ {
+ return $this->prototype('scalar');
+ }
+
+ /**
+ * @return BooleanNodeDefinition
+ */
+ public function booleanPrototype()
+ {
+ return $this->prototype('boolean');
+ }
+
+ /**
+ * @return IntegerNodeDefinition
+ */
+ public function integerPrototype()
+ {
+ return $this->prototype('integer');
+ }
+
+ /**
+ * @return FloatNodeDefinition
+ */
+ public function floatPrototype()
+ {
+ return $this->prototype('float');
+ }
+
+ /**
+ * @return ArrayNodeDefinition
+ */
+ public function arrayPrototype()
+ {
+ return $this->prototype('array');
+ }
+
+ /**
+ * @return EnumNodeDefinition
+ */
+ public function enumPrototype()
+ {
+ return $this->prototype('enum');
+ }
+
/**
* Adds the default value if the node is not set in the configuration.
*
@@ -86,7 +136,7 @@ public function prototype($type)
* If this function has been called and the node is not set during the finalization
* phase, it's default value will be derived from its children default values.
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
public function addDefaultsIfNotSet()
{
@@ -98,11 +148,11 @@ public function addDefaultsIfNotSet()
/**
* Adds children with a default value when none are defined.
*
- * @param int|string|array|null $children The number of children|The child name|The children names to be added
- *
* This method is applicable to prototype nodes only.
*
- * @return ArrayNodeDefinition
+ * @param int|string|array|null $children The number of children|The child name|The children names to be added
+ *
+ * @return $this
*/
public function addDefaultChildrenIfNoneSet($children = null)
{
@@ -116,7 +166,7 @@ public function addDefaultChildrenIfNoneSet($children = null)
*
* This method is applicable to prototype nodes only.
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
public function requiresAtLeastOneElement()
{
@@ -130,7 +180,7 @@ public function requiresAtLeastOneElement()
*
* If used all keys have to be defined in the same configuration file.
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
public function disallowNewKeysInSubsequentConfigs()
{
@@ -142,12 +192,12 @@ public function disallowNewKeysInSubsequentConfigs()
/**
* Sets a normalization rule for XML configurations.
*
- * @param string $singular The key to remap
- * @param string $plural The plural of the key for irregular plurals
+ * @param string $singular The key to remap
+ * @param string|null $plural The plural of the key for irregular plurals
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
- public function fixXmlConfig($singular, $plural = null)
+ public function fixXmlConfig(string $singular, string $plural = null)
{
$this->normalization()->remap($singular, $plural);
@@ -162,15 +212,15 @@ public function fixXmlConfig($singular, $plural = null)
* to be the key of the particular item. For example, if "id" is the
* "key", then:
*
- * array(
- * array('id' => 'my_name', 'foo' => 'bar'),
- * );
+ * [
+ * ['id' => 'my_name', 'foo' => 'bar'],
+ * ];
*
* becomes
*
- * array(
- * 'my_name' => array('foo' => 'bar'),
- * );
+ * [
+ * 'my_name' => ['foo' => 'bar'],
+ * ];
*
* If you'd like "'id' => 'my_name'" to still be present in the resulting
* array, then you can set the second argument of this method to false.
@@ -180,9 +230,9 @@ public function fixXmlConfig($singular, $plural = null)
* @param string $name The name of the key
* @param bool $removeKeyItem Whether or not the key item should be removed
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
- public function useAttributeAsKey($name, $removeKeyItem = true)
+ public function useAttributeAsKey(string $name, bool $removeKeyItem = true)
{
$this->key = $name;
$this->removeKeyItem = $removeKeyItem;
@@ -193,11 +243,9 @@ public function useAttributeAsKey($name, $removeKeyItem = true)
/**
* Sets whether the node can be unset.
*
- * @param bool $allow
- *
- * @return ArrayNodeDefinition
+ * @return $this
*/
- public function canBeUnset($allow = true)
+ public function canBeUnset(bool $allow = true)
{
$this->merge()->allowUnset($allow);
@@ -217,19 +265,19 @@ public function canBeUnset($allow = true)
* enableableArrayNode: {enabled: false, ...} # The config is disabled
* enableableArrayNode: false # The config is disabled
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
public function canBeEnabled()
{
$this
->addDefaultsIfNotSet()
- ->treatFalseLike(array('enabled' => false))
- ->treatTrueLike(array('enabled' => true))
- ->treatNullLike(array('enabled' => true))
+ ->treatFalseLike(['enabled' => false])
+ ->treatTrueLike(['enabled' => true])
+ ->treatNullLike(['enabled' => true])
->beforeNormalization()
->ifArray()
- ->then(function ($v) {
- $v['enabled'] = isset($v['enabled']) ? $v['enabled'] : true;
+ ->then(function (array $v) {
+ $v['enabled'] = $v['enabled'] ?? true;
return $v;
})
@@ -247,15 +295,15 @@ public function canBeEnabled()
*
* By default, the section is enabled.
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
public function canBeDisabled()
{
$this
->addDefaultsIfNotSet()
- ->treatFalseLike(array('enabled' => false))
- ->treatTrueLike(array('enabled' => true))
- ->treatNullLike(array('enabled' => true))
+ ->treatFalseLike(['enabled' => false])
+ ->treatTrueLike(['enabled' => true])
+ ->treatNullLike(['enabled' => true])
->children()
->booleanNode('enabled')
->defaultTrue()
@@ -267,7 +315,7 @@ public function canBeDisabled()
/**
* Disables the deep merging of the node.
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
public function performNoDeepMerging()
{
@@ -280,16 +328,16 @@ public function performNoDeepMerging()
* Allows extra config keys to be specified under an array without
* throwing an exception.
*
- * Those config values are simply ignored and removed from the
- * resulting array. This should be used only in special cases where
- * you want to send an entire configuration array through a special
- * tree that processes only part of the array.
+ * Those config values are ignored and removed from the resulting
+ * array. This should be used only in special cases where you want
+ * to send an entire configuration array through a special tree that
+ * processes only part of the array.
*
* @param bool $remove Whether to remove the extra keys
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
- public function ignoreExtraKeys($remove = true)
+ public function ignoreExtraKeys(bool $remove = true)
{
$this->ignoreExtraKeys = true;
$this->removeExtraKeys = $remove;
@@ -298,33 +346,19 @@ public function ignoreExtraKeys($remove = true)
}
/**
- * Sets key normalization.
- *
- * @param bool $bool Whether to enable key normalization
+ * Sets whether to enable key normalization.
*
- * @return ArrayNodeDefinition
+ * @return $this
*/
- public function normalizeKeys($bool)
+ public function normalizeKeys(bool $bool)
{
- $this->normalizeKeys = (bool) $bool;
+ $this->normalizeKeys = $bool;
return $this;
}
/**
- * Appends a node definition.
- *
- * $node = new ArrayNodeDefinition()
- * ->children()
- * ->scalarNode('foo')->end()
- * ->scalarNode('baz')->end()
- * ->end()
- * ->append($this->getBarNodeDefinition())
- * ;
- *
- * @param NodeDefinition $node A NodeDefinition instance
- *
- * @return ArrayNodeDefinition This node
+ * {@inheritdoc}
*/
public function append(NodeDefinition $node)
{
@@ -336,7 +370,7 @@ public function append(NodeDefinition $node)
/**
* Returns a node builder to be used to add children and prototype.
*
- * @return NodeBuilder The node builder
+ * @return NodeBuilder
*/
protected function getNodeBuilder()
{
@@ -353,7 +387,7 @@ protected function getNodeBuilder()
protected function createNode()
{
if (null === $this->prototype) {
- $node = new ArrayNode($this->name, $this->parent);
+ $node = new ArrayNode($this->name, $this->parent, $this->pathSeparator);
$this->validateConcreteNode($node);
@@ -364,7 +398,7 @@ protected function createNode()
$node->addChild($child->getNode());
}
} else {
- $node = new PrototypedArrayNode($this->name, $this->parent);
+ $node = new PrototypedArrayNode($this->name, $this->parent, $this->pathSeparator);
$this->validatePrototypeNode($node);
@@ -372,11 +406,15 @@ protected function createNode()
$node->setKeyAttribute($this->key, $this->removeKeyItem);
}
- if (true === $this->atLeastOne) {
+ if (true === $this->atLeastOne || false === $this->allowEmptyValue) {
$node->setMinNumberOfElements(1);
}
if ($this->default) {
+ if (!\is_array($this->defaultValue)) {
+ throw new \InvalidArgumentException(sprintf('%s: the default value of an array node has to be an array.', $node->getPath()));
+ }
+
$node->setDefaultValue($this->defaultValue);
}
@@ -400,6 +438,10 @@ protected function createNode()
$node->setIgnoreExtraKeys($this->ignoreExtraKeys, $this->removeExtraKeys);
$node->setNormalizeKeys($this->normalizeKeys);
+ if ($this->deprecation) {
+ $node->setDeprecated($this->deprecation['package'], $this->deprecation['version'], $this->deprecation['message']);
+ }
+
if (null !== $this->normalization) {
$node->setNormalizationClosures($this->normalization->before);
$node->setXmlRemappings($this->normalization->remappings);
@@ -420,8 +462,6 @@ protected function createNode()
/**
* Validate the configuration of a concrete node.
*
- * @param ArrayNode $node The related node
- *
* @throws InvalidDefinitionException
*/
protected function validateConcreteNode(ArrayNode $node)
@@ -429,35 +469,29 @@ protected function validateConcreteNode(ArrayNode $node)
$path = $node->getPath();
if (null !== $this->key) {
- throw new InvalidDefinitionException(
- sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s".', $path));
+ }
+
+ if (false === $this->allowEmptyValue) {
+ throw new InvalidDefinitionException(sprintf('->cannotBeEmpty() is not applicable to concrete nodes at path "%s".', $path));
}
if (true === $this->atLeastOne) {
- throw new InvalidDefinitionException(
- sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s".', $path));
}
if ($this->default) {
- throw new InvalidDefinitionException(
- sprintf('->defaultValue() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->defaultValue() is not applicable to concrete nodes at path "%s".', $path));
}
if (false !== $this->addDefaultChildren) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s".', $path));
}
}
/**
* Validate the configuration of a prototype node.
*
- * @param PrototypedArrayNode $node The related node
- *
* @throws InvalidDefinitionException
*/
protected function validatePrototypeNode(PrototypedArrayNode $node)
@@ -465,29 +499,51 @@ protected function validatePrototypeNode(PrototypedArrayNode $node)
$path = $node->getPath();
if ($this->addDefaults) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s".', $path));
}
if (false !== $this->addDefaultChildren) {
if ($this->default) {
- throw new InvalidDefinitionException(
- sprintf('A default value and default children might not be used together at path "%s"', $path)
- );
+ throw new InvalidDefinitionException(sprintf('A default value and default children might not be used together at path "%s".', $path));
}
- if (null !== $this->key && (null === $this->addDefaultChildren || is_int($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path)
- );
+ if (null !== $this->key && (null === $this->addDefaultChildren || \is_int($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
+ throw new InvalidDefinitionException(sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s".', $path));
}
- if (null === $this->key && (is_string($this->addDefaultChildren) || is_array($this->addDefaultChildren))) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s"', $path)
- );
+ if (null === $this->key && (\is_string($this->addDefaultChildren) || \is_array($this->addDefaultChildren))) {
+ throw new InvalidDefinitionException(sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s".', $path));
}
}
}
+
+ /**
+ * @return NodeDefinition[]
+ */
+ public function getChildNodeDefinitions()
+ {
+ return $this->children;
+ }
+
+ /**
+ * Finds a node defined by the given $nodePath.
+ *
+ * @param string $nodePath The path of the node to find. e.g "doctrine.orm.mappings"
+ */
+ public function find(string $nodePath): NodeDefinition
+ {
+ $firstPathSegment = (false === $pathSeparatorPos = strpos($nodePath, $this->pathSeparator))
+ ? $nodePath
+ : substr($nodePath, 0, $pathSeparatorPos);
+
+ if (null === $node = ($this->children[$firstPathSegment] ?? null)) {
+ throw new \RuntimeException(sprintf('Node with name "%s" does not exist in the current node "%s".', $firstPathSegment, $this->name));
+ }
+
+ if (false === $pathSeparatorPos) {
+ return $node;
+ }
+
+ return $node->find(substr($nodePath, $pathSeparatorPos + \strlen($this->pathSeparator)));
+ }
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php
index 28e56579a..ace0b34a2 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php
@@ -24,7 +24,7 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
/**
* {@inheritdoc}
*/
- public function __construct($name, NodeParentInterface $parent = null)
+ public function __construct(?string $name, NodeParentInterface $parent = null)
{
parent::__construct($name, $parent);
@@ -34,11 +34,11 @@ public function __construct($name, NodeParentInterface $parent = null)
/**
* Instantiate a Node.
*
- * @return BooleanNode The node
+ * @return BooleanNode
*/
protected function instantiateNode()
{
- return new BooleanNode($this->name, $this->parent);
+ return new BooleanNode($this->name, $this->parent, $this->pathSeparator);
}
/**
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php b/tests/integration/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php
new file mode 100644
index 000000000..f30b8736c
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php
@@ -0,0 +1,25 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Definition\Builder;
+
+/**
+ * An interface that can be implemented by nodes which build other nodes.
+ *
+ * @author Roland Franssen
+ */
+interface BuilderAwareInterface
+{
+ /**
+ * Sets a custom children builder.
+ */
+ public function setBuilder(NodeBuilder $builder);
+}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php
index 5d3ff014f..52e2fd111 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php
@@ -23,9 +23,7 @@ class EnumNodeDefinition extends ScalarNodeDefinition
private $values;
/**
- * @param array $values
- *
- * @return EnumNodeDefinition|$this
+ * @return $this
*/
public function values(array $values)
{
@@ -43,7 +41,7 @@ public function values(array $values)
/**
* Instantiate a Node.
*
- * @return EnumNode The node
+ * @return EnumNode
*
* @throws \RuntimeException
*/
@@ -53,6 +51,6 @@ protected function instantiateNode()
throw new \RuntimeException('You must call ->values() on enum nodes.');
}
- return new EnumNode($this->name, $this->parent, $this->values);
+ return new EnumNode($this->name, $this->parent, $this->values, $this->pathSeparator);
}
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/ExprBuilder.php b/tests/integration/vendor/symfony/config/Definition/Builder/ExprBuilder.php
index 94f6e2075..14387b51b 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/ExprBuilder.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/ExprBuilder.php
@@ -25,11 +25,6 @@ class ExprBuilder
public $ifPart;
public $thenPart;
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
public function __construct(NodeDefinition $node)
{
$this->node = $node;
@@ -38,13 +33,11 @@ public function __construct(NodeDefinition $node)
/**
* Marks the expression as being always used.
*
- * @param \Closure $then
- *
- * @return ExprBuilder
+ * @return $this
*/
public function always(\Closure $then = null)
{
- $this->ifPart = function ($v) { return true; };
+ $this->ifPart = function () { return true; };
if (null !== $then) {
$this->thenPart = $then;
@@ -58,9 +51,7 @@ public function always(\Closure $then = null)
*
* The default one tests if the value is true.
*
- * @param \Closure $closure
- *
- * @return ExprBuilder
+ * @return $this
*/
public function ifTrue(\Closure $closure = null)
{
@@ -76,11 +67,11 @@ public function ifTrue(\Closure $closure = null)
/**
* Tests if the value is a string.
*
- * @return ExprBuilder
+ * @return $this
*/
public function ifString()
{
- $this->ifPart = function ($v) { return is_string($v); };
+ $this->ifPart = function ($v) { return \is_string($v); };
return $this;
}
@@ -88,7 +79,7 @@ public function ifString()
/**
* Tests if the value is null.
*
- * @return ExprBuilder
+ * @return $this
*/
public function ifNull()
{
@@ -100,7 +91,7 @@ public function ifNull()
/**
* Tests if the value is empty.
*
- * @return ExprBuilder
+ * @return $this
*/
public function ifEmpty()
{
@@ -112,11 +103,11 @@ public function ifEmpty()
/**
* Tests if the value is an array.
*
- * @return ExprBuilder
+ * @return $this
*/
public function ifArray()
{
- $this->ifPart = function ($v) { return is_array($v); };
+ $this->ifPart = function ($v) { return \is_array($v); };
return $this;
}
@@ -124,13 +115,11 @@ public function ifArray()
/**
* Tests if the value is in an array.
*
- * @param array $array
- *
- * @return ExprBuilder
+ * @return $this
*/
public function ifInArray(array $array)
{
- $this->ifPart = function ($v) use ($array) { return in_array($v, $array, true); };
+ $this->ifPart = function ($v) use ($array) { return \in_array($v, $array, true); };
return $this;
}
@@ -138,23 +127,32 @@ public function ifInArray(array $array)
/**
* Tests if the value is not in an array.
*
- * @param array $array
- *
- * @return ExprBuilder
+ * @return $this
*/
public function ifNotInArray(array $array)
{
- $this->ifPart = function ($v) use ($array) { return !in_array($v, $array, true); };
+ $this->ifPart = function ($v) use ($array) { return !\in_array($v, $array, true); };
return $this;
}
/**
- * Sets the closure to run if the test pass.
+ * Transforms variables of any type into an array.
*
- * @param \Closure $closure
+ * @return $this
+ */
+ public function castToArray()
+ {
+ $this->ifPart = function ($v) { return !\is_array($v); };
+ $this->thenPart = function ($v) { return [$v]; };
+
+ return $this;
+ }
+
+ /**
+ * Sets the closure to run if the test pass.
*
- * @return ExprBuilder
+ * @return $this
*/
public function then(\Closure $closure)
{
@@ -166,43 +164,41 @@ public function then(\Closure $closure)
/**
* Sets a closure returning an empty array.
*
- * @return ExprBuilder
+ * @return $this
*/
public function thenEmptyArray()
{
- $this->thenPart = function ($v) { return array(); };
+ $this->thenPart = function () { return []; };
return $this;
}
/**
- * Sets a closure marking the value as invalid at validation time.
+ * Sets a closure marking the value as invalid at processing time.
*
* if you want to add the value of the node in your message just use a %s placeholder.
*
- * @param string $message
- *
- * @return ExprBuilder
+ * @return $this
*
* @throws \InvalidArgumentException
*/
- public function thenInvalid($message)
+ public function thenInvalid(string $message)
{
- $this->thenPart = function ($v) use ($message) {throw new \InvalidArgumentException(sprintf($message, json_encode($v))); };
+ $this->thenPart = function ($v) use ($message) { throw new \InvalidArgumentException(sprintf($message, json_encode($v))); };
return $this;
}
/**
- * Sets a closure unsetting this key of the array at validation time.
+ * Sets a closure unsetting this key of the array at processing time.
*
- * @return ExprBuilder
+ * @return $this
*
* @throws UnsetKeyException
*/
public function thenUnset()
{
- $this->thenPart = function ($v) { throw new UnsetKeyException('Unsetting key'); };
+ $this->thenPart = function () { throw new UnsetKeyException('Unsetting key.'); };
return $this;
}
@@ -210,7 +206,7 @@ public function thenUnset()
/**
* Returns the related node.
*
- * @return NodeDefinition
+ * @return NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition
*
* @throws \RuntimeException
*/
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/FloatNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/FloatNodeDefinition.php
index c0bed462b..f50f190f8 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/FloatNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/FloatNodeDefinition.php
@@ -23,10 +23,10 @@ class FloatNodeDefinition extends NumericNodeDefinition
/**
* Instantiates a Node.
*
- * @return FloatNode The node
+ * @return FloatNode
*/
protected function instantiateNode()
{
- return new FloatNode($this->name, $this->parent, $this->min, $this->max);
+ return new FloatNode($this->name, $this->parent, $this->min, $this->max, $this->pathSeparator);
}
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/IntegerNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/IntegerNodeDefinition.php
index f6c3c147f..d28e5aecb 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/IntegerNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/IntegerNodeDefinition.php
@@ -23,10 +23,10 @@ class IntegerNodeDefinition extends NumericNodeDefinition
/**
* Instantiates a Node.
*
- * @return IntegerNode The node
+ * @return IntegerNode
*/
protected function instantiateNode()
{
- return new IntegerNode($this->name, $this->parent, $this->min, $this->max);
+ return new IntegerNode($this->name, $this->parent, $this->min, $this->max, $this->pathSeparator);
}
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/MergeBuilder.php b/tests/integration/vendor/symfony/config/Definition/Builder/MergeBuilder.php
index f908a499c..a88d49ba9 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/MergeBuilder.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/MergeBuilder.php
@@ -22,11 +22,6 @@ class MergeBuilder
public $allowFalse = false;
public $allowOverwrite = true;
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
public function __construct(NodeDefinition $node)
{
$this->node = $node;
@@ -35,11 +30,9 @@ public function __construct(NodeDefinition $node)
/**
* Sets whether the node can be unset.
*
- * @param bool $allow
- *
- * @return MergeBuilder
+ * @return $this
*/
- public function allowUnset($allow = true)
+ public function allowUnset(bool $allow = true)
{
$this->allowFalse = $allow;
@@ -49,11 +42,9 @@ public function allowUnset($allow = true)
/**
* Sets whether the node can be overwritten.
*
- * @param bool $deny Whether the overwriting is forbidden or not
- *
- * @return MergeBuilder
+ * @return $this
*/
- public function denyOverwrite($deny = true)
+ public function denyOverwrite(bool $deny = true)
{
$this->allowOverwrite = !$deny;
@@ -63,7 +54,7 @@ public function denyOverwrite($deny = true)
/**
* Returns the related node.
*
- * @return NodeDefinition
+ * @return NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition
*/
public function end()
{
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/NodeBuilder.php b/tests/integration/vendor/symfony/config/Definition/Builder/NodeBuilder.php
index 2a063f1bd..245e97277 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/NodeBuilder.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/NodeBuilder.php
@@ -21,28 +21,23 @@ class NodeBuilder implements NodeParentInterface
protected $parent;
protected $nodeMapping;
- /**
- * Constructor.
- */
public function __construct()
{
- $this->nodeMapping = array(
- 'variable' => __NAMESPACE__.'\\VariableNodeDefinition',
- 'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition',
- 'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition',
- 'integer' => __NAMESPACE__.'\\IntegerNodeDefinition',
- 'float' => __NAMESPACE__.'\\FloatNodeDefinition',
- 'array' => __NAMESPACE__.'\\ArrayNodeDefinition',
- 'enum' => __NAMESPACE__.'\\EnumNodeDefinition',
- );
+ $this->nodeMapping = [
+ 'variable' => VariableNodeDefinition::class,
+ 'scalar' => ScalarNodeDefinition::class,
+ 'boolean' => BooleanNodeDefinition::class,
+ 'integer' => IntegerNodeDefinition::class,
+ 'float' => FloatNodeDefinition::class,
+ 'array' => ArrayNodeDefinition::class,
+ 'enum' => EnumNodeDefinition::class,
+ ];
}
/**
* Set the parent node.
*
- * @param ParentNodeDefinitionInterface $parent The parent node
- *
- * @return NodeBuilder This node builder
+ * @return $this
*/
public function setParent(ParentNodeDefinitionInterface $parent = null)
{
@@ -54,11 +49,9 @@ public function setParent(ParentNodeDefinitionInterface $parent = null)
/**
* Creates a child array node.
*
- * @param string $name The name of the node
- *
- * @return ArrayNodeDefinition The child node
+ * @return ArrayNodeDefinition
*/
- public function arrayNode($name)
+ public function arrayNode(string $name)
{
return $this->node($name, 'array');
}
@@ -66,11 +59,9 @@ public function arrayNode($name)
/**
* Creates a child scalar node.
*
- * @param string $name the name of the node
- *
- * @return ScalarNodeDefinition The child node
+ * @return ScalarNodeDefinition
*/
- public function scalarNode($name)
+ public function scalarNode(string $name)
{
return $this->node($name, 'scalar');
}
@@ -78,11 +69,9 @@ public function scalarNode($name)
/**
* Creates a child Boolean node.
*
- * @param string $name The name of the node
- *
- * @return BooleanNodeDefinition The child node
+ * @return BooleanNodeDefinition
*/
- public function booleanNode($name)
+ public function booleanNode(string $name)
{
return $this->node($name, 'boolean');
}
@@ -90,11 +79,9 @@ public function booleanNode($name)
/**
* Creates a child integer node.
*
- * @param string $name the name of the node
- *
- * @return IntegerNodeDefinition The child node
+ * @return IntegerNodeDefinition
*/
- public function integerNode($name)
+ public function integerNode(string $name)
{
return $this->node($name, 'integer');
}
@@ -102,11 +89,9 @@ public function integerNode($name)
/**
* Creates a child float node.
*
- * @param string $name the name of the node
- *
- * @return FloatNodeDefinition The child node
+ * @return FloatNodeDefinition
*/
- public function floatNode($name)
+ public function floatNode(string $name)
{
return $this->node($name, 'float');
}
@@ -114,11 +99,9 @@ public function floatNode($name)
/**
* Creates a child EnumNode.
*
- * @param string $name
- *
* @return EnumNodeDefinition
*/
- public function enumNode($name)
+ public function enumNode(string $name)
{
return $this->node($name, 'enum');
}
@@ -126,11 +109,9 @@ public function enumNode($name)
/**
* Creates a child variable node.
*
- * @param string $name The name of the node
- *
- * @return VariableNodeDefinition The builder of the child node
+ * @return VariableNodeDefinition
*/
- public function variableNode($name)
+ public function variableNode(string $name)
{
return $this->node($name, 'variable');
}
@@ -138,7 +119,7 @@ public function variableNode($name)
/**
* Returns the parent node.
*
- * @return ParentNodeDefinitionInterface|NodeDefinition The parent node
+ * @return NodeDefinition&ParentNodeDefinitionInterface
*/
public function end()
{
@@ -148,15 +129,12 @@ public function end()
/**
* Creates a child node.
*
- * @param string $name The name of the node
- * @param string $type The type of the node
- *
- * @return NodeDefinition The child node
+ * @return NodeDefinition
*
* @throws \RuntimeException When the node type is not registered
* @throws \RuntimeException When the node class is not found
*/
- public function node($name, $type)
+ public function node(?string $name, string $type)
{
$class = $this->getNodeClass($type);
@@ -180,13 +158,11 @@ public function node($name, $type)
* ->end()
* ;
*
- * @param NodeDefinition $node
- *
- * @return NodeBuilder This node builder
+ * @return $this
*/
public function append(NodeDefinition $node)
{
- if ($node instanceof ParentNodeDefinitionInterface) {
+ if ($node instanceof BuilderAwareInterface) {
$builder = clone $this;
$builder->setParent(null);
$node->setBuilder($builder);
@@ -207,9 +183,9 @@ public function append(NodeDefinition $node)
* @param string $type The name of the type
* @param string $class The fully qualified name the node definition class
*
- * @return NodeBuilder This node builder
+ * @return $this
*/
- public function setNodeClass($type, $class)
+ public function setNodeClass(string $type, string $class)
{
$this->nodeMapping[strtolower($type)] = $class;
@@ -219,14 +195,12 @@ public function setNodeClass($type, $class)
/**
* Returns the class name of the node definition.
*
- * @param string $type The node type
- *
- * @return string The node definition class name
+ * @return string
*
* @throws \RuntimeException When the node type is not registered
* @throws \RuntimeException When the node class is not found
*/
- protected function getNodeClass($type)
+ protected function getNodeClass(string $type)
{
$type = strtolower($type);
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/NodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/NodeDefinition.php
index 4633dc7d2..cf153f01c 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/NodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/NodeDefinition.php
@@ -11,8 +11,9 @@
namespace Symfony\Component\Config\Definition\Builder;
-use Symfony\Component\Config\Definition\NodeInterface;
+use Symfony\Component\Config\Definition\BaseNode;
use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
+use Symfony\Component\Config\Definition\NodeInterface;
/**
* This class provides a fluent interface for defining a node.
@@ -27,25 +28,17 @@ abstract class NodeDefinition implements NodeParentInterface
protected $defaultValue;
protected $default = false;
protected $required = false;
+ protected $deprecation = [];
protected $merge;
protected $allowEmptyValue = true;
protected $nullEquivalent;
protected $trueEquivalent = true;
protected $falseEquivalent = false;
-
- /**
- * @var NodeParentInterface|null
- */
+ protected $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR;
protected $parent;
- protected $attributes = array();
+ protected $attributes = [];
- /**
- * Constructor.
- *
- * @param string $name The name of the node
- * @param NodeParentInterface|null $parent The parent
- */
- public function __construct($name, NodeParentInterface $parent = null)
+ public function __construct(?string $name, NodeParentInterface $parent = null)
{
$this->parent = $parent;
$this->name = $name;
@@ -54,9 +47,7 @@ public function __construct($name, NodeParentInterface $parent = null)
/**
* Sets the parent node.
*
- * @param NodeParentInterface $parent The parent
- *
- * @return NodeDefinition|$this
+ * @return $this
*/
public function setParent(NodeParentInterface $parent)
{
@@ -68,11 +59,9 @@ public function setParent(NodeParentInterface $parent)
/**
* Sets info message.
*
- * @param string $info The info text
- *
- * @return NodeDefinition|$this
+ * @return $this
*/
- public function info($info)
+ public function info(string $info)
{
return $this->attribute('info', $info);
}
@@ -82,7 +71,7 @@ public function info($info)
*
* @param string|array $example
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function example($example)
{
@@ -92,12 +81,11 @@ public function example($example)
/**
* Sets an attribute on the node.
*
- * @param string $key
- * @param mixed $value
+ * @param mixed $value
*
- * @return NodeDefinition|$this
+ * @return $this
*/
- public function attribute($key, $value)
+ public function attribute(string $key, $value)
{
$this->attributes[$key] = $value;
@@ -107,7 +95,7 @@ public function attribute($key, $value)
/**
* Returns the parent node.
*
- * @return NodeParentInterface|NodeBuilder|NodeDefinition|null The builder of the parent node
+ * @return NodeParentInterface|NodeBuilder|NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition|null
*/
public function end()
{
@@ -117,11 +105,9 @@ public function end()
/**
* Creates the node.
*
- * @param bool $forceRootNode Whether to force this node as the root node
- *
* @return NodeInterface
*/
- public function getNode($forceRootNode = false)
+ public function getNode(bool $forceRootNode = false)
{
if ($forceRootNode) {
$this->parent = null;
@@ -136,7 +122,9 @@ public function getNode($forceRootNode = false)
}
$node = $this->createNode();
- $node->setAttributes($this->attributes);
+ if ($node instanceof BaseNode) {
+ $node->setAttributes($this->attributes);
+ }
return $node;
}
@@ -146,7 +134,7 @@ public function getNode($forceRootNode = false)
*
* @param mixed $value The default value
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function defaultValue($value)
{
@@ -159,7 +147,7 @@ public function defaultValue($value)
/**
* Sets the node as required.
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function isRequired()
{
@@ -168,12 +156,48 @@ public function isRequired()
return $this;
}
+ /**
+ * Sets the node as deprecated.
+ *
+ * @param string $package The name of the composer package that is triggering the deprecation
+ * @param string $version The version of the package that introduced the deprecation
+ * @param string $message the deprecation message to use
+ *
+ * You can use %node% and %path% placeholders in your message to display,
+ * respectively, the node name and its complete path
+ *
+ * @return $this
+ */
+ public function setDeprecated(/* string $package, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.' */)
+ {
+ $args = \func_get_args();
+
+ if (\func_num_args() < 2) {
+ trigger_deprecation('symfony/config', '5.1', 'The signature of method "%s()" requires 3 arguments: "string $package, string $version, string $message", not defining them is deprecated.', __METHOD__);
+
+ $message = $args[0] ?? 'The child node "%node%" at path "%path%" is deprecated.';
+ $package = $version = '';
+ } else {
+ $package = (string) $args[0];
+ $version = (string) $args[1];
+ $message = (string) ($args[2] ?? 'The child node "%node%" at path "%path%" is deprecated.');
+ }
+
+ $this->deprecation = [
+ 'package' => $package,
+ 'version' => $version,
+ 'message' => $message,
+ ];
+
+ return $this;
+ }
+
/**
* Sets the equivalent value used when the node contains null.
*
* @param mixed $value
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function treatNullLike($value)
{
@@ -187,7 +211,7 @@ public function treatNullLike($value)
*
* @param mixed $value
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function treatTrueLike($value)
{
@@ -201,7 +225,7 @@ public function treatTrueLike($value)
*
* @param mixed $value
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function treatFalseLike($value)
{
@@ -213,7 +237,7 @@ public function treatFalseLike($value)
/**
* Sets null as the default value.
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function defaultNull()
{
@@ -223,7 +247,7 @@ public function defaultNull()
/**
* Sets true as the default value.
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function defaultTrue()
{
@@ -233,7 +257,7 @@ public function defaultTrue()
/**
* Sets false as the default value.
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function defaultFalse()
{
@@ -253,7 +277,7 @@ public function beforeNormalization()
/**
* Denies the node value being empty.
*
- * @return NodeDefinition|$this
+ * @return $this
*/
public function cannotBeEmpty()
{
@@ -279,11 +303,9 @@ public function validate()
/**
* Sets whether the node can be overwritten.
*
- * @param bool $deny Whether the overwriting is forbidden or not
- *
- * @return NodeDefinition|$this
+ * @return $this
*/
- public function cannotBeOverwritten($deny = true)
+ public function cannotBeOverwritten(bool $deny = true)
{
$this->merge()->denyOverwrite($deny);
@@ -335,9 +357,27 @@ protected function normalization()
/**
* Instantiate and configure the node according to this definition.
*
- * @return NodeInterface $node The node instance
+ * @return NodeInterface
*
* @throws InvalidDefinitionException When the definition is invalid
*/
abstract protected function createNode();
+
+ /**
+ * Set PathSeparator to use.
+ *
+ * @return $this
+ */
+ public function setPathSeparator(string $separator)
+ {
+ if ($this instanceof ParentNodeDefinitionInterface) {
+ foreach ($this->getChildNodeDefinitions() as $child) {
+ $child->setPathSeparator($separator);
+ }
+ }
+
+ $this->pathSeparator = $separator;
+
+ return $this;
+ }
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php b/tests/integration/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php
index 748c9f28c..06cbbd434 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php
@@ -19,14 +19,9 @@
class NormalizationBuilder
{
protected $node;
- public $before = array();
- public $remappings = array();
+ public $before = [];
+ public $remappings = [];
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
public function __construct(NodeDefinition $node)
{
$this->node = $node;
@@ -35,14 +30,14 @@ public function __construct(NodeDefinition $node)
/**
* Registers a key to remap to its plural form.
*
- * @param string $key The key to remap
- * @param string $plural The plural of the key in case of irregular plural
+ * @param string $key The key to remap
+ * @param string|null $plural The plural of the key in case of irregular plural
*
- * @return NormalizationBuilder
+ * @return $this
*/
- public function remap($key, $plural = null)
+ public function remap(string $key, string $plural = null)
{
- $this->remappings[] = array($key, null === $plural ? $key.'s' : $plural);
+ $this->remappings[] = [$key, null === $plural ? $key.'s' : $plural];
return $this;
}
@@ -50,9 +45,7 @@ public function remap($key, $plural = null)
/**
* Registers a closure to run before the normalization or an expression builder to build it if null is provided.
*
- * @param \Closure $closure
- *
- * @return ExprBuilder|NormalizationBuilder
+ * @return ExprBuilder|$this
*/
public function before(\Closure $closure = null)
{
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php
index 8451e75b2..c4bff1756 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php
@@ -26,16 +26,16 @@ abstract class NumericNodeDefinition extends ScalarNodeDefinition
/**
* Ensures that the value is smaller than the given reference.
*
- * @param mixed $max
+ * @param int|float $max
*
- * @return NumericNodeDefinition
+ * @return $this
*
* @throws \InvalidArgumentException when the constraint is inconsistent
*/
public function max($max)
{
if (isset($this->min) && $this->min > $max) {
- throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min));
+ throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s).', $max, $this->min));
}
$this->max = $max;
@@ -45,16 +45,16 @@ public function max($max)
/**
* Ensures that the value is bigger than the given reference.
*
- * @param mixed $min
+ * @param int|float $min
*
- * @return NumericNodeDefinition
+ * @return $this
*
* @throws \InvalidArgumentException when the constraint is inconsistent
*/
public function min($min)
{
if (isset($this->max) && $this->max < $min) {
- throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s)', $min, $this->max));
+ throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s).', $min, $this->max));
}
$this->min = $min;
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php b/tests/integration/vendor/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php
index 575495bb6..449b91afd 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php
@@ -16,11 +16,36 @@
*
* @author Victor Berchet
*/
-interface ParentNodeDefinitionInterface
+interface ParentNodeDefinitionInterface extends BuilderAwareInterface
{
+ /**
+ * Returns a builder to add children nodes.
+ *
+ * @return NodeBuilder
+ */
public function children();
+ /**
+ * Appends a node definition.
+ *
+ * Usage:
+ *
+ * $node = $parentNode
+ * ->children()
+ * ->scalarNode('foo')->end()
+ * ->scalarNode('baz')->end()
+ * ->append($this->getBarNodeDefinition())
+ * ->end()
+ * ;
+ *
+ * @return $this
+ */
public function append(NodeDefinition $node);
- public function setBuilder(NodeBuilder $builder);
+ /**
+ * Gets the child node definitions.
+ *
+ * @return NodeDefinition[]
+ */
+ public function getChildNodeDefinitions();
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/ScalarNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/ScalarNodeDefinition.php
index 6170555cc..076f74b34 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/ScalarNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/ScalarNodeDefinition.php
@@ -23,10 +23,10 @@ class ScalarNodeDefinition extends VariableNodeDefinition
/**
* Instantiate a Node.
*
- * @return ScalarNode The node
+ * @return ScalarNode
*/
protected function instantiateNode()
{
- return new ScalarNode($this->name, $this->parent);
+ return new ScalarNode($this->name, $this->parent, $this->pathSeparator);
}
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/TreeBuilder.php b/tests/integration/vendor/symfony/config/Definition/Builder/TreeBuilder.php
index 5d02848a0..f3c3c2109 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/TreeBuilder.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/TreeBuilder.php
@@ -22,24 +22,19 @@ class TreeBuilder implements NodeParentInterface
{
protected $tree;
protected $root;
- protected $builder;
+
+ public function __construct(string $name, string $type = 'array', NodeBuilder $builder = null)
+ {
+ $builder = $builder ?? new NodeBuilder();
+ $this->root = $builder->node($name, $type)->setParent($this);
+ }
/**
- * Creates the root node.
- *
- * @param string $name The name of the root node
- * @param string $type The type of the root node
- * @param NodeBuilder $builder A custom node builder instance
- *
- * @return ArrayNodeDefinition|NodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array')
- *
- * @throws \RuntimeException When the node type is not supported
+ * @return NodeDefinition|ArrayNodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array')
*/
- public function root($name, $type = 'array', NodeBuilder $builder = null)
+ public function getRootNode(): NodeDefinition
{
- $builder = $builder ?: new NodeBuilder();
-
- return $this->root = $builder->node($name, $type)->setParent($this);
+ return $this->root;
}
/**
@@ -51,13 +46,18 @@ public function root($name, $type = 'array', NodeBuilder $builder = null)
*/
public function buildTree()
{
- if (null === $this->root) {
- throw new \RuntimeException('The configuration tree has no root node.');
- }
if (null !== $this->tree) {
return $this->tree;
}
return $this->tree = $this->root->getNode(true);
}
+
+ public function setPathSeparator(string $separator)
+ {
+ // unset last built as changing path separator changes all nodes
+ $this->tree = null;
+
+ $this->root->setPathSeparator($separator);
+ }
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/ValidationBuilder.php b/tests/integration/vendor/symfony/config/Definition/Builder/ValidationBuilder.php
index e88582389..4efc726c0 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/ValidationBuilder.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/ValidationBuilder.php
@@ -19,13 +19,8 @@
class ValidationBuilder
{
protected $node;
- public $rules = array();
+ public $rules = [];
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
public function __construct(NodeDefinition $node)
{
$this->node = $node;
@@ -34,9 +29,7 @@ public function __construct(NodeDefinition $node)
/**
* Registers a closure to run as normalization or an expression builder to build it if null is provided.
*
- * @param \Closure $closure
- *
- * @return ExprBuilder|ValidationBuilder
+ * @return ExprBuilder|$this
*/
public function rule(\Closure $closure = null)
{
diff --git a/tests/integration/vendor/symfony/config/Definition/Builder/VariableNodeDefinition.php b/tests/integration/vendor/symfony/config/Definition/Builder/VariableNodeDefinition.php
index a46b7ea61..eea16cc32 100644
--- a/tests/integration/vendor/symfony/config/Definition/Builder/VariableNodeDefinition.php
+++ b/tests/integration/vendor/symfony/config/Definition/Builder/VariableNodeDefinition.php
@@ -23,11 +23,11 @@ class VariableNodeDefinition extends NodeDefinition
/**
* Instantiate a Node.
*
- * @return VariableNode The node
+ * @return VariableNode
*/
protected function instantiateNode()
{
- return new VariableNode($this->name, $this->parent);
+ return new VariableNode($this->name, $this->parent, $this->pathSeparator);
}
/**
@@ -55,6 +55,10 @@ protected function createNode()
$node->addEquivalentValue(false, $this->falseEquivalent);
$node->setRequired($this->required);
+ if ($this->deprecation) {
+ $node->setDeprecated($this->deprecation['package'], $this->deprecation['version'], $this->deprecation['message']);
+ }
+
if (null !== $this->validation) {
$node->setFinalValidationClosures($this->validation->rules);
}
diff --git a/tests/integration/vendor/symfony/config/Definition/ConfigurationInterface.php b/tests/integration/vendor/symfony/config/Definition/ConfigurationInterface.php
index d6456edb8..7b5d443fe 100644
--- a/tests/integration/vendor/symfony/config/Definition/ConfigurationInterface.php
+++ b/tests/integration/vendor/symfony/config/Definition/ConfigurationInterface.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Config\Definition;
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+
/**
* Configuration interface.
*
@@ -21,7 +23,7 @@ interface ConfigurationInterface
/**
* Generates the configuration tree builder.
*
- * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
+ * @return TreeBuilder
*/
public function getConfigTreeBuilder();
}
diff --git a/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php b/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php
index ec5460f2f..a8b18a023 100644
--- a/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php
+++ b/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php
@@ -11,14 +11,15 @@
namespace Symfony\Component\Config\Definition\Dumper;
-use Symfony\Component\Config\Definition\ConfigurationInterface;
-use Symfony\Component\Config\Definition\NodeInterface;
use Symfony\Component\Config\Definition\ArrayNode;
+use Symfony\Component\Config\Definition\BaseNode;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\EnumNode;
+use Symfony\Component\Config\Definition\NodeInterface;
use Symfony\Component\Config\Definition\PrototypedArrayNode;
/**
- * Dumps a XML reference configuration for the given configuration/node instance.
+ * Dumps an XML reference configuration for the given configuration/node instance.
*
* @author Wouter J
*/
@@ -26,12 +27,12 @@ class XmlReferenceDumper
{
private $reference;
- public function dump(ConfigurationInterface $configuration, $namespace = null)
+ public function dump(ConfigurationInterface $configuration, string $namespace = null)
{
return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace);
}
- public function dumpNode(NodeInterface $node, $namespace = null)
+ public function dumpNode(NodeInterface $node, string $namespace = null)
{
$this->reference = '';
$this->writeNode($node, 0, true, $namespace);
@@ -41,34 +42,28 @@ public function dumpNode(NodeInterface $node, $namespace = null)
return $ref;
}
- /**
- * @param NodeInterface $node
- * @param int $depth
- * @param bool $root If the node is the root node
- * @param string $namespace The namespace of the node
- */
- private function writeNode(NodeInterface $node, $depth = 0, $root = false, $namespace = null)
+ private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, string $namespace = null)
{
$rootName = ($root ? 'config' : $node->getName());
$rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null));
// xml remapping
if ($node->getParent()) {
- $remapping = array_filter($node->getParent()->getXmlRemappings(), function ($mapping) use ($rootName) {
+ $remapping = array_filter($node->getParent()->getXmlRemappings(), function (array $mapping) use ($rootName) {
return $rootName === $mapping[1];
});
- if (count($remapping)) {
- list($singular) = current($remapping);
+ if (\count($remapping)) {
+ [$singular] = current($remapping);
$rootName = $singular;
}
}
$rootName = str_replace('_', '-', $rootName);
- $rootAttributes = array();
- $rootAttributeComments = array();
- $rootChildren = array();
- $rootComments = array();
+ $rootAttributes = [];
+ $rootAttributeComments = [];
+ $rootChildren = [];
+ $rootComments = [];
if ($node instanceof ArrayNode) {
$children = $node->getChildren();
@@ -97,15 +92,15 @@ private function writeNode(NodeInterface $node, $depth = 0, $root = false, $name
}
if ($prototype instanceof PrototypedArrayNode) {
- $prototype->setName($key);
- $children = array($key => $prototype);
+ $prototype->setName($key ?? '');
+ $children = [$key => $prototype];
} elseif ($prototype instanceof ArrayNode) {
$children = $prototype->getChildren();
} else {
if ($prototype->hasDefaultValue()) {
$prototypeValue = $prototype->getDefaultValue();
} else {
- switch (get_class($prototype)) {
+ switch (\get_class($prototype)) {
case 'Symfony\Component\Config\Definition\ScalarNode':
$prototypeValue = 'scalar value';
break;
@@ -132,65 +127,72 @@ private function writeNode(NodeInterface $node, $depth = 0, $root = false, $name
// get attributes and elements
foreach ($children as $child) {
- if (!$child instanceof ArrayNode) {
- // get attributes
+ if ($child instanceof ArrayNode) {
+ // get elements
+ $rootChildren[] = $child;
- // metadata
- $name = str_replace('_', '-', $child->getName());
- $value = '%%%%not_defined%%%%'; // use a string which isn't used in the normal world
+ continue;
+ }
- // comments
- $comments = array();
- if ($info = $child->getInfo()) {
- $comments[] = $info;
- }
+ // get attributes
- if ($example = $child->getExample()) {
- $comments[] = 'Example: '.$example;
- }
+ // metadata
+ $name = str_replace('_', '-', $child->getName());
+ $value = '%%%%not_defined%%%%'; // use a string which isn't used in the normal world
- if ($child->isRequired()) {
- $comments[] = 'Required';
- }
+ // comments
+ $comments = [];
+ if ($child instanceof BaseNode && $info = $child->getInfo()) {
+ $comments[] = $info;
+ }
- if ($child instanceof EnumNode) {
- $comments[] = 'One of '.implode('; ', array_map('json_encode', $child->getValues()));
- }
+ if ($child instanceof BaseNode && $example = $child->getExample()) {
+ $comments[] = 'Example: '.$example;
+ }
- if (count($comments)) {
- $rootAttributeComments[$name] = implode(";\n", $comments);
- }
+ if ($child->isRequired()) {
+ $comments[] = 'Required';
+ }
- // default values
- if ($child->hasDefaultValue()) {
- $value = $child->getDefaultValue();
- }
+ if ($child instanceof BaseNode && $child->isDeprecated()) {
+ $deprecation = $child->getDeprecation($child->getName(), $node->getPath());
+ $comments[] = sprintf('Deprecated (%s)', ($deprecation['package'] || $deprecation['version'] ? "Since {$deprecation['package']} {$deprecation['version']}: " : '').$deprecation['message']);
+ }
- // append attribute
- $rootAttributes[$name] = $value;
- } else {
- // get elements
- $rootChildren[] = $child;
+ if ($child instanceof EnumNode) {
+ $comments[] = 'One of '.implode('; ', array_map('json_encode', $child->getValues()));
}
+
+ if (\count($comments)) {
+ $rootAttributeComments[$name] = implode(";\n", $comments);
+ }
+
+ // default values
+ if ($child->hasDefaultValue()) {
+ $value = $child->getDefaultValue();
+ }
+
+ // append attribute
+ $rootAttributes[$name] = $value;
}
}
// render comments
// root node comment
- if (count($rootComments)) {
+ if (\count($rootComments)) {
foreach ($rootComments as $comment) {
$this->writeLine('', $depth);
}
}
// attribute comments
- if (count($rootAttributeComments)) {
+ if (\count($rootAttributeComments)) {
foreach ($rootAttributeComments as $attrName => $comment) {
- $commentDepth = $depth + 4 + strlen($attrName) + 2;
+ $commentDepth = $depth + 4 + \strlen($attrName) + 2;
$commentLines = explode("\n", $comment);
- $multiline = (count($commentLines) > 1);
- $comment = implode(PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
+ $multiline = (\count($commentLines) > 1);
+ $comment = implode(\PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
if ($multiline) {
$this->writeLine('
-
-
-
-
-
-
-
-
-
-
- scalar value
-
-
- scalar value
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-EOL
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/Dumper/YamlReferenceDumperTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/Dumper/YamlReferenceDumperTest.php
deleted file mode 100644
index ede5a19d0..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/Dumper/YamlReferenceDumperTest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition\Dumper;
-
-use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
-use Symfony\Component\Config\Tests\Fixtures\Configuration\ExampleConfiguration;
-
-class YamlReferenceDumperTest extends \PHPUnit_Framework_TestCase
-{
- public function testDumper()
- {
- $configuration = new ExampleConfiguration();
-
- $dumper = new YamlReferenceDumper();
-
- $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration));
- }
-
- private function getConfigurationAsString()
- {
- return <<<'EOL'
-acme_root:
- boolean: true
- scalar_empty: ~
- scalar_null: null
- scalar_true: true
- scalar_false: false
- scalar_default: default
- scalar_array_empty: []
- scalar_array_defaults:
-
- # Defaults:
- - elem1
- - elem2
- scalar_required: ~ # Required
- node_with_a_looong_name: ~
- enum_with_default: this # One of "this"; "that"
- enum: ~ # One of "this"; "that"
-
- # some info
- array:
- child1: ~
- child2: ~
-
- # this is a long
- # multi-line info text
- # which should be indented
- child3: ~ # Example: example setting
- scalar_prototyped: []
- parameters:
-
- # Prototype: Parameter name
- name: ~
- connections:
-
- # Prototype
- -
- user: ~
- pass: ~
- cms_pages:
-
- # Prototype
- page:
-
- # Prototype
- locale:
- title: ~ # Required
- path: ~ # Required
- pipou:
-
- # Prototype
- name: []
-
-EOL;
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/EnumNodeTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/EnumNodeTest.php
deleted file mode 100644
index 654d5050d..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/EnumNodeTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\EnumNode;
-
-class EnumNodeTest extends \PHPUnit_Framework_TestCase
-{
- public function testFinalizeValue()
- {
- $node = new EnumNode('foo', null, array('foo', 'bar'));
- $this->assertSame('foo', $node->finalize('foo'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage $values must contain at least one element.
- */
- public function testConstructionWithNoValues()
- {
- new EnumNode('foo', null, array());
- }
-
- public function testConstructionWithOneValue()
- {
- $node = new EnumNode('foo', null, array('foo'));
- $this->assertSame('foo', $node->finalize('foo'));
- }
-
- public function testConstructionWithOneDistinctValue()
- {
- $node = new EnumNode('foo', null, array('foo', 'foo'));
- $this->assertSame('foo', $node->finalize('foo'));
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- * @expectedExceptionMessage The value "foobar" is not allowed for path "foo". Permissible values: "foo", "bar"
- */
- public function testFinalizeWithInvalidValue()
- {
- $node = new EnumNode('foo', null, array('foo', 'bar'));
- $node->finalize('foobar');
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/FinalizationTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/FinalizationTest.php
deleted file mode 100644
index 19fc347d8..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/FinalizationTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\Builder\TreeBuilder;
-use Symfony\Component\Config\Definition\Processor;
-use Symfony\Component\Config\Definition\NodeInterface;
-
-class FinalizationTest extends \PHPUnit_Framework_TestCase
-{
- public function testUnsetKeyWithDeepHierarchy()
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('config', 'array')
- ->children()
- ->node('level1', 'array')
- ->canBeUnset()
- ->children()
- ->node('level2', 'array')
- ->canBeUnset()
- ->children()
- ->node('somevalue', 'scalar')->end()
- ->node('anothervalue', 'scalar')->end()
- ->end()
- ->end()
- ->node('level1_scalar', 'scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $a = array(
- 'level1' => array(
- 'level2' => array(
- 'somevalue' => 'foo',
- 'anothervalue' => 'bar',
- ),
- 'level1_scalar' => 'foo',
- ),
- );
-
- $b = array(
- 'level1' => array(
- 'level2' => false,
- ),
- );
-
- $this->assertEquals(array(
- 'level1' => array(
- 'level1_scalar' => 'foo',
- ),
- ), $this->process($tree, array($a, $b)));
- }
-
- protected function process(NodeInterface $tree, array $configs)
- {
- $processor = new Processor();
-
- return $processor->process($tree, $configs);
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/FloatNodeTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/FloatNodeTest.php
deleted file mode 100644
index 84afd6c10..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/FloatNodeTest.php
+++ /dev/null
@@ -1,77 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\FloatNode;
-
-class FloatNodeTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getValidValues
- */
- public function testNormalize($value)
- {
- $node = new FloatNode('test');
- $this->assertSame($value, $node->normalize($value));
- }
-
- /**
- * @dataProvider getValidValues
- *
- * @param int $value
- */
- public function testValidNonEmptyValues($value)
- {
- $node = new FloatNode('test');
- $node->setAllowEmptyValue(false);
-
- $this->assertSame($value, $node->finalize($value));
- }
-
- public function getValidValues()
- {
- return array(
- array(1798.0),
- array(-678.987),
- array(12.56E45),
- array(0.0),
- // Integer are accepted too, they will be cast
- array(17),
- array(-10),
- array(0),
- );
- }
-
- /**
- * @dataProvider getInvalidValues
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
- */
- public function testNormalizeThrowsExceptionOnInvalidValues($value)
- {
- $node = new FloatNode('test');
- $node->normalize($value);
- }
-
- public function getInvalidValues()
- {
- return array(
- array(null),
- array(''),
- array('foo'),
- array(true),
- array(false),
- array(array()),
- array(array('foo' => 'bar')),
- array(new \stdClass()),
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/IntegerNodeTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/IntegerNodeTest.php
deleted file mode 100644
index 58d214859..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/IntegerNodeTest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\IntegerNode;
-
-class IntegerNodeTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getValidValues
- */
- public function testNormalize($value)
- {
- $node = new IntegerNode('test');
- $this->assertSame($value, $node->normalize($value));
- }
-
- /**
- * @dataProvider getValidValues
- *
- * @param int $value
- */
- public function testValidNonEmptyValues($value)
- {
- $node = new IntegerNode('test');
- $node->setAllowEmptyValue(false);
-
- $this->assertSame($value, $node->finalize($value));
- }
-
- public function getValidValues()
- {
- return array(
- array(1798),
- array(-678),
- array(0),
- );
- }
-
- /**
- * @dataProvider getInvalidValues
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
- */
- public function testNormalizeThrowsExceptionOnInvalidValues($value)
- {
- $node = new IntegerNode('test');
- $node->normalize($value);
- }
-
- public function getInvalidValues()
- {
- return array(
- array(null),
- array(''),
- array('foo'),
- array(true),
- array(false),
- array(0.0),
- array(0.1),
- array(array()),
- array(array('foo' => 'bar')),
- array(new \stdClass()),
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/MergeTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/MergeTest.php
deleted file mode 100644
index 08ddc3209..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/MergeTest.php
+++ /dev/null
@@ -1,195 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\Builder\TreeBuilder;
-
-class MergeTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @expectedException \Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException
- */
- public function testForbiddenOverwrite()
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('root', 'array')
- ->children()
- ->node('foo', 'scalar')
- ->cannotBeOverwritten()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $a = array(
- 'foo' => 'bar',
- );
-
- $b = array(
- 'foo' => 'moo',
- );
-
- $tree->merge($a, $b);
- }
-
- public function testUnsetKey()
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('root', 'array')
- ->children()
- ->node('foo', 'scalar')->end()
- ->node('bar', 'scalar')->end()
- ->node('unsettable', 'array')
- ->canBeUnset()
- ->children()
- ->node('foo', 'scalar')->end()
- ->node('bar', 'scalar')->end()
- ->end()
- ->end()
- ->node('unsetted', 'array')
- ->canBeUnset()
- ->prototype('scalar')->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $a = array(
- 'foo' => 'bar',
- 'unsettable' => array(
- 'foo' => 'a',
- 'bar' => 'b',
- ),
- 'unsetted' => false,
- );
-
- $b = array(
- 'foo' => 'moo',
- 'bar' => 'b',
- 'unsettable' => false,
- 'unsetted' => array('a', 'b'),
- );
-
- $this->assertEquals(array(
- 'foo' => 'moo',
- 'bar' => 'b',
- 'unsettable' => false,
- 'unsetted' => array('a', 'b'),
- ), $tree->merge($a, $b));
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function testDoesNotAllowNewKeysInSubsequentConfigs()
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('config', 'array')
- ->children()
- ->node('test', 'array')
- ->disallowNewKeysInSubsequentConfigs()
- ->useAttributeAsKey('key')
- ->prototype('array')
- ->children()
- ->node('value', 'scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->buildTree();
-
- $a = array(
- 'test' => array(
- 'a' => array('value' => 'foo'),
- ),
- );
-
- $b = array(
- 'test' => array(
- 'b' => array('value' => 'foo'),
- ),
- );
-
- $tree->merge($a, $b);
- }
-
- public function testPerformsNoDeepMerging()
- {
- $tb = new TreeBuilder();
-
- $tree = $tb
- ->root('config', 'array')
- ->children()
- ->node('no_deep_merging', 'array')
- ->performNoDeepMerging()
- ->children()
- ->node('foo', 'scalar')->end()
- ->node('bar', 'scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $a = array(
- 'no_deep_merging' => array(
- 'foo' => 'a',
- 'bar' => 'b',
- ),
- );
-
- $b = array(
- 'no_deep_merging' => array(
- 'c' => 'd',
- ),
- );
-
- $this->assertEquals(array(
- 'no_deep_merging' => array(
- 'c' => 'd',
- ),
- ), $tree->merge($a, $b));
- }
-
- public function testPrototypeWithoutAKeyAttribute()
- {
- $tb = new TreeBuilder();
-
- $tree = $tb
- ->root('config', 'array')
- ->children()
- ->arrayNode('append_elements')
- ->prototype('scalar')->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $a = array(
- 'append_elements' => array('a', 'b'),
- );
-
- $b = array(
- 'append_elements' => array('c', 'd'),
- );
-
- $this->assertEquals(array('append_elements' => array('a', 'b', 'c', 'd')), $tree->merge($a, $b));
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/NormalizationTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/NormalizationTest.php
deleted file mode 100644
index a896f9622..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/NormalizationTest.php
+++ /dev/null
@@ -1,229 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\NodeInterface;
-use Symfony\Component\Config\Definition\Builder\TreeBuilder;
-
-class NormalizationTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getEncoderTests
- */
- public function testNormalizeEncoders($denormalized)
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('root_name', 'array')
- ->fixXmlConfig('encoder')
- ->children()
- ->node('encoders', 'array')
- ->useAttributeAsKey('class')
- ->prototype('array')
- ->beforeNormalization()->ifString()->then(function ($v) { return array('algorithm' => $v); })->end()
- ->children()
- ->node('algorithm', 'scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $normalized = array(
- 'encoders' => array(
- 'foo' => array('algorithm' => 'plaintext'),
- ),
- );
-
- $this->assertNormalized($tree, $denormalized, $normalized);
- }
-
- public function getEncoderTests()
- {
- $configs = array();
-
- // XML
- $configs[] = array(
- 'encoder' => array(
- array('class' => 'foo', 'algorithm' => 'plaintext'),
- ),
- );
-
- // XML when only one element of this type
- $configs[] = array(
- 'encoder' => array('class' => 'foo', 'algorithm' => 'plaintext'),
- );
-
- // YAML/PHP
- $configs[] = array(
- 'encoders' => array(
- array('class' => 'foo', 'algorithm' => 'plaintext'),
- ),
- );
-
- // YAML/PHP
- $configs[] = array(
- 'encoders' => array(
- 'foo' => 'plaintext',
- ),
- );
-
- // YAML/PHP
- $configs[] = array(
- 'encoders' => array(
- 'foo' => array('algorithm' => 'plaintext'),
- ),
- );
-
- return array_map(function ($v) {
- return array($v);
- }, $configs);
- }
-
- /**
- * @dataProvider getAnonymousKeysTests
- */
- public function testAnonymousKeysArray($denormalized)
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('root', 'array')
- ->children()
- ->node('logout', 'array')
- ->fixXmlConfig('handler')
- ->children()
- ->node('handlers', 'array')
- ->prototype('scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $normalized = array('logout' => array('handlers' => array('a', 'b', 'c')));
-
- $this->assertNormalized($tree, $denormalized, $normalized);
- }
-
- public function getAnonymousKeysTests()
- {
- $configs = array();
-
- $configs[] = array(
- 'logout' => array(
- 'handlers' => array('a', 'b', 'c'),
- ),
- );
-
- $configs[] = array(
- 'logout' => array(
- 'handler' => array('a', 'b', 'c'),
- ),
- );
-
- return array_map(function ($v) { return array($v); }, $configs);
- }
-
- /**
- * @dataProvider getNumericKeysTests
- */
- public function testNumericKeysAsAttributes($denormalized)
- {
- $normalized = array(
- 'thing' => array(42 => array('foo', 'bar'), 1337 => array('baz', 'qux')),
- );
-
- $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, $normalized);
- }
-
- public function getNumericKeysTests()
- {
- $configs = array();
-
- $configs[] = array(
- 'thing' => array(
- 42 => array('foo', 'bar'), 1337 => array('baz', 'qux'),
- ),
- );
-
- $configs[] = array(
- 'thing' => array(
- array('foo', 'bar', 'id' => 42), array('baz', 'qux', 'id' => 1337),
- ),
- );
-
- return array_map(function ($v) { return array($v); }, $configs);
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- * @expectedExceptionMessage The attribute "id" must be set for path "root.thing".
- */
- public function testNonAssociativeArrayThrowsExceptionIfAttributeNotSet()
- {
- $denormalized = array(
- 'thing' => array(
- array('foo', 'bar'), array('baz', 'qux'),
- ),
- );
-
- $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, array());
- }
-
- public function testAssociativeArrayPreserveKeys()
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('root', 'array')
- ->prototype('array')
- ->children()
- ->node('foo', 'scalar')->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- $data = array('first' => array('foo' => 'bar'));
-
- $this->assertNormalized($tree, $data, $data);
- }
-
- public static function assertNormalized(NodeInterface $tree, $denormalized, $normalized)
- {
- self::assertSame($normalized, $tree->normalize($denormalized));
- }
-
- private function getNumericKeysTestTree()
- {
- $tb = new TreeBuilder();
- $tree = $tb
- ->root('root', 'array')
- ->children()
- ->node('thing', 'array')
- ->useAttributeAsKey('id')
- ->prototype('array')
- ->prototype('scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->buildTree()
- ;
-
- return $tree;
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/PrototypedArrayNodeTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/PrototypedArrayNodeTest.php
deleted file mode 100644
index c343fcfd9..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/PrototypedArrayNodeTest.php
+++ /dev/null
@@ -1,180 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
-use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\ScalarNode;
-
-class PrototypedArrayNodeTest extends \PHPUnit_Framework_TestCase
-{
- public function testGetDefaultValueReturnsAnEmptyArrayForPrototypes()
- {
- $node = new PrototypedArrayNode('root');
- $prototype = new ArrayNode(null, $node);
- $node->setPrototype($prototype);
- $this->assertEmpty($node->getDefaultValue());
- }
-
- public function testGetDefaultValueReturnsDefaultValueForPrototypes()
- {
- $node = new PrototypedArrayNode('root');
- $prototype = new ArrayNode(null, $node);
- $node->setPrototype($prototype);
- $node->setDefaultValue(array('test'));
- $this->assertEquals(array('test'), $node->getDefaultValue());
- }
-
- // a remapped key (e.g. "mapping" -> "mappings") should be unset after being used
- public function testRemappedKeysAreUnset()
- {
- $node = new ArrayNode('root');
- $mappingsNode = new PrototypedArrayNode('mappings');
- $node->addChild($mappingsNode);
-
- // each item under mappings is just a scalar
- $prototype = new ScalarNode(null, $mappingsNode);
- $mappingsNode->setPrototype($prototype);
-
- $remappings = array();
- $remappings[] = array('mapping', 'mappings');
- $node->setXmlRemappings($remappings);
-
- $normalized = $node->normalize(array('mapping' => array('foo', 'bar')));
- $this->assertEquals(array('mappings' => array('foo', 'bar')), $normalized);
- }
-
- /**
- * Tests that when a key attribute is mapped, that key is removed from the array.
- *
- *
- *
- *
- * The above should finally be mapped to an array that looks like this
- * (because "id" is the key attribute).
- *
- * array(
- * 'things' => array(
- * 'option1' => 'foo',
- * 'option2' => 'bar',
- * )
- * )
- */
- public function testMappedAttributeKeyIsRemoved()
- {
- $node = new PrototypedArrayNode('root');
- $node->setKeyAttribute('id', true);
-
- // each item under the root is an array, with one scalar item
- $prototype = new ArrayNode(null, $node);
- $prototype->addChild(new ScalarNode('foo'));
- $node->setPrototype($prototype);
-
- $children = array();
- $children[] = array('id' => 'item_name', 'foo' => 'bar');
- $normalized = $node->normalize($children);
-
- $expected = array();
- $expected['item_name'] = array('foo' => 'bar');
- $this->assertEquals($expected, $normalized);
- }
-
- /**
- * Tests the opposite of the testMappedAttributeKeyIsRemoved because
- * the removal can be toggled with an option.
- */
- public function testMappedAttributeKeyNotRemoved()
- {
- $node = new PrototypedArrayNode('root');
- $node->setKeyAttribute('id', false);
-
- // each item under the root is an array, with two scalar items
- $prototype = new ArrayNode(null, $node);
- $prototype->addChild(new ScalarNode('foo'));
- $prototype->addChild(new ScalarNode('id')); // the key attribute will remain
- $node->setPrototype($prototype);
-
- $children = array();
- $children[] = array('id' => 'item_name', 'foo' => 'bar');
- $normalized = $node->normalize($children);
-
- $expected = array();
- $expected['item_name'] = array('id' => 'item_name', 'foo' => 'bar');
- $this->assertEquals($expected, $normalized);
- }
-
- public function testAddDefaultChildren()
- {
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setAddChildrenIfNoneSet();
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array(array('foo' => 'bar')), $node->getDefaultValue());
-
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setKeyAttribute('foobar');
- $node->setAddChildrenIfNoneSet();
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array('defaults' => array('foo' => 'bar')), $node->getDefaultValue());
-
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setKeyAttribute('foobar');
- $node->setAddChildrenIfNoneSet('defaultkey');
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array('defaultkey' => array('foo' => 'bar')), $node->getDefaultValue());
-
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setKeyAttribute('foobar');
- $node->setAddChildrenIfNoneSet(array('defaultkey'));
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array('defaultkey' => array('foo' => 'bar')), $node->getDefaultValue());
-
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setKeyAttribute('foobar');
- $node->setAddChildrenIfNoneSet(array('dk1', 'dk2'));
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array('dk1' => array('foo' => 'bar'), 'dk2' => array('foo' => 'bar')), $node->getDefaultValue());
-
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setAddChildrenIfNoneSet(array(5, 6));
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array(0 => array('foo' => 'bar'), 1 => array('foo' => 'bar')), $node->getDefaultValue());
-
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setAddChildrenIfNoneSet(2);
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array(array('foo' => 'bar'), array('foo' => 'bar')), $node->getDefaultValue());
- }
-
- public function testDefaultChildrenWinsOverDefaultValue()
- {
- $node = $this->getPrototypeNodeWithDefaultChildren();
- $node->setAddChildrenIfNoneSet();
- $node->setDefaultValue(array('bar' => 'foo'));
- $this->assertTrue($node->hasDefaultValue());
- $this->assertEquals(array(array('foo' => 'bar')), $node->getDefaultValue());
- }
-
- protected function getPrototypeNodeWithDefaultChildren()
- {
- $node = new PrototypedArrayNode('root');
- $prototype = new ArrayNode(null, $node);
- $child = new ScalarNode('foo');
- $child->setDefaultValue('bar');
- $prototype->addChild($child);
- $prototype->setAddIfNotSet(true);
- $node->setPrototype($prototype);
-
- return $node;
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Definition/ScalarNodeTest.php b/tests/integration/vendor/symfony/config/Tests/Definition/ScalarNodeTest.php
deleted file mode 100644
index 86c180301..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Definition/ScalarNodeTest.php
+++ /dev/null
@@ -1,126 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition;
-
-use Symfony\Component\Config\Definition\ScalarNode;
-
-class ScalarNodeTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getValidValues
- */
- public function testNormalize($value)
- {
- $node = new ScalarNode('test');
- $this->assertSame($value, $node->normalize($value));
- }
-
- public function getValidValues()
- {
- return array(
- array(false),
- array(true),
- array(null),
- array(''),
- array('foo'),
- array(0),
- array(1),
- array(0.0),
- array(0.1),
- );
- }
-
- /**
- * @dataProvider getInvalidValues
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
- */
- public function testNormalizeThrowsExceptionOnInvalidValues($value)
- {
- $node = new ScalarNode('test');
- $node->normalize($value);
- }
-
- public function getInvalidValues()
- {
- return array(
- array(array()),
- array(array('foo' => 'bar')),
- array(new \stdClass()),
- );
- }
-
- public function testNormalizeThrowsExceptionWithoutHint()
- {
- $node = new ScalarNode('test');
-
- $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException', 'Invalid type for path "test". Expected scalar, but got array.');
-
- $node->normalize(array());
- }
-
- public function testNormalizeThrowsExceptionWithErrorMessage()
- {
- $node = new ScalarNode('test');
- $node->setInfo('"the test value"');
-
- $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException', "Invalid type for path \"test\". Expected scalar, but got array.\nHint: \"the test value\"");
-
- $node->normalize(array());
- }
-
- /**
- * @dataProvider getValidNonEmptyValues
- *
- * @param mixed $value
- */
- public function testValidNonEmptyValues($value)
- {
- $node = new ScalarNode('test');
- $node->setAllowEmptyValue(false);
-
- $this->assertSame($value, $node->finalize($value));
- }
-
- public function getValidNonEmptyValues()
- {
- return array(
- array(false),
- array(true),
- array('foo'),
- array(0),
- array(1),
- array(0.0),
- array(0.1),
- );
- }
-
- /**
- * @dataProvider getEmptyValues
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- *
- * @param mixed $value
- */
- public function testNotAllowedEmptyValuesThrowException($value)
- {
- $node = new ScalarNode('test');
- $node->setAllowEmptyValue(false);
- $node->finalize($value);
- }
-
- public function getEmptyValues()
- {
- return array(
- array(null),
- array(''),
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Exception/FileLoaderLoadExceptionTest.php b/tests/integration/vendor/symfony/config/Tests/Exception/FileLoaderLoadExceptionTest.php
deleted file mode 100644
index c3d050c75..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Exception/FileLoaderLoadExceptionTest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Exception;
-
-use Symfony\Component\Config\Exception\FileLoaderLoadException;
-
-class FileLoaderLoadExceptionTest extends \PHPUnit_Framework_TestCase
-{
- public function testMessageCannotLoadResource()
- {
- $exception = new FileLoaderLoadException('resource', null);
- $this->assertEquals('Cannot load resource "resource".', $exception->getMessage());
- }
-
- public function testMessageCannotImportResourceFromSource()
- {
- $exception = new FileLoaderLoadException('resource', 'sourceResource');
- $this->assertEquals('Cannot import resource "resource" from "sourceResource".', $exception->getMessage());
- }
-
- public function testMessageCannotImportBundleResource()
- {
- $exception = new FileLoaderLoadException('@resource', 'sourceResource');
- $this->assertEquals(
- 'Cannot import resource "@resource" from "sourceResource". '.
- 'Make sure the "resource" bundle is correctly registered and loaded in the application kernel class. '.
- 'If the bundle is registered, make sure the bundle path "@resource" is not empty.',
- $exception->getMessage()
- );
- }
-
- public function testMessageHasPreviousErrorWithDotAndUnableToLoad()
- {
- $exception = new FileLoaderLoadException(
- 'resource',
- null,
- null,
- new \Exception('There was a previous error with an ending dot.')
- );
- $this->assertEquals(
- 'There was a previous error with an ending dot in resource (which is loaded in resource "resource").',
- $exception->getMessage()
- );
- }
-
- public function testMessageHasPreviousErrorWithoutDotAndUnableToLoad()
- {
- $exception = new FileLoaderLoadException(
- 'resource',
- null,
- null,
- new \Exception('There was a previous error with no ending dot')
- );
- $this->assertEquals(
- 'There was a previous error with no ending dot in resource (which is loaded in resource "resource").',
- $exception->getMessage()
- );
- }
-
- public function testMessageHasPreviousErrorAndUnableToLoadBundle()
- {
- $exception = new FileLoaderLoadException(
- '@resource',
- null,
- null,
- new \Exception('There was a previous error with an ending dot.')
- );
- $this->assertEquals(
- 'There was a previous error with an ending dot in @resource '.
- '(which is loaded in resource "@resource"). '.
- 'Make sure the "resource" bundle is correctly registered and loaded in the application kernel class. '.
- 'If the bundle is registered, make sure the bundle path "@resource" is not empty.',
- $exception->getMessage()
- );
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/FileLocatorTest.php b/tests/integration/vendor/symfony/config/Tests/FileLocatorTest.php
deleted file mode 100644
index 0a03adf12..000000000
--- a/tests/integration/vendor/symfony/config/Tests/FileLocatorTest.php
+++ /dev/null
@@ -1,119 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests;
-
-use Symfony\Component\Config\FileLocator;
-
-class FileLocatorTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getIsAbsolutePathTests
- */
- public function testIsAbsolutePath($path)
- {
- $loader = new FileLocator(array());
- $r = new \ReflectionObject($loader);
- $m = $r->getMethod('isAbsolutePath');
- $m->setAccessible(true);
-
- $this->assertTrue($m->invoke($loader, $path), '->isAbsolutePath() returns true for an absolute path');
- }
-
- public function getIsAbsolutePathTests()
- {
- return array(
- array('/foo.xml'),
- array('c:\\\\foo.xml'),
- array('c:/foo.xml'),
- array('\\server\\foo.xml'),
- array('https://server/foo.xml'),
- array('phar://server/foo.xml'),
- );
- }
-
- public function testLocate()
- {
- $loader = new FileLocator(__DIR__.'/Fixtures');
-
- $this->assertEquals(
- __DIR__.DIRECTORY_SEPARATOR.'FileLocatorTest.php',
- $loader->locate('FileLocatorTest.php', __DIR__),
- '->locate() returns the absolute filename if the file exists in the given path'
- );
-
- $this->assertEquals(
- __DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml',
- $loader->locate('foo.xml', __DIR__),
- '->locate() returns the absolute filename if the file exists in one of the paths given in the constructor'
- );
-
- $this->assertEquals(
- __DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml',
- $loader->locate(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__),
- '->locate() returns the absolute filename if the file exists in one of the paths given in the constructor'
- );
-
- $loader = new FileLocator(array(__DIR__.'/Fixtures', __DIR__.'/Fixtures/Again'));
-
- $this->assertEquals(
- array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'),
- $loader->locate('foo.xml', __DIR__, false),
- '->locate() returns an array of absolute filenames'
- );
-
- $this->assertEquals(
- array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'),
- $loader->locate('foo.xml', __DIR__.'/Fixtures', false),
- '->locate() returns an array of absolute filenames'
- );
-
- $loader = new FileLocator(__DIR__.'/Fixtures/Again');
-
- $this->assertEquals(
- array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'),
- $loader->locate('foo.xml', __DIR__.'/Fixtures', false),
- '->locate() returns an array of absolute filenames'
- );
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Exception\FileLocatorFileNotFoundException
- * @expectedExceptionMessage The file "foobar.xml" does not exist
- */
- public function testLocateThrowsAnExceptionIfTheFileDoesNotExists()
- {
- $loader = new FileLocator(array(__DIR__.'/Fixtures'));
-
- $loader->locate('foobar.xml', __DIR__);
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Exception\FileLocatorFileNotFoundException
- */
- public function testLocateThrowsAnExceptionIfTheFileDoesNotExistsInAbsolutePath()
- {
- $loader = new FileLocator(array(__DIR__.'/Fixtures'));
-
- $loader->locate(__DIR__.'/Fixtures/foobar.xml', __DIR__);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage An empty file name is not valid to be located.
- */
- public function testLocateEmpty()
- {
- $loader = new FileLocator(array(__DIR__.'/Fixtures'));
-
- $loader->locate(null, __DIR__);
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Again/foo.xml b/tests/integration/vendor/symfony/config/Tests/Fixtures/Again/foo.xml
deleted file mode 100644
index e69de29bb..000000000
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/BarNodeDefinition.php b/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/BarNodeDefinition.php
deleted file mode 100644
index 47701c1b2..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/BarNodeDefinition.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition\Builder;
-
-use Symfony\Component\Config\Definition\Builder\NodeDefinition;
-
-class BarNodeDefinition extends NodeDefinition
-{
- protected function createNode()
- {
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/NodeBuilder.php b/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/NodeBuilder.php
deleted file mode 100644
index aa5986311..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/NodeBuilder.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition\Builder;
-
-use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder;
-
-class NodeBuilder extends BaseNodeBuilder
-{
- public function barNode($name)
- {
- return $this->node($name, 'bar');
- }
-
- protected function getNodeClass($type)
- {
- switch ($type) {
- case 'variable':
- return __NAMESPACE__.'\\'.ucfirst($type).'NodeDefinition';
- case 'bar':
- return __NAMESPACE__.'\\'.ucfirst($type).'NodeDefinition';
- default:
- return parent::getNodeClass($type);
- }
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/VariableNodeDefinition.php b/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/VariableNodeDefinition.php
deleted file mode 100644
index 1017880c1..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Builder/VariableNodeDefinition.php
+++ /dev/null
@@ -1,18 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Definition\Builder;
-
-use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVariableNodeDefinition;
-
-class VariableNodeDefinition extends BaseVariableNodeDefinition
-{
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Configuration/ExampleConfiguration.php b/tests/integration/vendor/symfony/config/Tests/Fixtures/Configuration/ExampleConfiguration.php
deleted file mode 100644
index 3a34f906a..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Configuration/ExampleConfiguration.php
+++ /dev/null
@@ -1,100 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Fixtures\Configuration;
-
-use Symfony\Component\Config\Definition\Builder\TreeBuilder;
-use Symfony\Component\Config\Definition\ConfigurationInterface;
-
-class ExampleConfiguration implements ConfigurationInterface
-{
- public function getConfigTreeBuilder()
- {
- $treeBuilder = new TreeBuilder();
- $rootNode = $treeBuilder->root('acme_root');
-
- $rootNode
- ->fixXmlConfig('parameter')
- ->fixXmlConfig('connection')
- ->fixXmlConfig('cms_page')
- ->children()
- ->booleanNode('boolean')->defaultTrue()->end()
- ->scalarNode('scalar_empty')->end()
- ->scalarNode('scalar_null')->defaultNull()->end()
- ->scalarNode('scalar_true')->defaultTrue()->end()
- ->scalarNode('scalar_false')->defaultFalse()->end()
- ->scalarNode('scalar_default')->defaultValue('default')->end()
- ->scalarNode('scalar_array_empty')->defaultValue(array())->end()
- ->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end()
- ->scalarNode('scalar_required')->isRequired()->end()
- ->scalarNode('node_with_a_looong_name')->end()
- ->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end()
- ->enumNode('enum')->values(array('this', 'that'))->end()
- ->arrayNode('array')
- ->info('some info')
- ->canBeUnset()
- ->children()
- ->scalarNode('child1')->end()
- ->scalarNode('child2')->end()
- ->scalarNode('child3')
- ->info(
- "this is a long\n".
- "multi-line info text\n".
- 'which should be indented'
- )
- ->example('example setting')
- ->end()
- ->end()
- ->end()
- ->arrayNode('scalar_prototyped')
- ->prototype('scalar')->end()
- ->end()
- ->arrayNode('parameters')
- ->useAttributeAsKey('name')
- ->prototype('scalar')->info('Parameter name')->end()
- ->end()
- ->arrayNode('connections')
- ->prototype('array')
- ->children()
- ->scalarNode('user')->end()
- ->scalarNode('pass')->end()
- ->end()
- ->end()
- ->end()
- ->arrayNode('cms_pages')
- ->useAttributeAsKey('page')
- ->prototype('array')
- ->useAttributeAsKey('locale')
- ->prototype('array')
- ->children()
- ->scalarNode('title')->isRequired()->end()
- ->scalarNode('path')->isRequired()->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->arrayNode('pipou')
- ->useAttributeAsKey('name')
- ->prototype('array')
- ->prototype('array')
- ->children()
- ->scalarNode('didou')
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ;
-
- return $treeBuilder;
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/document_type.xml b/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/document_type.xml
deleted file mode 100644
index 4c2522826..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/document_type.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-]>
-
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/invalid.xml b/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/invalid.xml
deleted file mode 100644
index a07af9fd8..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/invalid.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/invalid_schema.xml b/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/invalid_schema.xml
deleted file mode 100644
index e2725a2c2..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/invalid_schema.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/schema.xsd b/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/schema.xsd
deleted file mode 100644
index e56820f69..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/schema.xsd
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/valid.xml b/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/valid.xml
deleted file mode 100644
index a96bb3826..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Fixtures/Util/valid.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/tests/integration/vendor/symfony/config/Tests/Fixtures/foo.xml b/tests/integration/vendor/symfony/config/Tests/Fixtures/foo.xml
deleted file mode 100644
index e69de29bb..000000000
diff --git a/tests/integration/vendor/symfony/config/Tests/Loader/DelegatingLoaderTest.php b/tests/integration/vendor/symfony/config/Tests/Loader/DelegatingLoaderTest.php
deleted file mode 100644
index cdb098030..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Loader/DelegatingLoaderTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Loader;
-
-use Symfony\Component\Config\Loader\LoaderResolver;
-use Symfony\Component\Config\Loader\DelegatingLoader;
-
-class DelegatingLoaderTest extends \PHPUnit_Framework_TestCase
-{
- public function testConstructor()
- {
- $loader = new DelegatingLoader($resolver = new LoaderResolver());
- $this->assertTrue(true, '__construct() takes a loader resolver as its first argument');
- }
-
- public function testGetSetResolver()
- {
- $resolver = new LoaderResolver();
- $loader = new DelegatingLoader($resolver);
- $this->assertSame($resolver, $loader->getResolver(), '->getResolver() gets the resolver loader');
- $loader->setResolver($resolver = new LoaderResolver());
- $this->assertSame($resolver, $loader->getResolver(), '->setResolver() sets the resolver loader');
- }
-
- public function testSupports()
- {
- $loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $loader1->expects($this->once())->method('supports')->will($this->returnValue(true));
- $loader = new DelegatingLoader(new LoaderResolver(array($loader1)));
- $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable');
-
- $loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $loader1->expects($this->once())->method('supports')->will($this->returnValue(false));
- $loader = new DelegatingLoader(new LoaderResolver(array($loader1)));
- $this->assertFalse($loader->supports('foo.foo'), '->supports() returns false if the resource is not loadable');
- }
-
- public function testLoad()
- {
- $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $loader->expects($this->once())->method('supports')->will($this->returnValue(true));
- $loader->expects($this->once())->method('load');
- $resolver = new LoaderResolver(array($loader));
- $loader = new DelegatingLoader($resolver);
-
- $loader->load('foo');
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Exception\FileLoaderLoadException
- */
- public function testLoadThrowsAnExceptionIfTheResourceCannotBeLoaded()
- {
- $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $loader->expects($this->once())->method('supports')->will($this->returnValue(false));
- $resolver = new LoaderResolver(array($loader));
- $loader = new DelegatingLoader($resolver);
-
- $loader->load('foo');
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Loader/FileLoaderTest.php b/tests/integration/vendor/symfony/config/Tests/Loader/FileLoaderTest.php
deleted file mode 100644
index 1e8e91eda..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Loader/FileLoaderTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Loader;
-
-use Symfony\Component\Config\Loader\FileLoader;
-use Symfony\Component\Config\Loader\LoaderResolver;
-
-class FileLoaderTest extends \PHPUnit_Framework_TestCase
-{
- public function testImportWithFileLocatorDelegation()
- {
- $locatorMock = $this->getMock('Symfony\Component\Config\FileLocatorInterface');
-
- $locatorMockForAdditionalLoader = $this->getMock('Symfony\Component\Config\FileLocatorInterface');
- $locatorMockForAdditionalLoader->expects($this->any())->method('locate')->will($this->onConsecutiveCalls(
- array('path/to/file1'), // Default
- array('path/to/file1', 'path/to/file2'), // First is imported
- array('path/to/file1', 'path/to/file2'), // Second is imported
- array('path/to/file1'), // Exception
- array('path/to/file1', 'path/to/file2') // Exception
- ));
-
- $fileLoader = new TestFileLoader($locatorMock);
- $fileLoader->setSupports(false);
- $fileLoader->setCurrentDir('.');
-
- $additionalLoader = new TestFileLoader($locatorMockForAdditionalLoader);
- $additionalLoader->setCurrentDir('.');
-
- $fileLoader->setResolver($loaderResolver = new LoaderResolver(array($fileLoader, $additionalLoader)));
-
- // Default case
- $this->assertSame('path/to/file1', $fileLoader->import('my_resource'));
-
- // Check first file is imported if not already loading
- $this->assertSame('path/to/file1', $fileLoader->import('my_resource'));
-
- // Check second file is imported if first is already loading
- $fileLoader->addLoading('path/to/file1');
- $this->assertSame('path/to/file2', $fileLoader->import('my_resource'));
-
- // Check exception throws if first (and only available) file is already loading
- try {
- $fileLoader->import('my_resource');
- $this->fail('->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException', $e, '->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
- }
-
- // Check exception throws if all files are already loading
- try {
- $fileLoader->addLoading('path/to/file2');
- $fileLoader->import('my_resource');
- $this->fail('->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException', $e, '->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
- }
- }
-}
-
-class TestFileLoader extends FileLoader
-{
- private $supports = true;
-
- public function load($resource, $type = null)
- {
- return $resource;
- }
-
- public function supports($resource, $type = null)
- {
- return $this->supports;
- }
-
- public function addLoading($resource)
- {
- self::$loading[$resource] = true;
- }
-
- public function removeLoading($resource)
- {
- unset(self::$loading[$resource]);
- }
-
- public function clearLoading()
- {
- self::$loading = array();
- }
-
- public function setSupports($supports)
- {
- $this->supports = $supports;
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Loader/LoaderResolverTest.php b/tests/integration/vendor/symfony/config/Tests/Loader/LoaderResolverTest.php
deleted file mode 100644
index 03db21be4..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Loader/LoaderResolverTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Loader;
-
-use Symfony\Component\Config\Loader\LoaderResolver;
-
-class LoaderResolverTest extends \PHPUnit_Framework_TestCase
-{
- public function testConstructor()
- {
- $resolver = new LoaderResolver(array(
- $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'),
- ));
-
- $this->assertEquals(array($loader), $resolver->getLoaders(), '__construct() takes an array of loaders as its first argument');
- }
-
- public function testResolve()
- {
- $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $resolver = new LoaderResolver(array($loader));
- $this->assertFalse($resolver->resolve('foo.foo'), '->resolve() returns false if no loader is able to load the resource');
-
- $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $loader->expects($this->once())->method('supports')->will($this->returnValue(true));
- $resolver = new LoaderResolver(array($loader));
- $this->assertEquals($loader, $resolver->resolve(function () {}), '->resolve() returns the loader for the given resource');
- }
-
- public function testLoaders()
- {
- $resolver = new LoaderResolver();
- $resolver->addLoader($loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'));
-
- $this->assertEquals(array($loader), $resolver->getLoaders(), 'addLoader() adds a loader');
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Loader/LoaderTest.php b/tests/integration/vendor/symfony/config/Tests/Loader/LoaderTest.php
deleted file mode 100644
index e938a4b07..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Loader/LoaderTest.php
+++ /dev/null
@@ -1,117 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Loader;
-
-use Symfony\Component\Config\Loader\Loader;
-
-class LoaderTest extends \PHPUnit_Framework_TestCase
-{
- public function testGetSetResolver()
- {
- $resolver = $this->getMock('Symfony\Component\Config\Loader\LoaderResolverInterface');
-
- $loader = new ProjectLoader1();
- $loader->setResolver($resolver);
-
- $this->assertSame($resolver, $loader->getResolver(), '->setResolver() sets the resolver loader');
- }
-
- public function testResolve()
- {
- $resolvedLoader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
-
- $resolver = $this->getMock('Symfony\Component\Config\Loader\LoaderResolverInterface');
- $resolver->expects($this->once())
- ->method('resolve')
- ->with('foo.xml')
- ->will($this->returnValue($resolvedLoader));
-
- $loader = new ProjectLoader1();
- $loader->setResolver($resolver);
-
- $this->assertSame($loader, $loader->resolve('foo.foo'), '->resolve() finds a loader');
- $this->assertSame($resolvedLoader, $loader->resolve('foo.xml'), '->resolve() finds a loader');
- }
-
- /**
- * @expectedException \Symfony\Component\Config\Exception\FileLoaderLoadException
- */
- public function testResolveWhenResolverCannotFindLoader()
- {
- $resolver = $this->getMock('Symfony\Component\Config\Loader\LoaderResolverInterface');
- $resolver->expects($this->once())
- ->method('resolve')
- ->with('FOOBAR')
- ->will($this->returnValue(false));
-
- $loader = new ProjectLoader1();
- $loader->setResolver($resolver);
-
- $loader->resolve('FOOBAR');
- }
-
- public function testImport()
- {
- $resolvedLoader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $resolvedLoader->expects($this->once())
- ->method('load')
- ->with('foo')
- ->will($this->returnValue('yes'));
-
- $resolver = $this->getMock('Symfony\Component\Config\Loader\LoaderResolverInterface');
- $resolver->expects($this->once())
- ->method('resolve')
- ->with('foo')
- ->will($this->returnValue($resolvedLoader));
-
- $loader = new ProjectLoader1();
- $loader->setResolver($resolver);
-
- $this->assertEquals('yes', $loader->import('foo'));
- }
-
- public function testImportWithType()
- {
- $resolvedLoader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
- $resolvedLoader->expects($this->once())
- ->method('load')
- ->with('foo', 'bar')
- ->will($this->returnValue('yes'));
-
- $resolver = $this->getMock('Symfony\Component\Config\Loader\LoaderResolverInterface');
- $resolver->expects($this->once())
- ->method('resolve')
- ->with('foo', 'bar')
- ->will($this->returnValue($resolvedLoader));
-
- $loader = new ProjectLoader1();
- $loader->setResolver($resolver);
-
- $this->assertEquals('yes', $loader->import('foo', 'bar'));
- }
-}
-
-class ProjectLoader1 extends Loader
-{
- public function load($resource, $type = null)
- {
- }
-
- public function supports($resource, $type = null)
- {
- return is_string($resource) && 'foo' === pathinfo($resource, PATHINFO_EXTENSION);
- }
-
- public function getType()
- {
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Resource/ClassExistenceResourceTest.php b/tests/integration/vendor/symfony/config/Tests/Resource/ClassExistenceResourceTest.php
deleted file mode 100644
index 20d5b3308..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Resource/ClassExistenceResourceTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Resource;
-
-use Symfony\Component\Config\Resource\ClassExistenceResource;
-
-class ClassExistenceResourceTest extends \PHPUnit_Framework_TestCase
-{
- public function testToString()
- {
- $res = new ClassExistenceResource('BarClass');
- $this->assertSame('BarClass', (string) $res);
- }
-
- public function testGetResource()
- {
- $res = new ClassExistenceResource('BarClass');
- $this->assertSame('BarClass', $res->getResource());
- }
-
- public function testIsFreshWhenClassDoesNotExist()
- {
- $res = new ClassExistenceResource('Symfony\Component\Config\Tests\Fixtures\BarClass');
-
- $this->assertTrue($res->isFresh(time()));
-
- eval(<<assertFalse($res->isFresh(time()));
- }
-
- public function testIsFreshWhenClassExists()
- {
- $res = new ClassExistenceResource('Symfony\Component\Config\Tests\Resource\ClassExistenceResourceTest');
-
- $this->assertTrue($res->isFresh(time()));
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Resource/DirectoryResourceTest.php b/tests/integration/vendor/symfony/config/Tests/Resource/DirectoryResourceTest.php
deleted file mode 100644
index a22209dd8..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Resource/DirectoryResourceTest.php
+++ /dev/null
@@ -1,180 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Resource;
-
-use Symfony\Component\Config\Resource\DirectoryResource;
-
-class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
-{
- protected $directory;
-
- protected function setUp()
- {
- $this->directory = sys_get_temp_dir().DIRECTORY_SEPARATOR.'symfonyDirectoryIterator';
- if (!file_exists($this->directory)) {
- mkdir($this->directory);
- }
- touch($this->directory.'/tmp.xml');
- }
-
- protected function tearDown()
- {
- if (!is_dir($this->directory)) {
- return;
- }
- $this->removeDirectory($this->directory);
- }
-
- protected function removeDirectory($directory)
- {
- $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory), \RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($iterator as $path) {
- if (preg_match('#[/\\\\]\.\.?$#', $path->__toString())) {
- continue;
- }
- if ($path->isDir()) {
- rmdir($path->__toString());
- } else {
- unlink($path->__toString());
- }
- }
- rmdir($directory);
- }
-
- public function testGetResource()
- {
- $resource = new DirectoryResource($this->directory);
- $this->assertSame(realpath($this->directory), $resource->getResource(), '->getResource() returns the path to the resource');
- }
-
- public function testGetPattern()
- {
- $resource = new DirectoryResource($this->directory, 'bar');
- $this->assertEquals('bar', $resource->getPattern());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessageRegExp /The directory ".*" does not exist./
- */
- public function testResourceDoesNotExist()
- {
- $resource = new DirectoryResource('/____foo/foobar'.mt_rand(1, 999999));
- }
-
- public function testIsFresh()
- {
- $resource = new DirectoryResource($this->directory);
- $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if the resource has not changed');
- $this->assertFalse($resource->isFresh(time() - 86400), '->isFresh() returns false if the resource has been updated');
- }
-
- public function testIsFreshForDeletedResources()
- {
- $resource = new DirectoryResource($this->directory);
- $this->removeDirectory($this->directory);
-
- $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the resource does not exist');
- }
-
- public function testIsFreshUpdateFile()
- {
- $resource = new DirectoryResource($this->directory);
- touch($this->directory.'/tmp.xml', time() + 20);
- $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if an existing file is modified');
- }
-
- public function testIsFreshNewFile()
- {
- $resource = new DirectoryResource($this->directory);
- touch($this->directory.'/new.xml', time() + 20);
- $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a new file is added');
- }
-
- public function testIsFreshNewFileWithDifferentPattern()
- {
- $resource = new DirectoryResource($this->directory, '/.xml$/');
- touch($this->directory.'/new.yaml', time() + 20);
- $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if a new file with a non-matching pattern is added');
- }
-
- public function testIsFreshDeleteFile()
- {
- $resource = new DirectoryResource($this->directory);
- unlink($this->directory.'/tmp.xml');
- $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if an existing file is removed');
- }
-
- public function testIsFreshDeleteDirectory()
- {
- $resource = new DirectoryResource($this->directory);
- $this->removeDirectory($this->directory);
- $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the whole resource is removed');
- }
-
- public function testIsFreshCreateFileInSubdirectory()
- {
- $subdirectory = $this->directory.'/subdirectory';
- mkdir($subdirectory);
-
- $resource = new DirectoryResource($this->directory);
- $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if an unmodified subdirectory exists');
-
- touch($subdirectory.'/newfile.xml', time() + 20);
- $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a new file in a subdirectory is added');
- }
-
- public function testIsFreshModifySubdirectory()
- {
- $resource = new DirectoryResource($this->directory);
-
- $subdirectory = $this->directory.'/subdirectory';
- mkdir($subdirectory);
- touch($subdirectory, time() + 20);
-
- $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a subdirectory is modified (e.g. a file gets deleted)');
- }
-
- public function testFilterRegexListNoMatch()
- {
- $resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
-
- touch($this->directory.'/new.bar', time() + 20);
- $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if a new file not matching the filter regex is created');
- }
-
- public function testFilterRegexListMatch()
- {
- $resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
-
- touch($this->directory.'/new.xml', time() + 20);
- $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if an new file matching the filter regex is created ');
- }
-
- public function testSerializeUnserialize()
- {
- $resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
-
- $unserialized = unserialize(serialize($resource));
-
- $this->assertSame(realpath($this->directory), $resource->getResource());
- $this->assertSame('/\.(foo|xml)$/', $resource->getPattern());
- }
-
- public function testResourcesWithDifferentPatternsAreDifferent()
- {
- $resourceA = new DirectoryResource($this->directory, '/.xml$/');
- $resourceB = new DirectoryResource($this->directory, '/.yaml$/');
-
- $this->assertEquals(2, count(array_unique(array($resourceA, $resourceB))));
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Resource/FileExistenceResourceTest.php b/tests/integration/vendor/symfony/config/Tests/Resource/FileExistenceResourceTest.php
deleted file mode 100644
index 56ee584b1..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Resource/FileExistenceResourceTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Resource;
-
-use Symfony\Component\Config\Resource\FileExistenceResource;
-
-class FileExistenceResourceTest extends \PHPUnit_Framework_TestCase
-{
- protected $resource;
- protected $file;
- protected $time;
-
- protected function setUp()
- {
- $this->file = realpath(sys_get_temp_dir()).'/tmp.xml';
- $this->time = time();
- $this->resource = new FileExistenceResource($this->file);
- }
-
- protected function tearDown()
- {
- if (file_exists($this->file)) {
- unlink($this->file);
- }
- }
-
- public function testToString()
- {
- $this->assertSame($this->file, (string) $this->resource);
- }
-
- public function testGetResource()
- {
- $this->assertSame($this->file, $this->resource->getResource(), '->getResource() returns the path to the resource');
- }
-
- public function testIsFreshWithExistingResource()
- {
- touch($this->file, $this->time);
- $serialized = serialize(new FileExistenceResource($this->file));
-
- $resource = unserialize($serialized);
- $this->assertTrue($resource->isFresh($this->time), '->isFresh() returns true if the resource is still present');
-
- unlink($this->file);
- $resource = unserialize($serialized);
- $this->assertFalse($resource->isFresh($this->time), '->isFresh() returns false if the resource has been deleted');
- }
-
- public function testIsFreshWithAbsentResource()
- {
- $serialized = serialize(new FileExistenceResource($this->file));
-
- $resource = unserialize($serialized);
- $this->assertTrue($resource->isFresh($this->time), '->isFresh() returns true if the resource is still absent');
-
- touch($this->file, $this->time);
- $resource = unserialize($serialized);
- $this->assertFalse($resource->isFresh($this->time), '->isFresh() returns false if the resource has been created');
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Resource/FileResourceTest.php b/tests/integration/vendor/symfony/config/Tests/Resource/FileResourceTest.php
deleted file mode 100644
index 6a168e635..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Resource/FileResourceTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Resource;
-
-use Symfony\Component\Config\Resource\FileResource;
-
-class FileResourceTest extends \PHPUnit_Framework_TestCase
-{
- protected $resource;
- protected $file;
- protected $time;
-
- protected function setUp()
- {
- $this->file = sys_get_temp_dir().'/tmp.xml';
- $this->time = time();
- touch($this->file, $this->time);
- $this->resource = new FileResource($this->file);
- }
-
- protected function tearDown()
- {
- if (!file_exists($this->file)) {
- return;
- }
-
- unlink($this->file);
- }
-
- public function testGetResource()
- {
- $this->assertSame(realpath($this->file), $this->resource->getResource(), '->getResource() returns the path to the resource');
- }
-
- public function testGetResourceWithScheme()
- {
- $resource = new FileResource('file://'.$this->file);
- $this->assertSame('file://'.$this->file, $resource->getResource(), '->getResource() returns the path to the schemed resource');
- }
-
- public function testToString()
- {
- $this->assertSame(realpath($this->file), (string) $this->resource);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessageRegExp /The file ".*" does not exist./
- */
- public function testResourceDoesNotExist()
- {
- $resource = new FileResource('/____foo/foobar'.mt_rand(1, 999999));
- }
-
- public function testIsFresh()
- {
- $this->assertTrue($this->resource->isFresh($this->time), '->isFresh() returns true if the resource has not changed in same second');
- $this->assertTrue($this->resource->isFresh($this->time + 10), '->isFresh() returns true if the resource has not changed');
- $this->assertFalse($this->resource->isFresh($this->time - 86400), '->isFresh() returns false if the resource has been updated');
- }
-
- public function testIsFreshForDeletedResources()
- {
- unlink($this->file);
-
- $this->assertFalse($this->resource->isFresh($this->time), '->isFresh() returns false if the resource does not exist');
- }
-
- public function testSerializeUnserialize()
- {
- $unserialized = unserialize(serialize($this->resource));
-
- $this->assertSame(realpath($this->file), $this->resource->getResource());
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Resource/ResourceStub.php b/tests/integration/vendor/symfony/config/Tests/Resource/ResourceStub.php
deleted file mode 100644
index b01729cbf..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Resource/ResourceStub.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Resource;
-
-use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;
-
-class ResourceStub implements SelfCheckingResourceInterface
-{
- private $fresh = true;
-
- public function setFresh($isFresh)
- {
- $this->fresh = $isFresh;
- }
-
- public function __toString()
- {
- return 'stub';
- }
-
- public function isFresh($timestamp)
- {
- return $this->fresh;
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/ResourceCheckerConfigCacheTest.php b/tests/integration/vendor/symfony/config/Tests/ResourceCheckerConfigCacheTest.php
deleted file mode 100644
index c76c0dd0a..000000000
--- a/tests/integration/vendor/symfony/config/Tests/ResourceCheckerConfigCacheTest.php
+++ /dev/null
@@ -1,131 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests;
-
-use Symfony\Component\Config\Tests\Resource\ResourceStub;
-use Symfony\Component\Config\Resource\FileResource;
-use Symfony\Component\Config\ResourceCheckerConfigCache;
-
-class ResourceCheckerConfigCacheTest extends \PHPUnit_Framework_TestCase
-{
- private $cacheFile = null;
-
- protected function setUp()
- {
- $this->cacheFile = tempnam(sys_get_temp_dir(), 'config_');
- }
-
- protected function tearDown()
- {
- $files = array($this->cacheFile, "{$this->cacheFile}.meta");
-
- foreach ($files as $file) {
- if (file_exists($file)) {
- unlink($file);
- }
- }
- }
-
- public function testGetPath()
- {
- $cache = new ResourceCheckerConfigCache($this->cacheFile);
-
- $this->assertSame($this->cacheFile, $cache->getPath());
- }
-
- public function testCacheIsNotFreshIfEmpty()
- {
- $checker = $this->getMock('\Symfony\Component\Config\ResourceCheckerInterface')
- ->expects($this->never())->method('supports');
-
- /* If there is nothing in the cache, it needs to be filled (and thus it's not fresh).
- It does not matter if you provide checkers or not. */
-
- unlink($this->cacheFile); // remove tempnam() side effect
- $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker));
-
- $this->assertFalse($cache->isFresh());
- }
-
- public function testCacheIsFreshIfNocheckerProvided()
- {
- /* For example in prod mode, you may choose not to run any checkers
- at all. In that case, the cache should always be considered fresh. */
- $cache = new ResourceCheckerConfigCache($this->cacheFile);
- $this->assertTrue($cache->isFresh());
- }
-
- public function testResourcesWithoutcheckersAreIgnoredAndConsideredFresh()
- {
- /* As in the previous test, but this time we have a resource. */
- $cache = new ResourceCheckerConfigCache($this->cacheFile);
- $cache->write('', array(new ResourceStub()));
-
- $this->assertTrue($cache->isFresh()); // no (matching) ResourceChecker passed
- }
-
- public function testIsFreshWithchecker()
- {
- $checker = $this->getMock('\Symfony\Component\Config\ResourceCheckerInterface');
-
- $checker->expects($this->once())
- ->method('supports')
- ->willReturn(true);
-
- $checker->expects($this->once())
- ->method('isFresh')
- ->willReturn(true);
-
- $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker));
- $cache->write('', array(new ResourceStub()));
-
- $this->assertTrue($cache->isFresh());
- }
-
- public function testIsNotFreshWithchecker()
- {
- $checker = $this->getMock('\Symfony\Component\Config\ResourceCheckerInterface');
-
- $checker->expects($this->once())
- ->method('supports')
- ->willReturn(true);
-
- $checker->expects($this->once())
- ->method('isFresh')
- ->willReturn(false);
-
- $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker));
- $cache->write('', array(new ResourceStub()));
-
- $this->assertFalse($cache->isFresh());
- }
-
- public function testCacheIsNotFreshWhenUnserializeFails()
- {
- $checker = $this->getMock('\Symfony\Component\Config\ResourceCheckerInterface');
- $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker));
- $cache->write('foo', array(new FileResource(__FILE__)));
-
- $metaFile = "{$this->cacheFile}.meta";
- file_put_contents($metaFile, str_replace('FileResource', 'ClassNotHere', file_get_contents($metaFile)));
-
- $this->assertFalse($cache->isFresh());
- }
-
- public function testCacheKeepsContent()
- {
- $cache = new ResourceCheckerConfigCache($this->cacheFile);
- $cache->write('FOOBAR');
-
- $this->assertSame('FOOBAR', file_get_contents($cache->getPath()));
- }
-}
diff --git a/tests/integration/vendor/symfony/config/Tests/Util/XmlUtilsTest.php b/tests/integration/vendor/symfony/config/Tests/Util/XmlUtilsTest.php
deleted file mode 100644
index cefd4f295..000000000
--- a/tests/integration/vendor/symfony/config/Tests/Util/XmlUtilsTest.php
+++ /dev/null
@@ -1,195 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Tests\Util;
-
-use Symfony\Component\Config\Util\XmlUtils;
-
-class XmlUtilsTest extends \PHPUnit_Framework_TestCase
-{
- public function testLoadFile()
- {
- $fixtures = __DIR__.'/../Fixtures/Util/';
-
- try {
- XmlUtils::loadFile($fixtures.'invalid.xml');
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertContains('ERROR 77', $e->getMessage());
- }
-
- try {
- XmlUtils::loadFile($fixtures.'document_type.xml');
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertContains('Document types are not allowed', $e->getMessage());
- }
-
- try {
- XmlUtils::loadFile($fixtures.'invalid_schema.xml', $fixtures.'schema.xsd');
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertContains('ERROR 1845', $e->getMessage());
- }
-
- try {
- XmlUtils::loadFile($fixtures.'invalid_schema.xml', 'invalid_callback_or_file');
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertContains('XSD file or callable', $e->getMessage());
- }
-
- $mock = $this->getMock(__NAMESPACE__.'\Validator');
- $mock->expects($this->exactly(2))->method('validate')->will($this->onConsecutiveCalls(false, true));
-
- try {
- XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'));
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertContains('is not valid', $e->getMessage());
- }
-
- $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')));
- $this->assertSame(array(), libxml_get_errors());
- }
-
- public function testLoadFileWithInternalErrorsEnabled()
- {
- $internalErrors = libxml_use_internal_errors(true);
-
- $this->assertSame(array(), libxml_get_errors());
- $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/invalid_schema.xml'));
- $this->assertSame(array(), libxml_get_errors());
-
- libxml_clear_errors();
- libxml_use_internal_errors($internalErrors);
- }
-
- /**
- * @dataProvider getDataForConvertDomToArray
- */
- public function testConvertDomToArray($expected, $xml, $root = false, $checkPrefix = true)
- {
- $dom = new \DOMDocument();
- $dom->loadXML($root ? $xml : ''.$xml.'');
-
- $this->assertSame($expected, XmlUtils::convertDomElementToArray($dom->documentElement, $checkPrefix));
- }
-
- public function getDataForConvertDomToArray()
- {
- return array(
- array(null, ''),
- array('bar', 'bar'),
- array(array('bar' => 'foobar'), '', true),
- array(array('foo' => null), ''),
- array(array('foo' => 'bar'), 'bar'),
- array(array('foo' => array('foo' => 'bar')), ''),
- array(array('foo' => array('foo' => 0)), '0'),
- array(array('foo' => array('foo' => 'bar')), 'bar'),
- array(array('foo' => array('foo' => 'bar', 'value' => 'text')), 'text'),
- array(array('foo' => array('attr' => 'bar', 'foo' => 'text')), 'text'),
- array(array('foo' => array('bar', 'text')), 'bartext'),
- array(array('foo' => array(array('foo' => 'bar'), array('foo' => 'text'))), ''),
- array(array('foo' => array('foo' => array('bar', 'text'))), 'text'),
- array(array('foo' => 'bar'), 'bar'),
- array(array('foo' => 'text'), 'text'),
- array(array('foo' => array('bar' => 'bar', 'value' => 'text')), 'text', false, false),
- array(array('attr' => 1, 'b' => 'hello'), 'hello2', true),
- );
- }
-
- /**
- * @dataProvider getDataForPhpize
- */
- public function testPhpize($expected, $value)
- {
- $this->assertSame($expected, XmlUtils::phpize($value));
- }
-
- public function getDataForPhpize()
- {
- return array(
- array('', ''),
- array(null, 'null'),
- array(true, 'true'),
- array(false, 'false'),
- array(null, 'Null'),
- array(true, 'True'),
- array(false, 'False'),
- array(0, '0'),
- array(1, '1'),
- array(-1, '-1'),
- array(0777, '0777'),
- array(255, '0xFF'),
- array(100.0, '1e2'),
- array(-120.0, '-1.2E2'),
- array(-10100.1, '-10100.1'),
- array('-10,100.1', '-10,100.1'),
- array('1234 5678 9101 1121 3141', '1234 5678 9101 1121 3141'),
- array('1,2,3,4', '1,2,3,4'),
- array('11,22,33,44', '11,22,33,44'),
- array('11,222,333,4', '11,222,333,4'),
- array('1,222,333,444', '1,222,333,444'),
- array('11,222,333,444', '11,222,333,444'),
- array('111,222,333,444', '111,222,333,444'),
- array('1111,2222,3333,4444,5555', '1111,2222,3333,4444,5555'),
- array('foo', 'foo'),
- array(6, '0b0110'),
- );
- }
-
- public function testLoadEmptyXmlFile()
- {
- $file = __DIR__.'/../Fixtures/foo.xml';
- $this->setExpectedException('InvalidArgumentException', sprintf('File %s does not contain valid XML, it is empty.', $file));
- XmlUtils::loadFile($file);
- }
-
- // test for issue https://github.com/symfony/symfony/issues/9731
- public function testLoadWrongEmptyXMLWithErrorHandler()
- {
- $originalDisableEntities = libxml_disable_entity_loader(false);
- $errorReporting = error_reporting(-1);
-
- set_error_handler(function ($errno, $errstr) {
- throw new \Exception($errstr, $errno);
- });
-
- $file = __DIR__.'/../Fixtures/foo.xml';
- try {
- try {
- XmlUtils::loadFile($file);
- $this->fail('An exception should have been raised');
- } catch (\InvalidArgumentException $e) {
- $this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
- }
- } finally {
- restore_error_handler();
- error_reporting($errorReporting);
- }
-
- $disableEntities = libxml_disable_entity_loader(true);
- libxml_disable_entity_loader($disableEntities);
-
- libxml_disable_entity_loader($originalDisableEntities);
-
- $this->assertFalse($disableEntities);
-
- // should not throw an exception
- XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/valid.xml', __DIR__.'/../Fixtures/Util/schema.xsd');
- }
-}
-
-interface Validator
-{
- public function validate();
-}
diff --git a/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php b/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php
new file mode 100644
index 000000000..a335bbd2e
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Util\Exception;
+
+/**
+ * Exception class for when XML parsing with an XSD schema file path or a callable validator produces errors unrelated
+ * to the actual XML parsing.
+ *
+ * @author Ole Rößner
+ */
+class InvalidXmlException extends XmlParsingException
+{
+}
diff --git a/tests/integration/vendor/symfony/config/Util/Exception/XmlParsingException.php b/tests/integration/vendor/symfony/config/Util/Exception/XmlParsingException.php
new file mode 100644
index 000000000..9bceed660
--- /dev/null
+++ b/tests/integration/vendor/symfony/config/Util/Exception/XmlParsingException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Config\Util\Exception;
+
+/**
+ * Exception class for when XML cannot be parsed properly.
+ *
+ * @author Ole Rößner
+ */
+class XmlParsingException extends \InvalidArgumentException
+{
+}
diff --git a/tests/integration/vendor/symfony/config/Util/XmlUtils.php b/tests/integration/vendor/symfony/config/Util/XmlUtils.php
index 25d9b0a0a..8258a0627 100644
--- a/tests/integration/vendor/symfony/config/Util/XmlUtils.php
+++ b/tests/integration/vendor/symfony/config/Util/XmlUtils.php
@@ -11,6 +11,9 @@
namespace Symfony\Component\Config\Util;
+use Symfony\Component\Config\Util\Exception\InvalidXmlException;
+use Symfony\Component\Config\Util\Exception\XmlParsingException;
+
/**
* XMLUtils is a bunch of utility methods to XML operations.
*
@@ -18,6 +21,7 @@
*
* @author Fabien Potencier
* @author Martin Hasoň
+ * @author Ole Rößner
*/
class XmlUtils
{
@@ -29,42 +33,49 @@ private function __construct()
}
/**
- * Loads an XML file.
+ * Parses an XML string.
*
- * @param string $file An XML file path
+ * @param string $content An XML string
* @param string|callable|null $schemaOrCallable An XSD schema file path, a callable, or null to disable validation
*
* @return \DOMDocument
*
- * @throws \InvalidArgumentException When loading of XML file returns error
+ * @throws XmlParsingException When parsing of XML file returns error
+ * @throws InvalidXmlException When parsing of XML with schema or callable produces any errors unrelated to the XML parsing itself
+ * @throws \RuntimeException When DOM extension is missing
*/
- public static function loadFile($file, $schemaOrCallable = null)
+ public static function parse(string $content, $schemaOrCallable = null)
{
- $content = @file_get_contents($file);
- if ('' === trim($content)) {
- throw new \InvalidArgumentException(sprintf('File %s does not contain valid XML, it is empty.', $file));
+ if (!\extension_loaded('dom')) {
+ throw new \LogicException('Extension DOM is required.');
}
$internalErrors = libxml_use_internal_errors(true);
- $disableEntities = libxml_disable_entity_loader(true);
+ if (\LIBXML_VERSION < 20900) {
+ $disableEntities = libxml_disable_entity_loader(true);
+ }
libxml_clear_errors();
$dom = new \DOMDocument();
$dom->validateOnParse = true;
- if (!$dom->loadXML($content, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
- libxml_disable_entity_loader($disableEntities);
+ if (!$dom->loadXML($content, \LIBXML_NONET | (\defined('LIBXML_COMPACT') ? \LIBXML_COMPACT : 0))) {
+ if (\LIBXML_VERSION < 20900) {
+ libxml_disable_entity_loader($disableEntities);
+ }
- throw new \InvalidArgumentException(implode("\n", static::getXmlErrors($internalErrors)));
+ throw new XmlParsingException(implode("\n", static::getXmlErrors($internalErrors)));
}
$dom->normalizeDocument();
libxml_use_internal_errors($internalErrors);
- libxml_disable_entity_loader($disableEntities);
+ if (\LIBXML_VERSION < 20900) {
+ libxml_disable_entity_loader($disableEntities);
+ }
foreach ($dom->childNodes as $child) {
- if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
- throw new \InvalidArgumentException('Document types are not allowed.');
+ if (\XML_DOCUMENT_TYPE_NODE === $child->nodeType) {
+ throw new XmlParsingException('Document types are not allowed.');
}
}
@@ -73,27 +84,27 @@ public static function loadFile($file, $schemaOrCallable = null)
libxml_clear_errors();
$e = null;
- if (is_callable($schemaOrCallable)) {
+ if (\is_callable($schemaOrCallable)) {
try {
- $valid = call_user_func($schemaOrCallable, $dom, $internalErrors);
+ $valid = $schemaOrCallable($dom, $internalErrors);
} catch (\Exception $e) {
$valid = false;
}
- } elseif (!is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) {
+ } elseif (!\is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) {
$schemaSource = file_get_contents((string) $schemaOrCallable);
$valid = @$dom->schemaValidateSource($schemaSource);
} else {
libxml_use_internal_errors($internalErrors);
- throw new \InvalidArgumentException('The schemaOrCallable argument has to be a valid path to XSD file or callable.');
+ throw new XmlParsingException('The schemaOrCallable argument has to be a valid path to XSD file or callable.');
}
if (!$valid) {
$messages = static::getXmlErrors($internalErrors);
if (empty($messages)) {
- $messages = array(sprintf('The XML file "%s" is not valid.', $file));
+ throw new InvalidXmlException('The XML is not valid.', 0, $e);
}
- throw new \InvalidArgumentException(implode("\n", $messages), 0, $e);
+ throw new XmlParsingException(implode("\n", $messages), 0, $e);
}
}
@@ -104,7 +115,42 @@ public static function loadFile($file, $schemaOrCallable = null)
}
/**
- * Converts a \DomElement object to a PHP array.
+ * Loads an XML file.
+ *
+ * @param string $file An XML file path
+ * @param string|callable|null $schemaOrCallable An XSD schema file path, a callable, or null to disable validation
+ *
+ * @return \DOMDocument
+ *
+ * @throws \InvalidArgumentException When loading of XML file returns error
+ * @throws XmlParsingException When XML parsing returns any errors
+ * @throws \RuntimeException When DOM extension is missing
+ */
+ public static function loadFile(string $file, $schemaOrCallable = null)
+ {
+ if (!is_file($file)) {
+ throw new \InvalidArgumentException(sprintf('Resource "%s" is not a file.', $file));
+ }
+
+ if (!is_readable($file)) {
+ throw new \InvalidArgumentException(sprintf('File "%s" is not readable.', $file));
+ }
+
+ $content = @file_get_contents($file);
+
+ if ('' === trim($content)) {
+ throw new \InvalidArgumentException(sprintf('File "%s" does not contain valid XML, it is empty.', $file));
+ }
+
+ try {
+ return static::parse($content, $schemaOrCallable);
+ } catch (InvalidXmlException $e) {
+ throw new XmlParsingException(sprintf('The XML file "%s" is not valid.', $file), 0, $e->getPrevious());
+ }
+ }
+
+ /**
+ * Converts a \DOMElement object to a PHP array.
*
* The following rules applies during the conversion:
*
@@ -118,18 +164,18 @@ public static function loadFile($file, $schemaOrCallable = null)
*
* * The nested-tags are converted to keys (bar)
*
- * @param \DomElement $element A \DomElement instance
+ * @param \DOMElement $element A \DOMElement instance
* @param bool $checkPrefix Check prefix in an element or an attribute name
*
- * @return array A PHP array
+ * @return mixed
*/
- public static function convertDomElementToArray(\DOMElement $element, $checkPrefix = true)
+ public static function convertDomElementToArray(\DOMElement $element, bool $checkPrefix = true)
{
$prefix = (string) $element->prefix;
$empty = true;
- $config = array();
+ $config = [];
foreach ($element->attributes as $name => $node) {
- if ($checkPrefix && !in_array((string) $node->prefix, array('', $prefix), true)) {
+ if ($checkPrefix && !\in_array((string) $node->prefix, ['', $prefix], true)) {
continue;
}
$config[$name] = static::phpize($node->value);
@@ -150,8 +196,8 @@ public static function convertDomElementToArray(\DOMElement $element, $checkPref
$key = $node->localName;
if (isset($config[$key])) {
- if (!is_array($config[$key]) || !is_int(key($config[$key]))) {
- $config[$key] = array($config[$key]);
+ if (!\is_array($config[$key]) || !\is_int(key($config[$key]))) {
+ $config[$key] = [$config[$key]];
}
$config[$key][] = $value;
} else {
@@ -164,7 +210,7 @@ public static function convertDomElementToArray(\DOMElement $element, $checkPref
if (false !== $nodeValue) {
$value = static::phpize($nodeValue);
- if (count($config)) {
+ if (\count($config)) {
$config['value'] = $value;
} else {
$config = $value;
@@ -188,40 +234,36 @@ public static function phpize($value)
switch (true) {
case 'null' === $lowercaseValue:
- return;
+ return null;
case ctype_digit($value):
- $raw = $value;
- $cast = (int) $value;
-
- return '0' == $value[0] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
case isset($value[1]) && '-' === $value[0] && ctype_digit(substr($value, 1)):
$raw = $value;
$cast = (int) $value;
- return '0' == $value[1] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
+ return self::isOctal($value) ? \intval($value, 8) : (($raw === (string) $cast) ? $cast : $raw);
case 'true' === $lowercaseValue:
return true;
case 'false' === $lowercaseValue:
return false;
- case isset($value[1]) && '0b' == $value[0].$value[1]:
+ case isset($value[1]) && '0b' == $value[0].$value[1] && preg_match('/^0b[01]*$/', $value):
return bindec($value);
case is_numeric($value):
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
case preg_match('/^0x[0-9a-f]++$/i', $value):
return hexdec($value);
- case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):
+ case preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value):
return (float) $value;
default:
return $value;
}
}
- protected static function getXmlErrors($internalErrors)
+ protected static function getXmlErrors(bool $internalErrors)
{
- $errors = array();
+ $errors = [];
foreach (libxml_get_errors() as $error) {
$errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)',
- LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR',
+ \LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR',
$error->code,
trim($error->message),
$error->file ?: 'n/a',
@@ -235,4 +277,13 @@ protected static function getXmlErrors($internalErrors)
return $errors;
}
+
+ private static function isOctal(string $str): bool
+ {
+ if ('-' === $str[0]) {
+ $str = substr($str, 1);
+ }
+
+ return $str === '0'.decoct(\intval($str, 8));
+ }
}
diff --git a/tests/integration/vendor/symfony/config/composer.json b/tests/integration/vendor/symfony/config/composer.json
index 2de34d92e..b357ed317 100644
--- a/tests/integration/vendor/symfony/config/composer.json
+++ b/tests/integration/vendor/symfony/config/composer.json
@@ -1,7 +1,7 @@
{
"name": "symfony/config",
"type": "library",
- "description": "Symfony Config Component",
+ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"keywords": [],
"homepage": "https://symfony.com",
"license": "MIT",
@@ -16,11 +16,22 @@
}
],
"require": {
- "php": ">=5.5.9",
- "symfony/filesystem": "~2.8|~3.0"
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/filesystem": "^4.4|^5.0|^6.0",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/polyfill-php81": "^1.22"
},
"require-dev": {
- "symfony/yaml": "~3.0"
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/messenger": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/yaml": "^4.4|^5.0|^6.0"
+ },
+ "conflict": {
+ "symfony/finder": "<4.4"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
@@ -31,10 +42,5 @@
"/Tests/"
]
},
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- }
+ "minimum-stability": "dev"
}
diff --git a/tests/integration/vendor/symfony/config/phpunit.xml.dist b/tests/integration/vendor/symfony/config/phpunit.xml.dist
deleted file mode 100644
index 3fe6fd87c..000000000
--- a/tests/integration/vendor/symfony/config/phpunit.xml.dist
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./Tests/
-
-
-
-
-
- ./
-
- ./Resources
- ./Tests
- ./vendor
-
-
-
-
diff --git a/tests/integration/vendor/symfony/console/Application.php b/tests/integration/vendor/symfony/console/Application.php
index f2746c896..a81cfdcbb 100644
--- a/tests/integration/vendor/symfony/console/Application.php
+++ b/tests/integration/vendor/symfony/console/Application.php
@@ -11,33 +11,47 @@
namespace Symfony\Component\Console;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Command\CompleteCommand;
+use Symfony\Component\Console\Command\DumpCompletionCommand;
+use Symfony\Component\Console\Command\HelpCommand;
+use Symfony\Component\Console\Command\LazyCommand;
+use Symfony\Component\Console\Command\ListCommand;
+use Symfony\Component\Console\Command\SignalableCommandInterface;
+use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
+use Symfony\Component\Console\Event\ConsoleCommandEvent;
+use Symfony\Component\Console\Event\ConsoleErrorEvent;
+use Symfony\Component\Console\Event\ConsoleSignalEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\Console\Exception\ExceptionInterface;
+use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Exception\NamespaceNotFoundException;
+use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\DebugFormatterHelper;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Helper\Helper;
+use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\StreamableInputInterface;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputAwareInterface;
-use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Command\HelpCommand;
-use Symfony\Component\Console\Command\ListCommand;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Event\ConsoleCommandEvent;
-use Symfony\Component\Console\Event\ConsoleExceptionEvent;
-use Symfony\Component\Console\Event\ConsoleTerminateEvent;
-use Symfony\Component\Console\Exception\CommandNotFoundException;
-use Symfony\Component\Console\Exception\LogicException;
-use Symfony\Component\Debug\Exception\FatalThrowableError;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\SignalRegistry\SignalRegistry;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\ErrorHandler\ErrorHandler;
+use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
+use Symfony\Contracts\Service\ResetInterface;
/**
* An Application is the container for a collection of commands.
@@ -54,13 +68,14 @@
*
* @author Fabien Potencier
*/
-class Application
+class Application implements ResetInterface
{
- private $commands = array();
+ private $commands = [];
private $wantHelps = false;
private $runningCommand;
private $name;
private $version;
+ private $commandLoader;
private $catchExceptions = true;
private $autoExit = true;
private $definition;
@@ -68,45 +83,63 @@ class Application
private $dispatcher;
private $terminal;
private $defaultCommand;
- private $singleCommand;
+ private $singleCommand = false;
+ private $initialized;
+ private $signalRegistry;
+ private $signalsToDispatchEvent = [];
- /**
- * @param string $name The name of the application
- * @param string $version The version of the application
- */
- public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
+ public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
{
$this->name = $name;
$this->version = $version;
$this->terminal = new Terminal();
$this->defaultCommand = 'list';
- $this->helperSet = $this->getDefaultHelperSet();
- $this->definition = $this->getDefaultInputDefinition();
-
- foreach ($this->getDefaultCommands() as $command) {
- $this->add($command);
+ if (\defined('SIGINT') && SignalRegistry::isSupported()) {
+ $this->signalRegistry = new SignalRegistry();
+ $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2];
}
}
+ /**
+ * @final
+ */
public function setDispatcher(EventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
}
+ public function setCommandLoader(CommandLoaderInterface $commandLoader)
+ {
+ $this->commandLoader = $commandLoader;
+ }
+
+ public function getSignalRegistry(): SignalRegistry
+ {
+ if (!$this->signalRegistry) {
+ throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
+ }
+
+ return $this->signalRegistry;
+ }
+
+ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
+ {
+ $this->signalsToDispatchEvent = $signalsToDispatchEvent;
+ }
+
/**
* Runs the current application.
*
- * @param InputInterface $input An Input instance
- * @param OutputInterface $output An Output instance
- *
* @return int 0 if everything went fine, or an error code
*
- * @throws \Exception When doRun returns Exception
+ * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
- putenv('LINES='.$this->terminal->getHeight());
- putenv('COLUMNS='.$this->terminal->getWidth());
+ if (\function_exists('putenv')) {
+ @putenv('LINES='.$this->terminal->getHeight());
+ @putenv('COLUMNS='.$this->terminal->getWidth());
+ }
if (null === $input) {
$input = new ArgvInput();
@@ -116,6 +149,22 @@ public function run(InputInterface $input = null, OutputInterface $output = null
$output = new ConsoleOutput();
}
+ $renderException = function (\Throwable $e) use ($output) {
+ if ($output instanceof ConsoleOutputInterface) {
+ $this->renderThrowable($e, $output->getErrorOutput());
+ } else {
+ $this->renderThrowable($e, $output);
+ }
+ };
+ if ($phpHandler = set_exception_handler($renderException)) {
+ restore_exception_handler();
+ if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) {
+ $errorHandler = true;
+ } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
+ $phpHandler[0]->setExceptionHandler($errorHandler);
+ }
+ }
+
$this->configureIO($input, $output);
try {
@@ -125,11 +174,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
throw $e;
}
- if ($output instanceof ConsoleOutputInterface) {
- $this->renderException($e, $output->getErrorOutput());
- } else {
- $this->renderException($e, $output);
- }
+ $renderException($e);
$exitCode = $e->getCode();
if (is_numeric($exitCode)) {
@@ -140,6 +185,20 @@ public function run(InputInterface $input = null, OutputInterface $output = null
} else {
$exitCode = 1;
}
+ } finally {
+ // if the exception handler changed, keep it
+ // otherwise, unregister $renderException
+ if (!$phpHandler) {
+ if (set_exception_handler($renderException) === $renderException) {
+ restore_exception_handler();
+ }
+ restore_exception_handler();
+ } elseif (!$errorHandler) {
+ $finalHandler = $phpHandler[0]->setExceptionHandler(null);
+ if ($finalHandler !== $renderException) {
+ $phpHandler[0]->setExceptionHandler($finalHandler);
+ }
+ }
}
if ($this->autoExit) {
@@ -156,24 +215,28 @@ public function run(InputInterface $input = null, OutputInterface $output = null
/**
* Runs the current application.
*
- * @param InputInterface $input An Input instance
- * @param OutputInterface $output An Output instance
- *
* @return int 0 if everything went fine, or an error code
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
- if (true === $input->hasParameterOption(array('--version', '-V'), true)) {
+ if (true === $input->hasParameterOption(['--version', '-V'], true)) {
$output->writeln($this->getLongVersion());
return 0;
}
+ try {
+ // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
+ $input->bind($this->getDefinition());
+ } catch (ExceptionInterface $e) {
+ // Errors must be ignored, full binding/validation happens later when the command is known.
+ }
+
$name = $this->getCommandName($input);
- if (true === $input->hasParameterOption(array('--help', '-h'), true)) {
+ if (true === $input->hasParameterOption(['--help', '-h'], true)) {
if (!$name) {
$name = 'help';
- $input = new ArrayInput(array('command_name' => $this->defaultCommand));
+ $input = new ArrayInput(['command_name' => $this->defaultCommand]);
} else {
$this->wantHelps = true;
}
@@ -181,11 +244,56 @@ public function doRun(InputInterface $input, OutputInterface $output)
if (!$name) {
$name = $this->defaultCommand;
- $input = new ArrayInput(array('command' => $this->defaultCommand));
+ $definition = $this->getDefinition();
+ $definition->setArguments(array_merge(
+ $definition->getArguments(),
+ [
+ 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name),
+ ]
+ ));
}
- // the command name MUST be the first element of the input
- $command = $this->find($name);
+ try {
+ $this->runningCommand = null;
+ // the command name MUST be the first element of the input
+ $command = $this->find($name);
+ } catch (\Throwable $e) {
+ if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) {
+ if (null !== $this->dispatcher) {
+ $event = new ConsoleErrorEvent($input, $output, $e);
+ $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
+
+ if (0 === $event->getExitCode()) {
+ return 0;
+ }
+
+ $e = $event->getError();
+ }
+
+ throw $e;
+ }
+
+ $alternative = $alternatives[0];
+
+ $style = new SymfonyStyle($input, $output);
+ $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error');
+ if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) {
+ if (null !== $this->dispatcher) {
+ $event = new ConsoleErrorEvent($input, $output, $e);
+ $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
+
+ return $event->getExitCode();
+ }
+
+ return 1;
+ }
+
+ $command = $this->find($alternative);
+ }
+
+ if ($command instanceof LazyCommand) {
+ $command = $command->getCommand();
+ }
$this->runningCommand = $command;
$exitCode = $this->doRunCommand($command, $input, $output);
@@ -195,10 +303,12 @@ public function doRun(InputInterface $input, OutputInterface $output)
}
/**
- * Set a helper set to be used with the command.
- *
- * @param HelperSet $helperSet The helper set
+ * {@inheritdoc}
*/
+ public function reset()
+ {
+ }
+
public function setHelperSet(HelperSet $helperSet)
{
$this->helperSet = $helperSet;
@@ -207,18 +317,17 @@ public function setHelperSet(HelperSet $helperSet)
/**
* Get the helper set associated with the command.
*
- * @return HelperSet The HelperSet instance associated with this command
+ * @return HelperSet
*/
public function getHelperSet()
{
+ if (!$this->helperSet) {
+ $this->helperSet = $this->getDefaultHelperSet();
+ }
+
return $this->helperSet;
}
- /**
- * Set an input definition to be used with this application.
- *
- * @param InputDefinition $definition The input definition
- */
public function setDefinition(InputDefinition $definition)
{
$this->definition = $definition;
@@ -227,10 +336,14 @@ public function setDefinition(InputDefinition $definition)
/**
* Gets the InputDefinition related to this Application.
*
- * @return InputDefinition The InputDefinition instance
+ * @return InputDefinition
*/
public function getDefinition()
{
+ if (!$this->definition) {
+ $this->definition = $this->getDefaultInputDefinition();
+ }
+
if ($this->singleCommand) {
$inputDefinition = $this->definition;
$inputDefinition->setArguments();
@@ -241,10 +354,33 @@ public function getDefinition()
return $this->definition;
}
+ /**
+ * Adds suggestions to $suggestions for the current completion input (e.g. option or argument).
+ */
+ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
+ {
+ if (
+ CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType()
+ && 'command' === $input->getCompletionName()
+ ) {
+ $suggestions->suggestValues(array_filter(array_map(function (Command $command) {
+ return $command->isHidden() ? null : $command->getName();
+ }, $this->all())));
+
+ return;
+ }
+
+ if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) {
+ $suggestions->suggestOptions($this->getDefinition()->getOptions());
+
+ return;
+ }
+ }
+
/**
* Gets the help message.
*
- * @return string A help message
+ * @return string
*/
public function getHelp()
{
@@ -254,7 +390,7 @@ public function getHelp()
/**
* Gets whether to catch exceptions or not during commands execution.
*
- * @return bool Whether to catch exceptions or not during commands execution
+ * @return bool
*/
public function areExceptionsCaught()
{
@@ -263,18 +399,16 @@ public function areExceptionsCaught()
/**
* Sets whether to catch exceptions or not during commands execution.
- *
- * @param bool $boolean Whether to catch exceptions or not during commands execution
*/
- public function setCatchExceptions($boolean)
+ public function setCatchExceptions(bool $boolean)
{
- $this->catchExceptions = (bool) $boolean;
+ $this->catchExceptions = $boolean;
}
/**
* Gets whether to automatically exit after a command execution or not.
*
- * @return bool Whether to automatically exit after a command execution or not
+ * @return bool
*/
public function isAutoExitEnabled()
{
@@ -283,18 +417,16 @@ public function isAutoExitEnabled()
/**
* Sets whether to automatically exit after a command execution or not.
- *
- * @param bool $boolean Whether to automatically exit after a command execution or not
*/
- public function setAutoExit($boolean)
+ public function setAutoExit(bool $boolean)
{
- $this->autoExit = (bool) $boolean;
+ $this->autoExit = $boolean;
}
/**
* Gets the name of the application.
*
- * @return string The application name
+ * @return string
*/
public function getName()
{
@@ -303,10 +435,8 @@ public function getName()
/**
* Sets the application name.
- *
- * @param string $name The application name
- */
- public function setName($name)
+ **/
+ public function setName(string $name)
{
$this->name = $name;
}
@@ -314,7 +444,7 @@ public function setName($name)
/**
* Gets the application version.
*
- * @return string The application version
+ * @return string
*/
public function getVersion()
{
@@ -323,10 +453,8 @@ public function getVersion()
/**
* Sets the application version.
- *
- * @param string $version The application version
*/
- public function setVersion($version)
+ public function setVersion(string $version)
{
$this->version = $version;
}
@@ -334,7 +462,7 @@ public function setVersion($version)
/**
* Returns the long version of the application.
*
- * @return string The long application version
+ * @return string
*/
public function getLongVersion()
{
@@ -352,11 +480,9 @@ public function getLongVersion()
/**
* Registers a new command.
*
- * @param string $name The command name
- *
- * @return Command The newly created command
+ * @return Command
*/
- public function register($name)
+ public function register(string $name)
{
return $this->add(new Command($name));
}
@@ -381,22 +507,27 @@ public function addCommands(array $commands)
* If a command with the same name already exists, it will be overridden.
* If the command is not enabled it will not be added.
*
- * @param Command $command A Command object
- *
- * @return Command|null The registered command if enabled or null
+ * @return Command|null
*/
public function add(Command $command)
{
+ $this->init();
+
$command->setApplication($this);
if (!$command->isEnabled()) {
$command->setApplication(null);
- return;
+ return null;
}
- if (null === $command->getDefinition()) {
- throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command)));
+ if (!$command instanceof LazyCommand) {
+ // Will throw if the command is not correctly initialized.
+ $command->getDefinition();
+ }
+
+ if (!$command->getName()) {
+ throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command)));
}
$this->commands[$command->getName()] = $command;
@@ -411,18 +542,23 @@ public function add(Command $command)
/**
* Returns a registered command by name or alias.
*
- * @param string $name The command name or alias
- *
- * @return Command A Command object
+ * @return Command
*
- * @throws CommandNotFoundException When command name given does not exist
+ * @throws CommandNotFoundException When given command name does not exist
*/
- public function get($name)
+ public function get(string $name)
{
- if (!isset($this->commands[$name])) {
+ $this->init();
+
+ if (!$this->has($name)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
}
+ // When the command has a different name than the one used at the command loader level
+ if (!isset($this->commands[$name])) {
+ throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name));
+ }
+
$command = $this->commands[$name];
if ($this->wantHelps) {
@@ -440,13 +576,13 @@ public function get($name)
/**
* Returns true if the command exists, false otherwise.
*
- * @param string $name The command name or alias
- *
- * @return bool true if the command exists, false otherwise
+ * @return bool
*/
- public function has($name)
+ public function has(string $name)
{
- return isset($this->commands[$name]);
+ $this->init();
+
+ return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name)));
}
/**
@@ -454,42 +590,44 @@ public function has($name)
*
* It does not return the global namespace which always exists.
*
- * @return string[] An array of namespaces
+ * @return string[]
*/
public function getNamespaces()
{
- $namespaces = array();
+ $namespaces = [];
foreach ($this->all() as $command) {
- $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName()));
+ if ($command->isHidden()) {
+ continue;
+ }
+
+ $namespaces[] = $this->extractAllNamespaces($command->getName());
foreach ($command->getAliases() as $alias) {
- $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias));
+ $namespaces[] = $this->extractAllNamespaces($alias);
}
}
- return array_values(array_unique(array_filter($namespaces)));
+ return array_values(array_unique(array_filter(array_merge([], ...$namespaces))));
}
/**
* Finds a registered namespace by a name or an abbreviation.
*
- * @param string $namespace A namespace or abbreviation to search for
+ * @return string
*
- * @return string A registered namespace
- *
- * @throws CommandNotFoundException When namespace is incorrect or ambiguous
+ * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous
*/
- public function findNamespace($namespace)
+ public function findNamespace(string $namespace)
{
$allNamespaces = $this->getNamespaces();
- $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace);
+ $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*';
$namespaces = preg_grep('{^'.$expr.'}', $allNamespaces);
if (empty($namespaces)) {
$message = sprintf('There are no commands defined in the "%s" namespace.', $namespace);
if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) {
- if (1 == count($alternatives)) {
+ if (1 == \count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
@@ -498,12 +636,12 @@ public function findNamespace($namespace)
$message .= implode("\n ", $alternatives);
}
- throw new CommandNotFoundException($message, $alternatives);
+ throw new NamespaceNotFoundException($message, $alternatives);
}
- $exact = in_array($namespace, $namespaces, true);
- if (count($namespaces) > 1 && !$exact) {
- throw new CommandNotFoundException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
+ $exact = \in_array($namespace, $namespaces, true);
+ if (\count($namespaces) > 1 && !$exact) {
+ throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
}
return $exact ? $namespace : reset($namespaces);
@@ -515,19 +653,38 @@ public function findNamespace($namespace)
* Contrary to get, this command tries to find the best
* match if you give it an abbreviation of a name or alias.
*
- * @param string $name A command name or a command alias
- *
- * @return Command A Command instance
+ * @return Command
*
* @throws CommandNotFoundException When command name is incorrect or ambiguous
*/
- public function find($name)
+ public function find(string $name)
{
- $allCommands = array_keys($this->commands);
- $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name);
+ $this->init();
+
+ $aliases = [];
+
+ foreach ($this->commands as $command) {
+ foreach ($command->getAliases() as $alias) {
+ if (!$this->has($alias)) {
+ $this->commands[$alias] = $command;
+ }
+ }
+ }
+
+ if ($this->has($name)) {
+ return $this->get($name);
+ }
+
+ $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands);
+ $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*';
$commands = preg_grep('{^'.$expr.'}', $allCommands);
- if (empty($commands) || count(preg_grep('{^'.$expr.'$}', $commands)) < 1) {
+ if (empty($commands)) {
+ $commands = preg_grep('{^'.$expr.'}i', $allCommands);
+ }
+
+ // if no commands matched or we just matched namespaces
+ if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) {
if (false !== $pos = strrpos($name, ':')) {
// check if a namespace exists and contains commands
$this->findNamespace(substr($name, 0, $pos));
@@ -536,7 +693,12 @@ public function find($name)
$message = sprintf('Command "%s" is not defined.', $name);
if ($alternatives = $this->findAlternatives($name, $allCommands)) {
- if (1 == count($alternatives)) {
+ // remove hidden commands
+ $alternatives = array_filter($alternatives, function ($name) {
+ return !$this->get($name)->isHidden();
+ });
+
+ if (1 == \count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
@@ -544,27 +706,58 @@ public function find($name)
$message .= implode("\n ", $alternatives);
}
- throw new CommandNotFoundException($message, $alternatives);
+ throw new CommandNotFoundException($message, array_values($alternatives));
}
// filter out aliases for commands which are already on the list
- if (count($commands) > 1) {
- $commandList = $this->commands;
- $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) {
+ if (\count($commands) > 1) {
+ $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
+ $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
+ if (!$commandList[$nameOrAlias] instanceof Command) {
+ $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
+ }
+
$commandName = $commandList[$nameOrAlias]->getName();
- return $commandName === $nameOrAlias || !in_array($commandName, $commands);
- });
+ $aliases[$nameOrAlias] = $commandName;
+
+ return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
+ }));
}
- $exact = in_array($name, $commands, true);
- if (count($commands) > 1 && !$exact) {
- $suggestions = $this->getAbbreviationSuggestions(array_values($commands));
+ if (\count($commands) > 1) {
+ $usableWidth = $this->terminal->getWidth() - 10;
+ $abbrevs = array_values($commands);
+ $maxLen = 0;
+ foreach ($abbrevs as $abbrev) {
+ $maxLen = max(Helper::width($abbrev), $maxLen);
+ }
+ $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) {
+ if ($commandList[$cmd]->isHidden()) {
+ unset($commands[array_search($cmd, $commands)]);
+
+ return false;
+ }
- throw new CommandNotFoundException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions), array_values($commands));
+ $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription();
+
+ return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev;
+ }, array_values($commands));
+
+ if (\count($commands) > 1) {
+ $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs));
+
+ throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands));
+ }
}
- return $this->get($exact ? $name : reset($commands));
+ $command = $this->get(reset($commands));
+
+ if ($command->isHidden()) {
+ throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
+ }
+
+ return $command;
}
/**
@@ -572,38 +765,55 @@ public function find($name)
*
* The array keys are the full names and the values the command instances.
*
- * @param string $namespace A namespace name
- *
- * @return Command[] An array of Command instances
+ * @return Command[]
*/
- public function all($namespace = null)
+ public function all(string $namespace = null)
{
+ $this->init();
+
if (null === $namespace) {
- return $this->commands;
+ if (!$this->commandLoader) {
+ return $this->commands;
+ }
+
+ $commands = $this->commands;
+ foreach ($this->commandLoader->getNames() as $name) {
+ if (!isset($commands[$name]) && $this->has($name)) {
+ $commands[$name] = $this->get($name);
+ }
+ }
+
+ return $commands;
}
- $commands = array();
+ $commands = [];
foreach ($this->commands as $name => $command) {
if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) {
$commands[$name] = $command;
}
}
+ if ($this->commandLoader) {
+ foreach ($this->commandLoader->getNames() as $name) {
+ if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) {
+ $commands[$name] = $this->get($name);
+ }
+ }
+ }
+
return $commands;
}
/**
* Returns an array of possible abbreviations given a set of names.
*
- * @param array $names An array of names
- *
- * @return array An array of abbreviations
+ * @return string[][]
*/
- public static function getAbbreviations($names)
+ public static function getAbbreviations(array $names)
{
- $abbrevs = array();
+ $abbrevs = [];
foreach ($names as $name) {
- for ($len = strlen($name); $len > 0; --$len) {
+ for ($len = \strlen($name); $len > 0; --$len) {
$abbrev = substr($name, 0, $len);
$abbrevs[$abbrev][] = $name;
}
@@ -612,195 +822,140 @@ public static function getAbbreviations($names)
return $abbrevs;
}
- /**
- * Renders a caught exception.
- *
- * @param \Exception $e An exception instance
- * @param OutputInterface $output An OutputInterface instance
- */
- public function renderException(\Exception $e, OutputInterface $output)
+ public function renderThrowable(\Throwable $e, OutputInterface $output): void
{
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
+ $this->doRenderThrowable($e, $output);
+
+ if (null !== $this->runningCommand) {
+ $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET);
+ $output->writeln('', OutputInterface::VERBOSITY_QUIET);
+ }
+ }
+
+ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void
+ {
do {
- $title = sprintf(
- ' [%s%s] ',
- get_class($e),
- $output->isVerbose() && 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''
- );
-
- $len = $this->stringWidth($title);
-
- $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
- // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
- if (defined('HHVM_VERSION') && $width > 1 << 31) {
- $width = 1 << 31;
+ $message = trim($e->getMessage());
+ if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $class = get_debug_type($e);
+ $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : '');
+ $len = Helper::width($title);
+ } else {
+ $len = 0;
}
- $formatter = $output->getFormatter();
- $lines = array();
- foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
+
+ if (str_contains($message, "@anonymous\0")) {
+ $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
+ return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
+ }, $message);
+ }
+
+ $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX;
+ $lines = [];
+ foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) {
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
// pre-format lines to get the right string length
- $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4;
- $lines[] = array($line, $lineLength);
+ $lineLength = Helper::width($line) + 4;
+ $lines[] = [$line, $lineLength];
$len = max($lineLength, $len);
}
}
- $messages = array();
- $messages[] = $emptyLine = $formatter->format(sprintf('%s', str_repeat(' ', $len)));
- $messages[] = $formatter->format(sprintf('%s%s', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title)))));
+ $messages = [];
+ if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
+ }
+ $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len));
+ if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title))));
+ }
foreach ($lines as $line) {
- $messages[] = $formatter->format(sprintf(' %s %s', $line[0], str_repeat(' ', $len - $line[1])));
+ $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1]));
}
$messages[] = $emptyLine;
$messages[] = '';
- $output->writeln($messages, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET);
+ $output->writeln($messages, OutputInterface::VERBOSITY_QUIET);
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET);
// exception related properties
$trace = $e->getTrace();
- array_unshift($trace, array(
+
+ array_unshift($trace, [
'function' => '',
- 'file' => $e->getFile() !== null ? $e->getFile() : 'n/a',
- 'line' => $e->getLine() !== null ? $e->getLine() : 'n/a',
- 'args' => array(),
- ));
-
- for ($i = 0, $count = count($trace); $i < $count; ++$i) {
- $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
- $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
- $function = $trace[$i]['function'];
- $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
- $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
-
- $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
+ 'file' => $e->getFile() ?: 'n/a',
+ 'line' => $e->getLine() ?: 'n/a',
+ 'args' => [],
+ ]);
+
+ for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
+ $class = $trace[$i]['class'] ?? '';
+ $type = $trace[$i]['type'] ?? '';
+ $function = $trace[$i]['function'] ?? '';
+ $file = $trace[$i]['file'] ?? 'n/a';
+ $line = $trace[$i]['line'] ?? 'n/a';
+
+ $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET);
}
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
}
} while ($e = $e->getPrevious());
-
- if (null !== $this->runningCommand) {
- $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET);
- $output->writeln('', OutputInterface::VERBOSITY_QUIET);
- }
- }
-
- /**
- * Tries to figure out the terminal width in which this application runs.
- *
- * @return int|null
- *
- * @deprecated since version 3.2, to be removed in 4.0. Create a Terminal instance instead.
- */
- protected function getTerminalWidth()
- {
- @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED);
-
- return $this->terminal->getWidth();
- }
-
- /**
- * Tries to figure out the terminal height in which this application runs.
- *
- * @return int|null
- *
- * @deprecated since version 3.2, to be removed in 4.0. Create a Terminal instance instead.
- */
- protected function getTerminalHeight()
- {
- @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED);
-
- return $this->terminal->getHeight();
- }
-
- /**
- * Tries to figure out the terminal dimensions based on the current environment.
- *
- * @return array Array containing width and height
- *
- * @deprecated since version 3.2, to be removed in 4.0. Create a Terminal instance instead.
- */
- public function getTerminalDimensions()
- {
- @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED);
-
- return array($this->terminal->getWidth(), $this->terminal->getHeight());
- }
-
- /**
- * Sets terminal dimensions.
- *
- * Can be useful to force terminal dimensions for functional tests.
- *
- * @param int $width The width
- * @param int $height The height
- *
- * @return Application The current application
- *
- * @deprecated since version 3.2, to be removed in 4.0. Set the COLUMNS and LINES env vars instead.
- */
- public function setTerminalDimensions($width, $height)
- {
- @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Set the COLUMNS and LINES env vars instead.', __METHOD__), E_USER_DEPRECATED);
-
- putenv('COLUMNS='.$width);
- putenv('LINES='.$height);
-
- return $this;
}
/**
* Configures the input and output instances based on the user arguments and options.
- *
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
- if (true === $input->hasParameterOption(array('--ansi'), true)) {
+ if (true === $input->hasParameterOption(['--ansi'], true)) {
$output->setDecorated(true);
- } elseif (true === $input->hasParameterOption(array('--no-ansi'), true)) {
+ } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) {
$output->setDecorated(false);
}
- if (true === $input->hasParameterOption(array('--no-interaction', '-n'), true)) {
+ if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) {
$input->setInteractive(false);
- } elseif (function_exists('posix_isatty')) {
- $inputStream = null;
-
- if ($input instanceof StreamableInputInterface) {
- $inputStream = $input->getStream();
- }
-
- // This check ensures that calling QuestionHelper::setInputStream() works
- // To be removed in 4.0 (in the same time as QuestionHelper::setInputStream)
- if (!$inputStream && $this->getHelperSet()->has('question')) {
- $inputStream = $this->getHelperSet()->get('question')->getInputStream(false);
- }
+ }
- if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
- $input->setInteractive(false);
- }
+ switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) {
+ case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break;
+ case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break;
+ case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break;
+ case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break;
+ default: $shellVerbosity = 0; break;
}
- if (true === $input->hasParameterOption(array('--quiet', '-q'), true)) {
+ if (true === $input->hasParameterOption(['--quiet', '-q'], true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
- $input->setInteractive(false);
+ $shellVerbosity = -1;
} else {
- if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || $input->getParameterOption('--verbose', false, true) === 3) {
+ if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
- } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || $input->getParameterOption('--verbose', false, true) === 2) {
+ $shellVerbosity = 3;
+ } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
+ $shellVerbosity = 2;
} elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
+ $shellVerbosity = 1;
}
}
+
+ if (-1 === $shellVerbosity) {
+ $input->setInteractive(false);
+ }
+
+ if (\function_exists('putenv')) {
+ @putenv('SHELL_VERBOSITY='.$shellVerbosity);
+ }
+ $_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
+ $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
}
/**
@@ -809,13 +964,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
* If an event dispatcher has been attached to the application,
* events are also dispatched during the life-cycle of the command.
*
- * @param Command $command A Command instance
- * @param InputInterface $input An Input instance
- * @param OutputInterface $output An Output instance
- *
* @return int 0 if everything went fine, or an error code
- *
- * @throws \Exception when the command being run threw an exception
*/
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
{
@@ -825,16 +974,47 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
}
}
- if (null === $this->dispatcher) {
- try {
- return $command->run($input, $output);
- } catch (\Exception $e) {
- throw $e;
- } catch (\Throwable $e) {
- throw new FatalThrowableError($e);
+ if ($command instanceof SignalableCommandInterface && ($this->signalsToDispatchEvent || $command->getSubscribedSignals())) {
+ if (!$this->signalRegistry) {
+ throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
+ }
+
+ if (Terminal::hasSttyAvailable()) {
+ $sttyMode = shell_exec('stty -g');
+
+ foreach ([\SIGINT, \SIGTERM] as $signal) {
+ $this->signalRegistry->register($signal, static function () use ($sttyMode) {
+ shell_exec('stty '.$sttyMode);
+ });
+ }
+ }
+
+ if ($this->dispatcher) {
+ foreach ($this->signalsToDispatchEvent as $signal) {
+ $event = new ConsoleSignalEvent($command, $input, $output, $signal);
+
+ $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) {
+ $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL);
+
+ // No more handlers, we try to simulate PHP default behavior
+ if (!$hasNext) {
+ if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) {
+ exit(0);
+ }
+ }
+ });
+ }
+ }
+
+ foreach ($command->getSubscribedSignals() as $signal) {
+ $this->signalRegistry->register($signal, [$command, 'handleSignal']);
}
}
+ if (null === $this->dispatcher) {
+ return $command->run($input, $output);
+ }
+
// bind before the console.command event, so the listeners have access to input options/arguments
try {
$command->mergeApplicationDefinition();
@@ -844,36 +1024,32 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
}
$event = new ConsoleCommandEvent($command, $input, $output);
- $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
+ $e = null;
- if ($event->commandShouldRun()) {
- try {
- $e = null;
+ try {
+ $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND);
+
+ if ($event->commandShouldRun()) {
$exitCode = $command->run($input, $output);
- } catch (\Exception $x) {
- $e = $x;
- } catch (\Throwable $x) {
- $e = new FatalThrowableError($x);
+ } else {
+ $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
}
- if (null !== $e) {
- $event = new ConsoleExceptionEvent($command, $input, $output, $e, $e->getCode());
- $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
+ } catch (\Throwable $e) {
+ $event = new ConsoleErrorEvent($input, $output, $e, $command);
+ $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
+ $e = $event->getError();
- if ($e !== $event->getException()) {
- $x = $e = $event->getException();
- }
-
- $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
- $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
-
- throw $x;
+ if (0 === $exitCode = $event->getExitCode()) {
+ $e = null;
}
- } else {
- $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
}
$event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
- $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
+ $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE);
+
+ if (null !== $e) {
+ throw $e;
+ }
return $event->getExitCode();
}
@@ -881,9 +1057,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
/**
* Gets the name of the command based on input.
*
- * @param InputInterface $input The input interface
- *
- * @return string The command name
+ * @return string|null
*/
protected function getCommandName(InputInterface $input)
{
@@ -893,58 +1067,52 @@ protected function getCommandName(InputInterface $input)
/**
* Gets the default input definition.
*
- * @return InputDefinition An InputDefinition instance
+ * @return InputDefinition
*/
protected function getDefaultInputDefinition()
{
- return new InputDefinition(array(
+ return new InputDefinition([
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
-
- new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'),
+ new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'),
new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'),
new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'),
new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'),
- new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'),
- new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'),
+ new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null),
new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'),
- ));
+ ]);
}
/**
* Gets the default commands that should always be available.
*
- * @return Command[] An array of default Command instances
+ * @return Command[]
*/
protected function getDefaultCommands()
{
- return array(new HelpCommand(), new ListCommand());
+ return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()];
}
/**
* Gets the default helper set with the helpers that should always be available.
*
- * @return HelperSet A HelperSet instance
+ * @return HelperSet
*/
protected function getDefaultHelperSet()
{
- return new HelperSet(array(
+ return new HelperSet([
new FormatterHelper(),
new DebugFormatterHelper(),
new ProcessHelper(),
new QuestionHelper(),
- ));
+ ]);
}
/**
* Returns abbreviated suggestions in string format.
- *
- * @param array $abbrevs Abbreviated suggestions to convert
- *
- * @return string A formatted string of abbreviated suggestions
*/
- private function getAbbreviationSuggestions($abbrevs)
+ private function getAbbreviationSuggestions(array $abbrevs): string
{
- return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : '');
+ return ' '.implode("\n ", $abbrevs);
}
/**
@@ -952,34 +1120,27 @@ private function getAbbreviationSuggestions($abbrevs)
*
* This method is not part of public API and should not be used directly.
*
- * @param string $name The full name of the command
- * @param string $limit The maximum number of parts of the namespace
- *
- * @return string The namespace of the command
+ * @return string
*/
- public function extractNamespace($name, $limit = null)
+ public function extractNamespace(string $name, int $limit = null)
{
- $parts = explode(':', $name);
- array_pop($parts);
+ $parts = explode(':', $name, -1);
- return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit));
+ return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
}
/**
* Finds alternative of $name among $collection,
* if nothing is found in $collection, try in $abbrevs.
*
- * @param string $name The string
- * @param array|\Traversable $collection The collection
- *
- * @return string[] A sorted array of similar string
+ * @return string[]
*/
- private function findAlternatives($name, $collection)
+ private function findAlternatives(string $name, iterable $collection): array
{
$threshold = 1e3;
- $alternatives = array();
+ $alternatives = [];
- $collectionParts = array();
+ $collectionParts = [];
foreach ($collection as $item) {
$collectionParts[$item] = explode(':', $item);
}
@@ -995,7 +1156,7 @@ private function findAlternatives($name, $collection)
}
$lev = levenshtein($subname, $parts[$i]);
- if ($lev <= strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) {
+ if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) {
$alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
} elseif ($exists) {
$alternatives[$collectionName] += $threshold;
@@ -1005,13 +1166,13 @@ private function findAlternatives($name, $collection)
foreach ($collection as $item) {
$lev = levenshtein($name, $item);
- if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) {
+ if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) {
$alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
}
}
$alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
- asort($alternatives);
+ ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE);
return array_keys($alternatives);
}
@@ -1019,14 +1180,11 @@ private function findAlternatives($name, $collection)
/**
* Sets the default Command name.
*
- * @param string $commandName The Command name
- * @param bool $isSingleCommand Set to true if there is only one command in this application
- *
- * @return self
+ * @return $this
*/
- public function setDefaultCommand($commandName, $isSingleCommand = false)
+ public function setDefaultCommand(string $commandName, bool $isSingleCommand = false)
{
- $this->defaultCommand = $commandName;
+ $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0];
if ($isSingleCommand) {
// Ensure the command exist
@@ -1038,16 +1196,15 @@ public function setDefaultCommand($commandName, $isSingleCommand = false)
return $this;
}
- private function stringWidth($string)
+ /**
+ * @internal
+ */
+ public function isSingleCommand(): bool
{
- if (false === $encoding = mb_detect_encoding($string, null, true)) {
- return strlen($string);
- }
-
- return mb_strwidth($string, $encoding);
+ return $this->singleCommand;
}
- private function splitStringByWidth($string, $width)
+ private function splitStringByWidth(string $string, int $width): array
{
// str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly.
// additionally, array_slice() is not enough as some character has doubled width.
@@ -1057,22 +1214,27 @@ private function splitStringByWidth($string, $width)
}
$utf8String = mb_convert_encoding($string, 'utf8', $encoding);
- $lines = array();
+ $lines = [];
$line = '';
- foreach (preg_split('//u', $utf8String) as $char) {
- // test if $char could be appended to current line
- if (mb_strwidth($line.$char, 'utf8') <= $width) {
- $line .= $char;
- continue;
+
+ $offset = 0;
+ while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) {
+ $offset += \strlen($m[0]);
+
+ foreach (preg_split('//u', $m[0]) as $char) {
+ // test if $char could be appended to current line
+ if (mb_strwidth($line.$char, 'utf8') <= $width) {
+ $line .= $char;
+ continue;
+ }
+ // if not, push current line to array and make new line
+ $lines[] = str_pad($line, $width);
+ $line = $char;
}
- // if not, push current line to array and make new line
- $lines[] = str_pad($line, $width);
- $line = $char;
- }
- if ('' !== $line) {
- $lines[] = count($lines) ? str_pad($line, $width) : $line;
}
+ $lines[] = \count($lines) ? str_pad($line, $width) : $line;
+
mb_convert_variables($encoding, 'utf8', $lines);
return $lines;
@@ -1081,18 +1243,16 @@ private function splitStringByWidth($string, $width)
/**
* Returns all namespaces of the command name.
*
- * @param string $name The full name of the command
- *
- * @return string[] The namespaces of the command
+ * @return string[]
*/
- private function extractAllNamespaces($name)
+ private function extractAllNamespaces(string $name): array
{
// -1 as third argument is needed to skip the command short name when exploding
$parts = explode(':', $name, -1);
- $namespaces = array();
+ $namespaces = [];
foreach ($parts as $part) {
- if (count($namespaces)) {
+ if (\count($namespaces)) {
$namespaces[] = end($namespaces).':'.$part;
} else {
$namespaces[] = $part;
@@ -1101,4 +1261,16 @@ private function extractAllNamespaces($name)
return $namespaces;
}
+
+ private function init()
+ {
+ if ($this->initialized) {
+ return;
+ }
+ $this->initialized = true;
+
+ foreach ($this->getDefaultCommands() as $command) {
+ $this->add($command);
+ }
+ }
}
diff --git a/tests/integration/vendor/symfony/console/Attribute/AsCommand.php b/tests/integration/vendor/symfony/console/Attribute/AsCommand.php
new file mode 100644
index 000000000..b337f548f
--- /dev/null
+++ b/tests/integration/vendor/symfony/console/Attribute/AsCommand.php
@@ -0,0 +1,39 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Attribute;
+
+/**
+ * Service tag to autoconfigure commands.
+ */
+#[\Attribute(\Attribute::TARGET_CLASS)]
+class AsCommand
+{
+ public function __construct(
+ public string $name,
+ public ?string $description = null,
+ array $aliases = [],
+ bool $hidden = false,
+ ) {
+ if (!$hidden && !$aliases) {
+ return;
+ }
+
+ $name = explode('|', $name);
+ $name = array_merge($name, $aliases);
+
+ if ($hidden && '' !== $name[0]) {
+ array_unshift($name, '');
+ }
+
+ $this->name = implode('|', $name);
+ }
+}
diff --git a/tests/integration/vendor/symfony/console/CHANGELOG.md b/tests/integration/vendor/symfony/console/CHANGELOG.md
index a97a4a7ad..6662dd1eb 100644
--- a/tests/integration/vendor/symfony/console/CHANGELOG.md
+++ b/tests/integration/vendor/symfony/console/CHANGELOG.md
@@ -1,19 +1,149 @@
CHANGELOG
=========
+5.4
+---
+
+ * Add `TesterTrait::assertCommandIsSuccessful()` to test command
+ * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement
+
+5.3
+---
+
+ * Add `GithubActionReporter` to render annotations in a Github Action
+ * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options
+ * Add the `Command::$defaultDescription` static property and the `description` attribute
+ on the `console.command` tag to allow the `list` command to instantiate commands lazily
+ * Add option `--short` to the `list` command
+ * Add support for bright colors
+ * Add `#[AsCommand]` attribute for declaring commands on PHP 8
+ * Add `Helper::width()` and `Helper::length()`
+ * The `--ansi` and `--no-ansi` options now default to `null`.
+
+5.2.0
+-----
+
+ * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester`
+ * added support for multiline responses to questions through `Question::setMultiline()`
+ and `Question::isMultiline()`
+ * Added `SignalRegistry` class to stack signals handlers
+ * Added support for signals:
+ * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods
+ * Added `SignalableCommandInterface` interface
+ * Added `TableCellStyle` class to customize table cell
+ * Removed `php ` prefix invocation from help messages.
+
+5.1.0
+-----
+
+ * `Command::setHidden()` is final since Symfony 5.1
+ * Add `SingleCommandApplication`
+ * Add `Cursor` class
+
+5.0.0
+-----
+
+ * removed support for finding hidden commands using an abbreviation, use the full name instead
+ * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()`
+ * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()`
+ * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()`
+ * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()`
+ * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()`
+ * removed support for returning `null` from `Command::execute()`, return `0` instead
+ * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument
+ * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface`
+ for its `dispatcher` argument
+ * renamed `Application::renderException()` and `Application::doRenderException()`
+ to `renderThrowable()` and `doRenderThrowable()` respectively.
+
+4.4.0
+-----
+
+ * deprecated finding hidden commands using an abbreviation, use the full name instead
+ * added `Question::setTrimmable` default to true to allow the answer to be trimmed
+ * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar`
+ * `Application` implements `ResetInterface`
+ * marked all dispatched event classes as `@final`
+ * added support for displaying table horizontally
+ * deprecated returning `null` from `Command::execute()`, return `0` instead
+ * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods,
+ use `renderThrowable()` and `doRenderThrowable()` instead.
+ * added support for the `NO_COLOR` env var (https://no-color.org/)
+
+4.3.0
+-----
+
+ * added support for hyperlinks
+ * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating
+ * added `Question::setAutocompleterCallback()` to provide a callback function
+ that dynamically generates suggestions as the user types
+
+4.2.0
+-----
+
+ * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to
+ `ProcessHelper::run()` to pass environment variables
+ * deprecated passing a command as a string to `ProcessHelper::run()`,
+ pass it the command as an array of its arguments instead
+ * made the `ProcessHelper` class final
+ * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`)
+ * added `capture_stderr_separately` option to `CommandTester::execute()`
+
+4.1.0
+-----
+
+ * added option to run suggested command if command is not found and only 1 alternative is available
+ * added option to modify console output and print multiple modifiable sections
+ * added support for iterable messages in output `write` and `writeln` methods
+
+4.0.0
+-----
+
+ * `OutputFormatter` throws an exception when unknown options are used
+ * removed `QuestionHelper::setInputStream()/getInputStream()`
+ * removed `Application::getTerminalWidth()/getTerminalHeight()` and
+ `Application::setTerminalDimensions()/getTerminalDimensions()`
+ * removed `ConsoleExceptionEvent`
+ * removed `ConsoleEvents::EXCEPTION`
+
+3.4.0
+-----
+
+ * added `SHELL_VERBOSITY` env var to control verbosity
+ * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11
+ `ContainerCommandLoader` for commands lazy-loading
+ * added a case-insensitive command name matching fallback
+ * added static `Command::$defaultName/getDefaultName()`, allowing for
+ commands to be registered at compile time in the application command loader.
+ Setting the `$defaultName` property avoids the need for filling the `command`
+ attribute on the `console.command` tag when using `AddConsoleCommandPass`.
+
+3.3.0
+-----
+
+ * added `ExceptionListener`
+ * added `AddConsoleCommandPass` (originally in FrameworkBundle)
+ * [BC BREAK] `Input::getOption()` no longer returns the default value for options
+ with value optional explicitly passed empty
+ * added console.error event to catch exceptions thrown by other listeners
+ * deprecated console.exception event in favor of console.error
+ * added ability to handle `CommandNotFoundException` through the
+ `console.error` event
+ * deprecated default validation in `SymfonyQuestionHelper::ask`
+
3.2.0
------
-* added `setInputs()` method to CommandTester for ease testing of commands expecting inputs
-* added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface)
-* added StreamableInputInterface
-* added LockableTrait
+ * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs
+ * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface)
+ * added StreamableInputInterface
+ * added LockableTrait
3.1.0
-----
* added truncate method to FormatterHelper
- * added setColumnWidth(s) method to Table
+ * added setColumnWidth(s) method to Table
2.8.3
-----
diff --git a/tests/integration/vendor/symfony/console/CI/GithubActionReporter.php b/tests/integration/vendor/symfony/console/CI/GithubActionReporter.php
new file mode 100644
index 000000000..a15c1ff18
--- /dev/null
+++ b/tests/integration/vendor/symfony/console/CI/GithubActionReporter.php
@@ -0,0 +1,99 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\CI;
+
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Utility class for Github actions.
+ *
+ * @author Maxime Steinhausser
+ */
+class GithubActionReporter
+{
+ private $output;
+
+ /**
+ * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85
+ */
+ private const ESCAPED_DATA = [
+ '%' => '%25',
+ "\r" => '%0D',
+ "\n" => '%0A',
+ ];
+
+ /**
+ * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94
+ */
+ private const ESCAPED_PROPERTIES = [
+ '%' => '%25',
+ "\r" => '%0D',
+ "\n" => '%0A',
+ ':' => '%3A',
+ ',' => '%2C',
+ ];
+
+ public function __construct(OutputInterface $output)
+ {
+ $this->output = $output;
+ }
+
+ public static function isGithubActionEnvironment(): bool
+ {
+ return false !== getenv('GITHUB_ACTIONS');
+ }
+
+ /**
+ * Output an error using the Github annotations format.
+ *
+ * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
+ */
+ public function error(string $message, string $file = null, int $line = null, int $col = null): void
+ {
+ $this->log('error', $message, $file, $line, $col);
+ }
+
+ /**
+ * Output a warning using the Github annotations format.
+ *
+ * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message
+ */
+ public function warning(string $message, string $file = null, int $line = null, int $col = null): void
+ {
+ $this->log('warning', $message, $file, $line, $col);
+ }
+
+ /**
+ * Output a debug log using the Github annotations format.
+ *
+ * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message
+ */
+ public function debug(string $message, string $file = null, int $line = null, int $col = null): void
+ {
+ $this->log('debug', $message, $file, $line, $col);
+ }
+
+ private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void
+ {
+ // Some values must be encoded.
+ $message = strtr($message, self::ESCAPED_DATA);
+
+ if (!$file) {
+ // No file provided, output the message solely:
+ $this->output->writeln(sprintf('::%s::%s', $type, $message));
+
+ return;
+ }
+
+ $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message));
+ }
+}
diff --git a/tests/integration/vendor/symfony/console/Color.php b/tests/integration/vendor/symfony/console/Color.php
new file mode 100644
index 000000000..22a4ce9ff
--- /dev/null
+++ b/tests/integration/vendor/symfony/console/Color.php
@@ -0,0 +1,180 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+
+/**
+ * @author Fabien Potencier
+ */
+final class Color
+{
+ private const COLORS = [
+ 'black' => 0,
+ 'red' => 1,
+ 'green' => 2,
+ 'yellow' => 3,
+ 'blue' => 4,
+ 'magenta' => 5,
+ 'cyan' => 6,
+ 'white' => 7,
+ 'default' => 9,
+ ];
+
+ private const BRIGHT_COLORS = [
+ 'gray' => 0,
+ 'bright-red' => 1,
+ 'bright-green' => 2,
+ 'bright-yellow' => 3,
+ 'bright-blue' => 4,
+ 'bright-magenta' => 5,
+ 'bright-cyan' => 6,
+ 'bright-white' => 7,
+ ];
+
+ private const AVAILABLE_OPTIONS = [
+ 'bold' => ['set' => 1, 'unset' => 22],
+ 'underscore' => ['set' => 4, 'unset' => 24],
+ 'blink' => ['set' => 5, 'unset' => 25],
+ 'reverse' => ['set' => 7, 'unset' => 27],
+ 'conceal' => ['set' => 8, 'unset' => 28],
+ ];
+
+ private $foreground;
+ private $background;
+ private $options = [];
+
+ public function __construct(string $foreground = '', string $background = '', array $options = [])
+ {
+ $this->foreground = $this->parseColor($foreground);
+ $this->background = $this->parseColor($background, true);
+
+ foreach ($options as $option) {
+ if (!isset(self::AVAILABLE_OPTIONS[$option])) {
+ throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS))));
+ }
+
+ $this->options[$option] = self::AVAILABLE_OPTIONS[$option];
+ }
+ }
+
+ public function apply(string $text): string
+ {
+ return $this->set().$text.$this->unset();
+ }
+
+ public function set(): string
+ {
+ $setCodes = [];
+ if ('' !== $this->foreground) {
+ $setCodes[] = $this->foreground;
+ }
+ if ('' !== $this->background) {
+ $setCodes[] = $this->background;
+ }
+ foreach ($this->options as $option) {
+ $setCodes[] = $option['set'];
+ }
+ if (0 === \count($setCodes)) {
+ return '';
+ }
+
+ return sprintf("\033[%sm", implode(';', $setCodes));
+ }
+
+ public function unset(): string
+ {
+ $unsetCodes = [];
+ if ('' !== $this->foreground) {
+ $unsetCodes[] = 39;
+ }
+ if ('' !== $this->background) {
+ $unsetCodes[] = 49;
+ }
+ foreach ($this->options as $option) {
+ $unsetCodes[] = $option['unset'];
+ }
+ if (0 === \count($unsetCodes)) {
+ return '';
+ }
+
+ return sprintf("\033[%sm", implode(';', $unsetCodes));
+ }
+
+ private function parseColor(string $color, bool $background = false): string
+ {
+ if ('' === $color) {
+ return '';
+ }
+
+ if ('#' === $color[0]) {
+ $color = substr($color, 1);
+
+ if (3 === \strlen($color)) {
+ $color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2];
+ }
+
+ if (6 !== \strlen($color)) {
+ throw new InvalidArgumentException(sprintf('Invalid "%s" color.', $color));
+ }
+
+ return ($background ? '4' : '3').$this->convertHexColorToAnsi(hexdec($color));
+ }
+
+ if (isset(self::COLORS[$color])) {
+ return ($background ? '4' : '3').self::COLORS[$color];
+ }
+
+ if (isset(self::BRIGHT_COLORS[$color])) {
+ return ($background ? '10' : '9').self::BRIGHT_COLORS[$color];
+ }
+
+ throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS)))));
+ }
+
+ private function convertHexColorToAnsi(int $color): string
+ {
+ $r = ($color >> 16) & 255;
+ $g = ($color >> 8) & 255;
+ $b = $color & 255;
+
+ // see https://github.com/termstandard/colors/ for more information about true color support
+ if ('truecolor' !== getenv('COLORTERM')) {
+ return (string) $this->degradeHexColorToAnsi($r, $g, $b);
+ }
+
+ return sprintf('8;2;%d;%d;%d', $r, $g, $b);
+ }
+
+ private function degradeHexColorToAnsi(int $r, int $g, int $b): int
+ {
+ if (0 === round($this->getSaturation($r, $g, $b) / 50)) {
+ return 0;
+ }
+
+ return (round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255);
+ }
+
+ private function getSaturation(int $r, int $g, int $b): int
+ {
+ $r = $r / 255;
+ $g = $g / 255;
+ $b = $b / 255;
+ $v = max($r, $g, $b);
+
+ if (0 === $diff = $v - min($r, $g, $b)) {
+ return 0;
+ }
+
+ return (int) $diff * 100 / $v;
+ }
+}
diff --git a/tests/integration/vendor/symfony/console/Command/Command.php b/tests/integration/vendor/symfony/console/Command/Command.php
index ecb2da745..146f6017b 100644
--- a/tests/integration/vendor/symfony/console/Command/Command.php
+++ b/tests/integration/vendor/symfony/console/Command/Command.php
@@ -11,16 +11,19 @@
namespace Symfony\Component\Console\Command;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Attribute\AsCommand;
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Exception\ExceptionInterface;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Exception\InvalidArgumentException;
-use Symfony\Component\Console\Exception\LogicException;
/**
* Base class for all commands.
@@ -29,42 +32,94 @@
*/
class Command
{
+ // see https://tldp.org/LDP/abs/html/exitcodes.html
+ public const SUCCESS = 0;
+ public const FAILURE = 1;
+ public const INVALID = 2;
+
+ /**
+ * @var string|null The default command name
+ */
+ protected static $defaultName;
+
+ /**
+ * @var string|null The default command description
+ */
+ protected static $defaultDescription;
+
private $application;
private $name;
private $processTitle;
- private $aliases = array();
+ private $aliases = [];
private $definition;
private $hidden = false;
- private $help;
- private $description;
+ private $help = '';
+ private $description = '';
+ private $fullDefinition;
private $ignoreValidationErrors = false;
- private $applicationDefinitionMerged = false;
- private $applicationDefinitionMergedWithArgs = false;
private $code;
- private $synopsis = array();
- private $usages = array();
+ private $synopsis = [];
+ private $usages = [];
private $helperSet;
/**
- * Constructor.
- *
+ * @return string|null
+ */
+ public static function getDefaultName()
+ {
+ $class = static::class;
+
+ if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) {
+ return $attribute[0]->newInstance()->name;
+ }
+
+ $r = new \ReflectionProperty($class, 'defaultName');
+
+ return $class === $r->class ? static::$defaultName : null;
+ }
+
+ public static function getDefaultDescription(): ?string
+ {
+ $class = static::class;
+
+ if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) {
+ return $attribute[0]->newInstance()->description;
+ }
+
+ $r = new \ReflectionProperty($class, 'defaultDescription');
+
+ return $class === $r->class ? static::$defaultDescription : null;
+ }
+
+ /**
* @param string|null $name The name of the command; passing null means it must be set in configure()
*
* @throws LogicException When the command name is empty
*/
- public function __construct($name = null)
+ public function __construct(string $name = null)
{
$this->definition = new InputDefinition();
+ if (null === $name && null !== $name = static::getDefaultName()) {
+ $aliases = explode('|', $name);
+
+ if ('' === $name = array_shift($aliases)) {
+ $this->setHidden(true);
+ $name = array_shift($aliases);
+ }
+
+ $this->setAliases($aliases);
+ }
+
if (null !== $name) {
$this->setName($name);
}
- $this->configure();
-
- if (!$this->name) {
- throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this)));
+ if ('' === $this->description) {
+ $this->setDescription(static::getDefaultDescription() ?? '');
}
+
+ $this->configure();
}
/**
@@ -77,11 +132,6 @@ public function ignoreValidationErrors()
$this->ignoreValidationErrors = true;
}
- /**
- * Sets the application instance for this command.
- *
- * @param Application $application An Application instance
- */
public function setApplication(Application $application = null)
{
$this->application = $application;
@@ -90,13 +140,10 @@ public function setApplication(Application $application = null)
} else {
$this->helperSet = null;
}
+
+ $this->fullDefinition = null;
}
- /**
- * Sets the helper set.
- *
- * @param HelperSet $helperSet A HelperSet instance
- */
public function setHelperSet(HelperSet $helperSet)
{
$this->helperSet = $helperSet;
@@ -105,7 +152,7 @@ public function setHelperSet(HelperSet $helperSet)
/**
* Gets the helper set.
*
- * @return HelperSet A HelperSet instance
+ * @return HelperSet|null
*/
public function getHelperSet()
{
@@ -115,7 +162,7 @@ public function getHelperSet()
/**
* Gets the application instance for this command.
*
- * @return Application An Application instance
+ * @return Application|null
*/
public function getApplication()
{
@@ -125,7 +172,7 @@ public function getApplication()
/**
* Checks whether the command is enabled or not in the current environment.
*
- * Override this to check for x or y and return false if the command can not
+ * Override this to check for x or y and return false if the command cannot
* run properly under the current conditions.
*
* @return bool
@@ -150,10 +197,7 @@ protected function configure()
* execute() method, you set the code to execute by passing
* a Closure to the setCode() method.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
- *
- * @return null|int null or 0 if everything went fine, or an error code
+ * @return int 0 if everything went fine, or an exit code
*
* @throws LogicException When this abstract method is not implemented
*
@@ -170,22 +214,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
* This method is executed before the InputDefinition is validated.
* This means that this is the only place where the command can
* interactively ask for values of missing required arguments.
- *
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
}
/**
- * Initializes the command just after the input has been validated.
+ * Initializes the command after the input has been bound and before the input
+ * is validated.
*
* This is mainly useful when a lot of commands extends one main command
* where some things need to be initialized based on the input arguments and options.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
+ * @see InputInterface::bind()
+ * @see InputInterface::validate()
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
@@ -198,26 +240,21 @@ protected function initialize(InputInterface $input, OutputInterface $output)
* setCode() method or by overriding the execute() method
* in a sub-class.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
- *
* @return int The command exit code
*
+ * @throws \Exception When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}.
+ *
* @see setCode()
* @see execute()
*/
public function run(InputInterface $input, OutputInterface $output)
{
- // force the creation of the synopsis before the merge with the app definition
- $this->getSynopsis(true);
- $this->getSynopsis(false);
-
// add the application arguments and options
$this->mergeApplicationDefinition();
// bind the input against the command specific arguments/options
try {
- $input->bind($this->definition);
+ $input->bind($this->getDefinition());
} catch (ExceptionInterface $e) {
if (!$this->ignoreValidationErrors) {
throw $e;
@@ -227,9 +264,15 @@ public function run(InputInterface $input, OutputInterface $output)
$this->initialize($input, $output);
if (null !== $this->processTitle) {
- if (function_exists('cli_set_process_title')) {
- cli_set_process_title($this->processTitle);
- } elseif (function_exists('setproctitle')) {
+ if (\function_exists('cli_set_process_title')) {
+ if (!@cli_set_process_title($this->processTitle)) {
+ if ('Darwin' === \PHP_OS) {
+ $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE);
+ } else {
+ cli_set_process_title($this->processTitle);
+ }
+ }
+ } elseif (\function_exists('setproctitle')) {
setproctitle($this->processTitle);
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
$output->writeln('Install the proctitle PECL to be able to change the process title.');
@@ -250,14 +293,25 @@ public function run(InputInterface $input, OutputInterface $output)
$input->validate();
if ($this->code) {
- $statusCode = call_user_func($this->code, $input, $output);
+ $statusCode = ($this->code)($input, $output);
} else {
$statusCode = $this->execute($input, $output);
+
+ if (!\is_int($statusCode)) {
+ throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode)));
+ }
}
return is_numeric($statusCode) ? (int) $statusCode : 0;
}
+ /**
+ * Adds suggestions to $suggestions for the current completion input (e.g. option or argument).
+ */
+ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
+ {
+ }
+
/**
* Sets the code to execute when running this command.
*
@@ -266,7 +320,7 @@ public function run(InputInterface $input, OutputInterface $output)
*
* @param callable $code A callable(InputInterface $input, OutputInterface $output)
*
- * @return Command The current instance
+ * @return $this
*
* @throws InvalidArgumentException
*
@@ -277,7 +331,14 @@ public function setCode(callable $code)
if ($code instanceof \Closure) {
$r = new \ReflectionFunction($code);
if (null === $r->getClosureThis()) {
- $code = \Closure::bind($code, $this);
+ set_error_handler(static function () {});
+ try {
+ if ($c = \Closure::bind($code, $this)) {
+ $code = $c;
+ }
+ } finally {
+ restore_error_handler();
+ }
}
}
@@ -292,24 +353,24 @@ public function setCode(callable $code)
* This method is not part of public API and should not be used directly.
*
* @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments
+ *
+ * @internal
*/
- public function mergeApplicationDefinition($mergeArgs = true)
+ public function mergeApplicationDefinition(bool $mergeArgs = true)
{
- if (null === $this->application || (true === $this->applicationDefinitionMerged && ($this->applicationDefinitionMergedWithArgs || !$mergeArgs))) {
+ if (null === $this->application) {
return;
}
- $this->definition->addOptions($this->application->getDefinition()->getOptions());
-
- if ($mergeArgs) {
- $currentArguments = $this->definition->getArguments();
- $this->definition->setArguments($this->application->getDefinition()->getArguments());
- $this->definition->addArguments($currentArguments);
- }
+ $this->fullDefinition = new InputDefinition();
+ $this->fullDefinition->setOptions($this->definition->getOptions());
+ $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions());
- $this->applicationDefinitionMerged = true;
if ($mergeArgs) {
- $this->applicationDefinitionMergedWithArgs = true;
+ $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments());
+ $this->fullDefinition->addArguments($this->definition->getArguments());
+ } else {
+ $this->fullDefinition->setArguments($this->definition->getArguments());
}
}
@@ -318,7 +379,7 @@ public function mergeApplicationDefinition($mergeArgs = true)
*
* @param array|InputDefinition $definition An array of argument and option instances or a definition instance
*
- * @return Command The current instance
+ * @return $this
*/
public function setDefinition($definition)
{
@@ -328,7 +389,7 @@ public function setDefinition($definition)
$this->definition->setDefinition($definition);
}
- $this->applicationDefinitionMerged = false;
+ $this->fullDefinition = null;
return $this;
}
@@ -336,11 +397,11 @@ public function setDefinition($definition)
/**
* Gets the InputDefinition attached to this Command.
*
- * @return InputDefinition An InputDefinition instance
+ * @return InputDefinition
*/
public function getDefinition()
{
- return $this->definition;
+ return $this->fullDefinition ?? $this->getNativeDefinition();
}
/**
@@ -351,26 +412,33 @@ public function getDefinition()
*
* This method is not part of public API and should not be used directly.
*
- * @return InputDefinition An InputDefinition instance
+ * @return InputDefinition
*/
public function getNativeDefinition()
{
- return $this->getDefinition();
+ if (null === $this->definition) {
+ throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class));
+ }
+
+ return $this->definition;
}
/**
* Adds an argument.
*
- * @param string $name The argument name
- * @param int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
- * @param string $description A description text
- * @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
+ * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
+ * @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
+ *
+ * @throws InvalidArgumentException When argument mode is not valid
*
- * @return Command The current instance
+ * @return $this
*/
- public function addArgument($name, $mode = null, $description = '', $default = null)
+ public function addArgument(string $name, int $mode = null, string $description = '', $default = null)
{
$this->definition->addArgument(new InputArgument($name, $mode, $description, $default));
+ if (null !== $this->fullDefinition) {
+ $this->fullDefinition->addArgument(new InputArgument($name, $mode, $description, $default));
+ }
return $this;
}
@@ -378,17 +446,20 @@ public function addArgument($name, $mode = null, $description = '', $default = n
/**
* Adds an option.
*
- * @param string $name The option name
- * @param string $shortcut The shortcut (can be null)
- * @param int $mode The option mode: One of the InputOption::VALUE_* constants
- * @param string $description A description text
- * @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
+ * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
+ * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
+ * @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
*
- * @return Command The current instance
+ * @throws InvalidArgumentException If option mode is invalid or incompatible
+ *
+ * @return $this
*/
- public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
+ public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
{
$this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
+ if (null !== $this->fullDefinition) {
+ $this->fullDefinition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
+ }
return $this;
}
@@ -401,13 +472,11 @@ public function addOption($name, $shortcut = null, $mode = null, $description =
*
* $command->setName('foo:bar');
*
- * @param string $name The command name
- *
- * @return Command The current instance
+ * @return $this
*
* @throws InvalidArgumentException When the name is invalid
*/
- public function setName($name)
+ public function setName(string $name)
{
$this->validateName($name);
@@ -422,13 +491,9 @@ public function setName($name)
* This feature should be used only when creating a long process command,
* like a daemon.
*
- * PHP 5.5+ or the proctitle PECL library is required
- *
- * @param string $title The process title
- *
- * @return Command The current instance
+ * @return $this
*/
- public function setProcessTitle($title)
+ public function setProcessTitle(string $title)
{
$this->processTitle = $title;
@@ -438,7 +503,7 @@ public function setProcessTitle($title)
/**
* Returns the command name.
*
- * @return string The command name
+ * @return string|null
*/
public function getName()
{
@@ -447,18 +512,21 @@ public function getName()
/**
* @param bool $hidden Whether or not the command should be hidden from the list of commands
+ * The default value will be true in Symfony 6.0
*
- * @return Command The current instance
+ * @return $this
+ *
+ * @final since Symfony 5.1
*/
- public function setHidden($hidden)
+ public function setHidden(bool $hidden /*= true*/)
{
- $this->hidden = (bool) $hidden;
+ $this->hidden = $hidden;
return $this;
}
/**
- * @return bool Whether the command should be publicly shown or not.
+ * @return bool whether the command should be publicly shown or not
*/
public function isHidden()
{
@@ -468,11 +536,9 @@ public function isHidden()
/**
* Sets the description for the command.
*
- * @param string $description The description for the command
- *
- * @return Command The current instance
+ * @return $this
*/
- public function setDescription($description)
+ public function setDescription(string $description)
{
$this->description = $description;
@@ -482,7 +548,7 @@ public function setDescription($description)
/**
* Returns the description for the command.
*
- * @return string The description for the command
+ * @return string
*/
public function getDescription()
{
@@ -492,11 +558,9 @@ public function getDescription()
/**
* Sets the help for the command.
*
- * @param string $help The help for the command
- *
- * @return Command The current instance
+ * @return $this
*/
- public function setHelp($help)
+ public function setHelp(string $help)
{
$this->help = $help;
@@ -506,7 +570,7 @@ public function setHelp($help)
/**
* Returns the help for the command.
*
- * @return string The help for the command
+ * @return string
*/
public function getHelp()
{
@@ -517,20 +581,21 @@ public function getHelp()
* Returns the processed help for the command replacing the %command.name% and
* %command.full_name% patterns with the real values dynamically.
*
- * @return string The processed help for the command
+ * @return string
*/
public function getProcessedHelp()
{
$name = $this->name;
+ $isSingleCommand = $this->application && $this->application->isSingleCommand();
- $placeholders = array(
+ $placeholders = [
'%command.name%',
'%command.full_name%',
- );
- $replacements = array(
+ ];
+ $replacements = [
$name,
- $_SERVER['PHP_SELF'].' '.$name,
- );
+ $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name,
+ ];
return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
}
@@ -540,21 +605,20 @@ public function getProcessedHelp()
*
* @param string[] $aliases An array of aliases for the command
*
- * @return Command The current instance
+ * @return $this
*
* @throws InvalidArgumentException When an alias is invalid
*/
- public function setAliases($aliases)
+ public function setAliases(iterable $aliases)
{
- if (!is_array($aliases) && !$aliases instanceof \Traversable) {
- throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
- }
+ $list = [];
foreach ($aliases as $alias) {
$this->validateName($alias);
+ $list[] = $alias;
}
- $this->aliases = $aliases;
+ $this->aliases = \is_array($aliases) ? $aliases : $list;
return $this;
}
@@ -562,7 +626,7 @@ public function setAliases($aliases)
/**
* Returns the aliases for the command.
*
- * @return array An array of aliases for the command
+ * @return array
*/
public function getAliases()
{
@@ -574,9 +638,9 @@ public function getAliases()
*
* @param bool $short Whether to show the short version of the synopsis (with options folded) or not
*
- * @return string The synopsis
+ * @return string
*/
- public function getSynopsis($short = false)
+ public function getSynopsis(bool $short = false)
{
$key = $short ? 'short' : 'long';
@@ -588,15 +652,13 @@ public function getSynopsis($short = false)
}
/**
- * Add a command usage example.
- *
- * @param string $usage The usage, it'll be prefixed with the command name
+ * Add a command usage example, it'll be prefixed with the command name.
*
- * @return Command The current instance
+ * @return $this
*/
- public function addUsage($usage)
+ public function addUsage(string $usage)
{
- if (0 !== strpos($usage, $this->name)) {
+ if (!str_starts_with($usage, $this->name)) {
$usage = sprintf('%s %s', $this->name, $usage);
}
@@ -618,14 +680,12 @@ public function getUsages()
/**
* Gets a helper instance by name.
*
- * @param string $name The helper name
- *
- * @return mixed The helper value
+ * @return mixed
*
* @throws LogicException if no HelperSet is defined
* @throws InvalidArgumentException if the helper is not defined
*/
- public function getHelper($name)
+ public function getHelper(string $name)
{
if (null === $this->helperSet) {
throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name));
@@ -639,11 +699,9 @@ public function getHelper($name)
*
* It must be non-empty and parts can optionally be separated by ":".
*
- * @param string $name
- *
* @throws InvalidArgumentException When the name is invalid
*/
- private function validateName($name)
+ private function validateName(string $name)
{
if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) {
throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
diff --git a/tests/integration/vendor/symfony/console/Command/CompleteCommand.php b/tests/integration/vendor/symfony/console/Command/CompleteCommand.php
new file mode 100644
index 000000000..97357d673
--- /dev/null
+++ b/tests/integration/vendor/symfony/console/Command/CompleteCommand.php
@@ -0,0 +1,204 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
+use Symfony\Component\Console\Completion\Output\BashCompletionOutput;
+use Symfony\Component\Console\Completion\Output\CompletionOutputInterface;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
+use Symfony\Component\Console\Exception\ExceptionInterface;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Responsible for providing the values to the shell completion.
+ *
+ * @author Wouter de Jong
+ */
+final class CompleteCommand extends Command
+{
+ protected static $defaultName = '|_complete';
+ protected static $defaultDescription = 'Internal command to provide shell completion suggestions';
+
+ private $completionOutputs;
+
+ private $isDebug = false;
+
+ /**
+ * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value
+ */
+ public function __construct(array $completionOutputs = [])
+ {
+ // must be set before the parent constructor, as the property value is used in configure()
+ $this->completionOutputs = $completionOutputs + ['bash' => BashCompletionOutput::class];
+
+ parent::__construct();
+ }
+
+ protected function configure(): void
+ {
+ $this
+ ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")')
+ ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)')
+ ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)')
+ ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script')
+ ;
+ }
+
+ protected function initialize(InputInterface $input, OutputInterface $output)
+ {
+ $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOLEAN);
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output): int
+ {
+ try {
+ // uncomment when a bugfix or BC break has been introduced in the shell completion scripts
+ //$version = $input->getOption('symfony');
+ //if ($version && version_compare($version, 'x.y', '>=')) {
+ // $message = sprintf('Completion script version is not supported ("%s" given, ">=x.y" required).', $version);
+ // $this->log($message);
+
+ // $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.');
+
+ // return 126;
+ //}
+
+ $shell = $input->getOption('shell');
+ if (!$shell) {
+ throw new \RuntimeException('The "--shell" option must be set.');
+ }
+
+ if (!$completionOutput = $this->completionOutputs[$shell] ?? false) {
+ throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs))));
+ }
+
+ $completionInput = $this->createCompletionInput($input);
+ $suggestions = new CompletionSuggestions();
+
+ $this->log([
+ '',
+ ''.date('Y-m-d H:i:s').'>',
+ 'Input:> ("|" indicates the cursor position)>',
+ ' '.(string) $completionInput,
+ 'Command:>',
+ ' '.(string) implode(' ', $_SERVER['argv']),
+ 'Messages:>',
+ ]);
+
+ $command = $this->findCommand($completionInput, $output);
+ if (null === $command) {
+ $this->log(' No command found, completing using the Application class.');
+
+ $this->getApplication()->complete($completionInput, $suggestions);
+ } elseif (
+ $completionInput->mustSuggestArgumentValuesFor('command')
+ && $command->getName() !== $completionInput->getCompletionValue()
+ ) {
+ $this->log(' No command found, completing using the Application class.');
+
+ // expand shortcut names ("cache:cl") into their full name ("cache:clear")
+ $suggestions->suggestValue($command->getName());
+ } else {
+ $command->mergeApplicationDefinition();
+ $completionInput->bind($command->getDefinition());
+
+ if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) {
+ $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).'> command.');
+
+ $suggestions->suggestOptions($command->getDefinition()->getOptions());
+ } else {
+ $this->log([
+ ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).'> class.',
+ ' Completing '.$completionInput->getCompletionType().'> for '.$completionInput->getCompletionName().'>',
+ ]);
+ if (null !== $compval = $completionInput->getCompletionValue()) {
+ $this->log(' Current value: '.$compval.'>');
+ }
+
+ $command->complete($completionInput, $suggestions);
+ }
+ }
+
+ /** @var CompletionOutputInterface $completionOutput */
+ $completionOutput = new $completionOutput();
+
+ $this->log('Suggestions:>');
+ if ($options = $suggestions->getOptionSuggestions()) {
+ $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options)));
+ } elseif ($values = $suggestions->getValueSuggestions()) {
+ $this->log(' '.implode(' ', $values));
+ } else {
+ $this->log(' No suggestions were provided>');
+ }
+
+ $completionOutput->write($suggestions, $output);
+ } catch (\Throwable $e) {
+ $this->log([
+ 'Error!',
+ (string) $e,
+ ]);
+
+ if ($output->isDebug()) {
+ throw $e;
+ }
+
+ return self::FAILURE;
+ }
+
+ return self::SUCCESS;
+ }
+
+ private function createCompletionInput(InputInterface $input): CompletionInput
+ {
+ $currentIndex = $input->getOption('current');
+ if (!$currentIndex || !ctype_digit($currentIndex)) {
+ throw new \RuntimeException('The "--current" option must be set and it must be an integer.');
+ }
+
+ $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex);
+
+ try {
+ $completionInput->bind($this->getApplication()->getDefinition());
+ } catch (ExceptionInterface $e) {
+ }
+
+ return $completionInput;
+ }
+
+ private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command
+ {
+ try {
+ $inputName = $completionInput->getFirstArgument();
+ if (null === $inputName) {
+ return null;
+ }
+
+ return $this->getApplication()->find($inputName);
+ } catch (CommandNotFoundException $e) {
+ }
+
+ return null;
+ }
+
+ private function log($messages): void
+ {
+ if (!$this->isDebug) {
+ return;
+ }
+
+ $commandName = basename($_SERVER['argv'][0]);
+ file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND);
+ }
+}
diff --git a/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php b/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php
new file mode 100644
index 000000000..64a800530
--- /dev/null
+++ b/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php
@@ -0,0 +1,133 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Process\Process;
+
+/**
+ * Dumps the completion script for the current shell.
+ *
+ * @author Wouter de Jong
+ */
+final class DumpCompletionCommand extends Command
+{
+ protected static $defaultName = 'completion';
+ protected static $defaultDescription = 'Dump the shell completion script';
+
+ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
+ {
+ if ($input->mustSuggestArgumentValuesFor('shell')) {
+ $suggestions->suggestValues($this->getSupportedShells());
+ }
+ }
+
+ protected function configure()
+ {
+ $fullCommand = $_SERVER['PHP_SELF'];
+ $commandName = basename($fullCommand);
+ $fullCommand = realpath($fullCommand) ?: $fullCommand;
+
+ $this
+ ->setHelp(<<%command.name%> command dumps the shell completion script required
+to use shell autocompletion (currently only bash completion is supported).
+
+Static installation
+------------------->
+
+Dump the script to a global completion file and restart your shell:
+
+ %command.full_name% bash | sudo tee /etc/bash_completion.d/${commandName}>
+
+Or dump the script to a local file and source it:
+
+ %command.full_name% bash > completion.sh>
+
+ # source the file whenever you use the project>
+ source completion.sh>
+
+ # or add this line at the end of your "~/.bashrc" file:>
+ source /path/to/completion.sh>
+
+Dynamic installation
+-------------------->
+
+Add this to the end of your shell configuration file (e.g. "~/.bashrc">):
+
+