Merge branch 'master' into release/produkcija

# Conflicts:
#	.gitignore
#	vendor/autoload.php
#	vendor/composer/ClassLoader.php
#	vendor/composer/LICENSE
#	vendor/composer/autoload_classmap.php
#	vendor/composer/autoload_files.php
#	vendor/composer/autoload_psr4.php
#	vendor/composer/autoload_real.php
#	vendor/composer/autoload_static.php
#	vendor/composer/installed.json
#	vendor/fgrosse/phpasn1/CHANGELOG.md
#	vendor/fgrosse/phpasn1/composer.json
#	vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php
#	vendor/geoip2/geoip2/CHANGELOG.md
#	vendor/geoip2/geoip2/composer.json
#	vendor/geoip2/geoip2/src/Database/Reader.php
#	vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php
#	vendor/geoip2/geoip2/src/Exception/AuthenticationException.php
#	vendor/geoip2/geoip2/src/Exception/GeoIp2Exception.php
#	vendor/geoip2/geoip2/src/Exception/HttpException.php
#	vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php
#	vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php
#	vendor/geoip2/geoip2/src/Model/AbstractModel.php
#	vendor/geoip2/geoip2/src/Model/AnonymousIp.php
#	vendor/geoip2/geoip2/src/Model/Asn.php
#	vendor/geoip2/geoip2/src/Model/City.php
#	vendor/geoip2/geoip2/src/Model/ConnectionType.php
#	vendor/geoip2/geoip2/src/Model/Country.php
#	vendor/geoip2/geoip2/src/Model/Domain.php
#	vendor/geoip2/geoip2/src/Model/Enterprise.php
#	vendor/geoip2/geoip2/src/Model/Insights.php
#	vendor/geoip2/geoip2/src/Model/Isp.php
#	vendor/geoip2/geoip2/src/ProviderInterface.php
#	vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php
#	vendor/geoip2/geoip2/src/Record/AbstractRecord.php
#	vendor/geoip2/geoip2/src/Record/City.php
#	vendor/geoip2/geoip2/src/Record/Continent.php
#	vendor/geoip2/geoip2/src/Record/Country.php
#	vendor/geoip2/geoip2/src/Record/Location.php
#	vendor/geoip2/geoip2/src/Record/MaxMind.php
#	vendor/geoip2/geoip2/src/Record/Postal.php
#	vendor/geoip2/geoip2/src/Record/RepresentedCountry.php
#	vendor/geoip2/geoip2/src/Record/Subdivision.php
#	vendor/geoip2/geoip2/src/Record/Traits.php
#	vendor/geoip2/geoip2/src/Util.php
#	vendor/geoip2/geoip2/src/WebService/Client.php
#	vendor/guzzlehttp/promises/CHANGELOG.md
#	vendor/guzzlehttp/promises/README.md
#	vendor/guzzlehttp/promises/composer.json
#	vendor/guzzlehttp/promises/src/AggregateException.php
#	vendor/guzzlehttp/promises/src/CancellationException.php
#	vendor/guzzlehttp/promises/src/Coroutine.php
#	vendor/guzzlehttp/promises/src/EachPromise.php
#	vendor/guzzlehttp/promises/src/FulfilledPromise.php
#	vendor/guzzlehttp/promises/src/Promise.php
#	vendor/guzzlehttp/promises/src/PromiseInterface.php
#	vendor/guzzlehttp/promises/src/PromisorInterface.php
#	vendor/guzzlehttp/promises/src/RejectedPromise.php
#	vendor/guzzlehttp/promises/src/RejectionException.php
#	vendor/guzzlehttp/promises/src/TaskQueue.php
#	vendor/guzzlehttp/promises/src/TaskQueueInterface.php
#	vendor/guzzlehttp/promises/src/functions.php
#	vendor/guzzlehttp/psr7/CHANGELOG.md
#	vendor/guzzlehttp/psr7/README.md
#	vendor/guzzlehttp/psr7/composer.json
#	vendor/guzzlehttp/psr7/src/AppendStream.php
#	vendor/guzzlehttp/psr7/src/BufferStream.php
#	vendor/guzzlehttp/psr7/src/CachingStream.php
#	vendor/guzzlehttp/psr7/src/DroppingStream.php
#	vendor/guzzlehttp/psr7/src/FnStream.php
#	vendor/guzzlehttp/psr7/src/InflateStream.php
#	vendor/guzzlehttp/psr7/src/LazyOpenStream.php
#	vendor/guzzlehttp/psr7/src/LimitStream.php
#	vendor/guzzlehttp/psr7/src/MessageTrait.php
#	vendor/guzzlehttp/psr7/src/MultipartStream.php
#	vendor/guzzlehttp/psr7/src/NoSeekStream.php
#	vendor/guzzlehttp/psr7/src/PumpStream.php
#	vendor/guzzlehttp/psr7/src/Request.php
#	vendor/guzzlehttp/psr7/src/Response.php
#	vendor/guzzlehttp/psr7/src/ServerRequest.php
#	vendor/guzzlehttp/psr7/src/Stream.php
#	vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php
#	vendor/guzzlehttp/psr7/src/StreamWrapper.php
#	vendor/guzzlehttp/psr7/src/UploadedFile.php
#	vendor/guzzlehttp/psr7/src/Uri.php
#	vendor/guzzlehttp/psr7/src/UriNormalizer.php
#	vendor/guzzlehttp/psr7/src/UriResolver.php
#	vendor/guzzlehttp/psr7/src/functions.php
#	vendor/maxmind-db/reader/CHANGELOG.md
#	vendor/maxmind-db/reader/composer.json
#	vendor/maxmind-db/reader/ext/maxminddb.c
#	vendor/maxmind-db/reader/ext/php_maxminddb.h
#	vendor/maxmind-db/reader/package.xml
#	vendor/maxmind/web-service-common/CHANGELOG.md
#	vendor/maxmind/web-service-common/README.md
#	vendor/maxmind/web-service-common/composer.json
#	vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php
#	vendor/maxmind/web-service-common/src/Exception/HttpException.php
#	vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php
#	vendor/maxmind/web-service-common/src/Exception/InvalidInputException.php
#	vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php
#	vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php
#	vendor/maxmind/web-service-common/src/Exception/PermissionRequiredException.php
#	vendor/maxmind/web-service-common/src/Exception/WebServiceException.php
#	vendor/maxmind/web-service-common/src/WebService/Client.php
#	vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php
#	vendor/maxmind/web-service-common/src/WebService/Http/Request.php
#	vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php
#	vendor/paragonie/random_compat/composer.json
#	vendor/paragonie/sodium_compat/.gitignore
#	vendor/paragonie/sodium_compat/composer.json
#	vendor/paragonie/sodium_compat/psalm-above-3.xml
#	vendor/paragonie/sodium_compat/src/Core/Ed25519.php
#	vendor/paragonie/sodium_compat/src/Core/SipHash.php
#	vendor/paragonie/sodium_compat/src/Core/Util.php
#	vendor/paragonie/sodium_compat/src/Core32/Ed25519.php
#	vendor/paragonie/sodium_compat/src/File.php
#	vendor/paragonie/sodium_compat/src/PHP52/SplFixedArray.php
#	vendor/phpmailer/phpmailer/README.md
#	vendor/phpmailer/phpmailer/VERSION
#	vendor/phpmailer/phpmailer/composer.json
#	vendor/phpmailer/phpmailer/get_oauth_token.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php
#	vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php
#	vendor/phpmailer/phpmailer/src/Exception.php
#	vendor/phpmailer/phpmailer/src/OAuth.php
#	vendor/phpmailer/phpmailer/src/PHPMailer.php
#	vendor/phpmailer/phpmailer/src/POP3.php
#	vendor/phpmailer/phpmailer/src/SMTP.php
#	vendor/spomky-labs/base64url/composer.json
#	vendor/stripe/stripe-php/CHANGELOG.md
#	vendor/stripe/stripe-php/VERSION
#	vendor/stripe/stripe-php/composer.json
#	vendor/stripe/stripe-php/init.php
#	vendor/stripe/stripe-php/lib/Account.php
#	vendor/stripe/stripe-php/lib/ApiRequestor.php
#	vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php
#	vendor/stripe/stripe-php/lib/Balance.php
#	vendor/stripe/stripe-php/lib/BalanceTransaction.php
#	vendor/stripe/stripe-php/lib/BaseStripeClient.php
#	vendor/stripe/stripe-php/lib/BitcoinReceiver.php
#	vendor/stripe/stripe-php/lib/Card.php
#	vendor/stripe/stripe-php/lib/Charge.php
#	vendor/stripe/stripe-php/lib/Checkout/Session.php
#	vendor/stripe/stripe-php/lib/Coupon.php
#	vendor/stripe/stripe-php/lib/CreditNote.php
#	vendor/stripe/stripe-php/lib/CreditNoteLineItem.php
#	vendor/stripe/stripe-php/lib/Customer.php
#	vendor/stripe/stripe-php/lib/ErrorObject.php
#	vendor/stripe/stripe-php/lib/Event.php
#	vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php
#	vendor/stripe/stripe-php/lib/Invoice.php
#	vendor/stripe/stripe-php/lib/InvoiceItem.php
#	vendor/stripe/stripe-php/lib/InvoiceLineItem.php
#	vendor/stripe/stripe-php/lib/Order.php
#	vendor/stripe/stripe-php/lib/PaymentIntent.php
#	vendor/stripe/stripe-php/lib/PaymentMethod.php
#	vendor/stripe/stripe-php/lib/Payout.php
#	vendor/stripe/stripe-php/lib/Plan.php
#	vendor/stripe/stripe-php/lib/PromotionCode.php
#	vendor/stripe/stripe-php/lib/Refund.php
#	vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php
#	vendor/stripe/stripe-php/lib/Service/CustomerService.php
#	vendor/stripe/stripe-php/lib/Service/InvoiceService.php
#	vendor/stripe/stripe-php/lib/Service/PayoutService.php
#	vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php
#	vendor/stripe/stripe-php/lib/Service/SubscriptionService.php
#	vendor/stripe/stripe-php/lib/SetupIntent.php
#	vendor/stripe/stripe-php/lib/Source.php
#	vendor/stripe/stripe-php/lib/Stripe.php
#	vendor/stripe/stripe-php/lib/StripeClient.php
#	vendor/stripe/stripe-php/lib/StripeObject.php
#	vendor/stripe/stripe-php/lib/Subscription.php
#	vendor/stripe/stripe-php/lib/TaxId.php
#	vendor/stripe/stripe-php/lib/TaxRate.php
#	vendor/stripe/stripe-php/lib/TransferReversal.php
#	vendor/stripe/stripe-php/lib/Util/ObjectTypes.php
#	vendor/stripe/stripe-php/lib/Util/Util.php
#	vendor/symfony/polyfill-intl-idn/Idn.php
#	vendor/symfony/polyfill-intl-idn/composer.json
#	vendor/symfony/polyfill-intl-normalizer/bootstrap.php
#	vendor/symfony/polyfill-intl-normalizer/composer.json
#	vendor/symfony/polyfill-php72/Php72.php
#	vendor/symfony/polyfill-php72/bootstrap.php
#	vendor/symfony/polyfill-php72/composer.json
This commit is contained in:
pero1203 2020-12-05 13:00:23 +01:00
commit 4cec48f127
235 changed files with 5880 additions and 68 deletions

5
.gitignore vendored
View File

@ -1,5 +1,10 @@
<<<<<<< HEAD
# Vendor folder - na produkciji vkljucimo vendor
##/vendor/
=======
# Vendor folder
#vendor/
>>>>>>> master
# DEV tools
.vscode/

123
composer.lock generated
View File

@ -1,10 +1,9 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"hash": "c9fc655cdb58743c38114c03e68c1cc7",
"content-hash": "a150435d7f20bef4fdda8cb6c59eb1a6",
"packages": [
{
@ -61,7 +60,7 @@
"ssl",
"tls"
],
"time": "2020-08-23 12:54:47"
"time": "2020-08-23T12:54:47+00:00"
},
{
"name": "fgrosse/phpasn1",
@ -132,7 +131,7 @@
"x509",
"x690"
],
"time": "2020-10-11 16:28:18"
"time": "2020-10-11T16:28:18+00:00"
},
{
"name": "geoip2/geoip2",
@ -185,7 +184,7 @@
"geolocation",
"maxmind"
],
"time": "2020-10-01 18:48:34"
"time": "2020-10-01T18:48:34+00:00"
},
{
"name": "guzzlehttp/guzzle",
@ -252,7 +251,7 @@
"rest",
"web service"
],
"time": "2020-06-16 21:01:06"
"time": "2020-06-16T21:01:06+00:00"
},
{
"name": "guzzlehttp/promises",
@ -303,7 +302,7 @@
"keywords": [
"promise"
],
"time": "2020-09-30 07:37:28"
"time": "2020-09-30T07:37:28+00:00"
},
{
"name": "guzzlehttp/psr7",
@ -374,7 +373,7 @@
"uri",
"url"
],
"time": "2020-09-30 07:37:11"
"time": "2020-09-30T07:37:11+00:00"
},
{
"name": "maxmind-db/reader",
@ -434,7 +433,7 @@
"geolocation",
"maxmind"
],
"time": "2020-10-01 17:30:21"
"time": "2020-10-01T17:30:21+00:00"
},
{
"name": "maxmind/web-service-common",
@ -480,7 +479,7 @@
],
"description": "Internal MaxMind Web Service API",
"homepage": "https://github.com/maxmind/web-service-common-php",
"time": "2020-11-02 17:00:53"
"time": "2020-11-02T17:00:53+00:00"
},
{
"name": "minishlink/web-push",
@ -536,7 +535,7 @@
"push",
"web"
],
"time": "2020-08-02 08:58:01"
"time": "2020-08-02T08:58:01+00:00"
},
{
"name": "paragonie/random_compat",
@ -581,20 +580,20 @@
"pseudorandom",
"random"
],
"time": "2020-10-15 08:29:30"
"time": "2020-10-15T08:29:30+00:00"
},
{
"name": "paragonie/sodium_compat",
"version": "v1.13.0",
"version": "v1.14.0",
"source": {
"type": "git",
"url": "https://github.com/paragonie/sodium_compat.git",
"reference": "bbade402cbe84c69b718120911506a3aa2bae653"
"reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bbade402cbe84c69b718120911506a3aa2bae653",
"reference": "bbade402cbe84c69b718120911506a3aa2bae653",
"url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3",
"reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3",
"shasum": ""
},
"require": {
@ -602,7 +601,7 @@
"php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8"
},
"require-dev": {
"phpunit/phpunit": "^3|^4|^5|^6|^7"
"phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9"
},
"suggest": {
"ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.",
@ -663,7 +662,7 @@
"secret-key cryptography",
"side-channel resistant"
],
"time": "2020-03-20 21:48:09"
"time": "2020-12-03T16:26:19+00:00"
},
{
"name": "paypal/paypal-checkout-sdk",
@ -712,7 +711,7 @@
"rest",
"sdk"
],
"time": "2019-11-07 23:16:44"
"time": "2019-11-07T23:16:44+00:00"
},
{
"name": "paypal/paypalhttp",
@ -751,21 +750,20 @@
"homepage": "https://github.com/paypal/paypalhttp_php/contributors"
}
],
"abandoned": true,
"time": "2019-11-06 21:27:12"
"time": "2019-11-06T21:27:12+00:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v6.1.8",
"version": "v6.2.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1"
"reference": "e38888a75c070304ca5514197d4847a59a5c853f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/917ab212fa00dc6eacbb26e8bc387ebe40993bc1",
"reference": "917ab212fa00dc6eacbb26e8bc387ebe40993bc1",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e38888a75c070304ca5514197d4847a59a5c853f",
"reference": "e38888a75c070304ca5514197d4847a59a5c853f",
"shasum": ""
},
"require": {
@ -775,9 +773,12 @@
"php": ">=5.5.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2",
"phpunit/phpunit": "^4.8 || ^5.7"
"phpcompatibility/php-compatibility": "^9.3.5",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5.6",
"yoast/phpunit-polyfills": "^0.2.0"
},
"suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset",
@ -815,7 +816,7 @@
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2020-10-09 14:55:58"
"time": "2020-11-25T15:24:57+00:00"
},
{
"name": "psr/http-message",
@ -865,7 +866,7 @@
"request",
"response"
],
"time": "2016-08-06 14:39:51"
"time": "2016-08-06T14:39:51+00:00"
},
{
"name": "ralouphie/getallheaders",
@ -905,7 +906,7 @@
}
],
"description": "A polyfill for getallheaders.",
"time": "2019-03-08 08:55:37"
"time": "2019-03-08T08:55:37+00:00"
},
{
"name": "sonata-project/google-authenticator",
@ -962,7 +963,7 @@
"keywords": [
"google authenticator"
],
"time": "2018-07-18 22:08:02"
"time": "2018-07-18T22:08:02+00:00"
},
{
"name": "spomky-labs/base64url",
@ -1013,20 +1014,20 @@
"safe",
"url"
],
"time": "2020-11-03 09:10:25"
"time": "2020-11-03T09:10:25+00:00"
},
{
"name": "stripe/stripe-php",
"version": "v7.61.0",
"version": "v7.66.1",
"source": {
"type": "git",
"url": "https://github.com/stripe/stripe-php.git",
"reference": "51c6cd18cb51740101c940a3fefc876ef7cd8cae"
"reference": "a2ebaa272a8797b21e81afaf8d5ba0953ff15e13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/51c6cd18cb51740101c940a3fefc876ef7cd8cae",
"reference": "51c6cd18cb51740101c940a3fefc876ef7cd8cae",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/a2ebaa272a8797b21e81afaf8d5ba0953ff15e13",
"reference": "a2ebaa272a8797b21e81afaf8d5ba0953ff15e13",
"shasum": ""
},
"require": {
@ -1036,7 +1037,7 @@
"php": ">=5.6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.16.1",
"friendsofphp/php-cs-fixer": "2.16.5",
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.3",
@ -1070,7 +1071,7 @@
"payment processing",
"stripe"
],
"time": "2020-10-20 20:01:45"
"time": "2020-12-01T18:44:12+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
@ -1140,7 +1141,7 @@
"portable",
"shim"
],
"time": "2020-10-23 14:02:19"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@ -1207,7 +1208,7 @@
"portable",
"shim"
],
"time": "2020-10-23 14:02:19"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/polyfill-php72",
@ -1266,7 +1267,7 @@
"portable",
"shim"
],
"time": "2020-10-23 14:02:19"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "web-token/jwt-core",
@ -1341,7 +1342,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-key-mgmt",
@ -1418,7 +1419,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-signature",
@ -1498,7 +1499,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-signature-algorithm-ecdsa",
@ -1565,7 +1566,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-signature-algorithm-eddsa",
@ -1632,7 +1633,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-signature-algorithm-hmac",
@ -1699,7 +1700,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-signature-algorithm-none",
@ -1766,7 +1767,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-signature-algorithm-rsa",
@ -1833,7 +1834,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
},
{
"name": "web-token/jwt-util-ecc",
@ -1902,7 +1903,7 @@
"jwt",
"symfony"
],
"time": "2020-03-20 13:29:04"
"time": "2020-03-20T13:29:04+00:00"
}
],
"packages-dev": [
@ -1965,7 +1966,7 @@
"throwable",
"whoops"
],
"time": "2020-11-01 12:00:00"
"time": "2020-11-01T12:00:00+00:00"
},
{
"name": "kint-php/kint",
@ -2016,7 +2017,7 @@
"kint",
"php"
],
"time": "2017-01-15 14:23:43"
"time": "2017-01-15T14:23:43+00:00"
},
{
"name": "maximebf/debugbar",
@ -2077,7 +2078,7 @@
"debug",
"debugbar"
],
"time": "2020-05-06 07:06:27"
"time": "2020-05-06T07:06:27+00:00"
},
{
"name": "psr/log",
@ -2124,7 +2125,7 @@
"psr",
"psr-3"
],
"time": "2020-03-23 09:12:05"
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@ -2187,7 +2188,7 @@
"portable",
"shim"
],
"time": "2020-10-23 14:02:19"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/polyfill-php80",
@ -2253,20 +2254,20 @@
"portable",
"shim"
],
"time": "2020-10-23 14:02:19"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v4.4.16",
"version": "v4.4.17",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "3718e18b68d955348ad860e505991802c09f5f73"
"reference": "65c6f1e848cda840ef7278686c8e30a7cc353c93"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/3718e18b68d955348ad860e505991802c09f5f73",
"reference": "3718e18b68d955348ad860e505991802c09f5f73",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/65c6f1e848cda840ef7278686c8e30a7cc353c93",
"reference": "65c6f1e848cda840ef7278686c8e30a7cc353c93",
"shasum": ""
},
"require": {
@ -2325,7 +2326,7 @@
"debug",
"dump"
],
"time": "2020-10-26 20:47:51"
"time": "2020-11-24T09:55:37+00:00"
}
],
"aliases": [],

6
vendor/autoload.php vendored
View File

@ -2,6 +2,12 @@
// autoload.php @generated by Composer
<<<<<<< HEAD
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a::getLoader();
=======
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit0d06eb1022200eb96b7e4bb652ca3996::getLoader();
>>>>>>> master

View File

@ -53,8 +53,14 @@ class ClassLoader
private $useIncludePath = false;
private $classMap = array();
<<<<<<< HEAD
private $classMapAuthoritative = false;
=======
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
>>>>>>> master
public function getPrefixes()
{
@ -272,6 +278,29 @@ class ClassLoader
}
/**
<<<<<<< HEAD
=======
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
>>>>>>> master
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
@ -313,22 +342,38 @@ class ClassLoader
*/
public function findFile($class)
{
<<<<<<< HEAD
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
=======
>>>>>>> master
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
<<<<<<< HEAD
if ($this->classMapAuthoritative) {
return false;
}
=======
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
>>>>>>> master
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
<<<<<<< HEAD
if ($file === null && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
@ -336,6 +381,19 @@ class ClassLoader
if ($file === null) {
// Remember that this class does not exist.
return $this->classMap[$class] = false;
=======
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
>>>>>>> master
}
return $file;
@ -348,10 +406,21 @@ class ClassLoader
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
<<<<<<< HEAD
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
if (0 === strpos($class, $prefix)) {
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
=======
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
>>>>>>> master
return $file;
}
}
@ -399,6 +468,11 @@ class ClassLoader
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
<<<<<<< HEAD
=======
return false;
>>>>>>> master
}
}

View File

@ -1,5 +1,9 @@
<<<<<<< HEAD
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
=======
Copyright (c) Nils Adermann, Jordi Boggiano
>>>>>>> master
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -54,12 +54,18 @@ return array(
'App\\Controllers\\Vprasanja\\TextController' => $baseDir . '/main/survey/app/Controllers/Vprasanja/TextController.php',
'App\\Controllers\\Vprasanja\\VprasanjaController' => $baseDir . '/main/survey/app/Controllers/Vprasanja/VprasanjaController.php',
'App\\Controllers\\Vprasanja\\VsotaController' => $baseDir . '/main/survey/app/Controllers/Vprasanja/VsotaController.php',
<<<<<<< HEAD
'App\\Controllers\\Vprasanja\\in' => $baseDir . '/main/survey/app/Controllers/Vprasanja/MultigridController.php',
'App\\Models\\Model' => $baseDir . '/main/survey/app/Models/Model.php',
'App\\Models\\SaveSurvey' => $baseDir . '/main/survey/app/Models/SaveSurvey.php',
'App\\Models\\User' => $baseDir . '/main/survey/app/Models/User.php',
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
=======
'App\\Models\\Model' => $baseDir . '/main/survey/app/Models/Model.php',
'App\\Models\\SaveSurvey' => $baseDir . '/main/survey/app/Models/SaveSurvey.php',
'App\\Models\\User' => $baseDir . '/main/survey/app/Models/User.php',
>>>>>>> master
'Base64Url\\Base64Url' => $vendorDir . '/spomky-labs/base64url/src/Base64Url.php',
'BesediloLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php',
'BesediloXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/BesediloXml.php',
@ -67,15 +73,22 @@ return array(
'BranchingAjax' => $baseDir . '/admin/survey/BranchingAjax.php',
'Cache' => $baseDir . '/admin/survey/classes/class.Cache.php',
'CheckboxXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/CheckboxXml.php',
<<<<<<< HEAD
'CollectIncrementalData' => $baseDir . '/admin/survey/classes/surveyData/old/class.CollectIncrementalData.php',
=======
>>>>>>> master
'Common' => $baseDir . '/admin/survey/classes/class.Common.php',
'Composer\\CaBundle\\CaBundle' => $vendorDir . '/composer/ca-bundle/src/CaBundle.php',
'CrossRoad' => $baseDir . '/admin/survey/classes/CrossRoad.php',
'DatumLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php',
'Demografija' => $baseDir . '/admin/survey/classes/class.Demografija.php',
<<<<<<< HEAD
'DivisionByZeroError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
'Dostop' => $baseDir . '/admin/survey/classes/class.Dostop.php',
'Error' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/Error.php',
=======
'Dostop' => $baseDir . '/admin/survey/classes/class.Dostop.php',
>>>>>>> master
'Evalvacija' => $baseDir . '/admin/survey/modules/Evalvacija/class.Evalvacija.php',
'EvoliForm' => $baseDir . '/admin/survey/modules/mod_EVOLI/class.EvoliForm.php',
'ExclusiveLock' => $baseDir . '/admin/survey/classes/surveyData/class.ExclusiveLock.php',
@ -206,8 +219,16 @@ return array(
'GuzzleHttp\\Promise\\AggregateException' => $vendorDir . '/guzzlehttp/promises/src/AggregateException.php',
'GuzzleHttp\\Promise\\CancellationException' => $vendorDir . '/guzzlehttp/promises/src/CancellationException.php',
'GuzzleHttp\\Promise\\Coroutine' => $vendorDir . '/guzzlehttp/promises/src/Coroutine.php',
<<<<<<< HEAD
'GuzzleHttp\\Promise\\EachPromise' => $vendorDir . '/guzzlehttp/promises/src/EachPromise.php',
'GuzzleHttp\\Promise\\FulfilledPromise' => $vendorDir . '/guzzlehttp/promises/src/FulfilledPromise.php',
=======
'GuzzleHttp\\Promise\\Create' => $vendorDir . '/guzzlehttp/promises/src/Create.php',
'GuzzleHttp\\Promise\\Each' => $vendorDir . '/guzzlehttp/promises/src/Each.php',
'GuzzleHttp\\Promise\\EachPromise' => $vendorDir . '/guzzlehttp/promises/src/EachPromise.php',
'GuzzleHttp\\Promise\\FulfilledPromise' => $vendorDir . '/guzzlehttp/promises/src/FulfilledPromise.php',
'GuzzleHttp\\Promise\\Is' => $vendorDir . '/guzzlehttp/promises/src/Is.php',
>>>>>>> master
'GuzzleHttp\\Promise\\Promise' => $vendorDir . '/guzzlehttp/promises/src/Promise.php',
'GuzzleHttp\\Promise\\PromiseInterface' => $vendorDir . '/guzzlehttp/promises/src/PromiseInterface.php',
'GuzzleHttp\\Promise\\PromisorInterface' => $vendorDir . '/guzzlehttp/promises/src/PromisorInterface.php',
@ -215,11 +236,16 @@ return array(
'GuzzleHttp\\Promise\\RejectionException' => $vendorDir . '/guzzlehttp/promises/src/RejectionException.php',
'GuzzleHttp\\Promise\\TaskQueue' => $vendorDir . '/guzzlehttp/promises/src/TaskQueue.php',
'GuzzleHttp\\Promise\\TaskQueueInterface' => $vendorDir . '/guzzlehttp/promises/src/TaskQueueInterface.php',
<<<<<<< HEAD
=======
'GuzzleHttp\\Promise\\Utils' => $vendorDir . '/guzzlehttp/promises/src/Utils.php',
>>>>>>> master
'GuzzleHttp\\Psr7\\AppendStream' => $vendorDir . '/guzzlehttp/psr7/src/AppendStream.php',
'GuzzleHttp\\Psr7\\BufferStream' => $vendorDir . '/guzzlehttp/psr7/src/BufferStream.php',
'GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php',
'GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php',
'GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php',
<<<<<<< HEAD
'GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php',
'GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php',
'GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php',
@ -227,6 +253,19 @@ return array(
'GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php',
'GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php',
'GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php',
=======
'GuzzleHttp\\Psr7\\Header' => $vendorDir . '/guzzlehttp/psr7/src/Header.php',
'GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php',
'GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php',
'GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php',
'GuzzleHttp\\Psr7\\Message' => $vendorDir . '/guzzlehttp/psr7/src/Message.php',
'GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php',
'GuzzleHttp\\Psr7\\MimeType' => $vendorDir . '/guzzlehttp/psr7/src/MimeType.php',
'GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php',
'GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php',
'GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php',
'GuzzleHttp\\Psr7\\Query' => $vendorDir . '/guzzlehttp/psr7/src/Query.php',
>>>>>>> master
'GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php',
'GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php',
'GuzzleHttp\\Psr7\\Rfc7230' => $vendorDir . '/guzzlehttp/psr7/src/Rfc7230.php',
@ -238,6 +277,10 @@ return array(
'GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php',
'GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php',
'GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php',
<<<<<<< HEAD
=======
'GuzzleHttp\\Psr7\\Utils' => $vendorDir . '/guzzlehttp/psr7/src/Utils.php',
>>>>>>> master
'GuzzleHttp\\RedirectMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RedirectMiddleware.php',
'GuzzleHttp\\RequestOptions' => $vendorDir . '/guzzlehttp/guzzle/src/RequestOptions.php',
'GuzzleHttp\\RetryMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RetryMiddleware.php',
@ -606,7 +649,10 @@ return array(
'PHPMailer\\PHPMailer\\PHPMailer' => $vendorDir . '/phpmailer/phpmailer/src/PHPMailer.php',
'PHPMailer\\PHPMailer\\POP3' => $vendorDir . '/phpmailer/phpmailer/src/POP3.php',
'PHPMailer\\PHPMailer\\SMTP' => $vendorDir . '/phpmailer/phpmailer/src/SMTP.php',
<<<<<<< HEAD
'ParseError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
=======
>>>>>>> master
'PayPalCheckoutSdk\\Core\\AccessToken' => $vendorDir . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php',
'PayPalCheckoutSdk\\Core\\AccessTokenRequest' => $vendorDir . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php',
'PayPalCheckoutSdk\\Core\\AuthorizationInjector' => $vendorDir . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php',
@ -673,7 +719,10 @@ return array(
'Sample\\PatchOrder' => $vendorDir . '/paypal/paypal-checkout-sdk/samples/PatchOrder.php',
'Sample\\PayPalClient' => $vendorDir . '/paypal/paypal-checkout-sdk/samples/PayPalClient.php',
'Sample\\RefundOrder' => $vendorDir . '/paypal/paypal-checkout-sdk/samples/RefundOrder.php',
<<<<<<< HEAD
'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
=======
>>>>>>> master
'Setting' => $baseDir . '/admin/survey/classes/class.Setting.php',
'Sonata\\GoogleAuthenticator\\FixedBitNotation' => $vendorDir . '/sonata-project/google-authenticator/src/FixedBitNotation.php',
'Sonata\\GoogleAuthenticator\\GoogleAuthenticator' => $vendorDir . '/sonata-project/google-authenticator/src/GoogleAuthenticator.php',
@ -838,6 +887,10 @@ return array(
'Stripe\\Service\\Reporting\\ReportTypeService' => $vendorDir . '/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php',
'Stripe\\Service\\Reporting\\ReportingServiceFactory' => $vendorDir . '/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php',
'Stripe\\Service\\ReviewService' => $vendorDir . '/stripe/stripe-php/lib/Service/ReviewService.php',
<<<<<<< HEAD
=======
'Stripe\\Service\\SetupAttemptService' => $vendorDir . '/stripe/stripe-php/lib/Service/SetupAttemptService.php',
>>>>>>> master
'Stripe\\Service\\SetupIntentService' => $vendorDir . '/stripe/stripe-php/lib/Service/SetupIntentService.php',
'Stripe\\Service\\Sigma\\ScheduledQueryRunService' => $vendorDir . '/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php',
'Stripe\\Service\\Sigma\\SigmaServiceFactory' => $vendorDir . '/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php',
@ -855,6 +908,10 @@ return array(
'Stripe\\Service\\TopupService' => $vendorDir . '/stripe/stripe-php/lib/Service/TopupService.php',
'Stripe\\Service\\TransferService' => $vendorDir . '/stripe/stripe-php/lib/Service/TransferService.php',
'Stripe\\Service\\WebhookEndpointService' => $vendorDir . '/stripe/stripe-php/lib/Service/WebhookEndpointService.php',
<<<<<<< HEAD
=======
'Stripe\\SetupAttempt' => $vendorDir . '/stripe/stripe-php/lib/SetupAttempt.php',
>>>>>>> master
'Stripe\\SetupIntent' => $vendorDir . '/stripe/stripe-php/lib/SetupIntent.php',
'Stripe\\Sigma\\ScheduledQueryRun' => $vendorDir . '/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php',
'Stripe\\SingletonApiResource' => $vendorDir . '/stripe/stripe-php/lib/SingletonApiResource.php',
@ -923,7 +980,10 @@ return array(
'SurveyDataFile' => $baseDir . '/admin/survey/classes/surveyData/class.SurveyDataFile.php',
'SurveyDataSettingProfiles' => $baseDir . '/admin/survey/classes/class.SurveyDataSettingProfiles.php',
'SurveyDiagnostics' => $baseDir . '/admin/survey/classes/class.SurveyDiagnostics.php',
<<<<<<< HEAD
'SurveyDisplayData' => $baseDir . '/admin/survey/classes/surveyData/old/class.SurveyDisplayData.php',
=======
>>>>>>> master
'SurveyEditsAnalysis' => $baseDir . '/admin/survey/classes/class.SurveyEditsAnalysis.php',
'SurveyEmployMeter' => $baseDir . '/admin/survey/modules/mod_EVOLI/class.SurveyEmployMeter.php',
'SurveyEvoli' => $baseDir . '/admin/survey/modules/mod_EVOLI/class.SurveyEvoli.php',
@ -964,7 +1024,10 @@ return array(
'SurveyRecoding' => $baseDir . '/admin/survey/classes/class.SurveyRecoding.php',
'SurveyReminderTracking' => $baseDir . '/admin/survey/classes/class.SurveyReminderTracking.php',
'SurveyRespondents' => $baseDir . '/admin/survey/classes/class.SurveyRespondents.php',
<<<<<<< HEAD
'SurveySNDataFile' => $baseDir . '/admin/survey/classes/surveyData/old/class.SurveySNDataFile.php',
=======
>>>>>>> master
'SurveySession' => $baseDir . '/admin/survey/classes/class.SurveySession.php',
'SurveySessionDestructor' => $baseDir . '/admin/survey/classes/class.SurveySession.php',
'SurveySetting' => $baseDir . '/admin/survey/classes/class.SurveySetting.php',
@ -985,7 +1048,10 @@ return array(
'SurveyTheme' => $baseDir . '/admin/survey/classes/class.SurveyTheme.php',
'SurveyThemeEditor' => $baseDir . '/admin/survey/classes/class.SurveyThemeEditor.php',
'SurveyTimeProfiles' => $baseDir . '/admin/survey/classes/class.SurveyTimeProfiles.php',
<<<<<<< HEAD
'SurveyTrackIncremental' => $baseDir . '/admin/survey/classes/surveyData/old/class.SurveyTrackIncremental.php',
=======
>>>>>>> master
'SurveyUnsubscribe' => $baseDir . '/admin/survey/classes/class.SurveyUnsubscribe.php',
'SurveyUporabnost' => $baseDir . '/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php',
'SurveyUrlLinks' => $baseDir . '/admin/survey/classes/class.SurveyUrlLinks.php',
@ -1002,11 +1068,17 @@ return array(
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\DisallowedRanges' => $vendorDir . '/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php',
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\Regex' => $vendorDir . '/symfony/polyfill-intl-idn/Resources/unidata/Regex.php',
'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Normalizer.php',
<<<<<<< HEAD
'Symfony\\Polyfill\\Php70\\Php70' => $vendorDir . '/symfony/polyfill-php70/Php70.php',
'Symfony\\Polyfill\\Php72\\Php72' => $vendorDir . '/symfony/polyfill-php72/Php72.php',
'Timer' => $baseDir . '/admin/survey/classes/class.Timer.php',
'TrackingClass' => $baseDir . '/admin/survey/classes/TrackingClass.php',
'TypeError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
=======
'Symfony\\Polyfill\\Php72\\Php72' => $vendorDir . '/symfony/polyfill-php72/Php72.php',
'Timer' => $baseDir . '/admin/survey/classes/class.Timer.php',
'TrackingClass' => $baseDir . '/admin/survey/classes/TrackingClass.php',
>>>>>>> master
'User' => $baseDir . '/admin/survey/classes/class.User.php',
'UserAccess' => $baseDir . '/frontend/payments/classes/class.UserAccess.php',
'UserNarocila' => $baseDir . '/frontend/payments/classes/class.UserNarocila.php',

View File

@ -7,12 +7,20 @@ $baseDir = dirname($vendorDir);
return array(
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
<<<<<<< HEAD
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
'023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
=======
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
>>>>>>> master
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'2bf0564df058fbe21b5554296cc8571a' => $baseDir . '/main/survey/class.EvalvacijaMain.php',

View File

@ -7,7 +7,10 @@ $baseDir = dirname($vendorDir);
return array(
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
<<<<<<< HEAD
'Symfony\\Polyfill\\Php70\\' => array($vendorDir . '/symfony/polyfill-php70'),
=======
>>>>>>> master
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
'Stripe\\' => array($vendorDir . '/stripe/stripe-php/lib'),
@ -21,7 +24,11 @@ return array(
'MaxMind\\WebService\\' => array($vendorDir . '/maxmind/web-service-common/src/WebService'),
'MaxMind\\Exception\\' => array($vendorDir . '/maxmind/web-service-common/src/Exception'),
'MaxMind\\Db\\' => array($vendorDir . '/maxmind-db/reader/src/MaxMind/Db'),
<<<<<<< HEAD
'Jose\\Component\\Signature\\Algorithm\\' => array($vendorDir . '/web-token/jwt-signature-algorithm-rsa', $vendorDir . '/web-token/jwt-signature-algorithm-none', $vendorDir . '/web-token/jwt-signature-algorithm-hmac', $vendorDir . '/web-token/jwt-signature-algorithm-eddsa', $vendorDir . '/web-token/jwt-signature-algorithm-ecdsa'),
=======
'Jose\\Component\\Signature\\Algorithm\\' => array($vendorDir . '/web-token/jwt-signature-algorithm-ecdsa', $vendorDir . '/web-token/jwt-signature-algorithm-eddsa', $vendorDir . '/web-token/jwt-signature-algorithm-hmac', $vendorDir . '/web-token/jwt-signature-algorithm-none', $vendorDir . '/web-token/jwt-signature-algorithm-rsa'),
>>>>>>> master
'Jose\\Component\\Signature\\' => array($vendorDir . '/web-token/jwt-signature'),
'Jose\\Component\\KeyManagement\\' => array($vendorDir . '/web-token/jwt-key-mgmt'),
'Jose\\Component\\Core\\Util\\Ecc\\' => array($vendorDir . '/web-token/jwt-util-ecc'),

View File

@ -2,7 +2,11 @@
// autoload_real.php @generated by Composer
<<<<<<< HEAD
class ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a
=======
class ComposerAutoloaderInit0d06eb1022200eb96b7e4bb652ca3996
>>>>>>> master
{
private static $loader;
@ -19,6 +23,7 @@ class ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a
return self::$loader;
}
<<<<<<< HEAD
spl_autoload_register(array('ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a', 'loadClassLoader'));
@ -28,6 +33,17 @@ class ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a::getInitializer($loader));
=======
spl_autoload_register(array('ComposerAutoloaderInit0d06eb1022200eb96b7e4bb652ca3996', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit0d06eb1022200eb96b7e4bb652ca3996', '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';
call_user_func(\Composer\Autoload\ComposerStaticInit0d06eb1022200eb96b7e4bb652ca3996::getInitializer($loader));
>>>>>>> master
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -48,19 +64,31 @@ class ComposerAutoloaderInit817d358f3360c5248956ccfb4ef6d09a
$loader->register(true);
if ($useStaticLoader) {
<<<<<<< HEAD
$includeFiles = Composer\Autoload\ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a::$files;
=======
$includeFiles = Composer\Autoload\ComposerStaticInit0d06eb1022200eb96b7e4bb652ca3996::$files;
>>>>>>> master
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
<<<<<<< HEAD
composerRequire817d358f3360c5248956ccfb4ef6d09a($fileIdentifier, $file);
=======
composerRequire0d06eb1022200eb96b7e4bb652ca3996($fileIdentifier, $file);
>>>>>>> master
}
return $loader;
}
}
<<<<<<< HEAD
function composerRequire817d358f3360c5248956ccfb4ef6d09a($fileIdentifier, $file)
=======
function composerRequire0d06eb1022200eb96b7e4bb652ca3996($fileIdentifier, $file)
>>>>>>> master
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,6 +4,7 @@
namespace Composer\Autoload;
<<<<<<< HEAD
class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
{
public static $files = array (
@ -14,6 +15,17 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
=======
class ComposerStaticInit0d06eb1022200eb96b7e4bb652ca3996
{
public static $files = array (
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
>>>>>>> master
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'2bf0564df058fbe21b5554296cc8571a' => __DIR__ . '/../..' . '/main/survey/class.EvalvacijaMain.php',
@ -29,7 +41,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'S' =>
array (
'Symfony\\Polyfill\\Php72\\' => 23,
<<<<<<< HEAD
'Symfony\\Polyfill\\Php70\\' => 23,
=======
>>>>>>> master
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
'Stripe\\' => 7,
@ -93,10 +108,13 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
),
<<<<<<< HEAD
'Symfony\\Polyfill\\Php70\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php70',
),
=======
>>>>>>> master
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
@ -151,11 +169,19 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
),
'Jose\\Component\\Signature\\Algorithm\\' =>
array (
<<<<<<< HEAD
0 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa',
1 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-none',
2 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-hmac',
3 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-eddsa',
4 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa',
=======
0 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa',
1 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-eddsa',
2 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-hmac',
3 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-none',
4 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa',
>>>>>>> master
),
'Jose\\Component\\Signature\\' =>
array (
@ -264,12 +290,18 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'App\\Controllers\\Vprasanja\\TextController' => __DIR__ . '/../..' . '/main/survey/app/Controllers/Vprasanja/TextController.php',
'App\\Controllers\\Vprasanja\\VprasanjaController' => __DIR__ . '/../..' . '/main/survey/app/Controllers/Vprasanja/VprasanjaController.php',
'App\\Controllers\\Vprasanja\\VsotaController' => __DIR__ . '/../..' . '/main/survey/app/Controllers/Vprasanja/VsotaController.php',
<<<<<<< HEAD
'App\\Controllers\\Vprasanja\\in' => __DIR__ . '/../..' . '/main/survey/app/Controllers/Vprasanja/MultigridController.php',
'App\\Models\\Model' => __DIR__ . '/../..' . '/main/survey/app/Models/Model.php',
'App\\Models\\SaveSurvey' => __DIR__ . '/../..' . '/main/survey/app/Models/SaveSurvey.php',
'App\\Models\\User' => __DIR__ . '/../..' . '/main/survey/app/Models/User.php',
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
=======
'App\\Models\\Model' => __DIR__ . '/../..' . '/main/survey/app/Models/Model.php',
'App\\Models\\SaveSurvey' => __DIR__ . '/../..' . '/main/survey/app/Models/SaveSurvey.php',
'App\\Models\\User' => __DIR__ . '/../..' . '/main/survey/app/Models/User.php',
>>>>>>> master
'Base64Url\\Base64Url' => __DIR__ . '/..' . '/spomky-labs/base64url/src/Base64Url.php',
'BesediloLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php',
'BesediloXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/BesediloXml.php',
@ -277,15 +309,22 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'BranchingAjax' => __DIR__ . '/../..' . '/admin/survey/BranchingAjax.php',
'Cache' => __DIR__ . '/../..' . '/admin/survey/classes/class.Cache.php',
'CheckboxXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/CheckboxXml.php',
<<<<<<< HEAD
'CollectIncrementalData' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/old/class.CollectIncrementalData.php',
=======
>>>>>>> master
'Common' => __DIR__ . '/../..' . '/admin/survey/classes/class.Common.php',
'Composer\\CaBundle\\CaBundle' => __DIR__ . '/..' . '/composer/ca-bundle/src/CaBundle.php',
'CrossRoad' => __DIR__ . '/../..' . '/admin/survey/classes/CrossRoad.php',
'DatumLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php',
'Demografija' => __DIR__ . '/../..' . '/admin/survey/classes/class.Demografija.php',
<<<<<<< HEAD
'DivisionByZeroError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
'Dostop' => __DIR__ . '/../..' . '/admin/survey/classes/class.Dostop.php',
'Error' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/Error.php',
=======
'Dostop' => __DIR__ . '/../..' . '/admin/survey/classes/class.Dostop.php',
>>>>>>> master
'Evalvacija' => __DIR__ . '/../..' . '/admin/survey/modules/Evalvacija/class.Evalvacija.php',
'EvoliForm' => __DIR__ . '/../..' . '/admin/survey/modules/mod_EVOLI/class.EvoliForm.php',
'ExclusiveLock' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.ExclusiveLock.php',
@ -416,8 +455,16 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'GuzzleHttp\\Promise\\AggregateException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/AggregateException.php',
'GuzzleHttp\\Promise\\CancellationException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/CancellationException.php',
'GuzzleHttp\\Promise\\Coroutine' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Coroutine.php',
<<<<<<< HEAD
'GuzzleHttp\\Promise\\EachPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/EachPromise.php',
'GuzzleHttp\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/FulfilledPromise.php',
=======
'GuzzleHttp\\Promise\\Create' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Create.php',
'GuzzleHttp\\Promise\\Each' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Each.php',
'GuzzleHttp\\Promise\\EachPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/EachPromise.php',
'GuzzleHttp\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/FulfilledPromise.php',
'GuzzleHttp\\Promise\\Is' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Is.php',
>>>>>>> master
'GuzzleHttp\\Promise\\Promise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Promise.php',
'GuzzleHttp\\Promise\\PromiseInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromiseInterface.php',
'GuzzleHttp\\Promise\\PromisorInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromisorInterface.php',
@ -425,11 +472,16 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'GuzzleHttp\\Promise\\RejectionException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectionException.php',
'GuzzleHttp\\Promise\\TaskQueue' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueue.php',
'GuzzleHttp\\Promise\\TaskQueueInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueueInterface.php',
<<<<<<< HEAD
=======
'GuzzleHttp\\Promise\\Utils' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Utils.php',
>>>>>>> master
'GuzzleHttp\\Psr7\\AppendStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/AppendStream.php',
'GuzzleHttp\\Psr7\\BufferStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/BufferStream.php',
'GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php',
'GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php',
'GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php',
<<<<<<< HEAD
'GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php',
'GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php',
'GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php',
@ -437,6 +489,19 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php',
'GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php',
'GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php',
=======
'GuzzleHttp\\Psr7\\Header' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Header.php',
'GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php',
'GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php',
'GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php',
'GuzzleHttp\\Psr7\\Message' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Message.php',
'GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php',
'GuzzleHttp\\Psr7\\MimeType' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MimeType.php',
'GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php',
'GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php',
'GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php',
'GuzzleHttp\\Psr7\\Query' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Query.php',
>>>>>>> master
'GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php',
'GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php',
'GuzzleHttp\\Psr7\\Rfc7230' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Rfc7230.php',
@ -448,6 +513,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php',
'GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php',
'GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php',
<<<<<<< HEAD
=======
'GuzzleHttp\\Psr7\\Utils' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Utils.php',
>>>>>>> master
'GuzzleHttp\\RedirectMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RedirectMiddleware.php',
'GuzzleHttp\\RequestOptions' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RequestOptions.php',
'GuzzleHttp\\RetryMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RetryMiddleware.php',
@ -816,7 +885,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'PHPMailer\\PHPMailer\\PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/PHPMailer.php',
'PHPMailer\\PHPMailer\\POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/POP3.php',
'PHPMailer\\PHPMailer\\SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/SMTP.php',
<<<<<<< HEAD
'ParseError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
=======
>>>>>>> master
'PayPalCheckoutSdk\\Core\\AccessToken' => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php',
'PayPalCheckoutSdk\\Core\\AccessTokenRequest' => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php',
'PayPalCheckoutSdk\\Core\\AuthorizationInjector' => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php',
@ -883,7 +955,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'Sample\\PatchOrder' => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/samples/PatchOrder.php',
'Sample\\PayPalClient' => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/samples/PayPalClient.php',
'Sample\\RefundOrder' => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/samples/RefundOrder.php',
<<<<<<< HEAD
'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
=======
>>>>>>> master
'Setting' => __DIR__ . '/../..' . '/admin/survey/classes/class.Setting.php',
'Sonata\\GoogleAuthenticator\\FixedBitNotation' => __DIR__ . '/..' . '/sonata-project/google-authenticator/src/FixedBitNotation.php',
'Sonata\\GoogleAuthenticator\\GoogleAuthenticator' => __DIR__ . '/..' . '/sonata-project/google-authenticator/src/GoogleAuthenticator.php',
@ -1048,6 +1123,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'Stripe\\Service\\Reporting\\ReportTypeService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php',
'Stripe\\Service\\Reporting\\ReportingServiceFactory' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php',
'Stripe\\Service\\ReviewService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/ReviewService.php',
<<<<<<< HEAD
=======
'Stripe\\Service\\SetupAttemptService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/SetupAttemptService.php',
>>>>>>> master
'Stripe\\Service\\SetupIntentService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/SetupIntentService.php',
'Stripe\\Service\\Sigma\\ScheduledQueryRunService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php',
'Stripe\\Service\\Sigma\\SigmaServiceFactory' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php',
@ -1065,6 +1144,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'Stripe\\Service\\TopupService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/TopupService.php',
'Stripe\\Service\\TransferService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/TransferService.php',
'Stripe\\Service\\WebhookEndpointService' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Service/WebhookEndpointService.php',
<<<<<<< HEAD
=======
'Stripe\\SetupAttempt' => __DIR__ . '/..' . '/stripe/stripe-php/lib/SetupAttempt.php',
>>>>>>> master
'Stripe\\SetupIntent' => __DIR__ . '/..' . '/stripe/stripe-php/lib/SetupIntent.php',
'Stripe\\Sigma\\ScheduledQueryRun' => __DIR__ . '/..' . '/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php',
'Stripe\\SingletonApiResource' => __DIR__ . '/..' . '/stripe/stripe-php/lib/SingletonApiResource.php',
@ -1133,7 +1216,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'SurveyDataFile' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.SurveyDataFile.php',
'SurveyDataSettingProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyDataSettingProfiles.php',
'SurveyDiagnostics' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyDiagnostics.php',
<<<<<<< HEAD
'SurveyDisplayData' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/old/class.SurveyDisplayData.php',
=======
>>>>>>> master
'SurveyEditsAnalysis' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyEditsAnalysis.php',
'SurveyEmployMeter' => __DIR__ . '/../..' . '/admin/survey/modules/mod_EVOLI/class.SurveyEmployMeter.php',
'SurveyEvoli' => __DIR__ . '/../..' . '/admin/survey/modules/mod_EVOLI/class.SurveyEvoli.php',
@ -1174,7 +1260,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'SurveyRecoding' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyRecoding.php',
'SurveyReminderTracking' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyReminderTracking.php',
'SurveyRespondents' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyRespondents.php',
<<<<<<< HEAD
'SurveySNDataFile' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/old/class.SurveySNDataFile.php',
=======
>>>>>>> master
'SurveySession' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySession.php',
'SurveySessionDestructor' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySession.php',
'SurveySetting' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySetting.php',
@ -1195,7 +1284,10 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'SurveyTheme' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyTheme.php',
'SurveyThemeEditor' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyThemeEditor.php',
'SurveyTimeProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyTimeProfiles.php',
<<<<<<< HEAD
'SurveyTrackIncremental' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/old/class.SurveyTrackIncremental.php',
=======
>>>>>>> master
'SurveyUnsubscribe' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUnsubscribe.php',
'SurveyUporabnost' => __DIR__ . '/../..' . '/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php',
'SurveyUrlLinks' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUrlLinks.php',
@ -1212,11 +1304,17 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\DisallowedRanges' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php',
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\Regex' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Resources/unidata/Regex.php',
'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Normalizer.php',
<<<<<<< HEAD
'Symfony\\Polyfill\\Php70\\Php70' => __DIR__ . '/..' . '/symfony/polyfill-php70/Php70.php',
'Symfony\\Polyfill\\Php72\\Php72' => __DIR__ . '/..' . '/symfony/polyfill-php72/Php72.php',
'Timer' => __DIR__ . '/../..' . '/admin/survey/classes/class.Timer.php',
'TrackingClass' => __DIR__ . '/../..' . '/admin/survey/classes/TrackingClass.php',
'TypeError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
=======
'Symfony\\Polyfill\\Php72\\Php72' => __DIR__ . '/..' . '/symfony/polyfill-php72/Php72.php',
'Timer' => __DIR__ . '/../..' . '/admin/survey/classes/class.Timer.php',
'TrackingClass' => __DIR__ . '/../..' . '/admin/survey/classes/TrackingClass.php',
>>>>>>> master
'User' => __DIR__ . '/../..' . '/admin/survey/classes/class.User.php',
'UserAccess' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserAccess.php',
'UserNarocila' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserNarocila.php',
@ -1245,9 +1343,15 @@ class ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
<<<<<<< HEAD
$loader->prefixLengthsPsr4 = ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit817d358f3360c5248956ccfb4ef6d09a::$classMap;
=======
$loader->prefixLengthsPsr4 = ComposerStaticInit0d06eb1022200eb96b7e4bb652ca3996::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0d06eb1022200eb96b7e4bb652ca3996::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0d06eb1022200eb96b7e4bb652ca3996::$classMap;
>>>>>>> master
}, null, ClassLoader::class);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,15 @@
<<<<<<< HEAD
=======
#### v2.2.0 (2020-08)
* support polyfills for bcmath and gmp, and add a composer.json
suggestion for the `phpseclib/bcmath_polyfill` for servers unable
to install PHP the gmp or bcmath extensions.
#### v.2.1.1 & &v.2.0.2 (2018-12)
* add stricter validation around some structures, highlighed
by wycheproof test suite
>>>>>>> master
#### v.2.1.0 (2018-03)
* add support for `bcmath` extension (making `gmp` optional)<br>
https://github.com/fgrosse/PHPASN1/pull/68

View File

@ -27,7 +27,13 @@
},
"suggest": {
"ext-gmp": "GMP is the preferred extension for big integer calculations",
<<<<<<< HEAD
"php-curl": "For loading OID information from the web if they have not bee defined statically"
=======
"ext-bcmath": "BCmath is the fallback extension for big integer calculations",
"phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available",
"ext-curl": "For loading OID information from the web if they have not bee defined statically"
>>>>>>> master
},
"autoload": {
"psr-4": {

View File

@ -53,6 +53,7 @@ abstract class BigInteger
}
else {
// autodetect
<<<<<<< HEAD
if (extension_loaded('gmp')) {
$ret = new BigIntegerGmp();
}
@ -61,6 +62,14 @@ abstract class BigInteger
}
else {
// TODO: potentially offer pure php implementation?
=======
if (function_exists('gmp_add')) {
$ret = new BigIntegerGmp();
}
elseif (function_exists('bcadd')) {
$ret = new BigIntegerBcmath();
} else {
>>>>>>> master
throw new \RuntimeException('Requires GMP or bcmath extension.');
}
}

View File

@ -1,6 +1,17 @@
CHANGELOG
=========
<<<<<<< HEAD
=======
2.11.0 (2020-10-01)
-------------------
* IMPORTANT: PHP 7.2 or greater is now required.
* Added the `isResidentialProxy` property to `GeoIp2\Model\AnonymousIP` and
`GeoIp2\Record\Traits`.
* Additional type hints have been added.
>>>>>>> master
2.10.0 (2019-12-12)
-------------------

View File

@ -13,14 +13,24 @@
}
],
"require": {
<<<<<<< HEAD
"maxmind-db/reader": "~1.5",
"maxmind/web-service-common": "~0.6",
"php": ">=5.6",
=======
"maxmind-db/reader": "~1.8",
"maxmind/web-service-common": "~0.8",
"php": ">=7.2",
>>>>>>> master
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.*",
<<<<<<< HEAD
"phpunit/phpunit": "5.*",
=======
"phpunit/phpunit": "^8.0 || ^9.0",
>>>>>>> master
"squizlabs/php_codesniffer": "3.*"
},
"autoload": {

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Database;
use GeoIp2\Exception\AddressNotFoundException;
@ -48,8 +53,13 @@ class Reader implements ProviderInterface
* is corrupt or invalid
*/
public function __construct(
<<<<<<< HEAD
$filename,
$locales = ['en']
=======
string $filename,
array $locales = ['en']
>>>>>>> master
) {
$this->dbReader = new DbReader($filename);
$this->dbType = $this->dbReader->metadata()->databaseType;
@ -65,10 +75,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\City
*/
public function city($ipAddress)
=======
*/
public function city(string $ipAddress): \GeoIp2\Model\City
>>>>>>> master
{
return $this->modelFor('City', 'City', $ipAddress);
}
@ -82,10 +97,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Country
*/
public function country($ipAddress)
=======
*/
public function country(string $ipAddress): \GeoIp2\Model\Country
>>>>>>> master
{
return $this->modelFor('Country', 'Country', $ipAddress);
}
@ -99,10 +119,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\AnonymousIp
*/
public function anonymousIp($ipAddress)
=======
*/
public function anonymousIp(string $ipAddress): \GeoIp2\Model\AnonymousIp
>>>>>>> master
{
return $this->flatModelFor(
'AnonymousIp',
@ -120,10 +145,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Asn
*/
public function asn($ipAddress)
=======
*/
public function asn(string $ipAddress): \GeoIp2\Model\Asn
>>>>>>> master
{
return $this->flatModelFor(
'Asn',
@ -141,10 +171,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\ConnectionType
*/
public function connectionType($ipAddress)
=======
*/
public function connectionType(string $ipAddress): \GeoIp2\Model\ConnectionType
>>>>>>> master
{
return $this->flatModelFor(
'ConnectionType',
@ -162,10 +197,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Domain
*/
public function domain($ipAddress)
=======
*/
public function domain(string $ipAddress): \GeoIp2\Model\Domain
>>>>>>> master
{
return $this->flatModelFor(
'Domain',
@ -183,10 +223,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Enterprise
*/
public function enterprise($ipAddress)
=======
*/
public function enterprise(string $ipAddress): \GeoIp2\Model\Enterprise
>>>>>>> master
{
return $this->modelFor('Enterprise', 'Enterprise', $ipAddress);
}
@ -200,10 +245,15 @@ class Reader implements ProviderInterface
* not in the database
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Isp
*/
public function isp($ipAddress)
=======
*/
public function isp(string $ipAddress): \GeoIp2\Model\Isp
>>>>>>> master
{
return $this->flatModelFor(
'Isp',
@ -212,7 +262,11 @@ class Reader implements ProviderInterface
);
}
<<<<<<< HEAD
private function modelFor($class, $type, $ipAddress)
=======
private function modelFor(string $class, string $type, string $ipAddress)
>>>>>>> master
{
list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress);
@ -224,7 +278,11 @@ class Reader implements ProviderInterface
return new $class($record, $this->locales);
}
<<<<<<< HEAD
private function flatModelFor($class, $type, $ipAddress)
=======
private function flatModelFor(string $class, string $type, string $ipAddress)
>>>>>>> master
{
list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress);
@ -235,7 +293,11 @@ class Reader implements ProviderInterface
return new $class($record);
}
<<<<<<< HEAD
private function getRecord($class, $type, $ipAddress)
=======
private function getRecord(string $class, string $type, string $ipAddress): array
>>>>>>> master
{
if (strpos($this->dbType, $type) === false) {
$method = lcfirst($class);
@ -272,7 +334,11 @@ class Reader implements ProviderInterface
*
* @return \MaxMind\Db\Reader\Metadata object for the database
*/
<<<<<<< HEAD
public function metadata()
=======
public function metadata(): \MaxMind\Db\Reader\Metadata
>>>>>>> master
{
return $this->dbReader->metadata();
}
@ -280,7 +346,11 @@ class Reader implements ProviderInterface
/**
* Closes the GeoIP2 database and returns the resources to the system.
*/
<<<<<<< HEAD
public function close()
=======
public function close(): void
>>>>>>> master
{
$this->dbReader->close();
}

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Exception;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Exception;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Exception;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Exception;
/**
@ -13,9 +18,15 @@ class HttpException extends GeoIp2Exception
public $uri;
public function __construct(
<<<<<<< HEAD
$message,
$httpStatus,
$uri,
=======
string $message,
int $httpStatus,
string $uri,
>>>>>>> master
\Exception $previous = null
) {
$this->uri = $uri;

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Exception;
/**
@ -14,10 +19,17 @@ class InvalidRequestException extends HttpException
public $error;
public function __construct(
<<<<<<< HEAD
$message,
$error,
$httpStatus,
$uri,
=======
string $message,
string $error,
int $httpStatus,
string $uri,
>>>>>>> master
\Exception $previous = null
) {
$this->error = $error;

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Exception;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
/**
@ -11,20 +16,30 @@ abstract class AbstractModel implements \JsonSerializable
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
*/
public function __construct($raw)
=======
*/
public function __construct(array $raw)
>>>>>>> master
{
$this->raw = $raw;
}
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $field
*/
protected function get($field)
=======
*/
protected function get(string $field)
>>>>>>> master
{
if (isset($this->raw[$field])) {
return $this->raw[$field];
@ -38,10 +53,15 @@ abstract class AbstractModel implements \JsonSerializable
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
public function __get($attr)
=======
*/
public function __get(string $attr)
>>>>>>> master
{
if ($attr !== 'instance' && property_exists($this, $attr)) {
return $this->$attr;
@ -52,15 +72,24 @@ abstract class AbstractModel implements \JsonSerializable
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
public function __isset($attr)
=======
*/
public function __isset(string $attr): bool
>>>>>>> master
{
return $attr !== 'instance' && isset($this->$attr);
}
<<<<<<< HEAD
public function jsonSerialize()
=======
public function jsonSerialize(): array
>>>>>>> master
{
return $this->raw;
}

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
use GeoIp2\Util;
@ -17,6 +22,11 @@ use GeoIp2\Util;
* to a hosting or VPN provider (see description of isAnonymousVpn property).
* @property-read bool $isPublicProxy This is true if the IP address belongs to
* a public proxy.
<<<<<<< HEAD
=======
* @property-read bool $isResidentialProxy This is true if the IP address is
* on a suspected anonymizing network and belongs to a residential ISP.
>>>>>>> master
* @property-read bool $isTorExitNode This is true if the IP address is a Tor
* exit node.
* @property-read string $ipAddress The IP address that the data in the model is
@ -31,16 +41,25 @@ class AnonymousIp extends AbstractModel
protected $isAnonymousVpn;
protected $isHostingProvider;
protected $isPublicProxy;
<<<<<<< HEAD
=======
protected $isResidentialProxy;
>>>>>>> master
protected $isTorExitNode;
protected $ipAddress;
protected $network;
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
*/
public function __construct($raw)
=======
*/
public function __construct(array $raw)
>>>>>>> master
{
parent::__construct($raw);
@ -48,6 +67,10 @@ class AnonymousIp extends AbstractModel
$this->isAnonymousVpn = $this->get('is_anonymous_vpn');
$this->isHostingProvider = $this->get('is_hosting_provider');
$this->isPublicProxy = $this->get('is_public_proxy');
<<<<<<< HEAD
=======
$this->isResidentialProxy = $this->get('is_residential_proxy');
>>>>>>> master
$this->isTorExitNode = $this->get('is_tor_exit_node');
$ipAddress = $this->get('ip_address');
$this->ipAddress = $ipAddress;

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
use GeoIp2\Util;
@ -27,10 +32,15 @@ class Asn extends AbstractModel
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
*/
public function __construct($raw)
=======
*/
public function __construct(array $raw)
>>>>>>> master
{
parent::__construct($raw);
$this->autonomousSystemNumber = $this->get('autonomous_system_number');

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
/**
@ -48,11 +53,16 @@ class City extends Country
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
* @param mixed $locales
*/
public function __construct($raw, $locales = ['en'])
=======
*/
public function __construct(array $raw, array $locales = ['en'])
>>>>>>> master
{
parent::__construct($raw, $locales);
@ -63,7 +73,11 @@ class City extends Country
$this->createSubdivisions($raw, $locales);
}
<<<<<<< HEAD
private function createSubdivisions($raw, $locales)
=======
private function createSubdivisions(array $raw, array $locales): void
>>>>>>> master
{
if (!isset($raw['subdivisions'])) {
return;
@ -79,10 +93,15 @@ class City extends Country
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
public function __get($attr)
=======
*/
public function __get(string $attr)
>>>>>>> master
{
if ($attr === 'mostSpecificSubdivision') {
return $this->$attr();
@ -93,10 +112,15 @@ class City extends Country
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
public function __isset($attr)
=======
*/
public function __isset(string $attr): bool
>>>>>>> master
{
if ($attr === 'mostSpecificSubdivision') {
// We always return a mostSpecificSubdivision, even if it is the
@ -107,7 +131,11 @@ class City extends Country
return parent::__isset($attr);
}
<<<<<<< HEAD
private function mostSpecificSubdivision()
=======
private function mostSpecificSubdivision(): \GeoIp2\Record\Subdivision
>>>>>>> master
{
return empty($this->subdivisions) ?
new \GeoIp2\Record\Subdivision([], $this->locales) :

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
use GeoIp2\Util;
@ -24,10 +29,15 @@ class ConnectionType extends AbstractModel
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
*/
public function __construct($raw)
=======
*/
public function __construct(array $raw)
>>>>>>> master
{
parent::__construct($raw);

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
/**
@ -39,11 +44,16 @@ class Country extends AbstractModel
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
* @param mixed $locales
*/
public function __construct($raw, $locales = ['en'])
=======
*/
public function __construct(array $raw, array $locales = ['en'])
>>>>>>> master
{
parent::__construct($raw);

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
use GeoIp2\Util;
@ -24,10 +29,15 @@ class Domain extends AbstractModel
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
*/
public function __construct($raw)
=======
*/
public function __construct(array $raw)
>>>>>>> master
{
parent::__construct($raw);

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Model;
use GeoIp2\Util;
@ -33,10 +38,15 @@ class Isp extends AbstractModel
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $raw
*/
public function __construct($raw)
=======
*/
public function __construct(array $raw)
>>>>>>> master
{
parent::__construct($raw);
$this->autonomousSystemNumber = $this->get('autonomous_system_number');

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2;
interface ProviderInterface
@ -9,12 +14,20 @@ interface ProviderInterface
*
* @return \GeoIp2\Model\Country a Country model for the requested IP address
*/
<<<<<<< HEAD
public function country($ipAddress);
=======
public function country(string $ipAddress): \GeoIp2\Model\Country;
>>>>>>> master
/**
* @param string $ipAddress an IPv4 or IPv6 address to lookup
*
* @return \GeoIp2\Model\City a City model for the requested IP address
*/
<<<<<<< HEAD
public function city($ipAddress);
=======
public function city(string $ipAddress): \GeoIp2\Model\City;
>>>>>>> master
}

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
abstract class AbstractPlaceRecord extends AbstractRecord
@ -8,11 +13,16 @@ abstract class AbstractPlaceRecord extends AbstractRecord
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $record
* @param mixed $locales
*/
public function __construct($record, $locales = ['en'])
=======
*/
public function __construct(?array $record, array $locales = ['en'])
>>>>>>> master
{
$this->locales = $locales;
parent::__construct($record);
@ -20,10 +30,15 @@ abstract class AbstractPlaceRecord extends AbstractRecord
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
public function __get($attr)
=======
*/
public function __get(string $attr)
>>>>>>> master
{
if ($attr === 'name') {
return $this->name();
@ -34,6 +49,7 @@ abstract class AbstractPlaceRecord extends AbstractRecord
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
@ -41,19 +57,34 @@ abstract class AbstractPlaceRecord extends AbstractRecord
{
if ($attr === 'name') {
return $this->firstSetNameLocale() === null ? false : true;
=======
*/
public function __isset(string $attr): bool
{
if ($attr === 'name') {
return $this->firstSetNameLocale() !== null;
>>>>>>> master
}
return parent::__isset($attr);
}
<<<<<<< HEAD
private function name()
=======
private function name(): ?string
>>>>>>> master
{
$locale = $this->firstSetNameLocale();
return $locale === null ? null : $this->names[$locale];
}
<<<<<<< HEAD
private function firstSetNameLocale()
=======
private function firstSetNameLocale(): ?string
>>>>>>> master
{
foreach ($this->locales as $locale) {
if (isset($this->names[$locale])) {

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
abstract class AbstractRecord implements \JsonSerializable
@ -8,20 +13,30 @@ abstract class AbstractRecord implements \JsonSerializable
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $record
*/
public function __construct($record)
=======
*/
public function __construct(?array $record)
>>>>>>> master
{
$this->record = isset($record) ? $record : [];
}
/**
* @ignore
<<<<<<< HEAD
*
* @param mixed $attr
*/
public function __get($attr)
=======
*/
public function __get(string $attr)
>>>>>>> master
{
// XXX - kind of ugly but greatly reduces boilerplate code
$key = $this->attributeToKey($attr);
@ -38,23 +53,39 @@ abstract class AbstractRecord implements \JsonSerializable
throw new \RuntimeException("Unknown attribute: $attr");
}
<<<<<<< HEAD
public function __isset($attr)
=======
public function __isset(string $attr): bool
>>>>>>> master
{
return $this->validAttribute($attr) &&
isset($this->record[$this->attributeToKey($attr)]);
}
<<<<<<< HEAD
private function attributeToKey($attr)
=======
private function attributeToKey(string $attr): string
>>>>>>> master
{
return strtolower(preg_replace('/([A-Z])/', '_\1', $attr));
}
<<<<<<< HEAD
private function validAttribute($attr)
=======
private function validAttribute(string $attr): bool
>>>>>>> master
{
return \in_array($attr, $this->validAttributes, true);
}
<<<<<<< HEAD
public function jsonSerialize()
=======
public function jsonSerialize(): ?array
>>>>>>> master
{
return $this->record;
}

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\Record;
use GeoIp2\Util;
@ -56,6 +61,12 @@ use GeoIp2\Util;
* @property-read bool $isPublicProxy This is true if the IP address belongs to
* a public proxy. This property is only available from GeoIP2 Precision
* Insights.
<<<<<<< HEAD
=======
* @property-read bool $isResidentialProxy This is true if the IP address is
* on a suspected anonymizing network and belongs to a residential ISP. This
* property is only available from GeoIP2 Precision Insights.
>>>>>>> master
* @property-read bool $isSatelliteProvider *Deprecated.* Due to the
* increased coverage by mobile carriers, very few satellite providers now
* serve multiple countries. As a result, the output does not provide
@ -120,6 +131,10 @@ class Traits extends AbstractRecord
'isLegitimateProxy',
'isp',
'isPublicProxy',
<<<<<<< HEAD
=======
'isResidentialProxy',
>>>>>>> master
'isSatelliteProvider',
'isTorExitNode',
'network',
@ -129,7 +144,11 @@ class Traits extends AbstractRecord
'userType',
];
<<<<<<< HEAD
public function __construct($record)
=======
public function __construct(?array $record)
>>>>>>> master
{
if (!isset($record['network']) && isset($record['ip_address']) && isset($record['prefix_len'])) {
$record['network'] = Util::cidr($record['ip_address'], $record['prefix_len']);

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2;
class Util
@ -10,11 +15,16 @@ class Util
*
* @internal
* @ignore
<<<<<<< HEAD
*
* @param mixed $ipAddress
* @param mixed $prefixLen
*/
public static function cidr($ipAddress, $prefixLen)
=======
*/
public static function cidr(string $ipAddress, int $prefixLen): string
>>>>>>> master
{
$ipBytes = inet_pton($ipAddress);
$networkBytes = str_repeat("\0", \strlen($ipBytes));

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace GeoIp2\WebService;
use GeoIp2\Exception\AddressNotFoundException;
@ -47,7 +52,11 @@ class Client implements ProviderInterface
private $client;
private static $basePath = '/geoip/v2.1';
<<<<<<< HEAD
const VERSION = 'v2.10.0';
=======
const VERSION = 'v2.11.0';
>>>>>>> master
/**
* Constructor.
@ -65,10 +74,17 @@ class Client implements ProviderInterface
* `http://username:password@127.0.0.1:10`.
*/
public function __construct(
<<<<<<< HEAD
$accountId,
$licenseKey,
$locales = ['en'],
$options = []
=======
int $accountId,
string $licenseKey,
array $locales = ['en'],
array $options = []
>>>>>>> master
) {
$this->locales = $locales;
@ -87,7 +103,11 @@ class Client implements ProviderInterface
$this->client = new WsClient($accountId, $licenseKey, $options);
}
<<<<<<< HEAD
private function userAgent()
=======
private function userAgent(): string
>>>>>>> master
{
return 'GeoIP2-API/' . self::VERSION;
}
@ -115,10 +135,15 @@ class Client implements ProviderInterface
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
* class to the above exceptions. It will be thrown directly
* if a 200 status code is returned but the body is invalid.
<<<<<<< HEAD
*
* @return \GeoIp2\Model\City
*/
public function city($ipAddress = 'me')
=======
*/
public function city(string $ipAddress = 'me'): \GeoIp2\Model\City
>>>>>>> master
{
return $this->responseFor('city', 'City', $ipAddress);
}
@ -146,10 +171,15 @@ class Client implements ProviderInterface
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent class to the above exceptions. It
* will be thrown directly if a 200 status code is returned but
* the body is invalid.
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Country
*/
public function country($ipAddress = 'me')
=======
*/
public function country(string $ipAddress = 'me'): \GeoIp2\Model\Country
>>>>>>> master
{
return $this->responseFor('country', 'Country', $ipAddress);
}
@ -177,15 +207,24 @@ class Client implements ProviderInterface
* @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
* class to the above exceptions. It will be thrown directly
* if a 200 status code is returned but the body is invalid.
<<<<<<< HEAD
*
* @return \GeoIp2\Model\Insights
*/
public function insights($ipAddress = 'me')
=======
*/
public function insights(string $ipAddress = 'me'): \GeoIp2\Model\Insights
>>>>>>> master
{
return $this->responseFor('insights', 'Insights', $ipAddress);
}
<<<<<<< HEAD
private function responseFor($endpoint, $class, $ipAddress)
=======
private function responseFor(string $endpoint, string $class, string $ipAddress)
>>>>>>> master
{
$path = implode('/', [self::$basePath, $endpoint, $ipAddress]);

View File

@ -1,6 +1,25 @@
# CHANGELOG
<<<<<<< HEAD
=======
## 1.4.0 - 2020-09-30
### Added
- Support for PHP 8
- Optional `$recursive` flag to `all`
- Replaced functions by static methods
### Fixed
- Fix empty `each` processing
- Fix promise handling for Iterators of non-unique keys
- Fixed `method_exists` crashes on PHP 8
- Memory leak on exceptions
>>>>>>> master
## 1.3.1 - 2016-12-20
### Fixed

View File

@ -26,7 +26,11 @@ 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
<<<<<<< HEAD
`GuzzleHttp\Promise\coroutine()`.
=======
`GuzzleHttp\Promise\Coroutine::of()`.
>>>>>>> master
# Quick start
@ -88,7 +92,11 @@ $promise
});
// Resolving the promise triggers the $onFulfilled callbacks and outputs
<<<<<<< HEAD
// "Hello, reader".
=======
// "Hello, reader."
>>>>>>> master
$promise->resolve('reader.');
```
@ -150,7 +158,11 @@ use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise->then(null, function ($reason) {
<<<<<<< HEAD
throw new \Exception($reason);
=======
throw new Exception($reason);
>>>>>>> master
})->then(null, function ($reason) {
assert($reason->getMessage() === 'Error!');
});
@ -182,7 +194,10 @@ invoked using the value returned from the `$onRejected` callback.
```php
use GuzzleHttp\Promise\Promise;
<<<<<<< HEAD
use GuzzleHttp\Promise\RejectedPromise;
=======
>>>>>>> master
$promise = new Promise();
$promise
@ -220,7 +235,11 @@ the promise is rejected with the exception and the exception is thrown.
```php
$promise = new Promise(function () use (&$promise) {
<<<<<<< HEAD
throw new \Exception('foo');
=======
throw new Exception('foo');
>>>>>>> master
});
$promise->wait(); // throws the exception.
@ -397,7 +416,11 @@ $deferred = new React\Promise\Deferred();
$reactPromise = $deferred->promise();
// Create a Guzzle promise that is fulfilled with a React promise.
<<<<<<< HEAD
$guzzlePromise = new \GuzzleHttp\Promise\Promise();
=======
$guzzlePromise = new GuzzleHttp\Promise\Promise();
>>>>>>> master
$guzzlePromise->then(function ($value) use ($reactPromise) {
// Do something something with the value...
// Return the React promise
@ -424,7 +447,11 @@ instance.
```php
// Get the global task queue
<<<<<<< HEAD
$queue = \GuzzleHttp\Promise\queue();
=======
$queue = GuzzleHttp\Promise\Utils::queue();
>>>>>>> master
$queue->run();
```
@ -502,3 +529,35 @@ $promise->then(function ($value) { echo $value; });
$promise->resolve('foo');
// prints "foo"
```
<<<<<<< HEAD
=======
## 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` |
>>>>>>> master

View File

@ -11,10 +11,17 @@
}
],
"require": {
<<<<<<< HEAD
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
=======
"php": ">=5.5"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
>>>>>>> master
},
"autoload": {
"psr-4": {
@ -22,9 +29,20 @@
},
"files": ["src/functions_include.php"]
},
<<<<<<< HEAD
"scripts": {
"test": "vendor/bin/phpunit",
"test-ci": "vendor/bin/phpunit --coverage-text"
=======
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Promise\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/simple-phpunit",
"test-ci": "vendor/bin/simple-phpunit --coverage-text"
>>>>>>> master
},
"extra": {
"branch-alias": {

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
use Exception;
@ -9,7 +13,11 @@ use Throwable;
* Creates a promise that is resolved using a generator that yields values or
* promises (somewhat similar to C#'s async keyword).
*
<<<<<<< HEAD
* When called, the coroutine function will start an instance of the generator
=======
* When called, the Coroutine::of method will start an instance of the generator
>>>>>>> master
* and returns a promise that is fulfilled with its final yielded value.
*
* Control is returned back to the generator when the yielded promise settles.
@ -22,7 +30,11 @@ use Throwable;
* return new Promise\FulfilledPromise($value);
* }
*
<<<<<<< HEAD
* $promise = Promise\coroutine(function () {
=======
* $promise = Promise\Coroutine::of(function () {
>>>>>>> master
* $value = (yield createPromise('a'));
* try {
* $value = (yield createPromise($value . 'b'));
@ -38,6 +50,10 @@ use Throwable;
* @param callable $generatorFn Generator function to wrap into a promise.
*
* @return Promise
<<<<<<< HEAD
=======
*
>>>>>>> master
* @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
*/
final class Coroutine implements PromiseInterface
@ -65,7 +81,27 @@ final class Coroutine implements PromiseInterface
$this->currentPromise->wait();
}
});
<<<<<<< HEAD
$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);
>>>>>>> master
}
public function then(
@ -108,7 +144,11 @@ final class Coroutine implements PromiseInterface
private function nextCoroutine($yielded)
{
<<<<<<< HEAD
$this->currentPromise = promise_for($yielded)
=======
$this->currentPromise = Create::promiseFor($yielded)
>>>>>>> master
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
}
@ -139,7 +179,11 @@ final class Coroutine implements PromiseInterface
{
unset($this->currentPromise);
try {
<<<<<<< HEAD
$nextYield = $this->generator->throw(exception_for($reason));
=======
$nextYield = $this->generator->throw(Create::exceptionFor($reason));
>>>>>>> master
// The throw was caught, so keep iterating on the coroutine
$this->nextCoroutine($nextYield);
} catch (Exception $exception) {

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -9,6 +13,7 @@ class EachPromise implements PromisorInterface
{
private $pending = [];
<<<<<<< HEAD
/** @var \Iterator */
private $iterable;
@ -25,6 +30,24 @@ class EachPromise implements PromisorInterface
private $aggregate;
/** @var bool */
=======
/** @var \Iterator|null */
private $iterable;
/** @var callable|int|null */
private $concurrency;
/** @var callable|null */
private $onFulfilled;
/** @var callable|null */
private $onRejected;
/** @var Promise|null */
private $aggregate;
/** @var bool|null */
>>>>>>> master
private $mutex;
/**
@ -45,12 +68,21 @@ class EachPromise implements PromisorInterface
* allowed number of outstanding concurrently executing promises,
* creating a capped pool of promises. There is no limit by default.
*
<<<<<<< HEAD
* @param mixed $iterable Promises or values to iterate.
* @param array $config Configuration options
*/
public function __construct($iterable, array $config = [])
{
$this->iterable = iter_for($iterable);
=======
* @param mixed $iterable Promises or values to iterate.
* @param array $config Configuration options
*/
public function __construct($iterable, array $config = [])
{
$this->iterable = Create::iterFor($iterable);
>>>>>>> master
if (isset($config['concurrency'])) {
$this->concurrency = $config['concurrency'];
@ -65,6 +97,10 @@ class EachPromise implements PromisorInterface
}
}
<<<<<<< HEAD
=======
/** @psalm-suppress InvalidNullableReturnType */
>>>>>>> master
public function promise()
{
if ($this->aggregate) {
@ -73,6 +109,7 @@ class EachPromise implements PromisorInterface
try {
$this->createPromise();
<<<<<<< HEAD
$this->iterable->rewind();
$this->refillPending();
} catch (\Throwable $e) {
@ -81,6 +118,31 @@ class EachPromise implements PromisorInterface
$this->aggregate->reject($e);
}
=======
/** @psalm-assert Promise $this->aggregate */
$this->iterable->rewind();
if (!$this->checkIfFinished()) {
$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
*/
>>>>>>> master
return $this->aggregate;
}
@ -89,17 +151,24 @@ class EachPromise implements PromisorInterface
$this->mutex = false;
$this->aggregate = new Promise(function () {
reset($this->pending);
<<<<<<< HEAD
if (empty($this->pending) && !$this->iterable->valid()) {
$this->aggregate->resolve(null);
return;
}
=======
>>>>>>> master
// 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();
<<<<<<< HEAD
if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
=======
if (Is::settled($this->aggregate)) {
>>>>>>> master
return;
}
}
@ -148,6 +217,7 @@ class EachPromise implements PromisorInterface
return false;
}
<<<<<<< HEAD
$promise = promise_for($this->iterable->current());
$idx = $this->iterable->key();
@ -156,14 +226,43 @@ class EachPromise implements PromisorInterface
if ($this->onFulfilled) {
call_user_func(
$this->onFulfilled, $value, $idx, $this->aggregate
=======
$promise = Create::promiseFor($this->iterable->current());
$key = $this->iterable->key();
// Iterable keys may not be unique, so we add the promises at the end
// of the pending array and retrieve the array index being used
$this->pending[] = null;
end($this->pending);
$idx = key($this->pending);
$this->pending[$idx] = $promise->then(
function ($value) use ($idx, $key) {
if ($this->onFulfilled) {
call_user_func(
$this->onFulfilled,
$value,
$key,
$this->aggregate
>>>>>>> master
);
}
$this->step($idx);
},
<<<<<<< HEAD
function ($reason) use ($idx) {
if ($this->onRejected) {
call_user_func(
$this->onRejected, $reason, $idx, $this->aggregate
=======
function ($reason) use ($idx, $key) {
if ($this->onRejected) {
call_user_func(
$this->onRejected,
$reason,
$key,
$this->aggregate
>>>>>>> master
);
}
$this->step($idx);
@ -201,7 +300,11 @@ class EachPromise implements PromisorInterface
private function step($idx)
{
// If the promise was already resolved, then ignore this step.
<<<<<<< HEAD
if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
=======
if (Is::settled($this->aggregate)) {
>>>>>>> master
return;
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -13,9 +17,16 @@ class FulfilledPromise implements PromiseInterface
public function __construct($value)
{
<<<<<<< HEAD
if (method_exists($value, 'then')) {
throw new \InvalidArgumentException(
'You cannot create a FulfilledPromise with a promise.');
=======
if (is_object($value) && method_exists($value, 'then')) {
throw new \InvalidArgumentException(
'You cannot create a FulfilledPromise with a promise.'
);
>>>>>>> master
}
$this->value = $value;
@ -30,11 +41,19 @@ class FulfilledPromise implements PromiseInterface
return $this;
}
<<<<<<< HEAD
$queue = queue();
$p = new Promise([$queue, 'run']);
$value = $this->value;
$queue->add(static function () use ($p, $value, $onFulfilled) {
if ($p->getState() === self::PENDING) {
=======
$queue = Utils::queue();
$p = new Promise([$queue, 'run']);
$value = $this->value;
$queue->add(static function () use ($p, $value, $onFulfilled) {
if (Is::pending($p)) {
>>>>>>> master
try {
$p->resolve($onFulfilled($value));
} catch (\Throwable $e) {

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -41,14 +45,23 @@ class Promise implements PromiseInterface
// Return a fulfilled promise and immediately invoke any callbacks.
if ($this->state === self::FULFILLED) {
<<<<<<< HEAD
return $onFulfilled
? promise_for($this->result)->then($onFulfilled)
: promise_for($this->result);
=======
$promise = Create::promiseFor($this->result);
return $onFulfilled ? $promise->then($onFulfilled) : $promise;
>>>>>>> master
}
// It's either cancelled or rejected, so return a rejected promise
// and immediately invoke any callbacks.
<<<<<<< HEAD
$rejection = rejection_for($this->result);
=======
$rejection = Create::rejectionFor($this->result);
>>>>>>> master
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
}
@ -61,6 +74,7 @@ class Promise implements PromiseInterface
{
$this->waitIfPending();
<<<<<<< HEAD
$inner = $this->result instanceof PromiseInterface
? $this->result->wait($unwrap)
: $this->result;
@ -74,6 +88,17 @@ class Promise implements PromiseInterface
// It's rejected so "unwrap" and throw an exception.
throw exception_for($inner);
}
=======
if ($this->result instanceof PromiseInterface) {
return $this->result->wait($unwrap);
}
if ($unwrap) {
if ($this->state === self::FULFILLED) {
return $this->result;
}
// It's rejected so "unwrap" and throw an exception.
throw Create::exceptionFor($this->result);
>>>>>>> master
}
}
@ -103,6 +128,10 @@ class Promise implements PromiseInterface
}
// Reject the promise only if it wasn't rejected in a then callback.
<<<<<<< HEAD
=======
/** @psalm-suppress RedundantCondition */
>>>>>>> master
if ($this->state === self::PENDING) {
$this->reject(new CancellationException('Promise has been cancelled'));
}
@ -148,17 +177,28 @@ class Promise implements PromiseInterface
// If the value was not a settled promise or a thenable, then resolve
// it in the task queue using the correct ID.
<<<<<<< HEAD
if (!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) {
=======
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.
Utils::queue()->add(static function () use ($id, $value, $handlers) {
>>>>>>> master
foreach ($handlers as $handler) {
self::callHandler($id, $value, $handler);
}
});
<<<<<<< HEAD
} elseif ($value instanceof Promise
&& $value->getState() === self::PENDING
) {
=======
} elseif ($value instanceof Promise && Is::pending($value)) {
>>>>>>> master
// We can just merge our handlers onto the next promise.
$value->handlers = array_merge($value->handlers, $handlers);
} else {
@ -184,8 +224,11 @@ class Promise implements PromiseInterface
* @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).
<<<<<<< HEAD
*
* @return array Returns the next group to resolve.
=======
>>>>>>> master
*/
private static function callHandler($index, $value, array $handler)
{
@ -194,13 +237,29 @@ class Promise implements PromiseInterface
// The promise may have been cancelled or resolved before placing
// this thunk in the queue.
<<<<<<< HEAD
if ($promise->getState() !== self::PENDING) {
=======
if (Is::settled($promise)) {
>>>>>>> master
return;
}
try {
if (isset($handler[$index])) {
<<<<<<< HEAD
$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));
>>>>>>> master
} elseif ($index === 1) {
// Forward resolution values as-is.
$promise->resolve($value);
@ -224,15 +283,25 @@ class Promise implements PromiseInterface
} elseif ($this->waitList) {
$this->invokeWaitList();
} else {
<<<<<<< HEAD
// If there's not wait function, then reject the promise.
=======
// If there's no wait function, then reject the promise.
>>>>>>> master
$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.');
}
<<<<<<< HEAD
queue()->run();
=======
Utils::queue()->run();
/** @psalm-suppress RedundantCondition */
>>>>>>> master
if ($this->state === self::PENDING) {
$this->reject('Invoking the wait callback did not resolve the promise');
}
@ -263,6 +332,7 @@ class Promise implements PromiseInterface
$this->waitList = null;
foreach ($waitList as $result) {
<<<<<<< HEAD
while (true) {
$result->waitIfPending();
@ -274,6 +344,15 @@ class Promise implements PromiseInterface
}
break;
}
=======
do {
$result->waitIfPending();
$result = $result->result;
} while ($result instanceof Promise);
if ($result instanceof PromiseInterface) {
$result->wait(false);
>>>>>>> master
}
}
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -56,6 +60,10 @@ interface PromiseInterface
* Resolve the promise with the given value.
*
* @param mixed $value
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws \RuntimeException if the promise is already resolved.
*/
public function resolve($value);
@ -64,6 +72,10 @@ interface PromiseInterface
* Reject the promise with the given reason.
*
* @param mixed $reason
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws \RuntimeException if the promise is already resolved.
*/
public function reject($reason);
@ -86,6 +98,10 @@ interface PromiseInterface
* @param bool $unwrap
*
* @return mixed
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws \LogicException if the promise has no wait function or if the
* promise does not settle after waiting.
*/

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -13,9 +17,16 @@ class RejectedPromise implements PromiseInterface
public function __construct($reason)
{
<<<<<<< HEAD
if (method_exists($reason, 'then')) {
throw new \InvalidArgumentException(
'You cannot create a RejectedPromise with a promise.');
=======
if (is_object($reason) && method_exists($reason, 'then')) {
throw new \InvalidArgumentException(
'You cannot create a RejectedPromise with a promise.'
);
>>>>>>> master
}
$this->reason = $reason;
@ -30,11 +41,19 @@ class RejectedPromise implements PromiseInterface
return $this;
}
<<<<<<< HEAD
$queue = queue();
$reason = $this->reason;
$p = new Promise([$queue, 'run']);
$queue->add(static function () use ($p, $reason, $onRejected) {
if ($p->getState() === self::PENDING) {
=======
$queue = Utils::queue();
$reason = $this->reason;
$p = new Promise([$queue, 'run']);
$queue->add(static function () use ($p, $reason, $onRejected) {
if (Is::pending($p)) {
>>>>>>> master
try {
// Return a resolved promise if onRejected does not throw.
$p->resolve($onRejected($reason));
@ -59,8 +78,15 @@ class RejectedPromise implements PromiseInterface
public function wait($unwrap = true, $defaultDelivery = null)
{
if ($unwrap) {
<<<<<<< HEAD
throw exception_for($this->reason);
}
=======
throw Create::exceptionFor($this->reason);
}
return null;
>>>>>>> master
}
public function getState()

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -12,7 +16,11 @@ class RejectionException extends \RuntimeException
private $reason;
/**
<<<<<<< HEAD
* @param mixed $reason Rejection reason.
=======
* @param mixed $reason Rejection reason.
>>>>>>> master
* @param string $description Optional description
*/
public function __construct($reason, $description = null)

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -8,7 +12,11 @@ namespace GuzzleHttp\Promise;
* maintains a constant stack size. You can use the task queue asynchronously
* by calling the `run()` function of the global task queue in an event loop.
*
<<<<<<< HEAD
* GuzzleHttp\Promise\queue()->run();
=======
* GuzzleHttp\Promise\Utils::queue()->run();
>>>>>>> master
*/
class TaskQueue implements TaskQueueInterface
{
@ -42,8 +50,13 @@ class TaskQueue implements TaskQueueInterface
public function run()
{
<<<<<<< HEAD
/** @var callable $task */
while ($task = array_shift($this->queue)) {
=======
while ($task = array_shift($this->queue)) {
/** @var callable $task */
>>>>>>> master
$task();
}
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
interface TaskQueueInterface
@ -13,8 +17,11 @@ interface TaskQueueInterface
/**
* Adds a task to the queue that will be executed the next time run is
* called.
<<<<<<< HEAD
*
* @param callable $task
=======
>>>>>>> master
*/
public function add(callable $task);

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Promise;
/**
@ -17,6 +21,7 @@ namespace GuzzleHttp\Promise;
* @param TaskQueueInterface $assign Optionally specify a new queue instance.
*
* @return TaskQueueInterface
<<<<<<< HEAD
*/
function queue(TaskQueueInterface $assign = null)
{
@ -29,6 +34,14 @@ function queue(TaskQueueInterface $assign = null)
}
return $queue;
=======
*
* @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.
*/
function queue(TaskQueueInterface $assign = null)
{
return Utils::queue($assign);
>>>>>>> master
}
/**
@ -38,6 +51,7 @@ function queue(TaskQueueInterface $assign = null)
* @param callable $task Task function to run.
*
* @return PromiseInterface
<<<<<<< HEAD
*/
function task(callable $task)
{
@ -54,6 +68,14 @@ function task(callable $task)
});
return $promise;
=======
*
* @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.
*/
function task(callable $task)
{
return Utils::task($task);
>>>>>>> master
}
/**
@ -62,6 +84,7 @@ function task(callable $task)
* @param mixed $value Promise or value.
*
* @return PromiseInterface
<<<<<<< HEAD
*/
function promise_for($value)
{
@ -79,6 +102,14 @@ function promise_for($value)
}
return new FulfilledPromise($value);
=======
*
* @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
*/
function promise_for($value)
{
return Create::promiseFor($value);
>>>>>>> master
}
/**
@ -88,6 +119,7 @@ function promise_for($value)
* @param mixed $reason Promise or reason.
*
* @return PromiseInterface
<<<<<<< HEAD
*/
function rejection_for($reason)
{
@ -96,6 +128,14 @@ function rejection_for($reason)
}
return new RejectedPromise($reason);
=======
*
* @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
*/
function rejection_for($reason)
{
return Create::rejectionFor($reason);
>>>>>>> master
}
/**
@ -104,12 +144,21 @@ function rejection_for($reason)
* @param mixed $reason
*
* @return \Exception|\Throwable
<<<<<<< HEAD
*/
function exception_for($reason)
{
return $reason instanceof \Exception || $reason instanceof \Throwable
? $reason
: new RejectionException($reason);
=======
*
* @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
*/
function exception_for($reason)
{
return Create::exceptionFor($reason);
>>>>>>> master
}
/**
@ -118,6 +167,7 @@ function exception_for($reason)
* @param mixed $value
*
* @return \Iterator
<<<<<<< HEAD
*/
function iter_for($value)
{
@ -128,6 +178,14 @@ function iter_for($value)
} else {
return new \ArrayIterator([$value]);
}
=======
*
* @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
*/
function iter_for($value)
{
return Create::iterFor($value);
>>>>>>> master
}
/**
@ -143,6 +201,7 @@ function iter_for($value)
* @param PromiseInterface $promise Promise or value.
*
* @return array
<<<<<<< HEAD
*/
function inspect(PromiseInterface $promise)
{
@ -158,6 +217,14 @@ function inspect(PromiseInterface $promise)
} catch (\Exception $e) {
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
}
=======
*
* @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
*/
function inspect(PromiseInterface $promise)
{
return Utils::inspect($promise);
>>>>>>> master
}
/**
@ -166,6 +233,7 @@ function inspect(PromiseInterface $promise)
*
* Returns an array of inspection state arrays.
*
<<<<<<< HEAD
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
*
* @return array
@ -179,6 +247,19 @@ function inspect_all($promises)
}
return $results;
=======
* @see inspect for the inspection state array format.
*
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
*
* @return array
*
* @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
*/
function inspect_all($promises)
{
return Utils::inspectAll($promises);
>>>>>>> master
}
/**
@ -188,6 +269,7 @@ function inspect_all($promises)
* the promises were provided). An exception is thrown if any of the promises
* are rejected.
*
<<<<<<< HEAD
* @param mixed $promises Iterable of PromiseInterface objects to wait on.
*
* @return array
@ -202,6 +284,20 @@ function unwrap($promises)
}
return $results;
=======
* @param iterable<PromiseInterface> $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)
{
return Utils::unwrap($promises);
>>>>>>> master
}
/**
@ -212,6 +308,7 @@ 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.
*
<<<<<<< HEAD
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
@ -231,6 +328,18 @@ function all($promises)
ksort($results);
return $results;
});
=======
* @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, $recursive = false)
{
return Utils::all($promises, $recursive);
>>>>>>> master
}
/**
@ -241,13 +350,19 @@ function all($promises)
* fulfilled with an array that contains the fulfillment values of the winners
* in order of resolution.
*
<<<<<<< HEAD
* 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.
>>>>>>> master
*
* @param int $count Total number of promises.
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
<<<<<<< HEAD
*/
function some($count, $promises)
{
@ -280,6 +395,14 @@ function some($count, $promises)
return array_values($results);
}
);
=======
*
* @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
*/
function some($count, $promises)
{
return Utils::some($count, $promises);
>>>>>>> master
}
/**
@ -289,10 +412,19 @@ function some($count, $promises)
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
<<<<<<< HEAD
*/
function any($promises)
{
return some(1, $promises)->then(function ($values) { return $values[0]; });
=======
*
* @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
*/
function any($promises)
{
return Utils::any($promises);
>>>>>>> master
}
/**
@ -301,6 +433,7 @@ function any($promises)
*
* The returned promise is fulfilled with an array of inspection state arrays.
*
<<<<<<< HEAD
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
@ -322,6 +455,19 @@ function settle($promises)
ksort($results);
return $results;
});
=======
* @see inspect for the inspection state array format.
*
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*
* @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
*/
function settle($promises)
{
return Utils::settle($promises);
>>>>>>> master
}
/**
@ -329,6 +475,7 @@ function settle($promises)
* fulfilled with a null value when the iterator has been consumed or the
* aggregate promise has been fulfilled or rejected.
*
<<<<<<< HEAD
* $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.
@ -336,22 +483,40 @@ function settle($promises)
* $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.
=======
* $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 if needed.
>>>>>>> master
*
* @param mixed $iterable Iterator or array to iterate over.
* @param callable $onFulfilled
* @param callable $onRejected
*
* @return PromiseInterface
<<<<<<< HEAD
=======
*
* @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
>>>>>>> master
*/
function each(
$iterable,
callable $onFulfilled = null,
callable $onRejected = null
) {
<<<<<<< HEAD
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
'rejected' => $onRejected
]))->promise();
=======
return Each::of($iterable, $onFulfilled, $onRejected);
>>>>>>> master
}
/**
@ -368,6 +533,11 @@ function each(
* @param callable $onRejected
*
* @return PromiseInterface
<<<<<<< HEAD
=======
*
* @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
>>>>>>> master
*/
function each_limit(
$iterable,
@ -375,11 +545,15 @@ function each_limit(
callable $onFulfilled = null,
callable $onRejected = null
) {
<<<<<<< HEAD
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
'rejected' => $onRejected,
'concurrency' => $concurrency
]))->promise();
=======
return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
>>>>>>> master
}
/**
@ -392,12 +566,18 @@ function each_limit(
* @param callable $onFulfilled
*
* @return PromiseInterface
<<<<<<< HEAD
=======
*
* @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
>>>>>>> master
*/
function each_limit_all(
$iterable,
$concurrency,
callable $onFulfilled = null
) {
<<<<<<< HEAD
return each_limit(
$iterable,
$concurrency,
@ -406,11 +586,15 @@ function each_limit_all(
$aggregate->reject($reason);
}
);
=======
return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
>>>>>>> master
}
/**
* Returns true if a promise is fulfilled.
*
<<<<<<< HEAD
* @param PromiseInterface $promise
*
* @return bool
@ -418,11 +602,21 @@ function each_limit_all(
function is_fulfilled(PromiseInterface $promise)
{
return $promise->getState() === PromiseInterface::FULFILLED;
=======
* @return bool
*
* @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
*/
function is_fulfilled(PromiseInterface $promise)
{
return Is::fulfilled($promise);
>>>>>>> master
}
/**
* Returns true if a promise is rejected.
*
<<<<<<< HEAD
* @param PromiseInterface $promise
*
* @return bool
@ -430,11 +624,21 @@ function is_fulfilled(PromiseInterface $promise)
function is_rejected(PromiseInterface $promise)
{
return $promise->getState() === PromiseInterface::REJECTED;
=======
* @return bool
*
* @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
*/
function is_rejected(PromiseInterface $promise)
{
return Is::rejected($promise);
>>>>>>> master
}
/**
* Returns true if a promise is fulfilled or rejected.
*
<<<<<<< HEAD
* @param PromiseInterface $promise
*
* @return bool
@ -454,4 +658,27 @@ function is_settled(PromiseInterface $promise)
function coroutine(callable $generatorFn)
{
return new Coroutine($generatorFn);
=======
* @return bool
*
* @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
*/
function is_settled(PromiseInterface $promise)
{
return Is::settled($promise);
}
/**
* Create a new coroutine.
*
* @see Coroutine
*
* @return PromiseInterface
*
* @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
*/
function coroutine(callable $generatorFn)
{
return Coroutine::of($generatorFn);
>>>>>>> master
}

View File

@ -9,8 +9,37 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
<<<<<<< HEAD
## [1.6.0]
=======
## [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
>>>>>>> master
### Added

View File

@ -23,11 +23,19 @@ Reads from multiple streams, one after the other.
```php
use GuzzleHttp\Psr7;
<<<<<<< HEAD
$a = Psr7\stream_for('abc, ');
$b = Psr7\stream_for('123.');
$composed = new Psr7\AppendStream([$a, $b]);
$composed->addStream(Psr7\stream_for(' Above all listen to me'));
=======
$a = Psr7\Utils::streamFor('abc, ');
$b = Psr7\Utils::streamFor('123.');
$composed = new Psr7\AppendStream([$a, $b]);
$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me'));
>>>>>>> master
echo $composed; // abc, 123. Above all listen to me.
```
@ -65,7 +73,11 @@ then on disk.
```php
use GuzzleHttp\Psr7;
<<<<<<< HEAD
$original = Psr7\stream_for(fopen('http://www.google.com', 'r'));
=======
$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r'));
>>>>>>> master
$stream = new Psr7\CachingStream($original);
$stream->read(1024);
@ -89,7 +101,11 @@ stream becomes too full.
use GuzzleHttp\Psr7;
// Create an empty stream
<<<<<<< HEAD
$stream = Psr7\stream_for();
=======
$stream = Psr7\Utils::streamFor();
>>>>>>> master
// Start dropping data when the stream has more than 10 bytes
$dropping = new Psr7\DroppingStream($stream, 10);
@ -112,7 +128,11 @@ to create a concrete class for a simple extension point.
use GuzzleHttp\Psr7;
<<<<<<< HEAD
$stream = Psr7\stream_for('hi');
=======
$stream = Psr7\Utils::streamFor('hi');
>>>>>>> master
$fnStream = Psr7\FnStream::decorate($stream, [
'rewind' => function () use ($stream) {
echo 'About to rewind - ';
@ -167,7 +187,11 @@ chunks (e.g. Amazon S3's multipart upload API).
```php
use GuzzleHttp\Psr7;
<<<<<<< HEAD
$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+'));
=======
$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+'));
>>>>>>> master
echo $original->getSize();
// >>> 1048576
@ -197,7 +221,11 @@ NoSeekStream wraps a stream and does not allow seeking.
```php
use GuzzleHttp\Psr7;
<<<<<<< HEAD
$original = Psr7\stream_for('foo');
=======
$original = Psr7\Utils::streamFor('foo');
>>>>>>> master
$noSeek = new Psr7\NoSeekStream($original);
echo $noSeek->read(3);
@ -271,7 +299,11 @@ This decorator could be added to any existing stream and used like so:
```php
use GuzzleHttp\Psr7;
<<<<<<< HEAD
$original = Psr7\stream_for('foo');
=======
$original = Psr7\Utils::streamFor('foo');
>>>>>>> master
$eofStream = new EofCallbackStream($original, function () {
echo 'EOF!';
@ -297,12 +329,17 @@ stream from a PSR-7 stream.
```php
use GuzzleHttp\Psr7\StreamWrapper;
<<<<<<< HEAD
$stream = GuzzleHttp\Psr7\stream_for('hello!');
=======
$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!');
>>>>>>> master
$resource = StreamWrapper::getResource($stream);
echo fread($resource, 6); // outputs hello!
```
<<<<<<< HEAD
# Function API
There are various functions available under the `GuzzleHttp\Psr7` namespace.
@ -311,11 +348,22 @@ There are various functions available under the `GuzzleHttp\Psr7` namespace.
## `function str`
`function str(MessageInterface $message)`
=======
# Static API
There are various static methods available under the `GuzzleHttp\Psr7` namespace.
## `GuzzleHttp\Psr7\Message::toString`
`public static function toString(MessageInterface $message): string`
>>>>>>> master
Returns the string representation of an HTTP message.
```php
$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
<<<<<<< HEAD
echo GuzzleHttp\Psr7\str($request);
```
@ -464,10 +512,163 @@ a rolling hash (based on PHP's hash_init functions).
## `function readline`
`function readline(StreamInterface $stream, $maxLength = null)`
=======
echo GuzzleHttp\Psr7\Message::toString($request);
```
## `GuzzleHttp\Psr7\Message::bodySummary`
`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null`
Get a short summary of the message body.
Will return `null` if the response is not printable.
## `GuzzleHttp\Psr7\Message::rewindBody`
`public static function rewindBody(MessageInterface $message): void`
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`.
## `GuzzleHttp\Psr7\Message::parseMessage`
`public static function parseMessage(string $message): array`
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.
## `GuzzleHttp\Psr7\Message::parseRequestUri`
`public static function parseRequestUri(string $path, array $headers): string`
Constructs a URI for an HTTP request message.
## `GuzzleHttp\Psr7\Message::parseRequest`
`public static function parseRequest(string $message): Request`
Parses a request message string into a request object.
## `GuzzleHttp\Psr7\Message::parseResponse`
`public static function parseResponse(string $message): Response`
Parses a response message string into a response object.
## `GuzzleHttp\Psr7\Header::parse`
`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.
## `GuzzleHttp\Psr7\Header::normalize`
`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.
## `GuzzleHttp\Psr7\Query::parse`
`public static function parse(string $str, int|bool $urlEncoding = true): array`
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\Query::build`
`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string`
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).
## `GuzzleHttp\Psr7\Utils::caselessRemove`
`public static function caselessRemove(iterable<string> $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.
## `GuzzleHttp\Psr7\Utils::hash`
`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string`
Calculate a hash of a stream.
This method reads the entire stream to calculate a rolling hash, based on
PHP's `hash_init` functions.
## `GuzzleHttp\Psr7\Utils::modifyRequest`
`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`
>>>>>>> master
Read a line from the stream up to the maximum allowed buffer length.
<<<<<<< HEAD
## `function parse_request`
`function parse_request($message)`
@ -508,17 +709,130 @@ This function does not modify the provided keys when an array is encountered
## `function mimetype_from_filename`
`function mimetype_from_filename($filename)`
=======
## `GuzzleHttp\Psr7\Utils::streamFor`
`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface`
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.
```php
$stream = GuzzleHttp\Psr7\Utils::streamFor('foo');
$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r'));
$generator = function ($bytes) {
for ($i = 0; $i < $bytes; $i++) {
yield ' ';
}
}
$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100));
```
## `GuzzleHttp\Psr7\Utils::tryFopen`
`public static function tryFopen(string $filename, string $mode): 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.
## `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.
## `GuzzleHttp\Psr7\MimeType::fromFilename`
`public static function fromFilename(string $filename): string|null`
>>>>>>> master
Determines the mimetype of a file by looking at its extension.
<<<<<<< HEAD
## `function mimetype_from_extension`
`function mimetype_from_extension($extension)`
=======
## `GuzzleHttp\Psr7\MimeType::fromExtension`
`public static function fromExtension(string $extension): string|null`
>>>>>>> master
Maps a file extensions to a mimetype.
<<<<<<< HEAD
=======
## 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 will be 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` |
>>>>>>> master
# Additional URI Methods
Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class,

View File

@ -21,14 +21,22 @@
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
},
"require-dev": {
<<<<<<< HEAD
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8",
=======
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10",
>>>>>>> master
"ext-zlib": "*"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"suggest": {
<<<<<<< HEAD
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
=======
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
>>>>>>> master
},
"autoload": {
"psr-4": {
@ -43,7 +51,11 @@
},
"extra": {
"branch-alias": {
<<<<<<< HEAD
"dev-master": "1.6-dev"
=======
"dev-master": "1.7-dev"
>>>>>>> master
}
}
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -61,7 +65,11 @@ class AppendStream implements StreamInterface
public function getContents()
{
<<<<<<< HEAD
return copy_to_string($this);
=======
return Utils::copyToString($this);
>>>>>>> master
}
/**
@ -98,6 +106,11 @@ class AppendStream implements StreamInterface
}
$this->streams = [];
<<<<<<< HEAD
=======
return null;
>>>>>>> master
}
public function tell()

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -49,6 +53,11 @@ class BufferStream implements StreamInterface
public function detach()
{
$this->close();
<<<<<<< HEAD
=======
return null;
>>>>>>> master
}
public function getSize()

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -131,7 +135,11 @@ class CachingStream implements StreamInterface
private function cacheEntireStream()
{
$target = new FnStream(['write' => 'strlen']);
<<<<<<< HEAD
copy_to_stream($this, $target);
=======
Utils::copyToStream($this, $target);
>>>>>>> master
return $this->tell();
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -34,6 +38,10 @@ class FnStream implements StreamInterface
/**
* Lazily determine which methods are not implemented.
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws \BadMethodCallException
*/
public function __get($name)

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -34,6 +38,10 @@ class LazyOpenStream implements StreamInterface
*/
protected function createStream()
{
<<<<<<< HEAD
return stream_for(try_fopen($this->filename, $this->mode));
=======
return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode));
>>>>>>> master
}
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -17,7 +21,11 @@ trait MessageTrait
/** @var string */
private $protocol = '1.1';
<<<<<<< HEAD
/** @var StreamInterface */
=======
/** @var StreamInterface|null */
>>>>>>> master
private $stream;
public function getProtocolVersion()
@ -117,7 +125,11 @@ trait MessageTrait
public function getBody()
{
if (!$this->stream) {
<<<<<<< HEAD
$this->stream = stream_for('');
=======
$this->stream = Utils::streamFor('');
>>>>>>> master
}
return $this->stream;
@ -194,7 +206,11 @@ trait MessageTrait
}
return trim((string) $value, " \t");
<<<<<<< HEAD
}, $values);
=======
}, array_values($values));
>>>>>>> master
}
private function assertHeader($header)

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -71,7 +75,11 @@ class MultipartStream implements StreamInterface
}
// Add the trailing boundary with CRLF
<<<<<<< HEAD
$stream->addStream(stream_for("--{$this->boundary}--\r\n"));
=======
$stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n"));
>>>>>>> master
return $stream;
}
@ -84,7 +92,11 @@ class MultipartStream implements StreamInterface
}
}
<<<<<<< HEAD
$element['contents'] = stream_for($element['contents']);
=======
$element['contents'] = Utils::streamFor($element['contents']);
>>>>>>> master
if (empty($element['filename'])) {
$uri = $element['contents']->getMetadata('uri');
@ -100,9 +112,15 @@ class MultipartStream implements StreamInterface
isset($element['headers']) ? $element['headers'] : []
);
<<<<<<< HEAD
$stream->addStream(stream_for($this->getHeaders($headers)));
$stream->addStream($body);
$stream->addStream(stream_for("\r\n"));
=======
$stream->addStream(Utils::streamFor($this->getHeaders($headers)));
$stream->addStream($body);
$stream->addStream(Utils::streamFor("\r\n"));
>>>>>>> master
}
/**
@ -131,7 +149,11 @@ class MultipartStream implements StreamInterface
// Set a default Content-Type if one was not supplied
$type = $this->getHeader($headers, 'content-type');
if (!$type && ($filename === '0' || $filename)) {
<<<<<<< HEAD
if ($type = mimetype_from_filename($filename)) {
=======
if ($type = MimeType::fromFilename($filename)) {
>>>>>>> master
$headers['Content-Type'] = $type;
}
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -51,7 +55,11 @@ class PumpStream implements StreamInterface
public function __toString()
{
try {
<<<<<<< HEAD
return copy_to_string($this);
=======
return Utils::copyToString($this);
>>>>>>> master
} catch (\Exception $e) {
return '';
}
@ -66,6 +74,11 @@ class PumpStream implements StreamInterface
{
$this->tellPos = false;
$this->source = null;
<<<<<<< HEAD
=======
return null;
>>>>>>> master
}
public function getSize()

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use InvalidArgumentException;
@ -51,7 +55,11 @@ class Request implements RequestInterface
}
if ($body !== '' && $body !== null) {
<<<<<<< HEAD
$this->stream = stream_for($body);
=======
$this->stream = Utils::streamFor($body);
>>>>>>> master
}
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\ResponseInterface;
@ -100,7 +104,11 @@ class Response implements ResponseInterface
$this->statusCode = $status;
if ($body !== '' && $body !== null) {
<<<<<<< HEAD
$this->stream = stream_for($body);
=======
$this->stream = Utils::streamFor($body);
>>>>>>> master
}
$this->setHeaders($headers);
@ -134,7 +142,11 @@ class Response implements ResponseInterface
if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
$reasonPhrase = self::$phrases[$new->statusCode];
}
<<<<<<< HEAD
$new->reasonPhrase = $reasonPhrase;
=======
$new->reasonPhrase = (string) $reasonPhrase;
>>>>>>> master
return $new;
}

View File

@ -79,8 +79,15 @@ class ServerRequest extends Request implements ServerRequestInterface
* Return an UploadedFile instance array.
*
* @param array $files A array which respect $_FILES structure
<<<<<<< HEAD
* @throws InvalidArgumentException for unrecognized values
* @return array
=======
*
* @return array
*
* @throws InvalidArgumentException for unrecognized values
>>>>>>> master
*/
public static function normalizeFiles(array $files)
{

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -76,8 +80,15 @@ class Stream implements StreamInterface
public function __toString()
{
try {
<<<<<<< HEAD
$this->seek(0);
return (string) stream_get_contents($this->stream);
=======
if ($this->isSeekable()) {
$this->seek(0);
}
return $this->getContents();
>>>>>>> master
} catch (\Exception $e) {
return '';
}
@ -193,7 +204,11 @@ class Stream implements StreamInterface
public function seek($offset, $whence = SEEK_SET)
{
$whence = (int) $whence;
<<<<<<< HEAD
=======
>>>>>>> master
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
}

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -52,7 +56,11 @@ trait StreamDecoratorTrait
public function getContents()
{
<<<<<<< HEAD
return copy_to_string($this);
=======
return Utils::copyToString($this);
>>>>>>> master
}
/**
@ -140,6 +148,10 @@ trait StreamDecoratorTrait
* Implement in subclasses to dynamically create streams when requested.
*
* @return StreamInterface
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws \BadMethodCallException
*/
protected function createStream()

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
@ -23,6 +27,10 @@ class StreamWrapper
* @param StreamInterface $stream The stream to get a resource for
*
* @return resource
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws \InvalidArgumentException if stream is not readable or writable
*/
public static function getResource(StreamInterface $stream)

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use InvalidArgumentException;
@ -85,6 +89,10 @@ class UploadedFile implements UploadedFileInterface
* Depending on the value set file or stream variable
*
* @param mixed $streamOrFile
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws InvalidArgumentException
*/
private function setStreamOrFile($streamOrFile)
@ -104,6 +112,10 @@ class UploadedFile implements UploadedFileInterface
/**
* @param int $error
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws InvalidArgumentException
*/
private function setError($error)
@ -125,6 +137,10 @@ class UploadedFile implements UploadedFileInterface
/**
* @param int $size
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws InvalidArgumentException
*/
private function setSize($size)
@ -158,6 +174,10 @@ class UploadedFile implements UploadedFileInterface
/**
* @param string|null $clientFilename
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws InvalidArgumentException
*/
private function setClientFilename($clientFilename)
@ -173,6 +193,10 @@ class UploadedFile implements UploadedFileInterface
/**
* @param string|null $clientMediaType
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws InvalidArgumentException
*/
private function setClientMediaType($clientMediaType)
@ -220,6 +244,10 @@ class UploadedFile implements UploadedFileInterface
/**
* {@inheritdoc}
<<<<<<< HEAD
=======
*
>>>>>>> master
* @throws RuntimeException if the upload was not successful.
*/
public function getStream()
@ -238,7 +266,13 @@ class UploadedFile implements UploadedFileInterface
*
* @see http://php.net/is_uploaded_file
* @see http://php.net/move_uploaded_file
<<<<<<< HEAD
* @param string $targetPath Path to which to move the uploaded file.
=======
*
* @param string $targetPath Path to which to move the uploaded file.
*
>>>>>>> master
* @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
@ -259,7 +293,11 @@ class UploadedFile implements UploadedFileInterface
? rename($this->file, $targetPath)
: move_uploaded_file($this->file, $targetPath);
} else {
<<<<<<< HEAD
copy_to_stream(
=======
Utils::copyToStream(
>>>>>>> master
$this->getStream(),
new LazyOpenStream($targetPath, 'w')
);

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\UriInterface;

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\UriInterface;

View File

@ -1,4 +1,8 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\UriInterface;

View File

@ -1,10 +1,17 @@
<?php
<<<<<<< HEAD
=======
>>>>>>> master
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\MessageInterface;
use Psr\Http\Message\RequestInterface;
<<<<<<< HEAD
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
=======
>>>>>>> master
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
@ -14,6 +21,7 @@ use Psr\Http\Message\UriInterface;
* @param MessageInterface $message Message to convert to a string.
*
* @return string
<<<<<<< HEAD
*/
function str(MessageInterface $message)
{
@ -37,18 +45,33 @@ function str(MessageInterface $message)
}
return "{$msg}\r\n\r\n" . $message->getBody();
=======
*
* @deprecated str will be removed in guzzlehttp/psr7:2.0. Use Message::toString instead.
*/
function str(MessageInterface $message)
{
return Message::toString($message);
>>>>>>> master
}
/**
* Returns a UriInterface for the given value.
*
<<<<<<< HEAD
* 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.
=======
* 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.
>>>>>>> master
*
* @param string|UriInterface $uri
*
* @return UriInterface
<<<<<<< HEAD
* @throws \InvalidArgumentException
*/
function uri_for($uri)
@ -60,6 +83,16 @@ function uri_for($uri)
}
throw new \InvalidArgumentException('URI must be a string or UriInterface');
=======
*
* @throws \InvalidArgumentException
*
* @deprecated uri_for will be removed in guzzlehttp/psr7:2.0. Use Utils::uriFor instead.
*/
function uri_for($uri)
{
return Utils::uriFor($uri);
>>>>>>> master
}
/**
@ -69,10 +102,36 @@ function uri_for($uri)
* - metadata: Array of custom metadata.
* - size: Size of the stream.
*
<<<<<<< HEAD
=======
* 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.
*
>>>>>>> master
* @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
* @param array $options Additional options
*
* @return StreamInterface
<<<<<<< HEAD
* @throws \InvalidArgumentException if the $resource arg is not valid.
*/
function stream_for($resource = '', array $options = [])
@ -114,17 +173,33 @@ function stream_for($resource = '', array $options = [])
}
throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
=======
*
* @throws \InvalidArgumentException if the $resource arg is not valid.
*
* @deprecated stream_for will be removed in guzzlehttp/psr7:2.0. Use Utils::streamFor instead.
*/
function stream_for($resource = '', array $options = [])
{
return Utils::streamFor($resource, $options);
>>>>>>> master
}
/**
* Parse an array of header values containing ";" separated data into an
<<<<<<< HEAD
* array of associative arrays representing the header key value pair
* data of the header. When a parameter does not contain a value, but just
=======
* array of associative arrays representing the header key value pair data
* of the header. When a parameter does not contain a value, but just
>>>>>>> master
* 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.
<<<<<<< HEAD
*/
function parse_header($header)
{
@ -149,6 +224,14 @@ function parse_header($header)
}
return $params;
=======
*
* @deprecated parse_header will be removed in guzzlehttp/psr7:2.0. Use Header::parse instead.
*/
function parse_header($header)
{
return Header::parse($header);
>>>>>>> master
}
/**
@ -158,6 +241,7 @@ function parse_header($header)
* @param string|array $header Header to normalize.
*
* @return array Returns the normalized header field values.
<<<<<<< HEAD
*/
function normalize_header($header)
{
@ -179,11 +263,25 @@ function normalize_header($header)
}
return $result;
=======
*
* @deprecated normalize_header will be removed in guzzlehttp/psr7:2.0. Use Header::normalize instead.
*/
function normalize_header($header)
{
return Header::normalize($header);
>>>>>>> master
}
/**
* Clone and modify a request with the given changes.
*
<<<<<<< HEAD
=======
* This method is useful for reducing the number of clones needed to mutate a
* message.
*
>>>>>>> master
* The changes can be one of:
* - method: (string) Changes the HTTP method.
* - set_headers: (array) Sets the given headers.
@ -197,6 +295,7 @@ function normalize_header($header)
* @param array $changes Changes to apply.
*
* @return RequestInterface
<<<<<<< HEAD
*/
function modify_request(RequestInterface $request, array $changes)
{
@ -263,6 +362,14 @@ function modify_request(RequestInterface $request, array $changes)
? $changes['version']
: $request->getProtocolVersion()
);
=======
*
* @deprecated modify_request will be removed in guzzlehttp/psr7:2.0. Use Utils::modifyRequest instead.
*/
function modify_request(RequestInterface $request, array $changes)
{
return Utils::modifyRequest($request, $changes);
>>>>>>> master
}
/**
@ -274,6 +381,7 @@ function modify_request(RequestInterface $request, array $changes)
* @param MessageInterface $message Message to rewind
*
* @throws \RuntimeException
<<<<<<< HEAD
*/
function rewind_body(MessageInterface $message)
{
@ -282,6 +390,14 @@ function rewind_body(MessageInterface $message)
if ($body->tell()) {
$body->rewind();
}
=======
*
* @deprecated rewind_body will be removed in guzzlehttp/psr7:2.0. Use Message::rewindBody instead.
*/
function rewind_body(MessageInterface $message)
{
Message::rewindBody($message);
>>>>>>> master
}
/**
@ -294,6 +410,7 @@ function rewind_body(MessageInterface $message)
* @param string $mode Mode used to open the file
*
* @return resource
<<<<<<< HEAD
* @throws \RuntimeException if the file cannot be opened
*/
function try_fopen($filename, $mode)
@ -317,6 +434,16 @@ function try_fopen($filename, $mode)
}
return $handle;
=======
*
* @throws \RuntimeException if the file cannot be opened
*
* @deprecated try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead.
*/
function try_fopen($filename, $mode)
{
return Utils::tryFopen($filename, $mode);
>>>>>>> master
}
/**
@ -327,6 +454,7 @@ function try_fopen($filename, $mode)
* @param int $maxLen Maximum number of bytes to read. Pass -1
* to read the entire stream.
* @return string
<<<<<<< HEAD
* @throws \RuntimeException on error.
*/
function copy_to_string(StreamInterface $stream, $maxLen = -1)
@ -357,6 +485,16 @@ function copy_to_string(StreamInterface $stream, $maxLen = -1)
}
return $buffer;
=======
*
* @throws \RuntimeException on error.
*
* @deprecated copy_to_string will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToString instead.
*/
function copy_to_string(StreamInterface $stream, $maxLen = -1)
{
return Utils::copyToString($stream, $maxLen);
>>>>>>> master
}
/**
@ -369,6 +507,7 @@ function copy_to_string(StreamInterface $stream, $maxLen = -1)
* to read the entire stream.
*
* @throws \RuntimeException on error.
<<<<<<< HEAD
*/
function copy_to_stream(
StreamInterface $source,
@ -399,12 +538,28 @@ function copy_to_stream(
/**
* Calculate a hash of a Stream
=======
*
* @deprecated copy_to_stream will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToStream instead.
*/
function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)
{
return Utils::copyToStream($source, $dest, $maxLen);
}
/**
* Calculate a hash of a stream.
*
* This method reads the entire stream to calculate a rolling hash, based on
* PHP's `hash_init` functions.
>>>>>>> master
*
* @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
<<<<<<< HEAD
* @throws \RuntimeException on error.
*/
function hash(
@ -455,6 +610,31 @@ function readline(StreamInterface $stream, $maxLength = null)
}
return $buffer;
=======
*
* @throws \RuntimeException on error.
*
* @deprecated hash will be removed in guzzlehttp/psr7:2.0. Use Utils::hash instead.
*/
function hash(StreamInterface $stream, $algo, $rawOutput = false)
{
return Utils::hash($stream, $algo, $rawOutput);
}
/**
* 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
*
* @return string
*
* @deprecated readline will be removed in guzzlehttp/psr7:2.0. Use Utils::readLine instead.
*/
function readline(StreamInterface $stream, $maxLength = null)
{
return Utils::readLine($stream, $maxLength);
>>>>>>> master
}
/**
@ -463,6 +643,7 @@ function readline(StreamInterface $stream, $maxLength = null)
* @param string $message Request message string.
*
* @return Request
<<<<<<< HEAD
*/
function parse_request($message)
{
@ -483,6 +664,14 @@ function parse_request($message)
);
return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
=======
*
* @deprecated parse_request will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequest instead.
*/
function parse_request($message)
{
return Message::parseRequest($message);
>>>>>>> master
}
/**
@ -491,6 +680,7 @@ function parse_request($message)
* @param string $message Response message string.
*
* @return Response
<<<<<<< HEAD
*/
function parse_response($message)
{
@ -510,20 +700,36 @@ function parse_response($message)
explode('/', $parts[0])[1],
isset($parts[2]) ? $parts[2] : null
);
=======
*
* @deprecated parse_response will be removed in guzzlehttp/psr7:2.0. Use Message::parseResponse instead.
*/
function parse_response($message)
{
return Message::parseResponse($message);
>>>>>>> master
}
/**
* Parse a query string into an associative array.
*
<<<<<<< HEAD
* 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']).
=======
* 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'])`.
>>>>>>> master
*
* @param string $str Query string to parse
* @param int|bool $urlEncoding How the query string is encoded
*
* @return array
<<<<<<< HEAD
*/
function parse_query($str, $urlEncoding = true)
{
@ -560,20 +766,35 @@ function parse_query($str, $urlEncoding = true)
}
return $result;
=======
*
* @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead.
*/
function parse_query($str, $urlEncoding = true)
{
return Query::parse($str, $urlEncoding);
>>>>>>> master
}
/**
* Build a query string from an array of key value pairs.
*
<<<<<<< HEAD
* 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).
=======
* 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).
>>>>>>> master
*
* @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
<<<<<<< HEAD
*/
function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
{
@ -612,11 +833,20 @@ function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
}
return $qs ? (string) substr($qs, 0, -1) : '';
=======
*
* @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead.
*/
function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
{
return Query::build($params, $encoding);
>>>>>>> master
}
/**
* Determines the mimetype of a file by looking at its extension.
*
<<<<<<< HEAD
* @param $filename
*
* @return null|string
@ -624,6 +854,17 @@ function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
function mimetype_from_filename($filename)
{
return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION));
=======
* @param string $filename
*
* @return string|null
*
* @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead.
*/
function mimetype_from_filename($filename)
{
return MimeType::fromFilename($filename);
>>>>>>> master
}
/**
@ -632,6 +873,7 @@ function mimetype_from_filename($filename)
* @param $extension string The file extension.
*
* @return string|null
<<<<<<< HEAD
* @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
*/
function mimetype_from_extension($extension)
@ -745,6 +987,15 @@ function mimetype_from_extension($extension)
return isset($mimetypes[$extension])
? $mimetypes[$extension]
: null;
=======
*
* @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
* @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead.
*/
function mimetype_from_extension($extension)
{
return MimeType::fromExtension($extension);
>>>>>>> master
}
/**
@ -757,6 +1008,7 @@ function mimetype_from_extension($extension)
* @param string $message HTTP request or response to parse.
*
* @return array
<<<<<<< HEAD
* @internal
*/
function _parse_message($message)
@ -812,6 +1064,15 @@ function _parse_message($message)
'headers' => $headers,
'body' => $body,
];
=======
*
* @internal
* @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead.
*/
function _parse_message($message)
{
return Message::parseMessage($message);
>>>>>>> master
}
/**
@ -821,6 +1082,7 @@ function _parse_message($message)
* @param array $headers Array of headers (each value an array).
*
* @return string
<<<<<<< HEAD
* @internal
*/
function _parse_request_uri($path, array $headers)
@ -842,12 +1104,26 @@ function _parse_request_uri($path, array $headers)
/**
* Get a short summary of the message body
=======
*
* @internal
* @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead.
*/
function _parse_request_uri($path, array $headers)
{
return Message::parseRequestUri($path, $headers);
}
/**
* Get a short summary of the message body.
>>>>>>> master
*
* 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
*
<<<<<<< HEAD
* @return null|string
*/
function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
@ -896,4 +1172,28 @@ function _caseless_remove($keys, array $data)
}
return $result;
=======
* @return string|null
*
* @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead.
*/
function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
{
return Message::bodySummary($message, $truncateAt);
}
/**
* Remove the items given by the keys, case insensitively from the data.
*
* @param iterable<string> $keys
*
* @return array
*
* @internal
* @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead.
*/
function _caseless_remove($keys, array $data)
{
return Utils::caselessRemove($keys, $data);
>>>>>>> master
}

View File

@ -1,6 +1,14 @@
CHANGELOG
=========
<<<<<<< HEAD
=======
1.8.0 (2020-10-01)
------------------
* Fixes for PHP 8.0. Pull Request by Remi Collet. GitHub #108.
>>>>>>> master
1.7.0 (2020-08-07)
------------------

View File

@ -21,7 +21,11 @@
"ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
},
"conflict": {
<<<<<<< HEAD
"ext-maxminddb": "<1.7.0,>=2.0.0"
=======
"ext-maxminddb": "<1.8.0,>=2.0.0"
>>>>>>> master
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.*",

View File

@ -45,6 +45,7 @@ typedef size_t strsize_t;
typedef zend_object free_obj_t;
/* For PHP 8 compatibility */
<<<<<<< HEAD
#ifndef TSRMLS_C
#define TSRMLS_C
#endif
@ -54,6 +55,23 @@ typedef zend_object free_obj_t;
#ifndef TSRMLS_DC
#define TSRMLS_DC
#endif
=======
#if PHP_VERSION_ID < 80000
#define PROP_OBJ(zv) (zv)
#else
#define PROP_OBJ(zv) Z_OBJ_P(zv)
#define TSRMLS_C
#define TSRMLS_CC
#define TSRMLS_DC
/* End PHP 8 compatibility */
#endif
>>>>>>> master
#ifndef ZEND_ACC_CTOR
#define ZEND_ACC_CTOR 0
#endif
@ -334,14 +352,19 @@ PHP_METHOD(MaxMind_Db_Reader, metadata) {
return;
}
MMDB_free_entry_data_list(entry_data_list);
<<<<<<< HEAD
#if PHP_VERSION_ID >= 80000
zend_call_method_with_1_params(Z_OBJ_P(return_value),
=======
zend_call_method_with_1_params(PROP_OBJ(return_value),
>>>>>>> master
metadata_ce,
&metadata_ce->constructor,
ZEND_CONSTRUCTOR_FUNC_NAME,
NULL,
&metadata_array);
zval_ptr_dtor(&metadata_array);
<<<<<<< HEAD
#else
zend_call_method_with_1_params(return_value,
metadata_ce,
@ -351,6 +374,8 @@ PHP_METHOD(MaxMind_Db_Reader, metadata) {
&metadata_array);
zval_ptr_dtor(&metadata_array);
#endif
=======
>>>>>>> master
}
PHP_METHOD(MaxMind_Db_Reader, close) {
@ -607,7 +632,11 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
"binary_format_major_version",
sizeof("binary_format_major_version") - 1))) {
zend_update_property(metadata_ce,
<<<<<<< HEAD
object,
=======
PROP_OBJ(object),
>>>>>>> master
"binaryFormatMajorVersion",
sizeof("binaryFormatMajorVersion") - 1,
tmp);
@ -617,7 +646,11 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
"binary_format_minor_version",
sizeof("binary_format_minor_version") - 1))) {
zend_update_property(metadata_ce,
<<<<<<< HEAD
object,
=======
PROP_OBJ(object),
>>>>>>> master
"binaryFormatMinorVersion",
sizeof("binaryFormatMinorVersion") - 1,
tmp);
@ -626,15 +659,27 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
if ((tmp = zend_hash_str_find(HASH_OF(metadata_array),
"build_epoch",
sizeof("build_epoch") - 1))) {
<<<<<<< HEAD
zend_update_property(
metadata_ce, object, "buildEpoch", sizeof("buildEpoch") - 1, tmp);
=======
zend_update_property(metadata_ce,
PROP_OBJ(object),
"buildEpoch",
sizeof("buildEpoch") - 1,
tmp);
>>>>>>> master
}
if ((tmp = zend_hash_str_find(HASH_OF(metadata_array),
"database_type",
sizeof("database_type") - 1))) {
zend_update_property(metadata_ce,
<<<<<<< HEAD
object,
=======
PROP_OBJ(object),
>>>>>>> master
"databaseType",
sizeof("databaseType") - 1,
tmp);
@ -643,28 +688,60 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
if ((tmp = zend_hash_str_find(HASH_OF(metadata_array),
"description",
sizeof("description") - 1))) {
<<<<<<< HEAD
zend_update_property(
metadata_ce, object, "description", sizeof("description") - 1, tmp);
=======
zend_update_property(metadata_ce,
PROP_OBJ(object),
"description",
sizeof("description") - 1,
tmp);
>>>>>>> master
}
if ((tmp = zend_hash_str_find(HASH_OF(metadata_array),
"ip_version",
sizeof("ip_version") - 1))) {
<<<<<<< HEAD
zend_update_property(
metadata_ce, object, "ipVersion", sizeof("ipVersion") - 1, tmp);
=======
zend_update_property(metadata_ce,
PROP_OBJ(object),
"ipVersion",
sizeof("ipVersion") - 1,
tmp);
>>>>>>> master
}
if ((tmp = zend_hash_str_find(
HASH_OF(metadata_array), "languages", sizeof("languages") - 1))) {
<<<<<<< HEAD
zend_update_property(
metadata_ce, object, "languages", sizeof("languages") - 1, tmp);
=======
zend_update_property(metadata_ce,
PROP_OBJ(object),
"languages",
sizeof("languages") - 1,
tmp);
>>>>>>> master
}
if ((tmp = zend_hash_str_find(HASH_OF(metadata_array),
"record_size",
sizeof("record_size") - 1))) {
<<<<<<< HEAD
zend_update_property(
metadata_ce, object, "recordSize", sizeof("recordSize") - 1, tmp);
=======
zend_update_property(metadata_ce,
PROP_OBJ(object),
"recordSize",
sizeof("recordSize") - 1,
tmp);
>>>>>>> master
if (Z_TYPE_P(tmp) == IS_LONG) {
record_size = Z_LVAL_P(tmp);
}
@ -672,7 +749,11 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
if (record_size != 0) {
zend_update_property_long(metadata_ce,
<<<<<<< HEAD
object,
=======
PROP_OBJ(object),
>>>>>>> master
"nodeByteSize",
sizeof("nodeByteSize") - 1,
record_size / 4);
@ -681,8 +762,16 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
if ((tmp = zend_hash_str_find(HASH_OF(metadata_array),
"node_count",
sizeof("node_count") - 1))) {
<<<<<<< HEAD
zend_update_property(
metadata_ce, object, "nodeCount", sizeof("nodeCount") - 1, tmp);
=======
zend_update_property(metadata_ce,
PROP_OBJ(object),
"nodeCount",
sizeof("nodeCount") - 1,
tmp);
>>>>>>> master
if (Z_TYPE_P(tmp) == IS_LONG) {
node_count = Z_LVAL_P(tmp);
}
@ -690,7 +779,11 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) {
if (record_size != 0) {
zend_update_property_long(metadata_ce,
<<<<<<< HEAD
object,
=======
PROP_OBJ(object),
>>>>>>> master
"searchTreeSize",
sizeof("searchTreeSize") - 1,
record_size * node_count / 4);

View File

@ -15,7 +15,11 @@
#ifndef PHP_MAXMINDDB_H
#define PHP_MAXMINDDB_H 1
<<<<<<< HEAD
#define PHP_MAXMINDDB_VERSION "1.7.0"
=======
#define PHP_MAXMINDDB_VERSION "1.8.0"
>>>>>>> master
#define PHP_MAXMINDDB_EXTNAME "maxminddb"
extern zend_module_entry maxminddb_module_entry;

View File

@ -14,9 +14,15 @@
<email>goschwald@maxmind.com</email>
<active>yes</active>
</lead>
<<<<<<< HEAD
<date>2020-08-07</date>
<version>
<release>1.7.0</release>
=======
<date>2020-10-01</date>
<version>
<release>1.8.0</release>
>>>>>>> master
<api>1.7.0</api>
</version>
<stability>
@ -24,6 +30,7 @@
<api>stable</api>
</stability>
<license uri="https://github.com/maxmind/MaxMind-DB-Reader-php/blob/master/LICENSE">Apache License 2.0</license>
<<<<<<< HEAD
<notes>* IMPORTANT: PHP 7.2 or greater is now required.
* The extension no longer depends on the pure PHP classes in
`maxmind-db/reader`. You can use it independently.
@ -35,6 +42,9 @@
#92.
* This is the first release of the extension as a PECL package.
GitHub #34.</notes>
=======
<notes>* Fixes for PHP 8.0. Pull Request by Remi Collet. GitHub #108.</notes>
>>>>>>> master
<contents>
<dir name="/">
<file role="doc" name="LICENSE"/>

View File

@ -1,6 +1,24 @@
CHANGELOG
=========
<<<<<<< HEAD
=======
0.8.1 (2020-11-02)
------------------
* We now correctly handle responses without a `Content-Type` header. In 0.8.0,
such responses could lead to a type error. In particular, this affected the
minFraud Report Transaction endpoint, which returns a response with no
content. Reported by Dmitry Malashko. GitHub #99 on
`maxmind/minfraud-api-php`.
0.8.0 (2020-10-01)
------------------
* PHP 7.2 or greater is now required.
* Added additional type hints.
>>>>>>> master
0.7.0 (2020-05-06)
------------------

View File

@ -5,7 +5,11 @@ shared code between MaxMind's various web service client APIs.
## Requirements ##
<<<<<<< HEAD
The library requires PHP 5.6 or greater.
=======
The library requires PHP 7.2 or greater.
>>>>>>> master
There are several other dependencies as defined in the `composer.json` file.

View File

@ -12,14 +12,22 @@
}
],
"require": {
<<<<<<< HEAD
"php": ">=5.6",
=======
"php": ">=7.2",
>>>>>>> master
"composer/ca-bundle": "^1.0.3",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.*",
<<<<<<< HEAD
"phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0",
=======
"phpunit/phpunit": "^8.0 || ^9.0",
>>>>>>> master
"squizlabs/php_codesniffer": "3.*"
},
"autoload": {

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace MaxMind\Exception;
/**

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace MaxMind\Exception;
/**
@ -19,21 +24,35 @@ class HttpException extends WebServiceException
* @param \Exception $previous the previous exception, if any
*/
public function __construct(
<<<<<<< HEAD
$message,
$httpStatus,
$uri,
=======
string $message,
int $httpStatus,
string $uri,
>>>>>>> master
\Exception $previous = null
) {
$this->uri = $uri;
parent::__construct($message, $httpStatus, $previous);
}
<<<<<<< HEAD
public function getUri()
=======
public function getUri(): string
>>>>>>> master
{
return $this->uri;
}
<<<<<<< HEAD
public function getStatusCode()
=======
public function getStatusCode(): int
>>>>>>> master
{
return $this->getCode();
}

View File

@ -1,5 +1,10 @@
<?php
<<<<<<< HEAD
=======
declare(strict_types=1);
>>>>>>> master
namespace MaxMind\Exception;
/**

Some files were not shown because too many files have changed in this diff Show More