diff --git a/composer.json b/composer.json index 7a811a8..6753fee 100644 --- a/composer.json +++ b/composer.json @@ -15,16 +15,17 @@ "issues": "https://github.com/bluem-development/bluem-php" }, "require": { - "php": ">=7.4|>=8.0", + "php": ">=8.0", "nesbot/carbon": "^2.31", - "pear/http_request2": "v2.4.2", + "pear/http_request2": "^2.5", "selective/xmldsig": "^2.4", "ext-dom": "*", "ext-libxml": "*", "ext-simplexml": "*", "ext-curl": "*", "ext-json": "*", - "ext-openssl": "*" + "ext-openssl": "*", + "robrichards/xmlseclibs": "^3.1" }, "autoload": { "psr-4": { @@ -35,6 +36,7 @@ "phpunit/phpunit": "^9.5", "phpspec/prophecy": "~1.0", "vlucas/phpdotenv": "^5.4", - "roave/security-advisories": "dev-latest" + "roave/security-advisories": "dev-latest", + "rector/rector": "^0.15.10" } } diff --git a/composer.lock b/composer.lock index 6403ee7..ef91aba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fee8832dd825153efb9cb0f1da92a719", + "content-hash": "1069edcedcf601a548e6ef5c865f28aa", "packages": [ { "name": "nesbot/carbon", - "version": "2.60.0", + "version": "2.65.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "00a259ae02b003c563158b54fb6743252b638ea6" + "reference": "09acf64155c16dc6f580f36569ae89344e9734a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/00a259ae02b003c563158b54fb6743252b638ea6", - "reference": "00a259ae02b003c563158b54fb6743252b638ea6", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/09acf64155c16dc6f580f36569ae89344e9734a3", + "reference": "09acf64155c16dc6f580f36569ae89344e9734a3", "shasum": "" }, "require": { @@ -28,7 +28,7 @@ "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/dbal": "^2.0 || ^3.1.4", "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", @@ -106,20 +106,20 @@ "type": "tidelift" } ], - "time": "2022-07-27T15:57:48+00:00" + "time": "2023-01-06T15:55:01+00:00" }, { "name": "pear/http_request2", - "version": "v2.4.2", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/pear/HTTP_Request2.git", - "reference": "84da432fbbf615593bd8aa25408aca3478b77502" + "reference": "db4ce7844f838d3adca0513a77420c0fec22ed2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/84da432fbbf615593bd8aa25408aca3478b77502", - "reference": "84da432fbbf615593bd8aa25408aca3478b77502", + "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/db4ce7844f838d3adca0513a77420c0fec22ed2d", + "reference": "db4ce7844f838d3adca0513a77420c0fec22ed2d", "shasum": "" }, "require": { @@ -128,7 +128,7 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "^3.7|^4.8|^5.7" + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-curl": "Allows using cURL as a request backend.", @@ -162,10 +162,10 @@ ], "support": { "docs": "https://pear.php.net/manual/en/package.http.http-request2.php", - "issues": "https://pear.php.net/bugs/search.php?cmd=display&package_name[]=HTTP_Request2", + "issues": "https://github.com/pear/HTTP_Request2/issues", "source": "https://github.com/pear/HTTP_Request2" }, - "time": "2020-09-24T22:07:33+00:00" + "time": "2022-01-06T18:20:25+00:00" }, { "name": "pear/net_url2", @@ -294,6 +294,48 @@ }, "time": "2021-03-21T15:43:46+00:00" }, + { + "name": "robrichards/xmlseclibs", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/robrichards/xmlseclibs.git", + "reference": "f8f19e58f26cdb42c54b214ff8a820760292f8df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/f8f19e58f26cdb42c54b214ff8a820760292f8df", + "reference": "f8f19e58f26cdb42c54b214ff8a820760292f8df", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">= 5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "RobRichards\\XMLSecLibs\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "A PHP library for XML Security", + "homepage": "https://github.com/robrichards/xmlseclibs", + "keywords": [ + "security", + "signature", + "xml", + "xmldsig" + ], + "support": { + "issues": "https://github.com/robrichards/xmlseclibs/issues", + "source": "https://github.com/robrichards/xmlseclibs/tree/3.1.1" + }, + "time": "2020-09-05T13:00:25+00:00" + }, { "name": "selective/xmldsig", "version": "2.4.0", @@ -346,85 +388,18 @@ "abandoned": "robrichards/xmlseclibs", "time": "2022-01-04T10:45:51+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -439,7 +414,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -478,7 +453,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -494,20 +469,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -516,7 +491,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -561,7 +536,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -577,52 +552,50 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/translation", - "version": "v5.4.11", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "7a1a8f6bbff269f434a83343a0a5d36a4f8cfa21" + "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/7a1a8f6bbff269f434a83343a0a5d36a4f8cfa21", - "reference": "7a1a8f6bbff269f434a83343a0a5d36a4f8cfa21", + "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", + "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "conflict": { - "symfony/config": "<4.4", - "symfony/console": "<5.3", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", + "symfony/config": "^5.4|^6.0", "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/yaml": "^5.4|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -658,7 +631,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.11" + "source": "https://github.com/symfony/translation/tree/v6.0.19" }, "funding": [ { @@ -674,24 +647,24 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe" + "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe", - "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", + "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -699,7 +672,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -736,7 +709,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" }, "funding": [ { @@ -752,36 +725,36 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2022-06-27T17:10:44+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -808,7 +781,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -824,7 +797,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "graham-campbell/result-type", @@ -949,16 +922,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -999,9 +972,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "phar-io/manifest", @@ -1226,25 +1199,30 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -1270,9 +1248,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" }, - "time": "2022-03-15T21:29:03+00:00" + "time": "2022-10-14T12:47:21+00:00" }, { "name": "phpoption/phpoption", @@ -1351,21 +1329,21 @@ }, { "name": "phpspec/prophecy", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" @@ -1412,29 +1390,88 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-11-29T15:06:56+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.9.14", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", + "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.9.14" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2023-01-19T10:47:09+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1483,7 +1520,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" }, "funding": [ { @@ -1491,7 +1528,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2023-01-26T08:26:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1736,20 +1773,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e", + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1760,7 +1797,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -1768,19 +1804,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -1822,7 +1855,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28" }, "funding": [ { @@ -1832,9 +1865,69 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2023-01-14T12:32:24+00:00" + }, + { + "name": "rector/rector", + "version": "0.15.10", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "000bfb6f7974449399f39e1a210458395b75c887" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/000bfb6f7974449399f39e1a210458395b75c887", + "reference": "000bfb6f7974449399f39e1a210458395b75c887", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.9.7" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-php-parser": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.14-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/0.15.10" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2023-01-21T14:30:16+00:00" }, { "name": "roave/security-advisories", @@ -1842,19 +1935,21 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "83594c26a26f66af6e5322b9011b2e243a5509e8" + "reference": "85ea494f3599c1d23c81c65d0c994e0f80895a75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/83594c26a26f66af6e5322b9011b2e243a5509e8", - "reference": "83594c26a26f66af6e5322b9011b2e243a5509e8", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/85ea494f3599c1d23c81c65d0c994e0f80895a75", + "reference": "85ea494f3599c1d23c81c65d0c994e0f80895a75", "shasum": "" }, "conflict": { "3f/pygmentize": "<1.2", "admidio/admidio": "<4.1.9", "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", + "aheinze/cockpit": "<=2.2.1", "akaunting/akaunting": "<2.1.13", + "akeneo/pim-community-dev": "<5.0.119|>=6,<6.0.53", "alextselegidis/easyappointments": "<=1.4.3", "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", "amazing/media2click": ">=1,<1.3.3", @@ -1863,16 +1958,22 @@ "amphp/http-client": ">=4,<4.4", "anchorcms/anchor-cms": "<=0.12.7", "andreapollastri/cipi": "<=3.1.15", + "apereo/phpcas": "<1.6", "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", "appwrite/server-ce": "<0.11.1|>=0.12,<0.12.2", + "arc/web": "<3", "area17/twill": "<1.2.5|>=2,<2.5.3", "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "awesome-support/awesome-support": "<=6.0.7", "aws/aws-sdk-php": ">=3,<3.2.1", + "backdrop/backdrop": "<=1.23", + "badaso/core": "<2.7", "bagisto/bagisto": "<0.1.5", "barrelstrength/sprout-base-email": "<1.2.7", "barrelstrength/sprout-forms": "<3.9", "barryvdh/laravel-translation-manager": "<0.6.2", - "baserproject/basercms": "<4.5.4", + "barzahlen/barzahlen-php": "<2.0.1", + "baserproject/basercms": "<4.7.2", "billz/raspap-webgui": "<=2.6.6", "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3", "bmarshall511/wordpress_zero_spam": "<5.2.13", @@ -1887,19 +1988,21 @@ "bugsnag/bugsnag-laravel": ">=2,<2.0.2", "bytefury/crater": "<6.0.2", "cachethq/cachet": "<2.5.1", - "cakephp/cakephp": "<3.10.3|>=4,<4.0.6", + "cakephp/cakephp": "<3.10.3|>=4,<4.0.10|>=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10|= 1.3.7|>=4.1,<4.1.4", + "cakephp/database": ">=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", "cardgate/magento2": "<2.0.33", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "catfan/medoo": "<1.7.5", - "centreon/centreon": "<20.10.7", + "centreon/centreon": "<22.10-beta.1", "cesnet/simplesamlphp-module-proxystatistics": "<3.1", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<=3.0.6", - "codeigniter4/framework": "<4.1.9", + "codeigniter4/framework": "<4.2.11", + "codeigniter4/shield": "= 1.0.0-beta", "codiad/codiad": "<=2.8.4", "composer/composer": "<1.10.26|>=2-alpha.1,<2.2.12|>=2.3,<2.3.5", - "concrete5/concrete5": "<9", + "concrete5/concrete5": "<=9.1.3|>= 9.0.0RC1, < 9.1.3", "concrete5/core": "<8.5.8|>=9,<9.1", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/contao": ">=4,<4.4.56|>=4.5,<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3", @@ -1907,13 +2010,14 @@ "contao/core-bundle": "<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3|= 4.10.0", "contao/listing-bundle": ">=4,<4.4.8", "contao/managed-edition": "<=1.5", - "craftcms/cms": "<3.7.36", + "craftcms/cms": "<3.7.55.2|>= 4.0.0-RC1, < 4.2.1", "croogo/croogo": "<3.0.7", "cuyz/valinor": "<0.12", "czproject/git-php": "<4.0.3", "darylldoyle/safe-svg": "<1.9.10", "datadog/dd-trace": ">=0.30,<0.30.2", "david-garcia/phpwhois": "<=4.3.1", + "dbrisinajumi/d2files": "<1", "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", "directmailteam/direct-mail": "<5.2.4", "doctrine/annotations": ">=1,<1.2.7", @@ -1925,8 +2029,8 @@ "doctrine/mongodb-odm": ">=1,<1.0.2", "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", - "dolibarr/dolibarr": "<16|= 12.0.5|>= 3.3.beta1, < 13.0.2", - "dompdf/dompdf": "<2", + "dolibarr/dolibarr": "<16|>=16.0.1,<16.0.3|= 12.0.5|>= 3.3.beta1, < 13.0.2", + "dompdf/dompdf": "<2.0.1", "drupal/core": ">=7,<7.91|>=8,<9.3.19|>=9.4,<9.4.3", "drupal/drupal": ">=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", "dweeves/magmi": "<=0.7.24", @@ -1938,65 +2042,75 @@ "enshrined/svg-sanitize": "<0.15", "erusev/parsedown": "<1.7.2", "ether/logs": "<3.0.4", + "exceedone/exment": "<4.4.3|>=5,<5.0.3", + "exceedone/laravel-admin": "= 3.0.0|<2.2.3", "ezsystems/demobundle": ">=5.4,<5.4.6.1", "ezsystems/ez-support-tools": ">=2.2,<2.2.3", "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", "ezsystems/ezplatform": "<=1.13.6|>=2,<=2.5.24", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.27", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.29|>=2.3,<2.3.26", "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", - "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.19", + "ezsystems/ezplatform-graphql": ">=1-rc.1,<1.0.13|>=2-beta.1,<2.3.12", + "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.26", "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", "ezsystems/ezplatform-richtext": ">=2.3,<=2.3.7", "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.29", + "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.30", "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.3.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2", "facturascripts/facturascripts": "<=2022.8", "feehi/cms": "<=2.1.1", - "feehi/feehicms": "<=0.1.3", + "feehi/feehicms": "<=2.1.1", "fenom/fenom": "<=2.12.1", "filegator/filegator": "<7.8", "firebase/php-jwt": "<2", - "flarum/core": ">=1,<=1.0.1", + "flarum/core": "<1.6.3", + "flarum/mentions": "<1.6.3", "flarum/sticky": ">=0.1-beta.14,<=0.1-beta.15", "flarum/tags": "<=0.1-beta.13", "fluidtypo3/vhs": "<5.1.1", + "fof/byobu": ">=0.3-beta.2,<1.1.7", "fof/upload": "<1.2.3", "fooman/tcpdf": "<6.2.22", "forkcms/forkcms": "<5.11.1", "fossar/tcpdf-parser": "<6.2.22", - "francoisjacquet/rosariosis": "<9.1", + "francoisjacquet/rosariosis": "<10.1", "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "froala/wysiwyg-editor": "<3.2.7", - "froxlor/froxlor": "<=0.10.22", + "froxlor/froxlor": "<2.0.8", "fuel/core": "<1.8.1", "gaoming13/wechat-php-sdk": "<=1.10.2", "genix/cms": "<=1.1.11", "getgrav/grav": "<1.7.34", - "getkirby/cms": "<3.5.8", + "getkirby/cms": "= 3.8.0|<3.5.8.2|>=3.6,<3.6.6.2|>=3.7,<3.7.5.1", "getkirby/panel": "<2.5.14", + "getkirby/starterkit": "<=3.7.0.2", "gilacms/gila": "<=1.11.4", "globalpayments/php-sdk": "<2", "google/protobuf": "<3.15", "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", - "grumpydictator/firefly-iii": "<5.6.5", + "grumpydictator/firefly-iii": "<5.8", "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", "guzzlehttp/psr7": "<1.8.4|>=2,<2.1.1", + "harvesthq/chosen": "<1.8.7", "helloxz/imgurl": "= 2.31|<=2.31", "hillelcoren/invoice-ninja": "<5.3.35", + "himiklab/yii2-jqgrid-widget": "<1.0.8", "hjue/justwriting": "<=1", "hov/jobfair": "<1.0.13|>=2,<2.0.2", "hyn/multi-tenant": ">=5.6,<5.7.2", - "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4", + "ibexa/admin-ui": ">=4.2,<4.2.3", + "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3", + "ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3", "ibexa/post-install": "<=1.0.4", "icecoder/icecoder": "<=8.1", "idno/known": "<=1.3.1", @@ -2006,21 +2120,25 @@ "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "illuminate/view": "<6.20.42|>=7,<7.30.6|>=8,<8.75", "impresscms/impresscms": "<=1.4.3", - "in2code/femanager": "<5.5.1|>=6,<6.3.1", + "in2code/femanager": "<5.5.2|>=6,<6.3.3|>=7,<7.0.1", "in2code/lux": "<17.6.1|>=18,<24.0.2", + "innologi/typo3-appointments": "<2.0.6", "intelliants/subrion": "<=4.2.1", "islandora/islandora": ">=2,<2.4.1", "ivankristianto/phpwhois": "<=4.3", "jackalope/jackalope-doctrine-dbal": "<1.7.4", "james-heinrich/getid3": "<1.9.21", + "jasig/phpcas": "<1.3.3", "joomla/archive": "<1.1.12|>=2,<2.0.1", "joomla/filesystem": "<1.6.2|>=2,<2.0.1", "joomla/filter": "<1.4.4|>=2,<2.0.1", "joomla/input": ">=2,<2.0.2", "joomla/session": "<1.3.1", + "joyqi/hyper-down": "<=2.4.27", "jsdecena/laracom": "<2.0.9", "jsmitty12/phpwhois": "<5.1", "kazist/phpwhois": "<=4.2.6", + "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", "kitodo/presentation": "<3.1.2", "klaviyo/magento2-extension": ">=1,<3", @@ -2032,7 +2150,6 @@ "laminas/laminas-http": "<2.14.2", "laravel/fortify": "<1.11.1", "laravel/framework": "<6.20.42|>=7,<7.30.6|>=8,<8.75", - "laravel/laravel": "<=9.1.8", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "latte/latte": "<2.10.8", "lavalite/cms": "<=5.8", @@ -2040,7 +2157,8 @@ "league/commonmark": "<0.18.3", "league/flysystem": "<1.1.4|>=2,<2.1.1", "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", - "librenms/librenms": "<22.4", + "librenms/librenms": "<22.10", + "liftkit/database": "<2.13.2", "limesurvey/limesurvey": "<3.27.19", "livehelperchat/livehelperchat": "<=3.91", "livewire/livewire": ">2.2.4,<2.2.6", @@ -2055,14 +2173,18 @@ "matyhtf/framework": "<3.0.6", "mautic/core": "<4.3|= 2.13.1", "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "melisplatform/melis-asset-manager": "<5.0.1", + "melisplatform/melis-cms": "<5.0.1", + "melisplatform/melis-front": "<5.0.1", "mezzio/mezzio-swoole": "<3.7|>=4,<4.3", - "microweber/microweber": "<1.3", + "mgallegos/laravel-jqgrid": "<=1.3", + "microweber/microweber": "<=1.3.1", "miniorange/miniorange-saml": "<1.4.3", "mittwald/typo3_forum": "<1.2.1", "modx/revolution": "<= 2.8.3-pl|<2.8", "mojo42/jirafeau": "<4.4", "monolog/monolog": ">=1.8,<1.12", - "moodle/moodle": "<4.0.1", + "moodle/moodle": "<4.0.5", "mustache/mustache": ">=2,<2.14.1", "namshi/jose": "<2.2", "neoan3-apps/template": "<1.1.1", @@ -2075,6 +2197,7 @@ "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", "nilsteampassnet/teampass": "<=2.1.27.36", + "notrinos/notrinos-erp": "<=0.7", "noumo/easyii": "<=0.9", "nukeviet/nukeviet": "<4.5.2", "nystudio107/craft-seomatic": "<3.4.12", @@ -2083,15 +2206,15 @@ "october/cms": "= 1.1.1|= 1.0.471|= 1.0.469|>=1.0.319,<1.0.469", "october/october": ">=1.0.319,<1.0.466|>=2.1,<2.1.12", "october/rain": "<1.0.472|>=1.1,<1.1.2", - "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.15", + "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.0.66", "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", "open-web-analytics/open-web-analytics": "<1.7.4", - "opencart/opencart": "<=3.0.3.2", + "opencart/opencart": "<=3.0.3.7", "openid/php-openid": "<2.3", - "openmage/magento-lts": "<19.4.15|>=20,<20.0.13", + "openmage/magento-lts": "<19.4.22|>=20,<20.0.19", "orchid/platform": ">=9,<9.4.4", - "oro/commerce": ">=5,<5.0.4", + "oro/commerce": ">=4.1,<5.0.6", "oro/crm": ">=1.7,<1.7.4|>=3.1,<4.1.17|>=4.2,<4.2.7", "oro/platform": ">=1.7,<1.7.4|>=3.1,<3.1.29|>=4.1,<4.1.17|>=4.2,<4.2.8", "packbackbooks/lti-1-3-php-library": "<5", @@ -2106,10 +2229,12 @@ "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1", "personnummer/personnummer": "<3.0.2", "phanan/koel": "<5.1.4", + "php-mod/curl": "<2.3.2", "phpfastcache/phpfastcache": "<6.1.5|>=7,<7.1.2|>=8,<8.0.7", "phpmailer/phpmailer": "<6.5", "phpmussel/phpmussel": ">=1,<1.6", "phpmyadmin/phpmyadmin": "<5.1.3", + "phpmyfaq/phpmyfaq": "<=3.1.7", "phpoffice/phpexcel": "<1.8", "phpoffice/phpspreadsheet": "<1.16", "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.7", @@ -2117,31 +2242,37 @@ "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", + "phpxmlrpc/phpxmlrpc": "<4.9.2", "pimcore/data-hub": "<1.2.4", - "pimcore/pimcore": "<10.4.4", + "pimcore/pimcore": "<10.5.14", "pocketmine/bedrock-protocol": "<8.0.2", - "pocketmine/pocketmine-mp": ">= 4.0.0-BETA5, < 4.4.2|<4.2.10", + "pocketmine/pocketmine-mp": "<4.12.5|>= 4.0.0-BETA5, < 4.4.2", "pressbooks/pressbooks": "<5.18", "prestashop/autoupgrade": ">=4,<4.10.1", "prestashop/blockwishlist": ">=2,<2.1.1", - "prestashop/contactform": ">1.0.1,<4.3", + "prestashop/contactform": ">=1.0.1,<4.3", "prestashop/gamification": "<2.3.2", - "prestashop/prestashop": ">=1.6.0.10,<1.7.8.7", - "prestashop/productcomments": ">=4,<4.2.1", + "prestashop/prestashop": "<1.7.8.8", + "prestashop/productcomments": "<5.0.2", "prestashop/ps_emailsubscription": "<2.6.1", "prestashop/ps_facetedsearch": "<3.4.1", "prestashop/ps_linklist": "<3.1", "privatebin/privatebin": "<1.4", + "processwire/processwire": "<=3.0.200", "propel/propel": ">=2-alpha.1,<=2-alpha.7", "propel/propel1": ">=1,<=1.7.1", "pterodactyl/panel": "<1.7", "ptrofimov/beanstalk_console": "<1.7.14", "pusher/pusher-php-server": "<2.2.1", "pwweb/laravel-core": "<=0.3.6-beta", + "pyrocms/pyrocms": "<=3.9.1", "rainlab/debugbar-plugin": "<3.1", + "rankmath/seo-by-rank-math": "<=1.0.95", + "react/http": ">=0.7,<1.7", "remdex/livehelperchat": "<3.99", "rmccue/requests": ">=1.6,<1.8", "robrichards/xmlseclibs": "<3.0.4", + "roots/soil": "<4.1", "rudloff/alltube": "<3.0.3", "s-cart/core": "<6.9", "s-cart/s-cart": "<6.9", @@ -2150,37 +2281,41 @@ "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", - "shopware/core": "<=6.4.9", - "shopware/platform": "<=6.4.9", + "shopware/core": "<=6.4.18", + "shopware/platform": "<=6.4.18", "shopware/production": "<=6.3.5.2", - "shopware/shopware": "<=5.7.13", + "shopware/shopware": "<=5.7.14", "shopware/storefront": "<=6.4.8.1", "shopxo/shopxo": "<2.2.6", "showdoc/showdoc": "<2.10.4", - "silverstripe/admin": ">=1,<1.8.1", - "silverstripe/assets": ">=1,<1.10.1", - "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", + "silverstripe/admin": ">=1,<1.11.3", + "silverstripe/assets": ">=1,<1.11.1", + "silverstripe/cms": "<4.11.3", "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.10.9", + "silverstripe/framework": "<4.11.14", "silverstripe/graphql": "<3.5.2|>=4-alpha.1,<4-alpha.2|= 4.0.0-alpha1", "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", "silverstripe/silverstripe-omnipay": "<2.5.2|>=3,<3.0.2|>=3.1,<3.1.4|>=3.2,<3.2.1", - "silverstripe/subsites": ">=2,<2.1.1", + "silverstripe/subsites": ">=2,<2.6.1", "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", "silverstripe/userforms": "<3", + "silverstripe/versioned-admin": ">=1,<1.11.1", "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", "simplesamlphp/simplesamlphp": "<1.18.6", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "simplesamlphp/simplesamlphp-module-openid": "<1", + "simplesamlphp/simplesamlphp-module-openidprovider": "<0.9", "simplito/elliptic-php": "<1.0.6", "slim/slim": "<2.6", - "smarty/smarty": "<3.1.45|>=4,<4.1.1", - "snipe/snipe-it": "<=6.0.2|>= 6.0.0-RC-1, <= 6.0.0-RC-5", + "smarty/smarty": "<3.1.47|>=4,<4.2.1", + "snipe/snipe-it": "<=6.0.14|>= 6.0.0-RC-1, <= 6.0.0-RC-5", "socalnick/scn-social-auth": "<1.15.2", "socialiteproviders/steam": "<1.1", + "spatie/browsershot": "<3.57.4", "spipu/html2pdf": "<5.2.4", "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", @@ -2189,7 +2324,9 @@ "stormpath/sdk": ">=0,<9.9.99", "studio-42/elfinder": "<2.1.59", "subrion/cms": "<=4.2.1", + "sukohi/surpass": "<1", "sulu/sulu": "= 2.4.0-RC1|<1.6.44|>=2,<2.2.18|>=2.3,<2.3.8", + "sumocoders/framework-user-bundle": "<1.4", "swiftmailer/swiftmailer": ">=4,<5.4.5", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", @@ -2199,8 +2336,9 @@ "sylius/sylius": "<1.9.10|>=1.10,<1.10.11|>=1.11,<1.11.2", "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4", + "symbiote/silverstripe-seed": "<6.0.3", "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfont/process": ">=0,<4", + "symfont/process": ">=0", "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", @@ -2238,54 +2376,62 @@ "thelia/thelia": ">=2.1-beta.1,<2.1.3", "theonedemon/phpwhois": "<=4.2.5", "thinkcmf/thinkcmf": "<=5.1.7", - "tinymce/tinymce": "<5.10", + "thorsten/phpmyfaq": "<3.1.10", + "tinymce/tinymce": "<5.10.7|>=6,<6.3.1", "titon/framework": ">=0,<9.9.99", - "topthink/framework": "<=6.0.12", + "tobiasbg/tablepress": "<= 2.0-RC1", + "topthink/framework": "<6.0.14", "topthink/think": "<=6.0.9", "topthink/thinkphp": "<=3.2.3", - "tribalsystems/zenario": "<9.2.55826", + "tribalsystems/zenario": "<=9.3.57595", "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.38|>=2,<2.14.11|>=3,<3.3.8", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.38|>=9,<9.5.29|>=10,<10.4.29|>=11,<11.5.11", + "ttskch/pagination-service-provider": "<1", + "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", + "typo3/cms": "<2.0.5|>=3,<3.0.3|>=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.38|>=9,<9.5.29|>=10,<10.4.33|>=11,<11.5.20|>=12,<12.1.1", "typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", - "typo3/cms-core": ">=6.2,<=6.2.56|>=7,<7.6.57|>=8,<8.7.47|>=9,<9.5.35|>=10,<10.4.29|>=11,<11.5.11", + "typo3/cms-core": "<8.7.49|>=9,<9.5.38|>=10,<10.4.33|>=11,<11.5.20|>=12,<12.1.1", "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "typo3/html-sanitizer": ">=1,<1.5|>=2,<2.1.1", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", "ua-parser/uap-php": "<3.8", - "unisharp/laravel-filemanager": "<=2.3", + "unisharp/laravel-filemanager": "<=2.5.1", "userfrosting/userfrosting": ">=0.3.1,<4.6.3", "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", "vanilla/safecurl": "<0.9.2", "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", + "vova07/yii2-fileapi-widget": "<0.1.9", "vrana/adminer": "<4.8.1", "wallabag/tcpdf": "<6.2.22", "wanglelecc/laracms": "<=1.0.3", "web-auth/webauthn-framework": ">=3.3,<3.3.4", "webcoast/deferred-image-processing": "<1.0.2", + "webpa/webpa": "<3.1.2", "wikimedia/parsoid": "<0.12.2", "willdurand/js-translation-bundle": "<2.1.1", - "wintercms/winter": "<1.0.475|>=1.1,<1.1.9", + "wintercms/winter": "<1.0.475|>=1.1,<1.1.10|>=1.2,<1.2.1", "woocommerce/woocommerce": "<6.6", "wp-cli/wp-cli": "<2.5", "wp-graphql/wp-graphql": "<0.3.5", "wpanel/wpanel4-cms": "<=4.3.1", "wwbn/avideo": "<=11.6", + "xataface/xataface": "<3", "yeswiki/yeswiki": "<4.1", - "yetiforce/yetiforce-crm": "<6.4", + "yetiforce/yetiforce-crm": "<=6.4", "yidashi/yii2cmf": "<=2", "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii": "<1.1.27", "yiisoft/yii2": "<2.0.38", "yiisoft/yii2-bootstrap": "<2.0.4", "yiisoft/yii2-dev": "<2.0.43", "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-gii": "<=2.2.4", "yiisoft/yii2-jui": "<2.0.4", "yiisoft/yii2-redis": "<2.0.8", + "yikesinc/yikes-inc-easy-mailchimp-extender": "<6.8.6", "yoast-seo-for-typo3/yoast_seo": "<7.2.3", "yourls/yourls": "<=1.8.2", "zendesk/zendesk_api_client_php": "<2.2.11", @@ -2349,7 +2495,7 @@ "type": "tidelift" } ], - "time": "2022-07-29T23:04:14+00:00" + "time": "2023-01-26T20:04:06+00:00" }, { "name": "sebastian/cli-parser", @@ -2520,16 +2666,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -2582,7 +2728,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -2590,7 +2736,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -2780,16 +2926,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -2845,7 +2991,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -2853,7 +2999,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -3208,16 +3354,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -3229,7 +3375,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -3252,7 +3398,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -3260,7 +3406,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -3317,16 +3463,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -3341,7 +3487,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3379,7 +3525,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -3395,7 +3541,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "theseer/tokenizer", @@ -3449,16 +3595,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.4.1", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f" + "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/264dce589e7ce37a7ba99cb901eed8249fbec92f", - "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", "shasum": "" }, "require": { @@ -3473,15 +3619,19 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" + "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" }, "suggest": { "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + }, "branch-alias": { - "dev-master": "5.4-dev" + "dev-master": "5.5-dev" } }, "autoload": { @@ -3513,7 +3663,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.1" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" }, "funding": [ { @@ -3525,7 +3675,7 @@ "type": "tidelift" } ], - "time": "2021-12-12T23:22:04+00:00" + "time": "2022-10-16T01:01:54+00:00" }, { "name": "webmozart/assert", @@ -3594,7 +3744,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4|>=8.0", + "php": ">=8.0", "ext-dom": "*", "ext-libxml": "*", "ext-simplexml": "*", @@ -3603,5 +3753,5 @@ "ext-openssl": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..6a860a8 --- /dev/null +++ b/rector.php @@ -0,0 +1,25 @@ +paths([ + __DIR__ . '/examples', + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + + // register a single rule +// $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + + // define sets of rules + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_80, + SetList::CODE_QUALITY + ]); +}; diff --git a/src/Bluem.php b/src/Bluem.php index f0410bc..4ba50dc 100644 --- a/src/Bluem.php +++ b/src/Bluem.php @@ -78,11 +78,10 @@ class Bluem { * Bluem constructor. * Give a mixed configuration object to initialize the Bluem object * - * @param mixed $rawConfig * * @throws InvalidBluemConfigurationException */ - public function __construct($rawConfig) + public function __construct(mixed $rawConfig) { if ($rawConfig ===null) { throw new InvalidBluemConfigurationException('No configuration given'); @@ -111,8 +110,6 @@ public function setConfig( string $key, $value ): bool { } /** - * @param string $key - * * @return false|mixed */ public function getConfig( string $key ) { @@ -124,18 +121,15 @@ public function getConfig( string $key ) { * and Mandate ID and return the request object, * sending it and returning the response * - * @param string $customer_id - * @param string $order_id - * @param string $mandate_id * - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws Exception */ public function Mandate( string $customer_id, string $order_id, string $mandate_id = "" - ) { + ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { + $e = null; try { $_request = $this->CreateMandateRequest( $customer_id, @@ -143,7 +137,7 @@ public function Mandate( $mandate_id ); } catch ( Exception $e ) { - throw new RuntimeException( $e->getMessage() ); + throw new RuntimeException($e->getMessage(), $e->getCode(), $e); } return $this->PerformRequest( $_request ); @@ -154,11 +148,7 @@ public function Mandate( * and Mandate ID and return the request object * WITHOUT sending it * - * @param string $customer_id - * @param string $order_id - * @param string $mandate_id * - * @return EmandateBluemRequest * @throws Exception */ public function CreateMandateRequest( @@ -184,7 +174,7 @@ public function CreateMandateRequest( $order_id, $mandate_id, ( $this->configuration->environment === "test" && - isset( $this->configuration->expectedReturnStatus ) ? + $this->configuration->expectedReturnStatus !== null ? $this->configuration->expectedReturnStatus : "" ) ); } @@ -194,8 +184,6 @@ public function CreateMandateRequest( * * @param String $order_id The order ID * @param String $customer_id The customer ID - * - * @return String */ public function CreateMandateID( string $order_id, string $customer_id ): string { // veteranen search team, specific @@ -211,13 +199,11 @@ public function CreateMandateID( string $order_id, string $customer_id ): string * Perform a request to the Bluem API given a request * object and return its response * - * @param BluemRequest $transaction_request * - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws DOMException|HTTP_Request2_LogicException * @throws Exception */ - public function PerformRequest( BluemRequest $transaction_request ) { + public function PerformRequest( BluemRequest $transaction_request ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { $validator = new BluemXMLValidator(); if ( ! $validator->validate( $transaction_request->RequestContext(), @@ -245,16 +231,29 @@ public function PerformRequest( BluemRequest $transaction_request ) { $request_url = $transaction_request->HttpRequestUrl(); - $req = new HTTP_Request2(); + $curl_xml = $transaction_request->XmlString(); - $req->setUrl( $request_url ); - $req->setMethod( HTTP_Request2::METHOD_POST ); + $curl_headers = [ + 'Access-Control-Allow-Origin: *', + 'Content-Type: application/xml; type=' . $transaction_request->transaction_code . '; charset=UTF-8', + 'x-ttrs-date: ' . $xttrs_date, + 'x-ttrs-files-count: 1', + 'x-ttrs-filename: ' . $xttrs_filename, + ]; - $req->setHeader( 'Access-Control-Allow-Origin', '*' ); - $req->setHeader( "Content-Type", "application/xml; type=" . $transaction_request->transaction_code . "; charset=UTF-8" ); - $req->setHeader( "x-ttrs-date", $xttrs_date ); - $req->setHeader( "x-ttrs-files-count", "1" ); - $req->setHeader( "x-ttrs-filename", $xttrs_filename ); + $curl = curl_init(); + + $curl_options = array( + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => "xmlRequest=" . $curl_xml, + // CURLOPT_POSTFIELDS => http_build_query($params), + CURLOPT_URL => $request_url, + CURLOPT_HTTPHEADER => $curl_headers, + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_FOLLOWLOCATION => 1, + CURLOPT_TIMEOUT => 30 + ); if ( self::$verbose ) { echo PHP_EOL . "
URL// " . $request_url; @@ -266,58 +265,45 @@ public function PerformRequest( BluemRequest $transaction_request ) { echo "
"; echo PHP_EOL . "BODY: " . $transaction_request->XmlString(); } + + // Set options to cURL request + curl_setopt_array($curl, $curl_options); - $req->setBody( $transaction_request->XmlString() ); try { - $http_response = $req->send(); - if ( self::$verbose ) { - echo PHP_EOL . "
RESPONSE// "; - echo( $http_response->getBody() ); - } + // Execute cURL request + $response = curl_exec($curl); + + // Get response HTTP status code + $response_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); - switch ( $http_response->getStatus() ) { + // Convert the XML result into array + $array_data = json_decode(json_encode(simplexml_load_string($response)), true); + + curl_close($curl); + + switch ( $response_status ) { case 200: { - if ( $http_response->getBody() === "" ) { + if ( empty($response) ) { return new ErrorBluemResponse( "Error: Empty response returned" ); } try { - $response = $this->fabricateResponseObject( $transaction_request->transaction_code, $http_response->getBody() ); + $response = $this->fabricateResponseObject( $transaction_request->transaction_code, $response ); } catch ( Throwable $th ) { return new ErrorBluemResponse( "Error: Could not create Bluem Response object. More details: " . $th->getMessage() ); } - if ( $response->attributes()['type'] . '' === "ErrorResponse" ) { - switch ( (string) $transaction_request->transaction_code ) { - case 'SRX': - case 'SUD': - case 'TRX': - case 'TRS': - $errorMessage = (string) $response->EMandateErrorResponse->Error->ErrorMessage; - break; - case 'PSU': - case 'PSX': - case 'PTS': - case 'PTX': - $errorMessage = (string) $response->PaymentErrorResponse->Error->ErrorMessage; - break; - case 'ITS': - case 'ITX': - case 'ISU': - case 'ISX': - $errorMessage = (string) $response->IdentityErrorResponse->Error->ErrorMessage; - break; - case 'INS': - case 'INX': - $errorMessage = (string) $response->IBANCheckErrorResponse->Error->ErrorMessage; - break; - default: - throw new RuntimeException( "Invalid transaction type requested" ); - } + if ( $array_data['@attributes']['type'] === "ErrorResponse" ) { + $errorMessage = match ((string) $transaction_request->transaction_code) { + 'SRX', 'SUD', 'TRX', 'TRS' => (string) $response->EMandateErrorResponse->Error->ErrorMessage, + 'PSU', 'PSX', 'PTS', 'PTX' => (string) $response->PaymentErrorResponse->Error->ErrorMessage, + 'ITS', 'ITX', 'ISU', 'ISX' => (string) $response->IdentityErrorResponse->Error->ErrorMessage, + 'INS', 'INX' => (string) $response->IBANCheckErrorResponse->Error->ErrorMessage, + default => throw new RuntimeException( "Invalid transaction type requested" ), + }; // @todo: move into a separate function - return new ErrorBluemResponse( "Error: " . ( $errorMessage ) ); } @@ -337,11 +323,86 @@ public function PerformRequest( BluemRequest $transaction_request ) { default: return new ErrorBluemResponse( 'Unexpected / erroneous response (code ' . $http_response->getStatus() . ')' ); } - } catch ( Throwable $e ) { + } catch ( Throwable ) { return new ErrorBluemResponse( 'HTTP Request Error' ); // @todo improve request return exceptions; add our own exception type - } + + // $req = new HTTP_Request2($request_url, HTTP_Request2::METHOD_POST); + + // $req->setHeader( 'Access-Control-Allow-Origin', '*' ); + // $req->setHeader( "Content-Type", "application/xml; type=" . $transaction_request->transaction_code . "; charset=UTF-8" ); + // $req->setHeader( "x-ttrs-date", $xttrs_date ); + // $req->setHeader( "x-ttrs-files-count", "1" ); + // $req->setHeader( "x-ttrs-filename", $xttrs_filename ); + + // if ( self::$verbose ) { + // echo PHP_EOL . "
URL// " . $request_url; + + // echo PHP_EOL . "
HEADER// " . "Content-Type: " . "application/xml; type=" . $transaction_request->transaction_code . "; charset=UTF-8"; + // echo PHP_EOL . "
HEADER// " . 'x-ttrs-date: ' . $xttrs_date; + // echo PHP_EOL . "
HEADER// " . 'x-ttrs-files-count: ' . '1'; + // echo PHP_EOL . "
HEADER// " . 'x-ttrs-filename: ' . $xttrs_filename; + // echo "
"; + // echo PHP_EOL . "BODY: " . $transaction_request->XmlString(); + // } + + // $req->setBody( $transaction_request->XmlString() ); + // try { + // $http_response = $req->send(); + // if ( self::$verbose ) { + // echo PHP_EOL . "
RESPONSE// "; + // echo( $http_response->getBody() ); + // } + + // switch ( $http_response->getStatus() ) { + // case 200: + // { + // if ( empty($http_response->getBody()) ) { + // return new ErrorBluemResponse( "Error: Empty response returned" ); + // } + + // try { + // $response = $this->fabricateResponseObject( $transaction_request->transaction_code, $http_response->getBody() ); + // } catch ( Throwable $th ) { + // return new ErrorBluemResponse( "Error: Could not create Bluem Response object. More details: " . $th->getMessage() ); + // } + + // if ( $response->attributes()['type'] . '' === "ErrorResponse" ) { + // $errorMessage = match ((string) $transaction_request->transaction_code) { + // 'SRX', 'SUD', 'TRX', 'TRS' => (string) $response->EMandateErrorResponse->Error->ErrorMessage, + // 'PSU', 'PSX', 'PTS', 'PTX' => (string) $response->PaymentErrorResponse->Error->ErrorMessage, + // 'ITS', 'ITX', 'ISU', 'ISX' => (string) $response->IdentityErrorResponse->Error->ErrorMessage, + // 'INS', 'INX' => (string) $response->IBANCheckErrorResponse->Error->ErrorMessage, + // default => throw new RuntimeException( "Invalid transaction type requested" ), + // }; + + // // @todo: move into a separate function + + // return new ErrorBluemResponse( "Error: " . ( $errorMessage ) ); + // } + + // if ( ! $response->Status() ) { + // return new ErrorBluemResponse( "Error: " . ( $response->Error->ErrorMessage ) ); + // } + + // return $response; + + // } + // case 400: + // return new ErrorBluemResponse( 'Your request was not formed correctly.' ); + // case 401: + // return new ErrorBluemResponse( 'Unauthorized: check your access credentials.' ); + // case 500: + // return new ErrorBluemResponse( 'An unrecoverable error at the server side occurred while processing the request' ); + // default: + // return new ErrorBluemResponse( 'Unexpected / erroneous response (code ' . $http_response->getStatus() . ')' ); + // } + // } catch ( Throwable ) { + // return new ErrorBluemResponse( 'HTTP Request Error' ); + // // @todo improve request return exceptions; add our own exception type + + // } } /** @@ -350,58 +411,40 @@ public function PerformRequest( BluemRequest $transaction_request ) { * @param $type * @param $response_xml * - * @return IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws Exception */ - private function fabricateResponseObject( $type, $response_xml ) { - switch ( $type ) { - case 'SRX': - case 'SUD': - return new MandateStatusBluemResponse( $response_xml ); - case 'TRX': - case 'TRS': - return new MandateTransactionBluemResponse( $response_xml ); - case 'PSU': - case 'PSX': - return new PaymentStatusBluemResponse( $response_xml ); - case 'PTS': - case 'PTX': - return new PaymentTransactionBluemResponse( $response_xml ); - case 'ITS': - case 'ITX': - return new IdentityTransactionBluemResponse( $response_xml ); - case 'ISU': - case 'ISX': - return new IdentityStatusBluemResponse( $response_xml ); - case 'INS': - case 'INX': - return new IBANNameCheckBluemResponse( $response_xml ); - default: - throw new RuntimeException( "Invalid transaction type requested" ); - } + private function fabricateResponseObject( $type, $response_xml ): \Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { + return match ($type) { + 'SRX', 'SUD' => new MandateStatusBluemResponse( $response_xml ), + 'TRX', 'TRS' => new MandateTransactionBluemResponse( $response_xml ), + 'PSU', 'PSX' => new PaymentStatusBluemResponse( $response_xml ), + 'PTS', 'PTX' => new PaymentTransactionBluemResponse( $response_xml ), + 'ITS', 'ITX' => new IdentityTransactionBluemResponse( $response_xml ), + 'ISU', 'ISX' => new IdentityStatusBluemResponse( $response_xml ), + 'INS', 'INX' => new IBANNameCheckBluemResponse( $response_xml ), + default => throw new RuntimeException( "Invalid transaction type requested" ), + }; } /**-------------- PAYMENT SPECIFIC FUNCTIONS --------------*/ - /** * Retrieving a mandate request's status based on a mandate ID and an entrance Code, and returning the response * * @param $mandateID * @param $entranceCode * - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws DOMException * @throws HTTP_Request2_LogicException * @throws Exception */ - public function MandateStatus( $mandateID, $entranceCode ) { + public function MandateStatus( $mandateID, $entranceCode ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { $r = new EMandateStatusBluemRequest( $this->configuration, $mandateID, $entranceCode, ( $this->configuration->environment === BLUEM_ENVIRONMENT_TESTING && - isset( $this->configuration->expectedReturnStatus ) ? + $this->configuration->expectedReturnStatus !== null ? $this->configuration->expectedReturnStatus : "" ) ); @@ -414,8 +457,6 @@ public function MandateStatus( $mandateID, $entranceCode ) { * mandates in webshop context * * @param $response - * - * @return object */ public function GetMaximumAmountFromTransactionResponse( $response ): object { @@ -425,14 +466,11 @@ public function GetMaximumAmountFromTransactionResponse( $response ): object /** * Create a payment request and perform it, returning the response * - * @param string $description * @param $debtorReference * @param $amount * @param null $dueDateTime - * @param string $currency * @param null $entranceCode * - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws DOMException * @throws HTTP_Request2_LogicException * @throws RuntimeException @@ -444,7 +482,8 @@ public function Payment( $dueDateTime = null, string $currency = "EUR", $entranceCode = null - ) { + ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { + $e = null; try { $request = $this->CreatePaymentRequest( $description, @@ -455,7 +494,7 @@ public function Payment( $entranceCode ?? $this->CreateEntranceCode() ); } catch (Exception $e) { - throw new RuntimeException("Could not create request: " . $e->getMessage()); + throw new RuntimeException("Could not create request: " . $e->getMessage(), $e->getCode(), $e); } return $this->PerformRequest($request); @@ -472,22 +511,14 @@ public function CreateEntranceCode(): string { // But that TransactionID doesn't make any sense because Bluem generates its own transactionID. // So the self generated TransactionID is added (together with the entranceCode) to the debtorReturnURL // but on the return page you can't do anything with the transactionID because it doesn't match the transactionID known by Bluem. - - /**-------------- IDENTITY SPECIFIC FUNCTIONS --------------*/ - /** * Create a payment request object * - * @param String $description * @param $debtorReference - * @param Float $amount * @param null $dueDateTime - * @param string $currency * @param null $entranceCode - * @param string $debtorReturnURL * - * @return PaymentBluemRequest * @throws Exception */ public function CreatePaymentRequest( @@ -521,7 +552,7 @@ public function CreatePaymentRequest( $this->CreatePaymentTransactionID( $debtorReference ), $entranceCode, ( $this->configuration->environment === BLUEM_ENVIRONMENT_TESTING && - isset( $this->configuration->expectedReturnStatus ) ? + $this->configuration->expectedReturnStatus !== null ? $this->configuration->expectedReturnStatus : "" ), $debtorReturnURL, $paymentReference @@ -531,9 +562,7 @@ public function CreatePaymentRequest( /** * Create a payment Transaction ID in the required structure, based on the order ID, customer ID and the current timestamp. * - * @param String $debtorReference * - * @return String */ public function CreatePaymentTransactionID( string $debtorReference ): string { return substr( $debtorReference, 0, 28 ) . Carbon::now()->format( 'Ymd' ); @@ -541,22 +570,20 @@ public function CreatePaymentTransactionID( string $debtorReference ): string { // @todo: Create Identity shorthand function - /** * Retrieve the status of a payment request, based on transactionID and Entrance Code * * @param $transactionID * @param $entranceCode * - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws Exception */ - public function PaymentStatus( $transactionID, $entranceCode ) { + public function PaymentStatus( $transactionID, $entranceCode ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { $r = new PaymentStatusBluemRequest( $this->configuration, $transactionID, ( $this->configuration->environment === BLUEM_ENVIRONMENT_TESTING && - isset( $this->configuration->expectedReturnStatus ) ? + $this->configuration->expectedReturnStatus !== null ? $this->configuration->expectedReturnStatus : "" ), $entranceCode ); @@ -566,17 +593,12 @@ public function PaymentStatus( $transactionID, $entranceCode ) { /** Universal Functions */ - /** * Create Identity request based on a category, description, reference and given a return URL. * * @param $requestCategory - * @param string $description * @param $debtorReference - * @param string $entranceCode - * @param string $returnURL * - * @return IdentityBluemRequest * @throws Exception */ public function CreateIdentityRequest( @@ -593,7 +615,7 @@ public function CreateIdentityRequest( $this->configuration, $entranceCode, $this->configuration->environment === BLUEM_ENVIRONMENT_TESTING && - isset( $this->configuration->expectedReturnStatus ) ? + $this->configuration->expectedReturnStatus !== null ? $this->configuration->expectedReturnStatus : "", $requestCategory, $description, @@ -608,15 +630,14 @@ public function CreateIdentityRequest( * @param $transactionID * @param $entranceCode * - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws Exception */ - public function IdentityStatus( $transactionID, $entranceCode ) { + public function IdentityStatus( $transactionID, $entranceCode ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { $r = new IdentityStatusBluemRequest( $this->configuration, $entranceCode, ( $this->configuration->environment === BLUEM_ENVIRONMENT_TESTING && - isset( $this->configuration->expectedReturnStatus ) ? + $this->configuration->expectedReturnStatus !== null ? $this->configuration->expectedReturnStatus : "" ), $transactionID ); @@ -631,11 +652,9 @@ public function IdentityStatus( $transactionID, $entranceCode ) { * The URL will be checked for consistency and * validity and will not be stored if any of the * checks fails. */ - /** * Create an Identity Transaction ID in the required structure, based on the order ID, customer ID and the current timestamp. * - * @param String $debtorReference * * @return String Identity Transaction ID */ @@ -655,7 +674,7 @@ public function Webhook() $this->configuration->senderID, $this->getConfig('webhookDebug') === true ); - } catch (Exception $e) { + } catch (Exception) { return null; } @@ -684,19 +703,17 @@ public function GetIdentityRequestTypes(): array { /* IBAN SPECIFIC */ - /** * Create and perform IBAN Name Check request * @param string $iban Given IBAN to check * @param string $name Given name to check * @param string $debtorReference An optional given debtor reference * to append to the check request - * @return ErrorBluemResponse|IBANNameCheckBluemResponse|IdentityStatusBluemResponse|IdentityTransactionBluemResponse|MandateStatusBluemResponse|MandateTransactionBluemResponse|PaymentStatusBluemResponse|PaymentTransactionBluemResponse * @throws DOMException * @throws HTTP_Request2_LogicException * @throws Exception */ - public function IBANNameCheck( string $iban, string $name, string $debtorReference = "" ) { + public function IBANNameCheck( string $iban, string $name, string $debtorReference = "" ): \Bluem\BluemPHP\Responses\ErrorBluemResponse|\Bluem\BluemPHP\Responses\IBANNameCheckBluemResponse|\Bluem\BluemPHP\Responses\IdentityStatusBluemResponse|\Bluem\BluemPHP\Responses\IdentityTransactionBluemResponse|\Bluem\BluemPHP\Responses\MandateStatusBluemResponse|\Bluem\BluemPHP\Responses\MandateTransactionBluemResponse|\Bluem\BluemPHP\Responses\PaymentStatusBluemResponse|\Bluem\BluemPHP\Responses\PaymentTransactionBluemResponse { $r = $this->CreateIBANNameCheckRequest( $iban, $name, $debtorReference ); return $this->PerformRequest( $r ); @@ -710,7 +727,6 @@ public function IBANNameCheck( string $iban, string $name, string $debtorReferen * @param string $debtorReference An optional given debtor reference * to append to the check request * - * @return IBANBluemRequest * @throws Exception */ public function CreateIBANNameCheckRequest( string $iban, string $name, string $debtorReference = "" ): IBANBluemRequest { @@ -730,7 +746,6 @@ public function CreateIBANNameCheckRequest( string $iban, string $name, string $ * * @param $contextName * - * @return array * @throws Exception */ public function retrieveBICCodesForContext( $contextName ): array { @@ -740,10 +755,9 @@ public function retrieveBICCodesForContext( $contextName ): array { /** * @param $context * - * @return IdentityContext|MandatesContext|PaymentsContext * @throws Exception */ - public function _retrieveContext( $context ) { + public function _retrieveContext( $context ): \Bluem\BluemPHP\Contexts\IdentityContext|\Bluem\BluemPHP\Contexts\MandatesContext|\Bluem\BluemPHP\Contexts\PaymentsContext { $localInstrumentCode = $this->configuration->localInstrumentCode; switch ( $context ) { case 'Mandates': @@ -772,7 +786,6 @@ public function _retrieveContext( $context ) { * * @param $contextName * - * @return array * @throws Exception */ public function retrieveBICsForContext( $contextName ): array { @@ -782,13 +795,11 @@ public function retrieveBICsForContext( $contextName ): array { /** * Verify if the current IP is based in the Netherlands * utilizing a geolocation integration. - * - * @return bool */ public function VerifyIPIsNetherlands(): bool { try { return (new IPAPI())->CheckIsNetherlands(); - } catch ( Throwable $th ) { + } catch ( Throwable ) { return false; } } diff --git a/src/Contexts/BluemContext.php b/src/Contexts/BluemContext.php index b4c3d7f..b1d4627 100644 --- a/src/Contexts/BluemContext.php +++ b/src/Contexts/BluemContext.php @@ -4,10 +4,8 @@ abstract class BluemContext { - public array $BICs; - - public function __construct( array $BICs = [] ) { - $this->BICs = $BICs; + public function __construct(public array $BICs = []) + { } public function getBICs(): array { diff --git a/src/Contexts/Context.php b/src/Contexts/Context.php index a45ab77..fb32d10 100644 --- a/src/Contexts/Context.php +++ b/src/Contexts/Context.php @@ -19,8 +19,6 @@ class Context implements ContextInterface { /** * BluemContext constructor. - * - * @param array $issuers */ public function __construct( array $issuers = [] ) { $this->issuers = $issuers; diff --git a/src/Contexts/MandatesContext.php b/src/Contexts/MandatesContext.php index a8f77f7..248f9ee 100644 --- a/src/Contexts/MandatesContext.php +++ b/src/Contexts/MandatesContext.php @@ -14,7 +14,7 @@ class MandatesContext extends BluemContext { public $debtorWalletElementName = "INCASSOMACHTIGEN"; - private $_possibleMandateTypes = [ 'CORE', 'B2B' ]; + private array $_possibleMandateTypes = [ 'CORE', 'B2B' ]; /** * MandatesContext constructor. diff --git a/src/Contexts/PaymentsContext.php b/src/Contexts/PaymentsContext.php index c8a868c..c831e02 100644 --- a/src/Contexts/PaymentsContext.php +++ b/src/Contexts/PaymentsContext.php @@ -58,7 +58,7 @@ public function getValidationSchema(): string { public function addPaymentMethodDetails(array $details = []) { $validationErrors = $this->validateDetails($details); - if (count($validationErrors) > 0 ) { + if ($validationErrors !== [] ) { throw new RuntimeException('Invalid details given: '. implode(', ', $validationErrors)); } @@ -67,8 +67,6 @@ public function addPaymentMethodDetails(array $details = []) private function validateDetails(array $details = []): array { - $errors = []; - if ($this->isIDEAL()) { // no validation yet } @@ -120,7 +118,7 @@ private function validateDetails(array $details = []): array // add upcoming validation here } - return $errors; + return []; } public function isIDEAL(): bool diff --git a/src/Exceptions/InvalidContextException.php b/src/Exceptions/InvalidContextException.php index fc969d5..ba73cf4 100644 --- a/src/Exceptions/InvalidContextException.php +++ b/src/Exceptions/InvalidContextException.php @@ -6,7 +6,7 @@ class InvalidContextException extends Exception { - const AVAILABLE_CONTEXTS = [ "Mandates", "Payments", "Identity" ]; + public const AVAILABLE_CONTEXTS = [ "Mandates", "Payments", "Identity" ]; /** * @param string $string diff --git a/src/Extensions/IPAPI.php b/src/Extensions/IPAPI.php index 044dbfe..0699dda 100644 --- a/src/Extensions/IPAPI.php +++ b/src/Extensions/IPAPI.php @@ -34,9 +34,7 @@ final class IPAPI { * Verify if a given or server IP is country coded NL (and default to true in case of error) * reference: https://www.javatpoint.com/how-to-get-the-ip-address-in-php * - * @param string $ip * - * @return bool */ public function CheckIsNetherlands( string $ip = "" ): bool { $result = $this->QueryIP( $ip ); @@ -58,7 +56,6 @@ public function CheckIsNetherlands( string $ip = "" ): bool { /** * Retrieve geolocation information of the given IP or if not given tries to infer the current IP. * - * @param string $ip * * @return mixed */ @@ -85,14 +82,14 @@ public function QueryIP( string $ip = "" ) { try { $api_result = json_decode($json, true, 512, JSON_THROW_ON_ERROR); } catch (JsonException $e) { - if ( $this->_debug === true ) { + if ( $this->_debug ) { var_dump( "Error: ". $e ); } return false; } // verbose for debugging - if ( $this->_debug === true ) { + if ( $this->_debug ) { var_dump( $api_result ); } @@ -103,8 +100,6 @@ public function QueryIP( string $ip = "" ) { /** * Retrieve the current IP from the server, if possible - * - * @return string */ public function GetCurrentIP(): string { $ip = ""; diff --git a/src/Helpers/BluemConfiguration.php b/src/Helpers/BluemConfiguration.php index 70c79d7..e96a8fb 100644 --- a/src/Helpers/BluemConfiguration.php +++ b/src/Helpers/BluemConfiguration.php @@ -32,10 +32,7 @@ class BluemConfiguration */ public $merchantReturnURLBase; - /** - * @var BluemConfigurationValidator - */ - private $validator; + private \Bluem\BluemPHP\Validators\BluemConfigurationValidator $validator; /** * @var mixed @@ -83,16 +80,9 @@ class BluemConfiguration */ public $merchantSubID; - /** - * @var string - */ - private $PaymentsBrandID; + private string $PaymentsBrandID; // @todo: consider deprecating this? - - /** - * @var string - */ - private $EmandateBrandID; + private string $EmandateBrandID; // @todo: consider deprecating this? // additional helper flags @@ -152,9 +142,6 @@ public function __construct($raw) $this->webhookDebug = false; } - /** - * @return string - */ public function errorsAsString(): string { return implode( ", ", $this->validator->errors() ); } @@ -163,7 +150,6 @@ public function errorsAsString(): string { * Assume a brandID for a service based on another valid brandID * * @param string $prefix - * @param string $brandID * * @return string * @throws Exception @@ -198,9 +184,6 @@ public function setBrandId( $selectedBrandID ) { $this->brandID = $selectedBrandID; } - /** - * @return array - */ public function errors(): array { return $this->validator->errors(); } diff --git a/src/Helpers/BluemCurrency.php b/src/Helpers/BluemCurrency.php index a234501..f13bdb7 100644 --- a/src/Helpers/BluemCurrency.php +++ b/src/Helpers/BluemCurrency.php @@ -4,7 +4,7 @@ use Exception; -class BluemCurrency { +class BluemCurrency implements \Stringable { /** * @var string @@ -15,11 +15,9 @@ class BluemCurrency { /** * @var string[] */ - private $allowed_currencies = [ 'EUR', 'USD' ]; + private array $allowed_currencies = [ 'EUR', 'USD' ]; /** - * @param string $code - * * @throws Exception */ public function __construct( string $code ) { @@ -31,7 +29,7 @@ public function __construct( string $code ) { $this->code = $code; } - public function __toString() { + public function __toString(): string { return $this->code; } diff --git a/src/Helpers/BluemMaxAmount.php b/src/Helpers/BluemMaxAmount.php index 017216c..d5054f0 100644 --- a/src/Helpers/BluemMaxAmount.php +++ b/src/Helpers/BluemMaxAmount.php @@ -2,7 +2,7 @@ namespace Bluem\BluemPHP\Helpers; -class BluemMaxAmount { +class BluemMaxAmount implements \Stringable { /** * @var BluemCurrency @@ -14,10 +14,6 @@ class BluemMaxAmount { */ public $amount; - /** - * @param float $amount - * @param string $currency - */ function __construct( float $amount, string $currency @@ -29,7 +25,7 @@ function __construct( } public function __toString(): string { - return $this->amount; + return (string) $this->amount; } } \ No newline at end of file diff --git a/src/Helpers/IdentityCategoryList.php b/src/Helpers/IdentityCategoryList.php index 3d7c005..9ca3a7a 100644 --- a/src/Helpers/IdentityCategoryList.php +++ b/src/Helpers/IdentityCategoryList.php @@ -4,7 +4,7 @@ class IdentityCategoryList { - private $cats = []; + private array $cats = []; public function getCats(): array { return $this->cats; @@ -12,8 +12,6 @@ public function getCats(): array { /** * @param $cat - * - * @return IdentityCategoryList */ public function addCat( $cat ): IdentityCategoryList { if ( ! in_array( $cat, $this->cats ) ) { diff --git a/src/Helpers/MaxAmount.php b/src/Helpers/MaxAmount.php index ec47c0a..8f7a366 100644 --- a/src/Helpers/MaxAmount.php +++ b/src/Helpers/MaxAmount.php @@ -5,7 +5,7 @@ use Bluem\BluemPHP\Models\Currency; -class MaxAmount { +class MaxAmount implements \Stringable { /** * @var Currency @@ -18,7 +18,6 @@ class MaxAmount { public $amount; /** - * @param float $amount * @param string $currency */ function __construct( @@ -32,7 +31,7 @@ function __construct( } public function __toString(): string { - return strval($this->amount); + return (string) $this->amount; } } \ No newline at end of file diff --git a/src/Models/Currency.php b/src/Models/Currency.php index fd298d8..4d8163d 100644 --- a/src/Models/Currency.php +++ b/src/Models/Currency.php @@ -4,15 +4,12 @@ use Exception; -class Currency { +class Currency implements \Stringable { private const CURRENCY_CODE_EURO = 'EUR'; private const CURRENCY_CODE_USDOLLAR = 'EUR'; - /** - * @var string - */ - private $code; + private string $code; // or use regex [A-Z]{3} /** @@ -25,8 +22,6 @@ class Currency { ]; /** - * @param string $code - * * @throws Exception */ public function __construct( string $code = '' ) { @@ -41,7 +36,7 @@ public function __construct( string $code = '' ) { $this->code = $code; } - public function __toString() { + public function __toString(): string { return $this->code; } diff --git a/src/Requests/BluemRequest.php b/src/Requests/BluemRequest.php index 16f87d3..07bae22 100644 --- a/src/Requests/BluemRequest.php +++ b/src/Requests/BluemRequest.php @@ -80,15 +80,12 @@ class BluemRequest implements BluemRequestInterface { */ protected $environment; - /** - * @var array - */ - private $_debtorAdditionalData = []; + private array $_debtorAdditionalData = []; /** * @var string[] */ - private $_possibleDebtorAdditionalDataKeys = [ + private array $_possibleDebtorAdditionalDataKeys = [ "EmailAddress", "MobilePhoneNumber", "CustomerProvidedDebtorIBAN", @@ -111,8 +108,6 @@ class BluemRequest implements BluemRequestInterface { * BluemRequest constructor. * * @param BluemConfiguration|object $config - * @param string $entranceCode - * @param string $expectedReturn * * @throws Exception */ @@ -143,23 +138,16 @@ public function __construct( */ // @todo Validate input entrance code if not empty string, based on XSD - if ( $entranceCode === "" ) { // if not given, create it - $this->entranceCode = $this->entranceCode( $expectedReturn ); - } else { - $this->entranceCode = $entranceCode; - } + $this->entranceCode = $entranceCode === "" ? $this->entranceCode( $expectedReturn ) : $entranceCode; } // @todo remove this? - /** * Generate an entranceCode, including test entranceCode substrings for certain types of return responses * * @param string $expectedReturn a possible expected return value * (none,success,cancelled,expired,failure,open,pending) or empty string * "YmdHisv" standardized format, in Europe/Amsterdam timezone - * - * @return string */ private function entranceCode( string $expectedReturn = 'none' ): string { $entranceCode = Carbon::now() @@ -231,8 +219,6 @@ public function Xml(): SimpleXMLElement { /** * Returning the current XML string; as this is an abstract request, it will be overridden by classes that * implement this. - * - * @return String */ public function XmlString(): string { return ""; @@ -256,47 +242,23 @@ public function Print() { public function HttpRequestURL(): string { $request_url = "https://"; - switch ( $this->environment ) { - case BLUEM_ENVIRONMENT_PRODUCTION: - { - $request_url .= ""; - break; - } - case BLUEM_ENVIRONMENT_ACCEPTANCE: - { - $request_url .= "acc."; - break; - } - case BLUEM_ENVIRONMENT_TESTING: - default: - { - $request_url .= "test."; - break; - } - } + match ($this->environment) { + BLUEM_ENVIRONMENT_PRODUCTION => $request_url .= "", + BLUEM_ENVIRONMENT_ACCEPTANCE => $request_url .= "acc.", + default => $request_url .= "test.", + }; $request_url .= "viamijnbank.net/$this->request_url_type/"; + match ($this->typeIdentifier) { + 'createTransaction' => $request_url .= "createTransactionWithToken", + 'requestStatus' => $request_url .= "requestTransactionStatusWithToken", + default => $request_url . "?token=$this->accessToken", + }; - switch ( $this->typeIdentifier ) { - case 'createTransaction': - { - $request_url .= "createTransactionWithToken"; - break; - } - case 'requestStatus': - { - $request_url .= "requestTransactionStatusWithToken"; - break; - } - } - $request_url .= "?token=$this->accessToken"; - - return $request_url; + return $request_url . "?token=$this->accessToken"; } /** * Retrieve array of objects with IssuerID and IssuerName of banks from the context - * - * @return array */ public function retrieveBICObjects(): array { return $this->context->BICs(); @@ -304,8 +266,6 @@ public function retrieveBICObjects(): array { /** * Retrieve array of BIC codes (IssuerIDs) of banks from context - * - * @return array */ public function retrieveBICCodes(): array { return $this->context->getBICCodes(); @@ -331,8 +291,6 @@ public function selectDebtorWallet( $BIC ) { /** * Create the XML element necessary to be added to the request XML string. - * - * @return string */ public function XmlWrapDebtorWallet(): string { if ( is_null( $this->debtorWallet ) ) { @@ -351,14 +309,10 @@ public function XmlWrapDebtorWallet(): string { $res .= "<{$this->context->debtorWalletElementName}>"; $res .= "" . $this->debtorWallet . ""; $res .= "context->debtorWalletElementName}>" . PHP_EOL; - $res .= "" . PHP_EOL; - return $res; + return $res . ("" . PHP_EOL); } - /** - * @return string - */ public function XmlWrapDebtorAdditionalData(): string { if ( count( $this->_debtorAdditionalData ) == 0 ) { return ''; @@ -377,9 +331,8 @@ public function XmlWrapDebtorAdditionalData(): string { $res .= $value; $res .= "" . PHP_EOL; } - $res .= "" . PHP_EOL; - return $res; + return $res . ("" . PHP_EOL); } /** @@ -405,9 +358,6 @@ public function RequestContext() { return $this->context; } - /** - * @return string - */ public function RequestType(): string { return ''; } @@ -454,17 +404,14 @@ protected function XmlRequestObjectWrap( string $element_name, string $rest, arr foreach ( $extra_attrs as $key => $value ) { $res .= "$key=\"$value\" " . PHP_EOL; } - $res .= '>' . $rest . ''; - return $res; + return $res . ('>' . $rest . ''); } /** * Perform sanitization of the description element * - * @param String $description * - * @return string */ protected function _sanitizeDescription( string $description ): string { // filter based on full list of invalid chars for description based on XSD diff --git a/src/Requests/EmandateBluemRequest.php b/src/Requests/EmandateBluemRequest.php index 67238c5..0405ad2 100644 --- a/src/Requests/EmandateBluemRequest.php +++ b/src/Requests/EmandateBluemRequest.php @@ -15,21 +15,14 @@ class EmandateBluemRequest extends BluemRequest implements BluemRequestInterface public $transaction_code = "TRX"; protected $merchantID; protected $merchantSubID; - private $localInstrumentCode; + private string $localInstrumentCode; private $merchantReturnURLBase; private $merchantReturnURL; private $sequenceType; - private $eMandateReason; - private $debtorReference; - private $purchaseID; - /** - * @var string - */ - private $automatically_redirect; - /** - * @var string - */ - private $xmlInterfaceName; + private ?string $eMandateReason = null; + private string $purchaseID; + private string $automatically_redirect; + private string $xmlInterfaceName = "EMandateInterface"; /** * @param BluemConfiguration $config @@ -40,14 +33,9 @@ class EmandateBluemRequest extends BluemRequest implements BluemRequestInterface * * @throws Exception */ - public function __construct( BluemConfiguration $config, $customer_id, $order_id, $mandateID, string $expected_return = "none" ) { + public function __construct( BluemConfiguration $config, private $debtorReference, $order_id, $mandateID, string $expected_return = "none" ) { parent::__construct( $config, "", $expected_return ); - $this->xmlInterfaceName = "EMandateInterface"; - // $this->request_url_type = "mr"; - $this->typeIdentifier = "createTransaction"; - - $this->merchantReturnURLBase = $config->merchantReturnURLBase; // $this->request_type = $request_type; @@ -55,29 +43,15 @@ public function __construct( BluemConfiguration $config, $customer_id, $order_id // $this->merchantReturnURL = $simple_redirect_url."?mandateID={$this->mandateID}"; // } - $this->localInstrumentCode = $config->localInstrumentCode; // @todo create localInstrumentCode datatype with these options // CORE | B2B , conform gegeven standaard $this->mandateID = $mandateID; // https - unique return URL for customer $this->merchantReturnURL = "$this->merchantReturnURLBase?mandateID=$this->mandateID"; - if ( isset( $config->sequenceType ) ) { - $this->sequenceType = $config->sequenceType; - } else { - $this->sequenceType = "RCUR"; - } - + $this->sequenceType = $config->sequenceType ?? "RCUR"; // reason for the mandate; configurable per client - if ( isset( $config->eMandateReason ) ) { - $this->eMandateReason = $config->eMandateReason; - } else { - $this->eMandateReason = "Incasso machtiging"; - } - // $this->eMandateReason = ; // TODO: uit config halen - - // Klantreferentie bijv naam of nummer - $this->debtorReference = $customer_id; + $this->eMandateReason = $config->eMandateReason ?? "Incasso machtiging"; // inkoop/contract/order/klantnummer /* PurchaseID is a mandatory field of the banks. @@ -85,7 +59,7 @@ public function __construct( BluemConfiguration $config, $customer_id, $order_id We do not present it on the checkout, because we see that many parties really do not know what to put there. We always advise customer number. And that is what many parties do. */ - if ( isset( $config->purchaseIDPrefix ) && $config->purchaseIDPrefix !== "" ) { + if ( property_exists($config, 'purchaseIDPrefix') && $config->purchaseIDPrefix !== null && $config->purchaseIDPrefix !== "" ) { $purchaseIDPrefix = $config->purchaseIDPrefix . "-"; } else { $purchaseIDPrefix = ""; @@ -94,22 +68,14 @@ public function __construct( BluemConfiguration $config, $customer_id, $order_id // @todo: move to mandate-specifics; as it is only necessary there - if ( isset( $config->merchantID ) ) { - $this->merchantID = $config->merchantID; - } else { - $this->merchantID = ""; - } + $this->merchantID = $config->merchantID ?? ""; // override with hardcoded merchantID when in test environment, according to documentation if ( $this->environment === BLUEM_ENVIRONMENT_TESTING ) { $this->merchantID = "0020000387"; } - if ( isset( $config->merchantSubID ) ) { - $this->merchantSubID = $config->merchantSubID; - } else { - $this->merchantSubID = "0"; - } + $this->merchantSubID = $config->merchantSubID ?? "0"; $this->automatically_redirect = "1"; diff --git a/src/Requests/EmandateStatusBluemRequest.php b/src/Requests/EmandateStatusBluemRequest.php index 6042c61..1f11759 100644 --- a/src/Requests/EmandateStatusBluemRequest.php +++ b/src/Requests/EmandateStatusBluemRequest.php @@ -13,10 +13,7 @@ class EmandateStatusBluemRequest extends BluemRequest implements BluemRequestInt public $typeIdentifier = "requestStatus"; public $request_url_type = "mr"; public $transaction_code = "SRX"; - /** - * @var string - */ - private $xmlInterfaceName; + private string $xmlInterfaceName = "EMandateInterface"; /** @@ -34,16 +31,11 @@ public function __construct( $expected_return ); - $this->xmlInterfaceName = "EMandateInterface"; - // @todo make this of BluemXMLInterfaceClass type - - $this->typeIdentifier = "requestStatus"; - $this->mandateID = $mandateID; try { $this->context = new MandatesContext( $config->localInstrumentCode ); - } catch ( Exception $e ) { + } catch ( Exception ) { // @todo: deal with improper instrument code set } } diff --git a/src/Requests/IBANBluemRequest.php b/src/Requests/IBANBluemRequest.php index 2908de6..4ebef04 100644 --- a/src/Requests/IBANBluemRequest.php +++ b/src/Requests/IBANBluemRequest.php @@ -12,10 +12,9 @@ class IBANBluemRequest extends BluemRequest implements BluemRequestInterface { public $request_url_type = "icr"; public $typeIdentifier = "createTransaction"; public $transaction_code = "INX"; - private $xmlInterfaceName = "IBANCheckInterface"; - private $_inputIban; - private $_inputName; - private $_debtorReference; + private string $xmlInterfaceName = "IBANCheckInterface"; + private string $_inputIban; + private string $_inputName; /** * Construct the request and prepare all properties @@ -31,25 +30,20 @@ public function __construct( $entranceCode, string $_inputIban, string $_inputName, - string $_debtorReference = "" + private string $_debtorReference = "" ) { parent::__construct( $config, $entranceCode ); $this->_inputIban = $this->_sanitizeIban( $_inputIban ); $this->_inputName = $this->_sanitizeName( $_inputName ); - $this->_debtorReference = $_debtorReference; - $this->context = new IBANCheckContext(); } // @todo: deprecated, remove - /** * Sanitize input IBAN for proper XML handling * * @param string $iban Given IBAN to sanitize - * - * @return string */ private function _sanitizeIban( string $iban ): string { return trim( @@ -61,8 +55,6 @@ private function _sanitizeIban( string $iban ): string { * Sanitize input Name for proper XML handling * * @param string $name Given name to check - * - * @return string */ private function _sanitizeName( string $name ): string { return trim( $name ); @@ -70,8 +62,6 @@ private function _sanitizeName( string $name ): string { /** * Retrieve the Bluem Transaction Type Code for this request - * - * @return string */ public function TransactionType(): string { return "INX"; @@ -79,8 +69,6 @@ public function TransactionType(): string { /** * Generate XML string that is used in the request - * - * @return string */ public function XmlString(): string { return $this->XmlRequestInterfaceWrap( diff --git a/src/Requests/IdentityBluemRequest.php b/src/Requests/IdentityBluemRequest.php index f7951dd..d96a38d 100644 --- a/src/Requests/IdentityBluemRequest.php +++ b/src/Requests/IdentityBluemRequest.php @@ -12,6 +12,7 @@ * IdentityBluemRequest object to request an Identity Transaction from the Bluem API. */ class IdentityBluemRequest extends BluemRequest implements BluemRequestInterface { + public $minage; public $request_url_type = "ir"; public $typeIdentifier = "createTransaction"; public $transaction_code = "ITX"; @@ -21,22 +22,9 @@ class IdentityBluemRequest extends BluemRequest implements BluemRequestInterface */ private $minAge; - /** - * @var string - */ - private $requestCategory; - /** - * @var string - */ - private $description; - /** - * @var mixed|string - */ - private $debtorReference; - /** - * @var string - */ - private $debtorReturnURL; + private string $requestCategory; + private string $description; + private string $debtorReturnURL; /** * @param $config @@ -55,26 +43,17 @@ public function __construct( $expectedReturn, array $requestCategory = [], string $description = "", - string $debtorReference = "", + private string $debtorReference = "", $debtorReturnURL = "" ) { parent::__construct( $config, $entranceCode, $expectedReturn ); // @todo: verify return URL can no longer be set in IdentityBluemRequest construction, instead it is created in the config // override specific brand ID - if ( isset( $config->IDINBrandID ) && $config->IDINBrandID !== "" ) { - $this->brandID = $config->IDINBrandID; - } else { - - // @todo Throw an error when config is insufficiently setup - $this->brandID = $config->brandID; - } + $this->brandID = isset( $config->IDINBrandID ) && $config->IDINBrandID !== "" ? $config->IDINBrandID : $config->brandID; $this->requestCategory = $this->getRequestCategoryElement( $requestCategory ); $this->description = $this->_sanitizeDescription( $description ); - - - $this->debtorReference = $debtorReference; if ( $debtorReturnURL == "" ) { throw new Exception( "Debtor return URL is required" ); } @@ -89,9 +68,6 @@ public function __construct( } /** - * @param array $active_categories - * - * @return string * @throws Exception */ private function getRequestCategoryElement( array $active_categories = [] ): string { @@ -124,51 +100,31 @@ private function getRequestCategoryElement( array $active_categories = [] ): str // @todo deal with possible exception here } - $result .= ""; - - return $result; + return $result . ""; } /** * @param $category - * @param bool $active * - * @return string * @throws Exception */ private function getIdinRequestCategory( $category, bool $active = true ): string { $action = ( $active ? "request" : "skip" ); - switch ( $category ) { - case 'CustomerIDRequest': - return ""; - case 'NameRequest': - return ""; - case 'AddressRequest': - return ""; - case 'BirthDateRequest': - return ""; - case 'GenderRequest': - return ""; - case 'TelephoneRequest': - return ""; - case 'EmailRequest': - return ""; - - // exclusive categories, cannot combine! - case 'AgeCheckRequest': - return "getMinAge() . - "\" action=\"$action\"/>"; - case 'CustomerIDLoginRequest': - return ""; - // @todo: Add DocumentSignatureRequest (exclusive) - - // default: Throw error. - default: - throw new Exception( "No proper iDIN request category given", 1 ); - // @todo: add our own exception class - } + return match ($category) { + 'CustomerIDRequest' => "", + 'NameRequest' => "", + 'AddressRequest' => "", + 'BirthDateRequest' => "", + 'GenderRequest' => "", + 'TelephoneRequest' => "", + 'EmailRequest' => "", + 'AgeCheckRequest' => "getMinAge() . + "\" action=\"$action\"/>", + 'CustomerIDLoginRequest' => "", + default => throw new Exception( "No proper iDIN request category given", 1 ), + }; } private function getMinAge(): string { diff --git a/src/Requests/PaymentBluemRequest.php b/src/Requests/PaymentBluemRequest.php index b75cfa4..bff31f7 100644 --- a/src/Requests/PaymentBluemRequest.php +++ b/src/Requests/PaymentBluemRequest.php @@ -24,8 +24,8 @@ class PaymentBluemRequest extends BluemRequest /** * @var mixed|string */ - private $currency; - private $debtorReference; + private string $currency; + private string $debtorReference; private float $amount; /** @@ -89,9 +89,9 @@ public function __construct( // Note: different variable name in config // added entranceCode as well, useful. Defined in generic bluem request class. - $this->paymentReference = !empty($paymentReference) - ? $paymentReference - : "$this->debtorReference$this->transactionID"; + $this->paymentReference = empty($paymentReference) + ? "$this->debtorReference$this->transactionID" + : $paymentReference; $this->context = new PaymentsContext(); } @@ -118,7 +118,6 @@ private function sanitizeTransactionID(string $transactionID): string { * * @param $currency * - * @return string * @throws Exception */ private function validateCurrency( $currency ): string { @@ -276,9 +275,8 @@ private function XmlWrapDebtorWalletForPaymentMethod(): string $res .= "<{$this->context->debtorWalletElementName}>"; $res .= "" . $bic . ""; $res .= "context->debtorWalletElementName}>" . PHP_EOL; - $res .= "" . PHP_EOL; - return $res; + return $res . ("" . PHP_EOL); } $res = PHP_EOL . "" . PHP_EOL; @@ -311,8 +309,7 @@ private function XmlWrapDebtorWalletForPaymentMethod(): string } $res .= "context->debtorWalletElementName}>" . PHP_EOL; - $res .= "" . PHP_EOL; - return $res; + return $res . ("" . PHP_EOL); } /** diff --git a/src/Responses/BluemResponse.php b/src/Responses/BluemResponse.php index 22d7fb5..d854830 100644 --- a/src/Responses/BluemResponse.php +++ b/src/Responses/BluemResponse.php @@ -41,16 +41,10 @@ public function ReceivedResponse(): bool { /** * Return if the response is a successful one, in boolean - * - * @return Bool */ - public function Status(): bool { - // $key = - if ( isset( $this->{static::$error_response_type} ) ) { - return false; - } - - return true; + public function Status(): bool + { + return self::$error_response_type === null; } /** @@ -58,7 +52,7 @@ public function Status(): bool { * */ public function Error(): ?string { - if ( isset( $this->EMandateErrorResponse ) ) { + if ( $this->EMandateErrorResponse !== null ) { return $this->EMandateErrorResponse->Error . ""; } @@ -68,7 +62,6 @@ public function Error(): ?string { /** * Retrieve the generated EntranceCode enclosed in this response * - * @return String * @throws Exception */ public function GetEntranceCode(): string { @@ -81,12 +74,12 @@ public function GetEntranceCode(): string { return $attrs['entranceCode'] . ""; } + // overridden in children protected function getParentXmlElement(): string { - // overridden in children return ""; } protected function getChildXmlElement(): string { - return static::$response_primary_key; + return self::$response_primary_key; } } diff --git a/src/Responses/ErrorBluemResponse.php b/src/Responses/ErrorBluemResponse.php index bdcbedc..61c3efb 100644 --- a/src/Responses/ErrorBluemResponse.php +++ b/src/Responses/ErrorBluemResponse.php @@ -6,10 +6,8 @@ * EMandateErrorResponse */ class ErrorBluemResponse { - private $error; - - public function __construct( string $error ) { - $this->error = $error; + public function __construct(private string $error) + { } public function Status(): bool { diff --git a/src/Responses/IdentityStatusBluemResponse.php b/src/Responses/IdentityStatusBluemResponse.php index d54c9c3..9d602c0 100644 --- a/src/Responses/IdentityStatusBluemResponse.php +++ b/src/Responses/IdentityStatusBluemResponse.php @@ -4,8 +4,8 @@ class IdentityStatusBluemResponse extends StatusBluemResponse { public static $transaction_type = "Identity"; - public static $response_primary_key = "Identity" . "Status"; - public static $error_response_type = "Identity" . "ErrorResponse"; + public static $response_primary_key = 'IdentityStatus'; + public static $error_response_type = 'IdentityErrorResponse'; public function GetStatusCode(): ?string { diff --git a/src/Responses/IdentityTransactionBluemResponse.php b/src/Responses/IdentityTransactionBluemResponse.php index c650e0c..b263cd6 100644 --- a/src/Responses/IdentityTransactionBluemResponse.php +++ b/src/Responses/IdentityTransactionBluemResponse.php @@ -4,6 +4,6 @@ class IdentityTransactionBluemResponse extends TransactionBluemResponse { public static $transaction_type = "Identity"; - public static $response_primary_key = "Identity" . "Transaction"; - public static $error_response_type = "Identity" . "ErrorResponse"; + public static $response_primary_key = 'IdentityTransaction'; + public static $error_response_type = 'IdentityErrorResponse'; } diff --git a/src/Responses/MandateStatusBluemResponse.php b/src/Responses/MandateStatusBluemResponse.php index c0552ba..094b2e7 100644 --- a/src/Responses/MandateStatusBluemResponse.php +++ b/src/Responses/MandateStatusBluemResponse.php @@ -6,11 +6,11 @@ class MandateStatusBluemResponse extends StatusBluemResponse { public static $transaction_type = "EMandate"; - public static $response_primary_key = "EMandate" . "Status"; - public static $error_response_type = "EMandate" . "ErrorResponse"; + public static $response_primary_key = 'EMandateStatus'; + public static $error_response_type = 'EMandateErrorResponse'; public function GetDebtorIBAN(): string { - if ( isset( $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorIBAN ) ) { + if ( $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorIBAN !== null ) { return $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorIBAN . ""; } @@ -18,7 +18,7 @@ public function GetDebtorIBAN(): string { } public function GetDebtorBankID(): string { - if ( isset( $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorBankID ) ) { + if ( $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorBankID !== null ) { return $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorBankID . ""; } @@ -26,7 +26,6 @@ public function GetDebtorBankID(): string { } /** - * @return BluemMaxAmount * @throws Exception */ public function GetMaximumAmount(): BluemMaxAmount { @@ -60,7 +59,7 @@ private function getAcceptanceReport() { public function GetDebtorAccountName() { - if (isset($this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorAccountName)) { + if ($this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorAccountName !== null) { return $this->EMandateStatusUpdate->EMandateStatus->AcceptanceReport->DebtorAccountName . ""; } diff --git a/src/Responses/MandateTransactionBluemResponse.php b/src/Responses/MandateTransactionBluemResponse.php index 1791125..fd7283c 100644 --- a/src/Responses/MandateTransactionBluemResponse.php +++ b/src/Responses/MandateTransactionBluemResponse.php @@ -4,15 +4,14 @@ class MandateTransactionBluemResponse extends TransactionBluemResponse { public static $transaction_type = "EMandate"; - public static $response_primary_key = "EMandate" . "Transaction"; - public static $error_response_type = "EMandate" . "ErrorResponse"; + public static $response_primary_key = 'EMandateTransaction'; + public static $error_response_type = 'EMandateErrorResponse'; /** * Get the mandate ID from the Transaction Response - * @return string */ public function GetMandateID(): string { - if ( ! isset( $this->EMandateTransactionResponse->MandateID ) ) { + if ( $this->EMandateTransactionResponse->MandateID === null ) { return false; } diff --git a/src/Responses/PaymentStatusBluemResponse.php b/src/Responses/PaymentStatusBluemResponse.php index 5d69cf8..5ec7eee 100644 --- a/src/Responses/PaymentStatusBluemResponse.php +++ b/src/Responses/PaymentStatusBluemResponse.php @@ -4,6 +4,6 @@ class PaymentStatusBluemResponse extends StatusBluemResponse { public static $transaction_type = "Payment"; - public static $response_primary_key = "Payment" . "Status"; - public static $error_response_type = "Payment" . "ErrorResponse"; + public static $response_primary_key = 'PaymentStatus'; + public static $error_response_type = 'PaymentErrorResponse'; } diff --git a/src/Responses/PaymentTransactionBluemResponse.php b/src/Responses/PaymentTransactionBluemResponse.php index 909ca79..d0efdff 100644 --- a/src/Responses/PaymentTransactionBluemResponse.php +++ b/src/Responses/PaymentTransactionBluemResponse.php @@ -4,6 +4,6 @@ class PaymentTransactionBluemResponse extends TransactionBluemResponse { public static $transaction_type = "Payment"; - public static $response_primary_key = "Payment" . "Transaction"; - public static $error_response_type = "Payment" . "ErrorResponse"; + public static $response_primary_key = 'PaymentTransaction'; + public static $error_response_type = 'PaymentErrorResponse'; } diff --git a/src/Validators/BluemConfigurationValidator.php b/src/Validators/BluemConfigurationValidator.php index 7758779..baf68bf 100644 --- a/src/Validators/BluemConfigurationValidator.php +++ b/src/Validators/BluemConfigurationValidator.php @@ -15,8 +15,7 @@ class BluemConfigurationValidator { - /** @var array */ - private $errors; + private ?array $errors = null; function validate( $config ) { @@ -78,7 +77,7 @@ private function _validateSenderID( $config ) { please add this to your configuration when instantiating the Bluem integration" ); } - if ( substr( $config->senderID, 0, 1 ) !== "S" ) { + if ( !str_starts_with($config->senderID, "S") ) { throw new Exception( "senderID always starts with an S followed by digits. Please correct this in your configuration when instantiating the Bluem integration" diff --git a/src/Validators/BluemXMLValidator.php b/src/Validators/BluemXMLValidator.php index 543a628..7222546 100644 --- a/src/Validators/BluemXMLValidator.php +++ b/src/Validators/BluemXMLValidator.php @@ -28,10 +28,7 @@ class BluemXMLValidator { * @var string */ protected $feedSchema = ""; - /** - * @var DOMDocument - */ - private $handler; + private \DOMDocument $handler; /** * Validation Class constructor Instantiating DOMDocument @@ -46,10 +43,8 @@ public function __construct( string $feedSchema = null ) { /** * Validate Incoming Feeds against Listing Schema * - * @param BluemContext $context * @param $contents * - * @return bool * @throws DOMException * @throws Exception */ @@ -86,9 +81,6 @@ public function validate( BluemContext $context, $contents ): bool { } } - /** - * @return array - */ private function libxmlDisplayErrors(): array { $errors = libxml_get_errors(); $result = []; @@ -102,20 +94,15 @@ private function libxmlDisplayErrors(): array { /** * @param libXMLError object $error - * - * @return string */ private function libxmlDisplayError( $error ): string { $errorString = "Error $error->code in $error->file (Line: $error->line):"; - $errorString .= trim( $error->message ); - return $errorString; + return $errorString . trim( $error->message ); } /** * Display Error if Resource is not validated - * - * @return array */ public function displayErrors(): array { return $this->errorDetails; diff --git a/src/Validators/WebhookSignatureValidation.php b/src/Validators/WebhookSignatureValidation.php index 0250592..3ac624e 100644 --- a/src/Validators/WebhookSignatureValidation.php +++ b/src/Validators/WebhookSignatureValidation.php @@ -16,9 +16,6 @@ class WebhookSignatureValidation extends WebhookValidator /** * Validate webhook signature based on a key file * available in the `keys` folder. - * - * @param string $postData - * @return WebhookSignatureValidation */ public function validate(string $postData): self { @@ -31,7 +28,7 @@ public function validate(string $postData): self { try { $signatureValidator->loadPublicKeyFile( $public_key_file_path ); - } catch ( Throwable $ex) { + } catch ( Throwable) { $this->addError("Couldn't load public key file"); } diff --git a/src/Validators/WebhookXmlValidation.php b/src/Validators/WebhookXmlValidation.php index 466ac7a..b9ff87b 100644 --- a/src/Validators/WebhookXmlValidation.php +++ b/src/Validators/WebhookXmlValidation.php @@ -9,14 +9,12 @@ class WebhookXmlValidation extends WebhookValidator { - private string $senderID; - private const ALLOWED_SERVICE_INTERFACES = [ 'EPaymentInterface', 'IdentityInterface', 'EMandateInterface' ]; - public function __construct(string $senderID) { - $this->senderID = $senderID; + public function __construct(private string $senderID) + { } public function validate(SimpleXMLElement $xmlObject): self @@ -38,11 +36,11 @@ public function validate(SimpleXMLElement $xmlObject): self $this->addError("Invalid service interface messageCount attribute"); } - if ( ! $xmlObject->Signature->SignatureValue ) { + if ( $xmlObject->Signature->SignatureValue === null ) { $this->addError("Invalid Signature Value"); } - if ( ! $xmlObject->Signature->KeyInfo->KeyName ) { + if ( $xmlObject->Signature->KeyInfo->KeyName === null ) { $this->addError("Invalid KeyName"); } diff --git a/src/Webhook.php b/src/Webhook.php index aa79233..05f295f 100644 --- a/src/Webhook.php +++ b/src/Webhook.php @@ -10,9 +10,6 @@ class Webhook private const PAYMENTS_SERVICE = 'Payments'; private const IDENTITY_SERVICE = 'Identity'; private const EMANDATES_SERVICE = 'EMandates'; - - private string $senderID; - private bool $webhookDebugging; public string $service; public ?SimpleXMLElement $xmlObject; @@ -20,12 +17,9 @@ class Webhook private string $xmlPayloadKey; public function __construct( - $senderID, $webhookDebugging = false + private $senderID, private $webhookDebugging = false ) { - $this->senderID = $senderID; - $this->webhookDebugging = $webhookDebugging; - $this->parse(); } @@ -57,7 +51,7 @@ private function parse(): void } $xmlObject = $this->parseRawXML($postData); - if($xmlObject === null) { + if(!$xmlObject instanceof \SimpleXMLElement) { $this->exitWithError('Could not parse XML'); } @@ -80,9 +74,6 @@ private function parse(): void $this->setServiceInterface(); } - /** - * @return bool - */ private function isHttpsRequest(): bool { return ((!empty($_SERVER['HTTPS']) @@ -102,13 +93,12 @@ private function exitWithError(string $string, int $errorCode = 400): void /** * @param $postData - * @return ?SimpleXMLElement */ private function parseRawXML($postData): ?SimpleXMLElement { try { $xmlObject = new SimpleXMLElement($postData); - } catch (Exception $e) { + } catch (Exception) { return null; } return $xmlObject; @@ -140,7 +130,7 @@ private function getPayloadValue(string $key) return null; } - if(count($payload->children())>0) { + if((is_countable($payload->children()) ? count($payload->children()) : 0)>0) { return $payload; } @@ -248,28 +238,28 @@ public function getPaymentMethodDetails(): ?SimpleXMLElement { public function getIDealDetails(): ?SimpleXMLElement { $paymentDetails = $this->getPaymentMethodDetails(); - if ($paymentDetails === null) { + if (!$paymentDetails instanceof \SimpleXMLElement) { return null; } return $paymentDetails->IDealDetails; } public function getDebtorAccountName(): ?string { $details = $this->getIDealDetails(); - if(!$details) { + if(!$details instanceof \SimpleXMLElement) { return ""; } return $details->DebtorAccountName."" ?? ""; } public function getDebtorIBAN(): ?string { $details = $this->getIDealDetails(); - if(!$details) { + if(!$details instanceof \SimpleXMLElement) { return ""; } return $details->DebtorIBAN."" ?? ""; } public function getDebtorBankID(): ?string { $details = $this->getIDealDetails(); - if(!$details) { + if(!$details instanceof \SimpleXMLElement) { return ""; } return $details->DebtorBankID."" ?? ""; @@ -339,7 +329,7 @@ public function getIdentityReportArray(): array { $report = $this->getPayload()->IdentityReport ?? null; - if($report === null) { + if(!$report instanceof \SimpleXMLElement) { return []; }