From e831340bf3c6994e001c07658b31f2a38016ca88 Mon Sep 17 00:00:00 2001 From: May Meow Date: Sun, 17 Oct 2021 17:30:30 +0200 Subject: [PATCH 1/3] Update to using php 8 --- composer.json | 3 +- composer.lock | 53 ++++++++++++++++---------------- docker/devcontainer/Dockerfile | 2 +- src/RSACryptoServiceProvider.php | 6 ++-- src/RSAParameters.php | 4 +-- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/composer.json b/composer.json index a6cf694..c0ce18b 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ } ], "require": { - "php": "7.4.*" + "php": "8.0.*", + "ext-openssl": "*" }, "require-dev": { "phpunit/phpunit": "^9.5", diff --git a/composer.lock b/composer.lock index 6592ba2..1704e97 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38f1e62e03a8651c9952bd4b77ea8c21", + "content-hash": "4b7dd164ed7557acd3f6e35b7e447229", "packages": [], "packages-dev": [ { @@ -136,16 +136,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.12.0", + "version": "v4.13.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -186,9 +186,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" }, - "time": "2021-07-21T10:44:31+00:00" + "time": "2021-09-20T12:20:58+00:00" }, { "name": "phar-io/manifest", @@ -412,16 +412,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", - "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -456,9 +456,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.5.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2021-09-17T15:28:14+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", @@ -911,16 +911,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.9", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", - "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -936,7 +936,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -998,7 +998,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.9" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" }, "funding": [ { @@ -1010,7 +1010,7 @@ "type": "github" } ], - "time": "2021-08-31T06:47:40+00:00" + "time": "2021-09-25T07:38:51+00:00" }, { "name": "sebastian/cli-parser", @@ -1865,6 +1865,7 @@ "type": "github" } ], + "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { @@ -1978,16 +1979,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", "shasum": "" }, "require": { @@ -2030,7 +2031,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-04-09T00:54:41+00:00" + "time": "2021-10-11T04:00:11+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2226,7 +2227,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "7.4.*" + "php": "8.0.*" }, "platform-dev": [], "plugin-api-version": "2.1.0" diff --git a/docker/devcontainer/Dockerfile b/docker/devcontainer/Dockerfile index bb836c8..fc0f695 100644 --- a/docker/devcontainer/Dockerfile +++ b/docker/devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/maymeow/php-ci-cd/php-ci-cd:7.4.16-cs-1 +FROM ghcr.io/maymeow/php-ci-cd/php-ci-cd:8.0.11-cs # arguments in docker-compose file ARG user=vscode diff --git a/src/RSACryptoServiceProvider.php b/src/RSACryptoServiceProvider.php index 3d5129d..096dd86 100644 --- a/src/RSACryptoServiceProvider.php +++ b/src/RSACryptoServiceProvider.php @@ -128,12 +128,10 @@ public function getFingerPrint(string $publicKey = null) : string } /** - * Returns RSA Parameters private key - * - * @return resource|string + * @return \OpenSSLAsymmetricKey|string * @throws Exceptions\DecryptPrivateKeyException */ - private function getPrivateKey() + private function getPrivateKey() : \OpenSSLAsymmetricKey|string { return $this->parameters->getPrivateKey(); } diff --git a/src/RSAParameters.php b/src/RSAParameters.php index 5db8938..66cbfe2 100644 --- a/src/RSAParameters.php +++ b/src/RSAParameters.php @@ -48,10 +48,10 @@ public function generateKeys(?string $passphrase = null, ?array $configArgs = nu } /** - * @return resource|string + * @return string|\OpenSSLAsymmetricKey * @throws DecryptPrivateKeyException */ - public function getPrivateKey() + public function getPrivateKey() : \OpenSSLAsymmetricKey|string { if ($this->passphrase != null && $this->privateKey != null) { $privateKeyResource = openssl_pkey_get_private($this->privateKey, $this->passphrase); From a420c201fcaf48a08623874063ed192a8468d308 Mon Sep 17 00:00:00 2001 From: MayMeow <3164256+MayMeow@users.noreply.github.com> Date: Sun, 17 Oct 2021 16:36:14 +0200 Subject: [PATCH 2/3] Change action to PHP8 based one --- .github/workflows/php.yml | 10 +++++----- composer.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 01b48ef..0d6a00c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,26 +10,26 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Composer run action PHPUnit uses: MayMeowHQ/composer-run-action@v1 with: composer_script: 'test' - codesniffer: + cs-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Composer run action PHPC_CS uses: MayMeowHQ/composer-run-action@v1 with: - composer_script: 'codesniffer' + composer_script: 'cs-check' stan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Composer run action PHPStan uses: MayMeowHQ/composer-run-action@v1 with: diff --git a/composer.json b/composer.json index c0ce18b..fa18de1 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "scripts": { "test": "phpunit tests", - "codesniffer": "phpcs --standard=PSR2 src", + "cs-check": "phpcs --standard=PSR2 src", "stan": "phpstan analyse" } } From 4b2792afb8366adbf1f4e5ab1268488f9dbd79a9 Mon Sep 17 00:00:00 2001 From: MayMeow <3164256+MayMeow@users.noreply.github.com> Date: Sun, 17 Oct 2021 16:37:42 +0200 Subject: [PATCH 3/3] Update php.yml --- .github/workflows/php.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0d6a00c..acde27b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,9 +10,9 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Composer run action PHPUnit - uses: MayMeowHQ/composer-run-action@v1 + uses: MayMeowHQ/composer-run-action@v4 with: composer_script: 'test' @@ -20,18 +20,18 @@ jobs: cs-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Composer run action PHPC_CS - uses: MayMeowHQ/composer-run-action@v1 + uses: MayMeowHQ/composer-run-action@v4 with: composer_script: 'cs-check' stan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Composer run action PHPStan - uses: MayMeowHQ/composer-run-action@v1 + uses: MayMeowHQ/composer-run-action@v4 with: composer_script: 'stan'