From b684836afeb3e1585e47cd41584bdb459fe3a7ca Mon Sep 17 00:00:00 2001 From: Aashish Date: Thu, 22 Aug 2024 10:16:06 +0700 Subject: [PATCH] Downgrade PHPStan to support PHP 7.1 --- composer.json | 2 +- examples/OmiseCharge.php | 3 ++- lib/omise/res/OmiseApiResource.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index d5ac568..9a0e94b 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "require-dev": { "phpunit/phpunit": "^5.7 || ^9.5", "friendsofphp/php-cs-fixer": "^2.19.3 || ^3.9.5", - "phpstan/phpstan": "^1.11", + "phpstan/phpstan": "1.4.*", "vlucas/phpdotenv": "5.5.0" }, "autoload": { diff --git a/examples/OmiseCharge.php b/examples/OmiseCharge.php index f6180e4..b507f9f 100644 --- a/examples/OmiseCharge.php +++ b/examples/OmiseCharge.php @@ -26,7 +26,8 @@ 'amount' => 100000, 'currency' => 'thb', 'return_uri' => 'http://www.example.com', - 'card' => $token->toArray()['id'] + 'card' => $token->toArray()['id'], + 'capture' => false ]); $chargeFetched = OmiseCharge::retrieve($chargeCreated->toArray()['id']); diff --git a/lib/omise/res/OmiseApiResource.php b/lib/omise/res/OmiseApiResource.php index 5f49170..0619990 100644 --- a/lib/omise/res/OmiseApiResource.php +++ b/lib/omise/res/OmiseApiResource.php @@ -37,7 +37,7 @@ class OmiseApiResource extends OmiseObject */ protected static function getInstance($publickey = null, $secretkey = null) { - $resource = new static($publickey, $secretkey); + $resource = new static($publickey, $secretkey); // @phpstan-ignore-line $className = get_class($resource); if (!isset(self::$instances[$className])) { static::$instances[$className] = $resource;