From bc4f0ca7006bdf4ceed0df392f1f9b7436f3db0d Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Tue, 11 Oct 2022 15:24:44 +0530 Subject: [PATCH 01/12] Create codeql-analysis.yml --- .../workflows/codeql-analysis.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml diff --git a/.github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml b/.github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml new file mode 100644 index 0000000..f02bcd6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml @@ -0,0 +1,20 @@ +name: "CodeQL" + +on: [pull_request] +jobs: + lint: + name: CodeQL + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - run: git checkout HEAD^2 + + - name: Run CodeQL + run: | + docker run --rm -v $PWD:/app composer sh -c \ + "composer install --profile --ignore-platform-reqs && composer check" From 1d83b34a44fe0a195020dca78845467bfbcf7b66 Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Tue, 11 Oct 2022 15:25:30 +0530 Subject: [PATCH 02/12] Delete .github/ISSUE_TEMPLATE/workflows directory --- .../workflows/codeql-analysis.yml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml diff --git a/.github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml b/.github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml deleted file mode 100644 index f02bcd6..0000000 --- a/.github/ISSUE_TEMPLATE/workflows/codeql-analysis.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: "CodeQL" - -on: [pull_request] -jobs: - lint: - name: CodeQL - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - run: git checkout HEAD^2 - - - name: Run CodeQL - run: | - docker run --rm -v $PWD:/app composer sh -c \ - "composer install --profile --ignore-platform-reqs && composer check" From 68b2242285f9cdb97c3d7588077c82a27777aeb9 Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Tue, 11 Oct 2022 15:29:02 +0530 Subject: [PATCH 03/12] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..f02bcd6 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,20 @@ +name: "CodeQL" + +on: [pull_request] +jobs: + lint: + name: CodeQL + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - run: git checkout HEAD^2 + + - name: Run CodeQL + run: | + docker run --rm -v $PWD:/app composer sh -c \ + "composer install --profile --ignore-platform-reqs && composer check" From e536cb271367438395e8221323a138bf26d47861 Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Tue, 11 Oct 2022 17:56:31 +0530 Subject: [PATCH 04/12] Update composer.json --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d880004..9de741c 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,9 @@ "email": "eldad@appwrite.io" } ], + "scripts": { + "check": "./vendor/bin/phpstan analyse --level max src tests" + }, "autoload": { "psr-4": {"Utopia\\Image\\":"src/Image"} }, @@ -20,6 +23,7 @@ "require-dev": { "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.13.1" + "phpstan/phpstan": "1.9.x-dev" }, "minimum-stability": "dev" -} \ No newline at end of file +} From 3ebcbb31cf0eee6e1f2f484ddb890e3bdf68407e Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Tue, 11 Oct 2022 18:12:16 +0530 Subject: [PATCH 05/12] Update composer.json --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 9de741c..fd49746 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,7 @@ "email": "eldad@appwrite.io" } ], - "scripts": { - "check": "./vendor/bin/phpstan analyse --level max src tests" + }, "autoload": { "psr-4": {"Utopia\\Image\\":"src/Image"} @@ -23,7 +22,7 @@ "require-dev": { "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.13.1" - "phpstan/phpstan": "1.9.x-dev" + }, "minimum-stability": "dev" } From fadf12f773cbe32a664073930a80a51bc4bd802c Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:04:50 +0530 Subject: [PATCH 06/12] Update composer.json --- composer.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index fd49746..9f51bd0 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,9 @@ "email": "eldad@appwrite.io" } ], - + "scripts": { + "check": "./vendor/bin/phpstan analyse --level max src tests" + }, }, "autoload": { "psr-4": {"Utopia\\Image\\":"src/Image"} @@ -21,7 +23,8 @@ }, "require-dev": { "phpunit/phpunit": "^9.3", - "vimeo/psalm": "4.13.1" + "vimeo/psalm": "4.13.1", + "phpstan/phpstan": "1.9.x-dev" }, "minimum-stability": "dev" From b83654c731ab513582e0d91cffc0f533145c5086 Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:23:06 +0530 Subject: [PATCH 07/12] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 9f51bd0..4d8265d 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,6 @@ "scripts": { "check": "./vendor/bin/phpstan analyse --level max src tests" }, - }, "autoload": { "psr-4": {"Utopia\\Image\\":"src/Image"} }, From cb70af62e57c7024d630d8fa6146f6ab2ccf2cf8 Mon Sep 17 00:00:00 2001 From: Neel Shah <71593494+neelshah2409@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:08:54 +0530 Subject: [PATCH 08/12] Update composer.lock --- composer.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 3564072..63a097c 100644 --- a/composer.lock +++ b/composer.lock @@ -1246,6 +1246,65 @@ }, "time": "2021-12-08T12:19:24+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.8.8", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "08310ce271984587e2a4cda94e1ac66510a6ea07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/08310ce271984587e2a4cda94e1ac66510a6ea07", + "reference": "08310ce271984587e2a4cda94e1ac66510a6ea07", + "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.8.8" + }, + "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": "2022-10-06T12:51:57+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.x-dev", @@ -1736,7 +1795,7 @@ "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=8.0" }, "default-branch": true, "type": "library", From 958be2894f49a4e4fcd56aba45308f6408a27d57 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 27 Jan 2023 09:54:29 +0000 Subject: [PATCH 09/12] feat: phpstan errors --- composer.lock | 443 +++++++++++++++++++------------------- src/Image/Image.php | 5 +- tests/Image/ImageTest.php | 46 ++-- 3 files changed, 242 insertions(+), 252 deletions(-) diff --git a/composer.lock b/composer.lock index 63a097c..50d0813 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "139a0267d907e9e9b4b7f349ee4d0e05", + "content-hash": "fb51cf549514c107798841227a1fc216", "packages": [], "packages-dev": [ { "name": "amphp/amp", - "version": "dev-master", + "version": "2.x-dev", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" + "reference": "c5ea79065f98f93f7b16a4d5a504fe5d69451447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "url": "https://api.github.com/repos/amphp/amp/zipball/c5ea79065f98f93f7b16a4d5a504fe5d69451447", + "reference": "c5ea79065f98f93f7b16a4d5a504fe5d69451447", "shasum": "" }, "require": { @@ -33,7 +33,6 @@ "psalm/phar": "^3.11@dev", "react/promise": "^2" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -87,7 +86,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" + "source": "https://github.com/amphp/amp/tree/master" }, "funding": [ { @@ -95,20 +94,20 @@ "type": "github" } ], - "time": "2022-02-20T17:52:18+00:00" + "time": "2022-08-21T11:55:21+00:00" }, { "name": "amphp/byte-stream", - "version": "dev-master", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "10c420782bd805c4af634bab69b5dfdc14ab721c" + "reference": "18f86b65129d923e004df27e2a3d6f4159c3c743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/10c420782bd805c4af634bab69b5dfdc14ab721c", - "reference": "10c420782bd805c4af634bab69b5dfdc14ab721c", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/18f86b65129d923e004df27e2a3d6f4159c3c743", + "reference": "18f86b65129d923e004df27e2a3d6f4159c3c743", "shasum": "" }, "require": { @@ -123,7 +122,6 @@ "phpunit/phpunit": "^6 || ^7 || ^8", "psalm/phar": "^3.11.4" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -173,7 +171,7 @@ "type": "github" } ], - "time": "2021-12-03T13:49:59+00:00" + "time": "2022-06-21T18:19:50+00:00" }, { "name": "composer/package-versions-deprecated", @@ -326,12 +324,12 @@ "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "fa1ec24f0ab1efe642671ec15c51a3ab879f59bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf", + "reference": "fa1ec24f0ab1efe642671ec15c51a3ab879f59bf", "shasum": "" }, "require": { @@ -382,9 +380,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/main" }, "funding": [ { @@ -400,7 +398,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-01-13T15:47:53+00:00" }, { "name": "composer/xdebug-handler", @@ -507,31 +505,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.x-dev", + "version": "2.0.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "d6eef505a6c46e963e54bf73bb9de43cdea70821" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d6eef505a6c46e963e54bf73bb9de43cdea70821", + "reference": "d6eef505a6c46e963e54bf73bb9de43cdea70821", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9", + "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.22" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -557,7 +556,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.x" + "source": "https://github.com/doctrine/instantiator/tree/2.0.x" }, "funding": [ { @@ -573,7 +572,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2023-01-04T15:42:40+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -626,12 +625,12 @@ "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" + "reference": "ae4c490773bb0d21ca6f5e08a737506f44e175ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/ae4c490773bb0d21ca6f5e08a737506f44e175ea", + "reference": "ae4c490773bb0d21ca6f5e08a737506f44e175ea", "shasum": "" }, "require": { @@ -673,9 +672,9 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/master" }, - "time": "2022-03-02T22:36:06+00:00" + "time": "2022-06-19T17:15:06+00:00" }, { "name": "myclabs/deep-copy", @@ -739,16 +738,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v4.0.0", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", "shasum": "" }, "require": { @@ -784,22 +783,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" }, - "time": "2020-12-01T19:48:11+00:00" + "time": "2022-12-08T20:46:14+00:00" }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "4.x-dev", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -810,6 +809,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, + "default-branch": true, "bin": [ "bin/php-parse" ], @@ -840,9 +840,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "openlss/lib-array2xml", @@ -1075,24 +1075,30 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9455bde915e322a823d464a2c41e5c0de03512a6" + "reference": "566af9fb94c556de91562fcfcbc392f66680111b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9455bde915e322a823d464a2c41e5c0de03512a6", - "reference": "9455bde915e322a823d464a2c41e5c0de03512a6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/566af9fb94c556de91562fcfcbc392f66680111b", + "reference": "566af9fb94c556de91562fcfcbc392f66680111b", "shasum": "" }, "require": { "ext-filter": "*", "php": "^7.2 || ^8.0", "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", + "phpdocumentor/type-resolver": "1.x-dev@dev", + "phpstan/phpdoc-parser": "^1.7", "webmozart/assert": "^1.9.1" }, "require-dev": { "mockery/mockery": "~1.3.5", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.26" }, "default-branch": true, "type": "library", @@ -1125,7 +1131,7 @@ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2022-04-02T20:16:01+00:00" + "time": "2022-11-19T20:28:46+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1133,21 +1139,28 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "06f36c92b434ac686de06b6563e88046943bccbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/06f36c92b434ac686de06b6563e88046943bccbe", + "reference": "06f36c92b434ac686de06b6563e88046943bccbe", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpbench/phpbench": "^1.2", + "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" }, "default-branch": true, "type": "library", @@ -1174,90 +1187,67 @@ "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.x" }, - "time": "2022-03-15T21:29:03+00:00" + "time": "2022-12-16T10:25:14+00:00" }, { - "name": "phpspec/prophecy", - "version": "dev-master", + "name": "phpstan/phpdoc-parser", + "version": "1.15.3", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "61800f71a5526081d1b5633766aa88341f1ade76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/61800f71a5526081d1b5633766aa88341f1ade76", + "reference": "61800f71a5526081d1b5633766aa88341f1ade76", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" }, - "default-branch": true, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "PHPStan\\PhpDocParser\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.15.3" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-12-20T20:56:55+00:00" }, { "name": "phpstan/phpstan", - "version": "1.8.8", + "version": "1.9.x-dev", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "08310ce271984587e2a4cda94e1ac66510a6ea07" + "reference": "81b8cc491a8900946b732d922a0e581b2913a359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/08310ce271984587e2a4cda94e1ac66510a6ea07", - "reference": "08310ce271984587e2a4cda94e1ac66510a6ea07", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/81b8cc491a8900946b732d922a0e581b2913a359", + "reference": "81b8cc491a8900946b732d922a0e581b2913a359", "shasum": "" }, "require": { @@ -1287,7 +1277,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.8" + "source": "https://github.com/phpstan/phpstan/tree/1.9.x" }, "funding": [ { @@ -1303,7 +1293,7 @@ "type": "tidelift" } ], - "time": "2022-10-06T12:51:57+00:00" + "time": "2023-01-26T12:21:06+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1311,19 +1301,19 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c" + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c", - "reference": "5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c", + "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", @@ -1372,7 +1362,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" }, "funding": [ { @@ -1380,7 +1370,7 @@ "type": "github" } ], - "time": "2022-05-03T08:11:05+00:00" + "time": "2023-01-26T08:26:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1625,20 +1615,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.x-dev", + "version": "9.6.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f53bae505d8e545cc23a1bbb6d66df9cbeb91f70" + "reference": "e6c588044e41e22777225c4339bce021113cc829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f53bae505d8e545cc23a1bbb6d66df9cbeb91f70", - "reference": "f53bae505d8e545cc23a1bbb6d66df9cbeb91f70", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e6c588044e41e22777225c4339bce021113cc829", + "reference": "e6c588044e41e22777225c4339bce021113cc829", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1649,7 +1639,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", @@ -1657,20 +1646,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": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -1681,7 +1666,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -1712,7 +1697,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6" }, "funding": [ { @@ -1722,9 +1707,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-05-03T08:11:40+00:00" + "time": "2023-01-26T08:31:58+00:00" }, { "name": "psr/container", @@ -1732,12 +1721,12 @@ "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "reference": "90db7b9ac2a2c5b849fcb69dde58f3ae182c68f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/php-fig/container/zipball/90db7b9ac2a2c5b849fcb69dde58f3ae182c68f5", + "reference": "90db7b9ac2a2c5b849fcb69dde58f3ae182c68f5", "shasum": "" }, "require": { @@ -1776,9 +1765,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "source": "https://github.com/php-fig/container/tree/master" }, - "time": "2021-11-05T16:47:00+00:00" + "time": "2022-07-19T17:36:59+00:00" }, { "name": "psr/log", @@ -1795,7 +1784,7 @@ "shasum": "" }, "require": { - "php": ">=8.0" + "php": ">=8.0.0" }, "default-branch": true, "type": "library", @@ -2000,16 +1989,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "b247957a1c8dc81a671770f74b479c0a78a818f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b247957a1c8dc81a671770f74b479c0a78a818f1", + "reference": "b247957a1c8dc81a671770f74b479c0a78a818f1", "shasum": "" }, "require": { @@ -2062,7 +2051,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" }, "funding": [ { @@ -2070,7 +2059,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:46:14+00:00" }, { "name": "sebastian/complexity", @@ -2264,12 +2253,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "428c31e2ea8b292aa814bc460cf28d58eba4d2ba" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/428c31e2ea8b292aa814bc460cf28d58eba4d2ba", - "reference": "428c31e2ea8b292aa814bc460cf28d58eba4d2ba", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -2333,7 +2322,7 @@ "type": "github" } ], - "time": "2022-03-06T06:59:32+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -2570,16 +2559,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e3a614438af7f71eaa6fc8e406be8a3aa5c34595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e3a614438af7f71eaa6fc8e406be8a3aa5c34595", + "reference": "e3a614438af7f71eaa6fc8e406be8a3aa5c34595", "shasum": "" }, "require": { @@ -2618,10 +2607,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0" }, "funding": [ { @@ -2629,7 +2618,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2022-07-30T08:13:09+00:00" }, { "name": "sebastian/resource-operations", @@ -2637,12 +2626,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0bb681ab112cdcd15dc71ea4ed7fb78e7060828b" + "reference": "b7a390ae3651f7ba3675d8364bff396e87931554" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0bb681ab112cdcd15dc71ea4ed7fb78e7060828b", - "reference": "0bb681ab112cdcd15dc71ea4ed7fb78e7060828b", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/b7a390ae3651f7ba3675d8364bff396e87931554", + "reference": "b7a390ae3651f7ba3675d8364bff396e87931554", "shasum": "" }, "require": { @@ -2684,20 +2673,20 @@ "type": "github" } ], - "time": "2022-04-11T13:39:05+00:00" + "time": "2022-06-14T05:05:56+00:00" }, { "name": "sebastian/type", - "version": "3.0.x-dev", + "version": "3.2.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "afad3e987736f63bc54d7c923f0c1ebf247e8618" + "reference": "4d34b23933f255b0822758a44272222cac593eb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/afad3e987736f63bc54d7c923f0c1ebf247e8618", - "reference": "afad3e987736f63bc54d7c923f0c1ebf247e8618", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/4d34b23933f255b0822758a44272222cac593eb4", + "reference": "4d34b23933f255b0822758a44272222cac593eb4", "shasum": "" }, "require": { @@ -2709,7 +2698,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2732,7 +2721,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2" }, "funding": [ { @@ -2740,7 +2729,7 @@ "type": "github" } ], - "time": "2022-03-27T17:35:59+00:00" + "time": "2022-10-01T05:56:17+00:00" }, { "name": "sebastian/version", @@ -2797,23 +2786,23 @@ }, { "name": "symfony/console", - "version": "6.1.x-dev", + "version": "6.3.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "efb04c650ab51c04d537edc41924e16cc98bd636" + "reference": "f7a519afe4e2763051b10856c20b5f0404914ec4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/efb04c650ab51c04d537edc41924e16cc98bd636", - "reference": "efb04c650ab51c04d537edc41924e16cc98bd636", + "url": "https://api.github.com/repos/symfony/console/zipball/f7a519afe4e2763051b10856c20b5f0404914ec4", + "reference": "f7a519afe4e2763051b10856c20b5f0404914ec4", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "conflict": { @@ -2873,7 +2862,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/6.1" + "source": "https://github.com/symfony/console/tree/6.3" }, "funding": [ { @@ -2889,7 +2878,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T09:20:06+00:00" + "time": "2023-01-13T09:23:11+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2897,12 +2886,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -2912,7 +2901,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -2941,7 +2930,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/main" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -2957,7 +2946,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2965,12 +2954,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "9fa980f4c4b0cbf0b6406832e307b9aed839876f" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/9fa980f4c4b0cbf0b6406832e307b9aed839876f", - "reference": "9fa980f4c4b0cbf0b6406832e307b9aed839876f", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -2986,7 +2975,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3040,7 +3029,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -3048,12 +3037,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "1dbff59483b45a8e5685ec0568c7fad4d4b18133" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/1dbff59483b45a8e5685ec0568c7fad4d4b18133", - "reference": "1dbff59483b45a8e5685ec0568c7fad4d4b18133", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -3066,7 +3055,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3122,7 +3111,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -3130,12 +3119,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "cb7c57fcdec70ed4606806bfab35940b64cbaf5d" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/cb7c57fcdec70ed4606806bfab35940b64cbaf5d", - "reference": "cb7c57fcdec70ed4606806bfab35940b64cbaf5d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -3148,7 +3137,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3207,7 +3196,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3215,12 +3204,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "240259a291e16e306dbf46dfe139d50c7fcb2d34" + "reference": "fd9e963bb80ccbf5d83ce813f9058aacc67cdb98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/240259a291e16e306dbf46dfe139d50c7fcb2d34", - "reference": "240259a291e16e306dbf46dfe139d50c7fcb2d34", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd9e963bb80ccbf5d83ce813f9058aacc67cdb98", + "reference": "fd9e963bb80ccbf5d83ce813f9058aacc67cdb98", "shasum": "" }, "require": { @@ -3236,7 +3225,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3291,7 +3280,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", @@ -3299,12 +3288,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957" + "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/aac98028c69df04ee77eb69b96b86ee51fbf4b75", + "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75", "shasum": "" }, "require": { @@ -3321,7 +3310,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3361,7 +3350,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/main" + "source": "https://github.com/symfony/service-contracts/tree/v3.2.0" }, "funding": [ { @@ -3377,20 +3366,20 @@ "type": "tidelift" } ], - "time": "2022-05-07T08:07:09+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/string", - "version": "6.1.x-dev", + "version": "6.3.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "360e14d2a1588eb525b09898ff37d63509748db5" + "reference": "295ef1f76d8afa41f63470f8c67e2ad4104c1abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/360e14d2a1588eb525b09898ff37d63509748db5", - "reference": "360e14d2a1588eb525b09898ff37d63509748db5", + "url": "https://api.github.com/repos/symfony/string/zipball/295ef1f76d8afa41f63470f8c67e2ad4104c1abe", + "reference": "295ef1f76d8afa41f63470f8c67e2ad4104c1abe", "shasum": "" }, "require": { @@ -3401,12 +3390,13 @@ "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -3446,7 +3436,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/6.1" + "source": "https://github.com/symfony/string/tree/6.3" }, "funding": [ { @@ -3462,7 +3452,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:23+00:00" + "time": "2023-01-13T09:23:11+00:00" }, { "name": "theseer/tokenizer", @@ -3622,16 +3612,16 @@ }, { "name": "webmozart/assert", - "version": "dev-master", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "dc96b6775d038bfa31a240150ad8505bfb856c2d" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/dc96b6775d038bfa31a240150ad8505bfb856c2d", - "reference": "dc96b6775d038bfa31a240150ad8505bfb856c2d", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { @@ -3645,7 +3635,6 @@ "require-dev": { "phpunit/phpunit": "^8.5.13" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3675,9 +3664,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/master" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2022-04-18T06:42:29+00:00" + "time": "2022-06-03T18:03:27+00:00" }, { "name": "webmozart/path-util", @@ -3734,7 +3723,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "phpstan/phpstan": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Image/Image.php b/src/Image/Image.php index 9e52c73..6ded282 100644 --- a/src/Image/Image.php +++ b/src/Image/Image.php @@ -38,7 +38,7 @@ class Image * * @throws Exception */ - public function __construct($data) + public function __construct(string $data) { $this->image = new Imagick(); @@ -218,7 +218,6 @@ public function setBorder(int $borderWidth, string $borderColor): self /** * Applies rounded corners, background to an image * @param integer $cornerRadius: The radius for the corners - * @param string $background: A valid HEX string representing the background color * @return Image $image: The processed image * * @throws \ImagickException @@ -261,7 +260,7 @@ public function setBorderRadius(int $cornerRadius): self } /** - * @param float opacity The opacity of the image + * @param float $opacity The opacity of the image * * @return Image * diff --git a/tests/Image/ImageTest.php b/tests/Image/ImageTest.php index 6f5523b..997ce80 100644 --- a/tests/Image/ImageTest.php +++ b/tests/Image/ImageTest.php @@ -16,7 +16,7 @@ public function tearDown(): void { } - public function testCrop100x100() + public function testCrop100x100(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x100.jpg'; @@ -36,7 +36,7 @@ public function testCrop100x100() \unlink($target); } - public function testCropGravityNW() + public function testCropGravityNW(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/NW.jpg'; @@ -57,7 +57,7 @@ public function testCropGravityNW() \unlink($target); } - public function testCropGravityN() + public function testCropGravityN(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-3.gif')); $target = __DIR__.'/N.gif'; @@ -78,7 +78,7 @@ public function testCropGravityN() \unlink($target); } - public function testCropGravityNE() + public function testCropGravityNE(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/NE.jpg'; @@ -99,7 +99,7 @@ public function testCropGravityNE() \unlink($target); } - public function testCropGravitySW() + public function testCropGravitySW(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/SW.jpg'; @@ -120,7 +120,7 @@ public function testCropGravitySW() \unlink($target); } - public function testCropGravityS() + public function testCropGravityS(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-3.gif')); $target = __DIR__.'/S.gif'; @@ -141,7 +141,7 @@ public function testCropGravityS() \unlink($target); } - public function testCropGravitySE() + public function testCropGravitySE(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/SE.jpg'; @@ -162,7 +162,7 @@ public function testCropGravitySE() \unlink($target); } - public function testCropGravityC() + public function testCropGravityC(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/C.jpg'; @@ -183,7 +183,7 @@ public function testCropGravityC() \unlink($target); } - public function testCropGravityW() + public function testCropGravityW(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-3.gif')); $target = __DIR__.'/W.gif'; @@ -204,7 +204,7 @@ public function testCropGravityW() \unlink($target); } - public function testCropGravityE() + public function testCropGravityE(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/E.jpg'; @@ -225,7 +225,7 @@ public function testCropGravityE() \unlink($target); } - public function testCrop100x400() + public function testCrop100x400(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x400.jpg'; @@ -245,7 +245,7 @@ public function testCrop100x400() \unlink($target); } - public function testCrop400x100() + public function testCrop400x100(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/400x100.jpg'; @@ -265,7 +265,7 @@ public function testCrop400x100() \unlink($target); } - public function testCrop100x100WEBP() + public function testCrop100x100WEBP(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x100.webp'; @@ -287,7 +287,7 @@ public function testCrop100x100WEBP() \unlink($target); } - public function testCrop100x100PNG() + public function testCrop100x100PNG(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x100.png'; @@ -311,7 +311,7 @@ public function testCrop100x100PNG() \unlink($target); } - public function testCrop100x100PNGQuality30() + public function testCrop100x100PNGQuality30(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x100-q30.jpg'; @@ -335,7 +335,7 @@ public function testCrop100x100PNGQuality30() \unlink($target); } - public function testCrop100x100GIF() + public function testCrop100x100GIF(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-3.gif')); $target = __DIR__.'/100x100.gif'; @@ -358,7 +358,7 @@ public function testCrop100x100GIF() \unlink($target); } - public function testBorder5Red() + public function testBorder5Red(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/border_5_red.jpg'; @@ -377,7 +377,7 @@ public function testBorder5Red() \unlink($target); } - public function testRotate45() + public function testRotate45(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/rotate_45.jpg'; @@ -398,7 +398,7 @@ public function testRotate45() \unlink($target); } - public function testOpacity02() + public function testOpacity02(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/opacity_0.2.png'; @@ -417,7 +417,7 @@ public function testOpacity02() \unlink($target); } - public function testBorderRadius500() + public function testBorderRadius500(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/border_radius_500.png'; @@ -436,7 +436,7 @@ public function testBorderRadius500() \unlink($target); } - public function testCrop100Op05() + public function testCrop100Op05(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x100_OP_0.5.png'; @@ -458,7 +458,7 @@ public function testCrop100Op05() \unlink($target); } - public function testCrop100BR50() + public function testCrop100BR50(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/kitten-1.jpg')); $target = __DIR__.'/100x100_BR_50.png'; @@ -478,7 +478,7 @@ public function testCrop100BR50() \unlink($target); } - public function testGifSmallLastFrame() + public function testGifSmallLastFrame(): void { $image = new Image(\file_get_contents(__DIR__ . '/../resources/disk-a/last-frame-1px.gif')); $target = __DIR__.'/last-frame-1px-output.gif'; From 3fef4d9b43df947883a060b93cef68da5a34bd52 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 19 Feb 2023 21:45:58 +0000 Subject: [PATCH 10/12] fix: code quality issues --- composer.lock | 294 ++++++++++++++++++++++++++------------ src/Image/Image.php | 25 ++-- tests/Image/ImageTest.php | 92 ++++++------ 3 files changed, 258 insertions(+), 153 deletions(-) diff --git a/composer.lock b/composer.lock index 75e926e..906ca80 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": "89960ac2392b011481cbd65e2b808dbe", + "content-hash": "6048cf88c9ecc9b51e48d5026fee8f6b", "packages": [], "packages-dev": [ { @@ -678,16 +678,16 @@ }, { "name": "laravel/pint", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86" + "reference": "e60e2112ee779ce60f253695b273d1646a17d6f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/1d276e4c803397a26cc337df908f55c2a4e90d86", - "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86", + "url": "https://api.github.com/repos/laravel/pint/zipball/e60e2112ee779ce60f253695b273d1646a17d6f1", + "reference": "e60e2112ee779ce60f253695b273d1646a17d6f1", "shasum": "" }, "require": { @@ -699,10 +699,10 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11.0", - "illuminate/view": "^9.27", - "laravel-zero/framework": "^9.1.3", - "mockery/mockery": "^1.5.0", - "nunomaduro/larastan": "^2.2", + "illuminate/view": "^9.32.0", + "laravel-zero/framework": "^9.2.0", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.2.0", "nunomaduro/termwind": "^1.14.0", "pestphp/pest": "^1.22.1" }, @@ -740,7 +740,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2022-09-13T15:07:15+00:00" + "time": "2022-11-29T16:25:20+00:00" }, { "name": "myclabs/deep-copy", @@ -859,12 +859,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "2f1fd784fe5560675722a1e5cbbcece5f43bf3a0" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2f1fd784fe5560675722a1e5cbbcece5f43bf3a0", - "reference": "2f1fd784fe5560675722a1e5cbbcece5f43bf3a0", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -906,9 +906,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/4.x" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-09-10T20:41:13+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "openlss/lib-array2xml", @@ -1141,12 +1141,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "203354b3c050367925c10e016b4e2e04755705ce" + "reference": "566af9fb94c556de91562fcfcbc392f66680111b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/203354b3c050367925c10e016b4e2e04755705ce", - "reference": "203354b3c050367925c10e016b4e2e04755705ce", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/566af9fb94c556de91562fcfcbc392f66680111b", + "reference": "566af9fb94c556de91562fcfcbc392f66680111b", "shasum": "" }, "require": { @@ -1197,7 +1197,7 @@ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2022-08-27T10:55:55+00:00" + "time": "2022-11-19T20:28:46+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1205,20 +1205,22 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + "reference": "06f36c92b434ac686de06b6563e88046943bccbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/06f36c92b434ac686de06b6563e88046943bccbe", + "reference": "06f36c92b434ac686de06b6563e88046943bccbe", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", @@ -1251,9 +1253,113 @@ "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.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.x" + }, + "time": "2022-12-16T10:25:14+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.16.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e27e92d939e2e3636f0a1f0afaba59692c0bf571", + "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.16.1" + }, + "time": "2023-02-07T18:11:17+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.9.x-dev", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "6c0217aa2b146c3e28474e8be3e87188fac55dac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6c0217aa2b146c3e28474e8be3e87188fac55dac", + "reference": "6c0217aa2b146c3e28474e8be3e87188fac55dac", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] }, - "time": "2022-10-14T12:47:21+00:00" + "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.x" + }, + "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-02-18T15:01:46+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1261,12 +1367,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8be4d431796da1afc21bd9d11b73105f17b3522b" + "reference": "b5f3416da036fb951a557518e8304b3595ff966a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8be4d431796da1afc21bd9d11b73105f17b3522b", - "reference": "8be4d431796da1afc21bd9d11b73105f17b3522b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b5f3416da036fb951a557518e8304b3595ff966a", + "reference": "b5f3416da036fb951a557518e8304b3595ff966a", "shasum": "" }, "require": { @@ -1322,7 +1428,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2" }, "funding": [ { @@ -1330,7 +1436,7 @@ "type": "github" } ], - "time": "2022-10-17T06:29:29+00:00" + "time": "2023-02-18T16:27:54+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1579,12 +1685,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "daa0bff0a1c08a4e10cdb9729b84a49f1934c30f" + "reference": "c1bf2dd252dec994ee27d804c038a98fd0d1d940" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/daa0bff0a1c08a4e10cdb9729b84a49f1934c30f", - "reference": "daa0bff0a1c08a4e10cdb9729b84a49f1934c30f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c1bf2dd252dec994ee27d804c038a98fd0d1d940", + "reference": "c1bf2dd252dec994ee27d804c038a98fd0d1d940", "shasum": "" }, "require": { @@ -1673,7 +1779,7 @@ "type": "tidelift" } ], - "time": "2022-10-17T06:29:58+00:00" + "time": "2023-02-18T16:26:49+00:00" }, { "name": "psr/container", @@ -2150,12 +2256,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "3fade0c8462024d0426a00dc1ad0a2fda0df733f" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/3fade0c8462024d0426a00dc1ad0a2fda0df733f", - "reference": "3fade0c8462024d0426a00dc1ad0a2fda0df733f", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -2205,7 +2311,7 @@ "type": "github" } ], - "time": "2022-04-14T11:24:33+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -2523,12 +2629,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e3a614438af7f71eaa6fc8e406be8a3aa5c34595" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e3a614438af7f71eaa6fc8e406be8a3aa5c34595", - "reference": "e3a614438af7f71eaa6fc8e406be8a3aa5c34595", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -2570,7 +2676,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -2578,7 +2684,7 @@ "type": "github" } ], - "time": "2022-07-30T08:13:09+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -2586,12 +2692,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "b7a390ae3651f7ba3675d8364bff396e87931554" + "reference": "e1157eac767e4dc4ae40dd9aab7fb4de6e56bd32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/b7a390ae3651f7ba3675d8364bff396e87931554", - "reference": "b7a390ae3651f7ba3675d8364bff396e87931554", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/e1157eac767e4dc4ae40dd9aab7fb4de6e56bd32", + "reference": "e1157eac767e4dc4ae40dd9aab7fb4de6e56bd32", "shasum": "" }, "require": { @@ -2633,7 +2739,7 @@ "type": "github" } ], - "time": "2022-06-14T05:05:56+00:00" + "time": "2023-02-08T06:53:39+00:00" }, { "name": "sebastian/type", @@ -2641,12 +2747,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "4d34b23933f255b0822758a44272222cac593eb4" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/4d34b23933f255b0822758a44272222cac593eb4", - "reference": "4d34b23933f255b0822758a44272222cac593eb4", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -2689,7 +2795,7 @@ "type": "github" } ], - "time": "2022-10-01T05:56:17+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -2746,16 +2852,16 @@ }, { "name": "symfony/console", - "version": "6.2.x-dev", + "version": "6.3.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c2cf3d6a9cbda9e5ce4c1ac89628b101c80ea907" + "reference": "7d6e719f78bd4e76919ff0286f0ab016c6abbe94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c2cf3d6a9cbda9e5ce4c1ac89628b101c80ea907", - "reference": "c2cf3d6a9cbda9e5ce4c1ac89628b101c80ea907", + "url": "https://api.github.com/repos/symfony/console/zipball/7d6e719f78bd4e76919ff0286f0ab016c6abbe94", + "reference": "7d6e719f78bd4e76919ff0286f0ab016c6abbe94", "shasum": "" }, "require": { @@ -2822,7 +2928,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/6.2" + "source": "https://github.com/symfony/console/tree/6.3" }, "funding": [ { @@ -2838,7 +2944,7 @@ "type": "tidelift" } ], - "time": "2022-10-17T20:01:40+00:00" + "time": "2023-02-16T09:01:12+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2846,12 +2952,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "4912000e79dc2d6df029d35d8755be1ed79b6691" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/4912000e79dc2d6df029d35d8755be1ed79b6691", - "reference": "4912000e79dc2d6df029d35d8755be1ed79b6691", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -2861,7 +2967,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -2906,7 +3012,7 @@ "type": "tidelift" } ], - "time": "2022-05-20T13:56:22+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2914,12 +3020,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "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/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -2973,7 +3079,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/main" }, "funding": [ { @@ -2989,7 +3095,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -2997,12 +3103,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -3055,7 +3161,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/main" }, "funding": [ { @@ -3071,7 +3177,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -3079,12 +3185,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -3140,7 +3246,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/main" }, "funding": [ { @@ -3156,7 +3262,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3164,12 +3270,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "f9c7affe77a00ae32ca127ca6833d034e6d33f25" }, "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/f9c7affe77a00ae32ca127ca6833d034e6d33f25", + "reference": "f9c7affe77a00ae32ca127ca6833d034e6d33f25", "shasum": "" }, "require": { @@ -3224,7 +3330,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/main" }, "funding": [ { @@ -3240,7 +3346,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2023-01-30T17:25:47+00:00" }, { "name": "symfony/service-contracts", @@ -3248,12 +3354,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "cb82f217a2029131afbcbd220c511d0d77ebed19" + "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/cb82f217a2029131afbcbd220c511d0d77ebed19", - "reference": "cb82f217a2029131afbcbd220c511d0d77ebed19", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/aac98028c69df04ee77eb69b96b86ee51fbf4b75", + "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75", "shasum": "" }, "require": { @@ -3270,7 +3376,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3326,20 +3432,20 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:19:18+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/string", - "version": "6.2.x-dev", + "version": "6.3.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "5d8211c95d9a0d913a0ccb02e932c8268ae9d3d3" + "reference": "6515bacc98212164f10db4371fa70ee7b8c70b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/5d8211c95d9a0d913a0ccb02e932c8268ae9d3d3", - "reference": "5d8211c95d9a0d913a0ccb02e932c8268ae9d3d3", + "url": "https://api.github.com/repos/symfony/string/zipball/6515bacc98212164f10db4371fa70ee7b8c70b80", + "reference": "6515bacc98212164f10db4371fa70ee7b8c70b80", "shasum": "" }, "require": { @@ -3356,7 +3462,7 @@ "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -3396,7 +3502,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/6.2" + "source": "https://github.com/symfony/string/tree/6.3" }, "funding": [ { @@ -3412,7 +3518,7 @@ "type": "tidelift" } ], - "time": "2022-10-17T20:01:40+00:00" + "time": "2023-02-14T09:04:20+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Image/Image.php b/src/Image/Image.php index 8af3618..2a1ad6b 100644 --- a/src/Image/Image.php +++ b/src/Image/Image.php @@ -42,7 +42,7 @@ class Image private int $rotation = 0; /** - * @param string $data + * @param string $data * * @throws Exception */ @@ -81,7 +81,7 @@ public function __construct(string $data) } /** - * @return array + * @return array */ public static function getGravityTypes(): array { @@ -270,15 +270,15 @@ public function setBorderRadius(int $cornerRadius): self } /** - * @param float $opacity The opacity of the image + * @param ?float $opacity The opacity of the image * * @return Image * * @throws \ImagickException */ - public function setOpacity(float $opacity): self + public function setOpacity(?float $opacity = null): self { - if ((empty($opacity) && $opacity != 0) || $opacity == 1) { + if (is_null($opacity) || $opacity == 1) { return $this; } $this->image->setImageAlpha($opacity); @@ -289,14 +289,14 @@ public function setOpacity(float $opacity): self /** * Rotates an image to $degree degree * - * @param int $degree: The amount to rotate in degrees + * @param ?int $degree: The amount to rotate in degrees * @return Image $image: The rotated image * * @throws \ImagickException */ - public function setRotation(int $degree): self + public function setRotation(?int $degree = null): self { - if (empty($degree) || $degree == 0) { + if (is_null($degree) || $degree == 0) { return $this; } @@ -336,10 +336,10 @@ public function output(string $type, int $quality = 75) } /** - * @param string $path - * @param $type - * @param int $quality - * @return false|null|string + * @param string $path + * @param string $type + * @param int $quality + * @return ($path is null ? string|false : void) * * @throws Exception */ @@ -418,7 +418,6 @@ public function save(string $path = null, string $type = '', int $quality = 75) default: throw new Exception('Invalid output type given'); - break; } if (empty($path)) { diff --git a/tests/Image/ImageTest.php b/tests/Image/ImageTest.php index 8a79e46..8227c8a 100644 --- a/tests/Image/ImageTest.php +++ b/tests/Image/ImageTest.php @@ -17,7 +17,7 @@ public function tearDown(): void public function testCrop100x100(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x100.jpg'; $image->crop(100, 100); @@ -25,7 +25,7 @@ public function testCrop100x100(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -37,7 +37,7 @@ public function testCrop100x100(): void public function testCropGravityNW(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/NW.jpg'; $original = __DIR__.'/../resources/resize/NW.jpg'; @@ -46,7 +46,7 @@ public function testCropGravityNW(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -58,7 +58,7 @@ public function testCropGravityNW(): void public function testCropGravityN(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); $target = __DIR__.'/N.gif'; $original = __DIR__.'/../resources/resize/N.gif'; @@ -67,7 +67,7 @@ public function testCropGravityN(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -79,7 +79,7 @@ public function testCropGravityN(): void public function testCropGravityNE(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/NE.jpg'; $original = __DIR__.'/../resources/resize/NE.jpg'; @@ -88,7 +88,7 @@ public function testCropGravityNE(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -100,7 +100,7 @@ public function testCropGravityNE(): void public function testCropGravitySW(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/SW.jpg'; $original = __DIR__.'/../resources/resize/SW.jpg'; @@ -109,7 +109,7 @@ public function testCropGravitySW(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -121,7 +121,7 @@ public function testCropGravitySW(): void public function testCropGravityS(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); $target = __DIR__.'/S.gif'; $original = __DIR__.'/../resources/resize/S.gif'; @@ -130,7 +130,7 @@ public function testCropGravityS(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -142,7 +142,7 @@ public function testCropGravityS(): void public function testCropGravitySE(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/SE.jpg'; $original = __DIR__.'/../resources/resize/SE.jpg'; @@ -151,7 +151,7 @@ public function testCropGravitySE(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -163,7 +163,7 @@ public function testCropGravitySE(): void public function testCropGravityC(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/C.jpg'; $original = __DIR__.'/../resources/resize/C.jpg'; @@ -172,7 +172,7 @@ public function testCropGravityC(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(150, $image->getImageWidth()); @@ -184,7 +184,7 @@ public function testCropGravityC(): void public function testCropGravityW(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); $target = __DIR__.'/W.gif'; $original = __DIR__.'/../resources/resize/W.gif'; @@ -193,7 +193,7 @@ public function testCropGravityW(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -205,7 +205,7 @@ public function testCropGravityW(): void public function testCropGravityE(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/E.jpg'; $original = __DIR__.'/../resources/resize/E.jpg'; @@ -214,7 +214,7 @@ public function testCropGravityE(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)), \md5(\file_get_contents($original))); + $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -226,7 +226,7 @@ public function testCropGravityE(): void public function testCrop100x400(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x400.jpg'; $image->crop(100, 400); @@ -234,7 +234,7 @@ public function testCrop100x400(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -246,7 +246,7 @@ public function testCrop100x400(): void public function testCrop400x100(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/400x100.jpg'; $image->crop(400, 100); @@ -254,7 +254,7 @@ public function testCrop400x100(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(400, $image->getImageWidth()); @@ -266,7 +266,7 @@ public function testCrop400x100(): void public function testCrop100x100WEBP(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x100.webp'; $original = __DIR__.'/../resources/resize/100x100.webp'; @@ -275,7 +275,7 @@ public function testCrop100x100WEBP(): void $image->save($target, 'webp', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); @@ -288,7 +288,7 @@ public function testCrop100x100WEBP(): void public function testCrop100x100PNG(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x100.png'; $original = __DIR__.'/../resources/resize/100x100.png'; @@ -300,7 +300,7 @@ public function testCrop100x100PNG(): void $this->assertGreaterThan(15000, \filesize($target)); $this->assertLessThan(30000, \filesize($target)); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -312,7 +312,7 @@ public function testCrop100x100PNG(): void public function testCrop100x100PNGQuality30(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x100-q30.jpg'; $original = __DIR__.'/../resources/resize/100x100-q30.jpg'; @@ -324,7 +324,7 @@ public function testCrop100x100PNGQuality30(): void $this->assertGreaterThan(500, \filesize($target)); $this->assertLessThan(2000, \filesize($target)); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -336,7 +336,7 @@ public function testCrop100x100PNGQuality30(): void public function testCrop100x100GIF(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); $target = __DIR__.'/100x100.gif'; $original = __DIR__.'/../resources/resize/100x100.gif'; @@ -348,7 +348,7 @@ public function testCrop100x100GIF(): void $this->assertGreaterThan(400000, \filesize($target)); $this->assertLessThan(800000, \filesize($target)); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -359,7 +359,7 @@ public function testCrop100x100GIF(): void public function testBorder5Red(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/border_5_red.jpg'; $original = __DIR__.'/../resources/resize/border_5_red.jpg'; @@ -369,7 +369,7 @@ public function testBorder5Red(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals('JPEG', $image->getImageFormat()); @@ -378,7 +378,7 @@ public function testBorder5Red(): void public function testRotate45(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/rotate_45.jpg'; $original = __DIR__.'/../resources/resize/rotate_45.jpg'; @@ -388,7 +388,7 @@ public function testRotate45(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals('JPEG', $image->getImageFormat()); @@ -399,7 +399,7 @@ public function testRotate45(): void public function testOpacity02(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/opacity_0.2.png'; $original = __DIR__.'/../resources/resize/opacity_0.2.png'; @@ -409,7 +409,7 @@ public function testOpacity02(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals('PNG', $image->getImageFormat()); @@ -418,7 +418,7 @@ public function testOpacity02(): void public function testBorderRadius500(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/border_radius_500.png'; $original = __DIR__.'/../resources/resize/border_radius_500.png'; @@ -428,7 +428,7 @@ public function testBorderRadius500(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals('PNG', $image->getImageFormat()); @@ -437,7 +437,7 @@ public function testBorderRadius500(): void public function testCrop100Op05(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x100_OP_0.5.png'; $original = __DIR__.'/../resources/resize/100x100_OP_0.5.png'; @@ -448,7 +448,7 @@ public function testCrop100Op05(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals($image->getImageWidth(), 100); @@ -459,7 +459,7 @@ public function testCrop100Op05(): void public function testCrop100BR50(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); $target = __DIR__.'/100x100_BR_50.png'; $original = __DIR__.'/../resources/resize/100x100_BR_50.png'; @@ -470,7 +470,7 @@ public function testCrop100BR50(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals('PNG', $image->getImageFormat()); @@ -479,7 +479,7 @@ public function testCrop100BR50(): void public function testGifSmallLastFrame(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/last-frame-1px.gif')); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/last-frame-1px.gif')?: ''); $target = __DIR__.'/last-frame-1px-output.gif'; $image->crop(0, 0); @@ -487,7 +487,7 @@ public function testGifSmallLastFrame(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target))); + $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); $image = new \Imagick($target); $this->assertEquals(329, $image->getImageWidth()); From f2d75b55c8108707c198a32dc6f5cac5c88afcb4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 19 Feb 2023 21:47:02 +0000 Subject: [PATCH 11/12] feat: linter --- src/Image/Image.php | 11 +++-- tests/Image/ImageTest.php | 92 +++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/src/Image/Image.php b/src/Image/Image.php index 2a1ad6b..caa4e23 100644 --- a/src/Image/Image.php +++ b/src/Image/Image.php @@ -42,7 +42,7 @@ class Image private int $rotation = 0; /** - * @param string $data + * @param string $data * * @throws Exception */ @@ -270,8 +270,7 @@ public function setBorderRadius(int $cornerRadius): self } /** - * @param ?float $opacity The opacity of the image - * + * @param ?float $opacity The opacity of the image * @return Image * * @throws \ImagickException @@ -336,9 +335,9 @@ public function output(string $type, int $quality = 75) } /** - * @param string $path - * @param string $type - * @param int $quality + * @param string $path + * @param string $type + * @param int $quality * @return ($path is null ? string|false : void) * * @throws Exception diff --git a/tests/Image/ImageTest.php b/tests/Image/ImageTest.php index 8227c8a..18ea6e2 100644 --- a/tests/Image/ImageTest.php +++ b/tests/Image/ImageTest.php @@ -17,7 +17,7 @@ public function tearDown(): void public function testCrop100x100(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x100.jpg'; $image->crop(100, 100); @@ -25,7 +25,7 @@ public function testCrop100x100(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -37,7 +37,7 @@ public function testCrop100x100(): void public function testCropGravityNW(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/NW.jpg'; $original = __DIR__.'/../resources/resize/NW.jpg'; @@ -46,7 +46,7 @@ public function testCropGravityNW(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -58,7 +58,7 @@ public function testCropGravityNW(): void public function testCropGravityN(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif') ?: ''); $target = __DIR__.'/N.gif'; $original = __DIR__.'/../resources/resize/N.gif'; @@ -67,7 +67,7 @@ public function testCropGravityN(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -79,7 +79,7 @@ public function testCropGravityN(): void public function testCropGravityNE(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/NE.jpg'; $original = __DIR__.'/../resources/resize/NE.jpg'; @@ -88,7 +88,7 @@ public function testCropGravityNE(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -100,7 +100,7 @@ public function testCropGravityNE(): void public function testCropGravitySW(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/SW.jpg'; $original = __DIR__.'/../resources/resize/SW.jpg'; @@ -109,7 +109,7 @@ public function testCropGravitySW(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -121,7 +121,7 @@ public function testCropGravitySW(): void public function testCropGravityS(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif') ?: ''); $target = __DIR__.'/S.gif'; $original = __DIR__.'/../resources/resize/S.gif'; @@ -130,7 +130,7 @@ public function testCropGravityS(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -142,7 +142,7 @@ public function testCropGravityS(): void public function testCropGravitySE(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/SE.jpg'; $original = __DIR__.'/../resources/resize/SE.jpg'; @@ -151,7 +151,7 @@ public function testCropGravitySE(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -163,7 +163,7 @@ public function testCropGravitySE(): void public function testCropGravityC(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/C.jpg'; $original = __DIR__.'/../resources/resize/C.jpg'; @@ -172,7 +172,7 @@ public function testCropGravityC(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(150, $image->getImageWidth()); @@ -184,7 +184,7 @@ public function testCropGravityC(): void public function testCropGravityW(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif') ?: ''); $target = __DIR__.'/W.gif'; $original = __DIR__.'/../resources/resize/W.gif'; @@ -193,7 +193,7 @@ public function testCropGravityW(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -205,7 +205,7 @@ public function testCropGravityW(): void public function testCropGravityE(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/E.jpg'; $original = __DIR__.'/../resources/resize/E.jpg'; @@ -214,7 +214,7 @@ public function testCropGravityE(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertEquals(\md5(\file_get_contents($target)?: ''), \md5(\file_get_contents($original)?: '')); + $this->assertEquals(\md5(\file_get_contents($target) ?: ''), \md5(\file_get_contents($original) ?: '')); $image = new \Imagick($target); $this->assertEquals(50, $image->getImageWidth()); @@ -226,7 +226,7 @@ public function testCropGravityE(): void public function testCrop100x400(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x400.jpg'; $image->crop(100, 400); @@ -234,7 +234,7 @@ public function testCrop100x400(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -246,7 +246,7 @@ public function testCrop100x400(): void public function testCrop400x100(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/400x100.jpg'; $image->crop(400, 100); @@ -254,7 +254,7 @@ public function testCrop400x100(): void $image->save($target, 'jpg', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(400, $image->getImageWidth()); @@ -266,7 +266,7 @@ public function testCrop400x100(): void public function testCrop100x100WEBP(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x100.webp'; $original = __DIR__.'/../resources/resize/100x100.webp'; @@ -275,7 +275,7 @@ public function testCrop100x100WEBP(): void $image->save($target, 'webp', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); @@ -288,7 +288,7 @@ public function testCrop100x100WEBP(): void public function testCrop100x100PNG(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x100.png'; $original = __DIR__.'/../resources/resize/100x100.png'; @@ -300,7 +300,7 @@ public function testCrop100x100PNG(): void $this->assertGreaterThan(15000, \filesize($target)); $this->assertLessThan(30000, \filesize($target)); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -312,7 +312,7 @@ public function testCrop100x100PNG(): void public function testCrop100x100PNGQuality30(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x100-q30.jpg'; $original = __DIR__.'/../resources/resize/100x100-q30.jpg'; @@ -324,7 +324,7 @@ public function testCrop100x100PNGQuality30(): void $this->assertGreaterThan(500, \filesize($target)); $this->assertLessThan(2000, \filesize($target)); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -336,7 +336,7 @@ public function testCrop100x100PNGQuality30(): void public function testCrop100x100GIF(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-3.gif') ?: ''); $target = __DIR__.'/100x100.gif'; $original = __DIR__.'/../resources/resize/100x100.gif'; @@ -348,7 +348,7 @@ public function testCrop100x100GIF(): void $this->assertGreaterThan(400000, \filesize($target)); $this->assertLessThan(800000, \filesize($target)); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(100, $image->getImageWidth()); @@ -359,7 +359,7 @@ public function testCrop100x100GIF(): void public function testBorder5Red(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/border_5_red.jpg'; $original = __DIR__.'/../resources/resize/border_5_red.jpg'; @@ -369,7 +369,7 @@ public function testBorder5Red(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals('JPEG', $image->getImageFormat()); @@ -378,7 +378,7 @@ public function testBorder5Red(): void public function testRotate45(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/rotate_45.jpg'; $original = __DIR__.'/../resources/resize/rotate_45.jpg'; @@ -388,7 +388,7 @@ public function testRotate45(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals('JPEG', $image->getImageFormat()); @@ -399,7 +399,7 @@ public function testRotate45(): void public function testOpacity02(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/opacity_0.2.png'; $original = __DIR__.'/../resources/resize/opacity_0.2.png'; @@ -409,7 +409,7 @@ public function testOpacity02(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals('PNG', $image->getImageFormat()); @@ -418,7 +418,7 @@ public function testOpacity02(): void public function testBorderRadius500(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/border_radius_500.png'; $original = __DIR__.'/../resources/resize/border_radius_500.png'; @@ -428,7 +428,7 @@ public function testBorderRadius500(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals('PNG', $image->getImageFormat()); @@ -437,7 +437,7 @@ public function testBorderRadius500(): void public function testCrop100Op05(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x100_OP_0.5.png'; $original = __DIR__.'/../resources/resize/100x100_OP_0.5.png'; @@ -448,7 +448,7 @@ public function testCrop100Op05(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals($image->getImageWidth(), 100); @@ -459,7 +459,7 @@ public function testCrop100Op05(): void public function testCrop100BR50(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/kitten-1.jpg') ?: ''); $target = __DIR__.'/100x100_BR_50.png'; $original = __DIR__.'/../resources/resize/100x100_BR_50.png'; @@ -470,7 +470,7 @@ public function testCrop100BR50(): void $this->assertEquals(\is_readable($target), true); $this->assertEquals(\mime_content_type($target), \mime_content_type($original)); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals('PNG', $image->getImageFormat()); @@ -479,7 +479,7 @@ public function testCrop100BR50(): void public function testGifSmallLastFrame(): void { - $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/last-frame-1px.gif')?: ''); + $image = new Image(\file_get_contents(__DIR__.'/../resources/disk-a/last-frame-1px.gif') ?: ''); $target = __DIR__.'/last-frame-1px-output.gif'; $image->crop(0, 0); @@ -487,7 +487,7 @@ public function testGifSmallLastFrame(): void $image->save($target, 'gif', 100); $this->assertEquals(\is_readable($target), true); - $this->assertNotEmpty(\md5(\file_get_contents($target)?: '')); + $this->assertNotEmpty(\md5(\file_get_contents($target) ?: '')); $image = new \Imagick($target); $this->assertEquals(329, $image->getImageWidth()); From 8266758b3a8267b400ed907b2bb3ed72c9bf3d48 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 6 Apr 2023 23:09:28 +0000 Subject: [PATCH 12/12] fix: update incorrect signature --- composer.lock | 171 ++++++++++++++++++++++++++++---------------- src/Image/Image.php | 12 ++-- 2 files changed, 115 insertions(+), 68 deletions(-) diff --git a/composer.lock b/composer.lock index 906ca80..0877408 100644 --- a/composer.lock +++ b/composer.lock @@ -503,6 +503,49 @@ }, "time": "2019-12-04T15:06:13+00:00" }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" + }, { "name": "doctrine/instantiator", "version": "2.0.x-dev", @@ -748,12 +791,12 @@ "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "928a96f585b86224ebc78f8f09d0482cf15b04f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/928a96f585b86224ebc78f8f09d0482cf15b04f5", + "reference": "928a96f585b86224ebc78f8f09d0482cf15b04f5", "shasum": "" }, "require": { @@ -761,11 +804,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" }, "default-branch": true, @@ -792,7 +836,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.x" }, "funding": [ { @@ -800,7 +844,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T17:24:01+00:00" }, { "name": "netresearch/jsonmapper", @@ -859,12 +903,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "0ffddce52d816f72d0efc4d9b02e276d3309ef01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ffddce52d816f72d0efc4d9b02e276d3309ef01", + "reference": "0ffddce52d816f72d0efc4d9b02e276d3309ef01", "shasum": "" }, "require": { @@ -906,9 +950,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/4.x" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-03-06T22:12:36+00:00" }, { "name": "openlss/lib-array2xml", @@ -1141,12 +1185,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "566af9fb94c556de91562fcfcbc392f66680111b" + "reference": "7b217217725dc991a0ae7b995041cee1d5019561" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/566af9fb94c556de91562fcfcbc392f66680111b", - "reference": "566af9fb94c556de91562fcfcbc392f66680111b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/7b217217725dc991a0ae7b995041cee1d5019561", + "reference": "7b217217725dc991a0ae7b995041cee1d5019561", "shasum": "" }, "require": { @@ -1197,7 +1241,7 @@ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2022-11-19T20:28:46+00:00" + "time": "2023-03-12T10:50:44+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1205,15 +1249,16 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "06f36c92b434ac686de06b6563e88046943bccbe" + "reference": "dfc078e8af9c99210337325ff5aa152872c98714" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/06f36c92b434ac686de06b6563e88046943bccbe", - "reference": "06f36c92b434ac686de06b6563e88046943bccbe", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", + "reference": "dfc078e8af9c99210337325ff5aa152872c98714", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0", "phpstan/phpdoc-parser": "^1.13" @@ -1253,22 +1298,22 @@ "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.x" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" }, - "time": "2022-12-16T10:25:14+00:00" + "time": "2023-03-27T19:02:04+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.16.1", + "version": "1.18.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571" + "reference": "882eabc9b6a12e25c27091a261397f9c8792e722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e27e92d939e2e3636f0a1f0afaba59692c0bf571", - "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/882eabc9b6a12e25c27091a261397f9c8792e722", + "reference": "882eabc9b6a12e25c27091a261397f9c8792e722", "shasum": "" }, "require": { @@ -1298,9 +1343,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.16.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.18.0" }, - "time": "2023-02-07T18:11:17+00:00" + "time": "2023-04-06T07:26:43+00:00" }, { "name": "phpstan/phpstan", @@ -1367,19 +1412,19 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "b5f3416da036fb951a557518e8304b3595ff966a" + "reference": "db887088b40ae43d17b9913886df860a7035145d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b5f3416da036fb951a557518e8304b3595ff966a", - "reference": "b5f3416da036fb951a557518e8304b3595ff966a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/db887088b40ae43d17b9913886df860a7035145d", + "reference": "db887088b40ae43d17b9913886df860a7035145d", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1394,8 +1439,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -1428,6 +1473,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" }, "funding": [ @@ -1436,7 +1482,7 @@ "type": "github" } ], - "time": "2023-02-18T16:27:54+00:00" + "time": "2023-04-04T09:22:25+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1685,12 +1731,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c1bf2dd252dec994ee27d804c038a98fd0d1d940" + "reference": "b754747169d4d5854ea71c7ffce16bcde0be9b59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c1bf2dd252dec994ee27d804c038a98fd0d1d940", - "reference": "c1bf2dd252dec994ee27d804c038a98fd0d1d940", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b754747169d4d5854ea71c7ffce16bcde0be9b59", + "reference": "b754747169d4d5854ea71c7ffce16bcde0be9b59", "shasum": "" }, "require": { @@ -1723,8 +1769,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -1763,6 +1809,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" }, "funding": [ @@ -1779,7 +1826,7 @@ "type": "tidelift" } ], - "time": "2023-02-18T16:26:49+00:00" + "time": "2023-04-04T09:12:50+00:00" }, { "name": "psr/container", @@ -2692,12 +2739,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "e1157eac767e4dc4ae40dd9aab7fb4de6e56bd32" + "reference": "20bdda85c7c585ab265c0c37ec052a019bae29c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/e1157eac767e4dc4ae40dd9aab7fb4de6e56bd32", - "reference": "e1157eac767e4dc4ae40dd9aab7fb4de6e56bd32", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/20bdda85c7c585ab265c0c37ec052a019bae29c4", + "reference": "20bdda85c7c585ab265c0c37ec052a019bae29c4", "shasum": "" }, "require": { @@ -2739,7 +2786,7 @@ "type": "github" } ], - "time": "2023-02-08T06:53:39+00:00" + "time": "2023-03-25T08:11:39+00:00" }, { "name": "sebastian/type", @@ -2856,12 +2903,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7d6e719f78bd4e76919ff0286f0ab016c6abbe94" + "reference": "22139f9c425d2be619ccbf1bdbabbd67d1060c50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7d6e719f78bd4e76919ff0286f0ab016c6abbe94", - "reference": "7d6e719f78bd4e76919ff0286f0ab016c6abbe94", + "url": "https://api.github.com/repos/symfony/console/zipball/22139f9c425d2be619ccbf1bdbabbd67d1060c50", + "reference": "22139f9c425d2be619ccbf1bdbabbd67d1060c50", "shasum": "" }, "require": { @@ -2923,7 +2970,7 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], @@ -2944,7 +2991,7 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:01:12+00:00" + "time": "2023-04-04T06:17:48+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2952,12 +2999,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "shasum": "" }, "require": { @@ -2996,7 +3043,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" }, "funding": [ { @@ -3012,7 +3059,7 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-03-01T10:25:55+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3354,12 +3401,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" + "reference": "a8c9cedf55f314f3a186041d19537303766df09a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/aac98028c69df04ee77eb69b96b86ee51fbf4b75", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", + "reference": "a8c9cedf55f314f3a186041d19537303766df09a", "shasum": "" }, "require": { @@ -3416,7 +3463,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" }, "funding": [ { @@ -3432,7 +3479,7 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-03-01T10:32:47+00:00" }, { "name": "symfony/string", @@ -3440,12 +3487,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "6515bacc98212164f10db4371fa70ee7b8c70b80" + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/6515bacc98212164f10db4371fa70ee7b8c70b80", - "reference": "6515bacc98212164f10db4371fa70ee7b8c70b80", + "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", "shasum": "" }, "require": { @@ -3518,7 +3565,7 @@ "type": "tidelift" } ], - "time": "2023-02-14T09:04:20+00:00" + "time": "2023-03-21T21:06:29+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Image/Image.php b/src/Image/Image.php index caa4e23..fe9aa6c 100644 --- a/src/Image/Image.php +++ b/src/Image/Image.php @@ -270,14 +270,14 @@ public function setBorderRadius(int $cornerRadius): self } /** - * @param ?float $opacity The opacity of the image + * @param float $opacity The opacity of the image * @return Image * * @throws \ImagickException */ - public function setOpacity(?float $opacity = null): self + public function setOpacity(float $opacity): self { - if (is_null($opacity) || $opacity == 1) { + if ($opacity == 1) { return $this; } $this->image->setImageAlpha($opacity); @@ -288,14 +288,14 @@ public function setOpacity(?float $opacity = null): self /** * Rotates an image to $degree degree * - * @param ?int $degree: The amount to rotate in degrees + * @param int $degree: The amount to rotate in degrees * @return Image $image: The rotated image * * @throws \ImagickException */ - public function setRotation(?int $degree = null): self + public function setRotation(int $degree): self { - if (is_null($degree) || $degree == 0) { + if ($degree == 0) { return $this; }