From b5fe783f0d904ca283a3e3ec636f33df58016bf4 Mon Sep 17 00:00:00 2001 From: Gregor Date: Wed, 31 Jul 2024 16:04:29 +0200 Subject: [PATCH 01/13] switch to new github workflow --- .github/workflows/php.yml | 96 +++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 3dfc483..eafc548 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,70 +1,80 @@ -name: "PHP" +# Controls when the action will run. on: + # Triggers the workflow on push or pull request events but only for the main branch push: - branches: - - "main" pull_request: - branches: - - "main" + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + permissions: contents: "read" + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # PHP lint for different PHP versions - build: + # composer validation + composer: + name: "composer config validation" + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - name: "Validate composer.json" + run: "composer validate --strict" + # PHP lint and PHPStan for different PHP versions + php: runs-on: "ubuntu-latest" strategy: matrix: php-version: - - "7.4" - "8.1" - env: - CC_TEST_REPORTER_ID: "b55ff60ba178ed6d17d568f49e8c6034e54aee0cfaf765c317a8545aeafe1215" + - "8.2" + - "8.3" name: "PHP ${{ matrix.php-version }}" steps: - - # git checkout - name: "git checkout" + - name: "git checkout" uses: "actions/checkout@v3" - - # Setup PHP - name: "Setup PHP" + - name: "setup PHP" uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" coverage: "xdebug" - - # Check PHP version - name: "Check PHP version" + - name: "check PHP version" run: "php -v" - - # Lint PHP files - name: "Lint PHP files" - run: | - for file in $(find ./ -type f -name '*.php'); do - echo -n "==> ${file}: "; - php -l "${file}"; - done - - # Validate composer.json and composer.lock - name: "Validate composer.json and composer.lock" - run: "composer validate --strict" - - # Cache Composer packages - name: "Cache Composer packages" - id: "composer-cache" - uses: "actions/cache@v3" + - name: "lint PHP files" + run: "php -l src/ tests/" +# - name: "install composer dependencies" +# run: "composer install --prefer-dist --no-progress" +# # PHPStan +# - name: "PHPStan static analysis" +# uses: "php-actions/phpstan@v3" +# with: +# php_version: "${{ matrix.php-version }}" +# configuration: "phpstan.neon" +# path: "src/ tests/" + # run unit tests + phpunit: + runs-on: "ubuntu-latest" + env: + CC_TEST_REPORTER_ID: "b55ff60ba178ed6d17d568f49e8c6034e54aee0cfaf765c317a8545aeafe1215" + name: "PHPUnit" + steps: + - name: "git checkout" + uses: "actions/checkout@v3" + - name: "setup PHP" + uses: "shivammathur/setup-php@v2" with: - path: "vendor" - key: "${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}" - restore-keys: "${{ runner.os }}-php-" - - # Install dependencies - name: "Install composer dependencies" - run: "composer install --prefer-dist --no-progress --ignore-platform-req=ext-sapnwrfc" - - # PHP_CodeSniffer - name: "PHP_CodeSniffer" - run: "php vendor/bin/phpcs" - - # CodeClimate Reporter Setup - name: "CodeClimate Reporter Setup" + php-version: "8.1" + coverage: "xdebug" + - name: "check PHP version" + run: "php -v" + - name: "install composer dependencies" + run: "composer install --prefer-dist --no-progress" + - name: "CodeClimate reporter setup" run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - - # Run phpunit - name: "Run phpunit" + - name: "run PHPUnit" run: | php vendor/bin/phpunit --coverage-clover clover.xml --coverage-text ./cc-test-reporter after-build -t clover --exit-code $? From b7024a30b843ddfd710e629372e59fb7631a48ed Mon Sep 17 00:00:00 2001 From: Gregor Date: Wed, 31 Jul 2024 18:44:31 +0200 Subject: [PATCH 02/13] add .uuid files to git ignore list --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0a19c94..c8d12d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor/ /.phpunit.result.cache +.uuid From 7d2ed3c7333716e2c2dfd70ce4927ece19e7f808 Mon Sep 17 00:00:00 2001 From: Gregor Date: Wed, 31 Jul 2024 18:45:01 +0200 Subject: [PATCH 03/13] update composer dependencies to PHP ^8.1 and development branches --- composer.json | 10 +- composer.lock | 373 ++++++++++++++++++++++++++++---------------------- 2 files changed, 211 insertions(+), 172 deletions(-) diff --git a/composer.json b/composer.json index 55d35ca..8189a61 100644 --- a/composer.json +++ b/composer.json @@ -30,15 +30,15 @@ }, "minimum-stability": "stable", "require": { - "php": ">=7.4", - "ext-sapnwrfc": "^1.4", - "php-sap/interfaces": "^4.0", - "php-sap/common": "^5.0" + "php": "^8.1", + "ext-sapnwrfc": "^2.1", + "php-sap/interfaces": "dev-main", + "php-sap/common": "dev-main" }, "require-dev": { "ext-json": "*", "phpunit/phpunit": "^9.6", - "php-sap/integration-tests": "^6.0", + "php-sap/integration-tests": "dev-main", "squizlabs/php_codesniffer": "^3.7" }, "autoload": { diff --git a/composer.lock b/composer.lock index 7058c8b..27be114 100644 --- a/composer.lock +++ b/composer.lock @@ -4,31 +4,33 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "43d298ec5f683bf43f51821e36034678", + "content-hash": "d63653d3be012e20a7eb280691e07dca", "packages": [ { "name": "php-sap/common", - "version": "v5.0.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/php-sap/common.git", - "reference": "1afaf2588e615f4ef784d9404bf4ae089e311ea9" + "reference": "490cfb015a307b70eee00902e9870c410e536383" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/common/zipball/1afaf2588e615f4ef784d9404bf4ae089e311ea9", - "reference": "1afaf2588e615f4ef784d9404bf4ae089e311ea9", + "url": "https://api.github.com/repos/php-sap/common/zipball/490cfb015a307b70eee00902e9870c410e536383", + "reference": "490cfb015a307b70eee00902e9870c410e536383", "shasum": "" }, "require": { "ext-json": "*", - "php": ">=7.4", - "php-sap/interfaces": "^4.0" + "php": "^8.1", + "php-sap/datetime": "^1.5", + "php-sap/interfaces": "dev-main" }, "require-dev": { "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.7" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -55,26 +57,26 @@ ], "support": { "issues": "https://github.com/php-sap/common/issues", - "source": "https://github.com/php-sap/common/tree/v5.0.0" + "source": "https://github.com/php-sap/common/tree/main" }, - "time": "2023-10-19T13:19:33+00:00" + "time": "2024-07-31T13:30:11+00:00" }, { "name": "php-sap/datetime", - "version": "v1.4.2", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/php-sap/datetime.git", - "reference": "6f6d21e90af497d0342eb30204dcc5f31d801a4d" + "reference": "53c0557e87964914a332e288204b9f841e9364dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/datetime/zipball/6f6d21e90af497d0342eb30204dcc5f31d801a4d", - "reference": "6f6d21e90af497d0342eb30204dcc5f31d801a4d", + "url": "https://api.github.com/repos/php-sap/datetime/zipball/53c0557e87964914a332e288204b9f841e9364dd", + "reference": "53c0557e87964914a332e288204b9f841e9364dd", "shasum": "" }, "require": { - "php": ">=7.4" + "php": "^8.1" }, "require-dev": { "phpunit/phpunit": "^9.6", @@ -110,28 +112,27 @@ ], "support": { "issues": "https://github.com/php-sap/datetime/issues", - "source": "https://github.com/php-sap/datetime/tree/v1.4.2" + "source": "https://github.com/php-sap/datetime/tree/v1.5.0" }, - "time": "2023-10-18T15:32:07+00:00" + "time": "2024-07-23T15:05:47+00:00" }, { "name": "php-sap/interfaces", - "version": "v4.0.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/php-sap/interfaces.git", - "reference": "f0ab5f7b37e6d0f909ea85685ce82d2d787527d8" + "reference": "d4ae1038eb26251f5e32eb6429cdf4f40d2ab422" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/interfaces/zipball/f0ab5f7b37e6d0f909ea85685ce82d2d787527d8", - "reference": "f0ab5f7b37e6d0f909ea85685ce82d2d787527d8", + "url": "https://api.github.com/repos/php-sap/interfaces/zipball/d4ae1038eb26251f5e32eb6429cdf4f40d2ab422", + "reference": "d4ae1038eb26251f5e32eb6429cdf4f40d2ab422", "shasum": "" }, "require": { "ext-json": "*", - "php": ">=7.4", - "php-sap/datetime": "^1.4" + "php": "^8.1" }, "conflict": { "kba-team/php-sap": "*" @@ -139,6 +140,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.7" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -165,38 +167,38 @@ ], "support": { "issues": "https://github.com/php-sap/interfaces/issues", - "source": "https://github.com/php-sap/interfaces/tree/v4.0.0" + "source": "https://github.com/php-sap/interfaces/tree/main" }, - "time": "2023-10-17T14:58:09+00:00" + "time": "2024-07-30T12:11:01+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^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.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -223,7 +225,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -239,7 +241,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "kba-team/memory-container", @@ -291,16 +293,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -308,11 +310,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -338,7 +341,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -346,29 +349,31 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v5.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -376,7 +381,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -400,26 +405,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2024-07-01T20:03:41+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -460,9 +466,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -517,29 +529,30 @@ }, { "name": "php-sap/integration-tests", - "version": "v6.0.1", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/php-sap/integration-tests.git", - "reference": "906b485a75fc97fe1766fde444eda0ab13bf71d5" + "reference": "1c55028f7d3b76d321084c09a797a62c52e7c3d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/integration-tests/zipball/906b485a75fc97fe1766fde444eda0ab13bf71d5", - "reference": "906b485a75fc97fe1766fde444eda0ab13bf71d5", + "url": "https://api.github.com/repos/php-sap/integration-tests/zipball/1c55028f7d3b76d321084c09a797a62c52e7c3d6", + "reference": "1c55028f7d3b76d321084c09a797a62c52e7c3d6", "shasum": "" }, "require": { "ext-json": "*", "kba-team/memory-container": "^2.0", - "php": ">=7.4", - "php-sap/common": "^5.0", - "php-sap/interfaces": "^4.0", + "php": "^8.1", + "php-sap/common": "dev-main", + "php-sap/interfaces": "dev-main", "phpunit/phpunit": "^9.6" }, "require-dev": { "squizlabs/php_codesniffer": "^3.7" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -561,29 +574,29 @@ "homepage": "https://php-sap.github.io/", "support": { "issues": "https://github.com/php-sap/integration-tests/issues", - "source": "https://github.com/php-sap/integration-tests/tree/v6.0.1" + "source": "https://github.com/php-sap/integration-tests/tree/main" }, - "time": "2023-10-20T10:09:30+00:00" + "time": "2024-07-31T16:13:06+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -633,7 +646,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -641,7 +654,7 @@ "type": "github" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -886,45 +899,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.13", + "version": "9.6.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "49d7820565836236411f5dc002d16dd689cde42f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", + "reference": "49d7820565836236411f5dc002d16dd689cde42f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.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.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -969,7 +982,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" }, "funding": [ { @@ -985,7 +998,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2024-07-10T11:45:39+00:00" }, { "name": "psr/container", @@ -1037,16 +1050,16 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -1081,7 +1094,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -1089,7 +1102,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -1278,20 +1291,20 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -1323,7 +1336,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -1331,20 +1344,20 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -1389,7 +1402,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -1397,7 +1410,7 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -1464,16 +1477,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -1529,7 +1542,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -1537,20 +1550,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -1593,7 +1606,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -1601,24 +1614,24 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -1650,7 +1663,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -1658,7 +1671,7 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -1837,16 +1850,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -1858,7 +1871,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1879,8 +1892,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -1888,7 +1900,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -2001,16 +2013,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.10.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { @@ -2020,11 +2032,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -2039,35 +2051,58 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-07-21T23:26:44+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -2096,7 +2131,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -2104,17 +2139,21 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "php-sap/interfaces": 20, + "php-sap/common": 20, + "php-sap/integration-tests": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", - "ext-sapnwrfc": "^1.4" + "php": "^8.1", + "ext-sapnwrfc": "^2.1" }, "platform-dev": { "ext-json": "*" From dbf2806015bf94d3ba3f2c7970e4ff9131ccbd9a Mon Sep 17 00:00:00 2001 From: Gregor Date: Thu, 1 Aug 2024 10:58:34 +0200 Subject: [PATCH 04/13] adapt to new interface and common library --- src/SapRfc.php | 19 +++++++------- src/Traits/ApiTrait.php | 52 ++++++++++++++++++++------------------ src/Traits/ConfigTrait.php | 12 ++++++--- src/Traits/ParamTrait.php | 14 ++++------ 4 files changed, 49 insertions(+), 48 deletions(-) diff --git a/src/SapRfc.php b/src/SapRfc.php index 1eb0460..93d66ef 100644 --- a/src/SapRfc.php +++ b/src/SapRfc.php @@ -124,8 +124,7 @@ protected function getConnection(): Connection } catch (IIncompleteConfigException $exception) { throw new IncompleteConfigException( $exception->getMessage(), - $exception->getCode(), - $exception + $exception->getCode() ); } /** @@ -134,9 +133,9 @@ protected function getConnection(): Connection try { if ($config->getTrace() !== null) { /** - * \SAPNWRFC\Connection::TRACE_LEVEL_* uses the same values as - * \phpsap\interfaces\Config\IConfigCommon::TRACE_*. Therefore - * no mapping is necessary. + * \SAPNWRFC\Connection::TRACE_LEVEL_* uses the same values + * as \phpsap\interfaces\Config\IConfigCommon::TRACE_*. + * Therefore, no mapping is necessary. */ Connection::setTraceLevel($config->getTrace()); } @@ -162,13 +161,13 @@ public function extractApi(): RemoteApi $api = new RemoteApi(); foreach ($this->saprfcFunctionInterface() as $name => $element) { try { - $api->add($this->createApiValue( + $api->add($this->createApiElement( strtoupper($name), $this->mapType($element['type']), $this->mapDirection($element['direction']), $element )); - } catch (SapLogicException $exception) { + } catch (IInvalidArgumentException | SapLogicException $exception) { /** * InvalidArgumentException is a child of SapLogicException and will * be caught too. @@ -213,7 +212,7 @@ public function invoke(): array */ $params = array_merge( $this->getInputParams( - $this->getApi()->getInputValues(), + $this->getApi()->getInputElements(), $this->getParams() ), $this->getTableParams( @@ -238,8 +237,8 @@ public function invoke(): array /** * Typecast the return values. */ - return $this->castOutputValues(array_merge( - $this->getApi()->getOutputValues(), + return $this->castOutput(array_merge( + $this->getApi()->getOutputElements(), $this->getApi()->getTables() ), $result); } diff --git a/src/Traits/ApiTrait.php b/src/Traits/ApiTrait.php index 9cd5cea..e30aa08 100644 --- a/src/Traits/ApiTrait.php +++ b/src/Traits/ApiTrait.php @@ -4,15 +4,16 @@ namespace phpsap\saprfc\Traits; -use phpsap\classes\Api\Element; +use phpsap\classes\Api\Member; use phpsap\classes\Api\Struct; use phpsap\classes\Api\Table; use phpsap\classes\Api\Value; use phpsap\exceptions\SapLogicException; -use phpsap\interfaces\Api\IElement; +use phpsap\interfaces\Api\IApiElement; use phpsap\interfaces\Api\IStruct; use phpsap\interfaces\Api\ITable; use phpsap\interfaces\Api\IValue; +use phpsap\interfaces\exceptions\IInvalidArgumentException; use function array_key_exists; use function is_array; @@ -29,29 +30,30 @@ trait ApiTrait /** * Create either Value, Struct or Table from a given remote function parameter * or return value. - * @param string $name The name of the parameter or return value. - * @param string $type The type of the parameter or return value. + * @param string $name The name of the parameter or return value. + * @param string $type The type of the parameter or return value. * @param string $direction The direction indicating whether it's a parameter or * return value. - * @param array $def The complete API value defintion from the module. + * @param array $def The complete API value defintion from the module. * @return Value|Struct|Table + * @throws IInvalidArgumentException */ - private function createApiValue(string $name, string $type, string $direction, array $def) + private function createApiElement(string $name, string $type, string $direction, array $def): Value|Table|Struct { $optional = $def['optional']; if ($type === ITable::TYPE_TABLE) { - return new Table($name, $direction, $optional, $this->createMembers($def)); + return Table::create($name, $direction, $optional, $this->createMembers($def)); } if ($type === IStruct::TYPE_STRUCT) { - return new Struct($name, $direction, $optional, $this->createMembers($def)); + return Struct::create($name, $direction, $optional, $this->createMembers($def)); } - return new Value($type, $name, $direction, $optional); + return Value::create($type, $name, $direction, $optional); } /** * Create either struct or table members from the def array of the remote function API. * @param array $def The complete API value defintion. - * @return Element[] An array of IElement compatible objects. + * @return Member[] An array of Member objects. * @throws SapLogicException In case a datatype is missing in the mappings array. */ private function createMembers(array $def): array @@ -59,7 +61,7 @@ private function createMembers(array $def): array $result = []; if (array_key_exists('typedef', $def) && is_array($def['typedef'])) { foreach ($def['typedef'] as $name => $member) { - $result[] = new Element($this->mapType($member['type']), $name); + $result[] = Member::create($this->mapType($member['type']), $name); } } return $result; @@ -74,18 +76,18 @@ private function createMembers(array $def): array private function mapType(string $type): string { $mapping = [ - 'RFCTYPE_DATE' => IElement::TYPE_DATE, - 'RFCTYPE_TIME' => IElement::TYPE_TIME, - 'RFCTYPE_INT' => IElement::TYPE_INTEGER, - 'RFCTYPE_NUM' => IElement::TYPE_INTEGER, - 'RFCTYPE_INT1' => IElement::TYPE_INTEGER, - 'RFCTYPE_INT2' => IElement::TYPE_INTEGER, - 'RFCTYPE_BCD' => IElement::TYPE_FLOAT, - 'RFCTYPE_FLOAT' => IElement::TYPE_FLOAT, - 'RFCTYPE_CHAR' => IElement::TYPE_STRING, - 'RFCTYPE_STRING' => IElement::TYPE_STRING, - 'RFCTYPE_BYTE' => IElement::TYPE_HEXBIN, - 'RFCTYPE_XSTRING' => IElement::TYPE_HEXBIN, + 'RFCTYPE_DATE' => IValue::TYPE_DATE, + 'RFCTYPE_TIME' => IValue::TYPE_TIME, + 'RFCTYPE_INT' => IValue::TYPE_INTEGER, + 'RFCTYPE_NUM' => IValue::TYPE_INTEGER, + 'RFCTYPE_INT1' => IValue::TYPE_INTEGER, + 'RFCTYPE_INT2' => IValue::TYPE_INTEGER, + 'RFCTYPE_BCD' => IValue::TYPE_FLOAT, + 'RFCTYPE_FLOAT' => IValue::TYPE_FLOAT, + 'RFCTYPE_CHAR' => IValue::TYPE_STRING, + 'RFCTYPE_STRING' => IValue::TYPE_STRING, + 'RFCTYPE_BYTE' => IValue::TYPE_HEXBIN, + 'RFCTYPE_XSTRING' => IValue::TYPE_HEXBIN, 'RFCTYPE_STRUCTURE' => IStruct::TYPE_STRUCT, 'RFCTYPE_TABLE' => ITable::TYPE_TABLE ]; @@ -104,8 +106,8 @@ private function mapType(string $type): string private function mapDirection(string $direction): string { $mapping = [ - 'RFC_EXPORT' => IValue::DIRECTION_OUTPUT, - 'RFC_IMPORT' => IValue::DIRECTION_INPUT, + 'RFC_EXPORT' => IApiElement::DIRECTION_OUTPUT, + 'RFC_IMPORT' => IApiElement::DIRECTION_INPUT, 'RFC_TABLES' => ITable::DIRECTION_TABLE ]; if (!array_key_exists($direction, $mapping)) { diff --git a/src/Traits/ConfigTrait.php b/src/Traits/ConfigTrait.php index 52949f6..c367e59 100644 --- a/src/Traits/ConfigTrait.php +++ b/src/Traits/ConfigTrait.php @@ -4,13 +4,14 @@ namespace phpsap\saprfc\Traits; -use phpsap\interfaces\Config\IConfigCommon; +use phpsap\exceptions\IncompleteConfigException; use phpsap\interfaces\Config\IConfigTypeA; use phpsap\interfaces\Config\IConfigTypeB; use phpsap\interfaces\Config\IConfiguration; use phpsap\interfaces\exceptions\IIncompleteConfigException; use function array_merge; +use function get_class; /** * Trait ConfigTrait @@ -47,7 +48,10 @@ private function getSpecificConfig(IConfiguration $config): array if ($config instanceof IConfigTypeA) { return $this->getTypeAConfig($config); } - return $this->getTypeBConfig($config); + if ($config instanceof IConfigTypeB) { + return $this->getTypeBConfig($config); + } + throw new IncompleteConfigException(sprintf('Unknown config type %s', get_class($config))); } /** @@ -56,11 +60,11 @@ private function getSpecificConfig(IConfiguration $config): array * I chose a "stupid" (and repetitive) way because it is more readable * and thus better maintainable for others than an "intelligent" way. * - * @param IConfigCommon $config + * @param IConfiguration $config * @return array * @throws IIncompleteConfigException */ - private function getCommonConfig(IConfigCommon $config): array + private function getCommonConfig(IConfiguration $config): array { $common = []; if ($config->getLang() !== null) { diff --git a/src/Traits/ParamTrait.php b/src/Traits/ParamTrait.php index ca7576b..9ef6142 100644 --- a/src/Traits/ParamTrait.php +++ b/src/Traits/ParamTrait.php @@ -5,16 +5,12 @@ namespace phpsap\saprfc\Traits; use phpsap\exceptions\FunctionCallException; -use phpsap\interfaces\Api\IElement; -use phpsap\interfaces\Api\IStruct; -use phpsap\interfaces\Api\ITable; -use phpsap\interfaces\Api\IValue; +use phpsap\interfaces\Api\IApiElement; use phpsap\interfaces\exceptions\IInvalidArgumentException; use function array_key_exists; use function count; use function is_array; -use function is_string; use function sprintf; /** @@ -28,7 +24,7 @@ trait ParamTrait /** * Generate a function call parameter array from a list of known input values * and the previously set parameters. - * @param IValue[] $inputs API input values. + * @param IApiElement[] $inputs API input values. * @param array $params Parameters * @return array * @throws FunctionCallException @@ -54,7 +50,7 @@ private function getInputParams(array $inputs, array $params): array /** * Generate a function call parameter array from a list of known tables and the * previously set parameters. - * @param ITable[] $tables + * @param IApiElement[] $tables * @param array $params * @return array */ @@ -75,12 +71,12 @@ private function getTableParams(array $tables, array $params): array } /** - * @param IValue[] $outputs + * @param IApiElement[] $outputs * @param array $result * @return array * @throws IInvalidArgumentException */ - private function castOutputValues(array $outputs, array $result): array + private function castOutput(array $outputs, array $result): array { $return = []; foreach ($outputs as $output) { From 2d4f9aea1af35443a09e505bed5f22a74f646d5b Mon Sep 17 00:00:00 2001 From: Gregor Date: Thu, 1 Aug 2024 15:58:45 +0200 Subject: [PATCH 05/13] update SAPNWRFC helper to stub from version 2.1.0 --- tests/helper/SAPNWRFC.php | 100 ++++++++++++++++++++++++++++++++------ 1 file changed, 85 insertions(+), 15 deletions(-) diff --git a/tests/helper/SAPNWRFC.php b/tests/helper/SAPNWRFC.php index 481d822..dc1ef5a 100644 --- a/tests/helper/SAPNWRFC.php +++ b/tests/helper/SAPNWRFC.php @@ -21,7 +21,7 @@ * actual module and an actual SAP system. */ if (extension_loaded('sapnwrfc')) { - throw new \RuntimeException('PHP module sapnwrfc is loaded. Cannot run tests using mockups.'); + die('PHP module sapnwrfc is loaded. Cannot run tests using mockups.'); } /** @@ -73,7 +73,7 @@ class Exception extends \RuntimeException * * @returns array|null */ - public function getErrorInfo(): array + public function getErrorInfo(): ?array { return $this->errorInfo; } @@ -102,21 +102,34 @@ class FunctionCallException extends Exception class Connection { /** - * Disable SAP remote function call tracing. + * Off. Only severe errors are logged to the dev_rfc.log file. + * @var int */ public const TRACE_LEVEL_OFF = 0; /** - * Brief tracing of SAP remote function calls. + * Brief. All API calls (except for the setter and getter functions) and important attributes like codepages, + * RFC headers, logon parameters are traced. Trace is written to a file named rfc.trc or + * rfc_.trc, depending on whether tracing is done on a "per-process" basis or a "per-thread" basis. + * is the current process ID, the current thread ID. + * @var int */ public const TRACE_LEVEL_BRIEF = 1; /** - * Verbose tracing of SAP remote function calls. + * Verbose. In addition to 1, the values of the "scalar" RFC parameters as well as the contents of the network + * containers are traced. Scalar parameters are primitive types (CHAR, INT, FLOAT, etc) and flat structures. + * @var int */ public const TRACE_LEVEL_VERBOSE = 2; /** - * Debug-like tracing of SAP remote function calls. + * Detailed. In addition to 2 the contents of nested structures and tables and hexdumps are traced. + * @var int */ - public const TRACE_LEVEL_FULL = 3; + public const TRACE_LEVEL_DETAILED = 3; + /** + * Full. In addition to 3 all API calls of setter and getter functions and table operations are traced. + * @var int + */ + public const TRACE_LEVEL_FULL = 4; /** * Connect to the system using the given parameters. @@ -166,19 +179,41 @@ public function ping(): bool * Lookup a RFC function and return a RemoteFunction object. * * @param string $functionnName Name of the function. + * @param bool $invalidateCache If true, invalidates the function desc cache. * * @return RemoteFunction A RemoteFunction class for the RFC function. * * @throws FunctionCallException if the lookup fails or an error is * returned during parameter parsing. */ - public function getFunction(string $functionName): RemoteFunction + public function getFunction(string $functionName, bool $invalidateCache = false): RemoteFunction { $func = \phpsap\IntegrationTests\SapRfcModuleMocks::singleton() ->get('\SAPNWRFC\Connection::' . __FUNCTION__); return $func($functionName); } + /** + * Retrieve a SSO ticket from the connection. + * + * For this to work, the connection must be opened with parameter `GETSSO2=1` + * and the profile parameter `login/create_sso2_ticket` must be set to a value + * different from '0' in the backend. + * + * Note: To retrieve a SSO ticket from the connection, SDK version 7.50.1 or + * later is required. + * + * @return string The SSO ticket. + * + * @throws ConnectionException if no SSO ticket could be retrieved. + */ + public function getSSOTicket(): string + { + $func = \phpsap\IntegrationTests\SapRfcModuleMocks::singleton() + ->get('\SAPNWRFC\Connection::' . __FUNCTION__); + return $func(); + } + /** * Close the connection. * @@ -234,7 +269,7 @@ public static function reloadIniFile(): bool * * @param string $path Path to trace directory (must exist). * - * @return bool True if path was set. + * @return true True if path was set (BC). * * @throws ConnectionException if path could not be set. */ @@ -250,7 +285,7 @@ public static function setTraceDir(string $path): bool * * @param int $level Trace level. * - * @return bool True if level was set. + * @return true True if trace level was set (BC). * * @throws ConnectionException if level could not be set. */ @@ -261,6 +296,26 @@ public static function setTraceLevel(int $level): bool return $func($level); } + /** + * Sets the global logon timeout in seconds. + * + * Sets the timeout for how long the logon in the ABAP backend can take when opening a connection. + * The default value is 60 seconds. + * + * The timeout can also be set via RFC_GLOBAL_LOGON_TIMEOUT in the DEFAULT + * section of the sapnwrfc.ini file. + * + * @param int $timeout Timeout in seconds (1 - 3600). + * + * @throws ConnectionException if timeout cannot be set or is out of range. + */ + public static function setGlobalLogonTimeout(int $timeout): void + { + $func = \phpsap\IntegrationTests\SapRfcModuleMocks::singleton() + ->get('\SAPNWRFC\Connection::' . __FUNCTION__); + $func($timeout); + } + /** * Get the extension version. * @@ -268,7 +323,7 @@ public static function setTraceLevel(int $level): bool */ public static function version(): string { - return 'SAPNWRFC MOCKUP 1.0'; + return 'SAPNWRFC MOCKUP 2.1.0'; } /** @@ -289,7 +344,8 @@ public static function rfcVersion(): string class RemoteFunction { /** - * RemoteFunction constructor. + * Manually inserted RemoteFunction constructor for ease of creation by + * \SAPNWRFC\Connection::getFunction() * @param string $name function name */ public function __construct($name) @@ -325,7 +381,7 @@ public function invoke(array $parameters = [], array $options = []): array * * @throws FunctionCallException if the parameter status could not be set. */ - public function setParameterActive(string $parameterName, bool $isActive) + public function setParameterActive(string $parameterName, bool $isActive): void { $func = \phpsap\IntegrationTests\SapRfcModuleMocks::singleton() ->get('\SAPNWRFC\RemoteFunction::' . __FUNCTION__); @@ -347,9 +403,11 @@ public function isParameterActive(string $parameterName): bool } /** - * Return the SAP remote function API description as array. + * Get the function's parameter description. + * + * @return array The parameter descriptions, indexed by parameter name. * - * @return array + * @throws FunctionCallException if the interface description cannot be retrieved. */ public function getFunctionDescription(): array { @@ -357,4 +415,16 @@ public function getFunctionDescription(): array ->get('\SAPNWRFC\RemoteFunction::' . __FUNCTION__); return $func(); } + + /** + * Get the function's name. + * + * @return string The function name. + */ + public function getName(): string + { + $func = \phpsap\IntegrationTests\SapRfcModuleMocks::singleton() + ->get('\SAPNWRFC\RemoteFunction::' . __FUNCTION__); + return $func(); + } } From 0357d8bdeb2a264ba00c5d534081aaad77eb52e1 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 13:28:13 +0200 Subject: [PATCH 06/13] update php-sap/common --- composer.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index 27be114..66c3dac 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/php-sap/common.git", - "reference": "490cfb015a307b70eee00902e9870c410e536383" + "reference": "b60fdd54a99b6c050a2a82265dc0cbd4b380b085" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/common/zipball/490cfb015a307b70eee00902e9870c410e536383", - "reference": "490cfb015a307b70eee00902e9870c410e536383", + "url": "https://api.github.com/repos/php-sap/common/zipball/b60fdd54a99b6c050a2a82265dc0cbd4b380b085", + "reference": "b60fdd54a99b6c050a2a82265dc0cbd4b380b085", "shasum": "" }, "require": { @@ -59,7 +59,7 @@ "issues": "https://github.com/php-sap/common/issues", "source": "https://github.com/php-sap/common/tree/main" }, - "time": "2024-07-31T13:30:11+00:00" + "time": "2024-08-02T11:22:36+00:00" }, { "name": "php-sap/datetime", @@ -533,12 +533,12 @@ "source": { "type": "git", "url": "https://github.com/php-sap/integration-tests.git", - "reference": "1c55028f7d3b76d321084c09a797a62c52e7c3d6" + "reference": "640bcd53302eba7b63ed1fd0886b54e8c390be87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/integration-tests/zipball/1c55028f7d3b76d321084c09a797a62c52e7c3d6", - "reference": "1c55028f7d3b76d321084c09a797a62c52e7c3d6", + "url": "https://api.github.com/repos/php-sap/integration-tests/zipball/640bcd53302eba7b63ed1fd0886b54e8c390be87", + "reference": "640bcd53302eba7b63ed1fd0886b54e8c390be87", "shasum": "" }, "require": { @@ -576,7 +576,7 @@ "issues": "https://github.com/php-sap/integration-tests/issues", "source": "https://github.com/php-sap/integration-tests/tree/main" }, - "time": "2024-07-31T16:13:06+00:00" + "time": "2024-08-02T07:35:43+00:00" }, { "name": "phpunit/php-code-coverage", From 1d60ad06b09ede42c447b4def2a262e4357c88f6 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 14:29:02 +0200 Subject: [PATCH 07/13] adapt code for sapnwrfc 2.1.0 --- src/SapRfc.php | 30 ++++++++++++++---------------- src/Traits/ApiTrait.php | 3 ++- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/SapRfc.php b/src/SapRfc.php index 93d66ef..963a12d 100644 --- a/src/SapRfc.php +++ b/src/SapRfc.php @@ -11,6 +11,7 @@ use phpsap\exceptions\IncompleteConfigException; use phpsap\exceptions\SapLogicException; use phpsap\exceptions\UnknownFunctionException; +use phpsap\interfaces\Config\IConfiguration; use phpsap\interfaces\exceptions\IIncompleteConfigException; use phpsap\interfaces\exceptions\IInvalidArgumentException; use phpsap\saprfc\Traits\ApiTrait; @@ -20,6 +21,7 @@ use SAPNWRFC\ConnectionException as ModuleConnectionException; use SAPNWRFC\FunctionCallException as ModuleFunctionCallException; use SAPNWRFC\RemoteFunction; +use TypeError; use function array_merge; use function get_object_vars; @@ -133,14 +135,19 @@ protected function getConnection(): Connection try { if ($config->getTrace() !== null) { /** - * \SAPNWRFC\Connection::TRACE_LEVEL_* uses the same values - * as \phpsap\interfaces\Config\IConfigCommon::TRACE_*. - * Therefore, no mapping is necessary. + * SAPNWRFC introduced TRACE_DETAILED (3) in v2.1.0 which + * is not available via the interface. */ - Connection::setTraceLevel($config->getTrace()); + $trace = match ($config->getTrace()) { + IConfiguration::TRACE_FULL => 4, + IConfiguration::TRACE_VERBOSE => 2, + IConfiguration::TRACE_BRIEF => 1, + default => 0, + }; + Connection::setTraceLevel($trace); } $this->connection = new Connection($moduleConfig); - } catch (ModuleConnectionException $exception) { + } catch (TypeError | ModuleConnectionException $exception) { throw new ConnectionFailedException(sprintf( 'Connection creation failed: %s', $exception->getMessage() @@ -155,9 +162,6 @@ protected function getConnection(): Connection */ public function extractApi(): RemoteApi { - /** - * InvalidArgumentException is never thrown, because no parameter is given. - */ $api = new RemoteApi(); foreach ($this->saprfcFunctionInterface() as $name => $element) { try { @@ -192,13 +196,7 @@ public function extractApi(): RemoteApi */ public function saprfcFunctionInterface(): array { - $function = $this->getFunction(); - if (method_exists($function, 'getFunctionDescription')) { - return $function->getFunctionDescription(); - } - $result = get_object_vars($function); - unset($result['name']); - return $result; + return $this->getFunction()->getFunctionDescription(); } /** @@ -227,7 +225,7 @@ public function invoke(): array $result = $this ->getFunction() ->invoke($params, self::$invokeOptions); - } catch (ModuleFunctionCallException $exception) { + } catch (TypeError | ModuleFunctionCallException $exception) { throw new FunctionCallException(sprintf( 'Function call %s failed: %s', $this->getName(), diff --git a/src/Traits/ApiTrait.php b/src/Traits/ApiTrait.php index e30aa08..57f3a16 100644 --- a/src/Traits/ApiTrait.php +++ b/src/Traits/ApiTrait.php @@ -82,7 +82,8 @@ private function mapType(string $type): string 'RFCTYPE_NUM' => IValue::TYPE_INTEGER, 'RFCTYPE_INT1' => IValue::TYPE_INTEGER, 'RFCTYPE_INT2' => IValue::TYPE_INTEGER, - 'RFCTYPE_BCD' => IValue::TYPE_FLOAT, + 'RFCTYPE_INT8' => IValue::TYPE_INTEGER, + 'RFCTYPE_BCD' => IValue::TYPE_STRING, 'RFCTYPE_FLOAT' => IValue::TYPE_FLOAT, 'RFCTYPE_CHAR' => IValue::TYPE_STRING, 'RFCTYPE_STRING' => IValue::TYPE_STRING, From 042fe7853a39e9708a82aac0f5406da50e07cb96 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 14:29:24 +0200 Subject: [PATCH 08/13] add phpstan config --- phpstan.neon | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 phpstan.neon diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..a077747 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,10 @@ +parameters: + level: 5 + paths: + - src/ + - tests/ + scanDirectories: + - vendor/ + ignoreErrors: + - '/Unreachable statement \- code above always terminates\./' + - '/PHPDoc tag @var above a method has no effect\./' From 4a34dcd485a8efd95b314ab18d3039e88a32ff33 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 14:29:35 +0200 Subject: [PATCH 09/13] fix code for phpstan --- src/Traits/ConfigTrait.php | 3 +++ src/Traits/ParamTrait.php | 4 ++++ tests/OutputTableTest.php | 15 +++++++++------ tests/SapRfcIntegrationTest.php | 3 ++- tests/helper/SAPNWRFC.php | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/Traits/ConfigTrait.php b/src/Traits/ConfigTrait.php index c367e59..0548d50 100644 --- a/src/Traits/ConfigTrait.php +++ b/src/Traits/ConfigTrait.php @@ -70,6 +70,7 @@ private function getCommonConfig(IConfiguration $config): array if ($config->getLang() !== null) { $common['lang'] = $config->getLang(); } + //mandatory configuration parameters $common['client'] = $config->getClient(); $common['user'] = $config->getUser(); $common['passwd'] = $config->getPasswd(); @@ -95,6 +96,7 @@ private function getTypeAConfig(IConfigTypeA $config): array if ($config->getGwserv() !== null) { $typeA['gwserv'] = $config->getGwserv(); } + //mandatory configuration parameters $typeA['ashost'] = $config->getAshost(); $typeA['sysnr'] = $config->getSysnr(); return $typeA; @@ -119,6 +121,7 @@ private function getTypeBConfig(IConfigTypeB $config): array if ($config->getGroup() !== null) { $typeB['group'] = $config->getGroup(); } + //mandatory configuration parameter $typeB['mshost'] = $config->getMshost(); return $typeB; } diff --git a/src/Traits/ParamTrait.php b/src/Traits/ParamTrait.php index 9ef6142..44f809f 100644 --- a/src/Traits/ParamTrait.php +++ b/src/Traits/ParamTrait.php @@ -4,6 +4,9 @@ namespace phpsap\saprfc\Traits; +use phpsap\classes\Api\Struct; +use phpsap\classes\Api\Table; +use phpsap\classes\Api\Value; use phpsap\exceptions\FunctionCallException; use phpsap\interfaces\Api\IApiElement; use phpsap\interfaces\exceptions\IInvalidArgumentException; @@ -79,6 +82,7 @@ private function getTableParams(array $tables, array $params): array private function castOutput(array $outputs, array $result): array { $return = []; + /** @var Value|Table|Struct $output */ foreach ($outputs as $output) { $key = $output->getName(); if (array_key_exists($key, $result)) { diff --git a/tests/OutputTableTest.php b/tests/OutputTableTest.php index daf1fdf..450e9bf 100644 --- a/tests/OutputTableTest.php +++ b/tests/OutputTableTest.php @@ -28,6 +28,9 @@ class OutputTableTest extends AbstractTestCase { use TestCaseTrait; + /** + * @var array + */ public static array $apiRaw = [ 'ET_API_ANGEBOT_ADRESSE' => [ 'name' => 'ET_API_ANGEBOT_ADRESSE', @@ -206,9 +209,9 @@ class OutputTableTest extends AbstractTestCase ] ]; /** - * @var string + * @var array */ - public static $apiJson = [ + public static array $apiJson = [ 0 => [ 'type' => 'table', 'name' => 'ET_API_ANGEBOT_ADRESSE', @@ -343,7 +346,7 @@ class OutputTableTest extends AbstractTestCase /** * Mock the RFC_OUTPUT_TABLE function. */ - public function mockRfcOutputTable() + public function mockRfcOutputTable(): void { //Use an object for connection flag and function name. $flags = new stdClass(); @@ -354,9 +357,9 @@ public function mockRfcOutputTable() $flags->response = self::$responseRaw; $expectedConfig = static::getSampleSapConfig(); static::mock('\SAPNWRFC\Connection::__construct', static function (array $config, array $options) use ($flags, $expectedConfig) { + unset($options); if ( - !is_array($config) - || !array_key_exists('ashost', $config) + !array_key_exists('ashost', $config) || !array_key_exists('sysnr', $config) || !array_key_exists('client', $config) || !array_key_exists('user', $config) @@ -373,7 +376,7 @@ public function mockRfcOutputTable() $flags->conn = true; }); static::mock('\SAPNWRFC\Connection::close', static function () use ($flags) { - //calling \SAPNWRFC\Connection::close twice has to fail + //calling \SAPNWRFC\Connection::close() twice has to fail if ($flags->conn !== true) { throw new ConnectionException('mock connection already closed!'); } diff --git a/tests/SapRfcIntegrationTest.php b/tests/SapRfcIntegrationTest.php index 9967191..47c37df 100644 --- a/tests/SapRfcIntegrationTest.php +++ b/tests/SapRfcIntegrationTest.php @@ -786,7 +786,8 @@ protected function mockFailedRemoteFunctionCallWithParameters() } return new RemoteFunction($name); }); - static::mock('\SAPNWRFC\RemoteFunction::invoke', static function (array $params, array $options) use ($flags) { + static::mock('\SAPNWRFC\RemoteFunction::invoke', static function (array $params, array $options) { + unset($params, $options); throw new FunctionCallException('mock function call exception!'); }); } diff --git a/tests/helper/SAPNWRFC.php b/tests/helper/SAPNWRFC.php index dc1ef5a..26b88ff 100644 --- a/tests/helper/SAPNWRFC.php +++ b/tests/helper/SAPNWRFC.php @@ -178,7 +178,7 @@ public function ping(): bool /** * Lookup a RFC function and return a RemoteFunction object. * - * @param string $functionnName Name of the function. + * @param string $functionName Name of the function. * @param bool $invalidateCache If true, invalidates the function desc cache. * * @return RemoteFunction A RemoteFunction class for the RFC function. From 1a5f4ece95ae3396b01b30c89db0ce1a57b21f38 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 14:30:02 +0200 Subject: [PATCH 10/13] enable phpstan in github workflow --- .github/workflows/php.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index eafc548..181be32 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -42,15 +42,15 @@ jobs: run: "php -v" - name: "lint PHP files" run: "php -l src/ tests/" -# - name: "install composer dependencies" -# run: "composer install --prefer-dist --no-progress" -# # PHPStan -# - name: "PHPStan static analysis" -# uses: "php-actions/phpstan@v3" -# with: -# php_version: "${{ matrix.php-version }}" -# configuration: "phpstan.neon" -# path: "src/ tests/" + - name: "install composer dependencies" + run: "composer install --prefer-dist --no-progress" + # PHPStan + - name: "PHPStan static analysis" + uses: "php-actions/phpstan@v3" + with: + php_version: "${{ matrix.php-version }}" + configuration: "phpstan.neon" + path: "src/ tests/" # run unit tests phpunit: runs-on: "ubuntu-latest" From a1d168fdd94d73735ae1b4f6df651e9cca749e79 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 14:33:47 +0200 Subject: [PATCH 11/13] github workflow ignore platform reqs on composer install --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 181be32..d4056a7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -43,7 +43,7 @@ jobs: - name: "lint PHP files" run: "php -l src/ tests/" - name: "install composer dependencies" - run: "composer install --prefer-dist --no-progress" + run: "composer install --prefer-dist --no-progress --ignore-platform-reqs" # PHPStan - name: "PHPStan static analysis" uses: "php-actions/phpstan@v3" @@ -68,7 +68,7 @@ jobs: - name: "check PHP version" run: "php -v" - name: "install composer dependencies" - run: "composer install --prefer-dist --no-progress" + run: "composer install --prefer-dist --no-progress --ignore-platform-reqs" - name: "CodeClimate reporter setup" run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter From 8a364fdb75281b95e6c71779394a524ca3eafb09 Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 2 Aug 2024 14:42:34 +0200 Subject: [PATCH 12/13] remove unused use statements --- src/SapRfc.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/SapRfc.php b/src/SapRfc.php index 963a12d..fe63bb9 100644 --- a/src/SapRfc.php +++ b/src/SapRfc.php @@ -24,8 +24,6 @@ use TypeError; use function array_merge; -use function get_object_vars; -use function method_exists; use function sprintf; /** From 47b8ddc9d8d9e69c588a34396caae06b6e0a9205 Mon Sep 17 00:00:00 2001 From: Gregor Date: Mon, 5 Aug 2024 13:32:30 +0200 Subject: [PATCH 13/13] updated php-sap interfaces to v5, common to v6 and integration-tests to v7 --- composer.json | 6 +++--- composer.lock | 45 +++++++++++++++++++-------------------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/composer.json b/composer.json index 8189a61..ea51d3a 100644 --- a/composer.json +++ b/composer.json @@ -32,13 +32,13 @@ "require": { "php": "^8.1", "ext-sapnwrfc": "^2.1", - "php-sap/interfaces": "dev-main", - "php-sap/common": "dev-main" + "php-sap/interfaces": "^5.0", + "php-sap/common": "^6.0" }, "require-dev": { "ext-json": "*", "phpunit/phpunit": "^9.6", - "php-sap/integration-tests": "dev-main", + "php-sap/integration-tests": "^7.0", "squizlabs/php_codesniffer": "^3.7" }, "autoload": { diff --git a/composer.lock b/composer.lock index 66c3dac..d7de46f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,33 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d63653d3be012e20a7eb280691e07dca", + "content-hash": "8a148f7f5d9c23afb9bc5766699702bb", "packages": [ { "name": "php-sap/common", - "version": "dev-main", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/php-sap/common.git", - "reference": "b60fdd54a99b6c050a2a82265dc0cbd4b380b085" + "reference": "85ea659659f9569246c778e082935ad813b1866f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/common/zipball/b60fdd54a99b6c050a2a82265dc0cbd4b380b085", - "reference": "b60fdd54a99b6c050a2a82265dc0cbd4b380b085", + "url": "https://api.github.com/repos/php-sap/common/zipball/85ea659659f9569246c778e082935ad813b1866f", + "reference": "85ea659659f9569246c778e082935ad813b1866f", "shasum": "" }, "require": { "ext-json": "*", "php": "^8.1", "php-sap/datetime": "^1.5", - "php-sap/interfaces": "dev-main" + "php-sap/interfaces": "^5.0" }, "require-dev": { "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.7" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -57,9 +56,9 @@ ], "support": { "issues": "https://github.com/php-sap/common/issues", - "source": "https://github.com/php-sap/common/tree/main" + "source": "https://github.com/php-sap/common/tree/v6.0.0" }, - "time": "2024-08-02T11:22:36+00:00" + "time": "2024-08-05T11:02:59+00:00" }, { "name": "php-sap/datetime", @@ -118,7 +117,7 @@ }, { "name": "php-sap/interfaces", - "version": "dev-main", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/php-sap/interfaces.git", @@ -140,7 +139,6 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.7" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -167,7 +165,7 @@ ], "support": { "issues": "https://github.com/php-sap/interfaces/issues", - "source": "https://github.com/php-sap/interfaces/tree/main" + "source": "https://github.com/php-sap/interfaces/tree/v5.0.0" }, "time": "2024-07-30T12:11:01+00:00" } @@ -529,30 +527,29 @@ }, { "name": "php-sap/integration-tests", - "version": "dev-main", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/php-sap/integration-tests.git", - "reference": "640bcd53302eba7b63ed1fd0886b54e8c390be87" + "reference": "76f374b23595f43c1855d8e523153c6e15c7f105" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-sap/integration-tests/zipball/640bcd53302eba7b63ed1fd0886b54e8c390be87", - "reference": "640bcd53302eba7b63ed1fd0886b54e8c390be87", + "url": "https://api.github.com/repos/php-sap/integration-tests/zipball/76f374b23595f43c1855d8e523153c6e15c7f105", + "reference": "76f374b23595f43c1855d8e523153c6e15c7f105", "shasum": "" }, "require": { "ext-json": "*", "kba-team/memory-container": "^2.0", "php": "^8.1", - "php-sap/common": "dev-main", - "php-sap/interfaces": "dev-main", + "php-sap/common": "^6.0", + "php-sap/interfaces": "^5.0", "phpunit/phpunit": "^9.6" }, "require-dev": { "squizlabs/php_codesniffer": "^3.7" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -574,9 +571,9 @@ "homepage": "https://php-sap.github.io/", "support": { "issues": "https://github.com/php-sap/integration-tests/issues", - "source": "https://github.com/php-sap/integration-tests/tree/main" + "source": "https://github.com/php-sap/integration-tests/tree/v7.0.0" }, - "time": "2024-08-02T07:35:43+00:00" + "time": "2024-08-05T11:28:32+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2144,11 +2141,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "php-sap/interfaces": 20, - "php-sap/common": 20, - "php-sap/integration-tests": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": {