From fd4a3ff40962a1d1a9c50c6417ede5224e4a932d Mon Sep 17 00:00:00 2001 From: Aselsan Date: Sat, 20 Jul 2024 20:57:08 +0700 Subject: [PATCH 1/3] use instantiation --- src/Libraries/Basic/ShieldOAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libraries/Basic/ShieldOAuth.php b/src/Libraries/Basic/ShieldOAuth.php index 1e84b51..c232fa2 100644 --- a/src/Libraries/Basic/ShieldOAuth.php +++ b/src/Libraries/Basic/ShieldOAuth.php @@ -57,7 +57,7 @@ public function allOAuth(): string $files = new FileCollection(); /** @var Autoload $autoload */ - $autoload = config(Autoload::class); + $autoload = new Autoload(); // Checking if it is installed manually if (array_key_exists('Datamweb\ShieldOAuth', $autoload->psr4)) { From 10a931ece05bdac795249e18d6398de11db75800 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Sat, 20 Jul 2024 21:09:14 +0700 Subject: [PATCH 2/3] ignore PHP 8.1 Coding Standards check --- src/Commands/Generators/NewShieldOauthGenerator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Commands/Generators/NewShieldOauthGenerator.php b/src/Commands/Generators/NewShieldOauthGenerator.php index 58b3a5c..56cecde 100644 --- a/src/Commands/Generators/NewShieldOauthGenerator.php +++ b/src/Commands/Generators/NewShieldOauthGenerator.php @@ -103,6 +103,8 @@ public function run(array $params): int // The proper class name should contain the `OAuth` suffix if it doesn't exist $class = str_ireplace('oauth', 'OAuth', $params[0]); + + // @phpstan-ignore-next-line if (strpos($class, 'OAuth') === false) { $class .= 'OAuth'; } From 60a85adc0b5e31d47800403144a5e82e17271e11 Mon Sep 17 00:00:00 2001 From: warcooft Date: Mon, 22 Jul 2024 02:56:59 +0700 Subject: [PATCH 3/3] set modernize_strpos to false for php7.4 compatibility --- .php-cs-fixer.dist.php | 1 + src/Commands/Generators/NewShieldOauthGenerator.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 0fbd2f0..17ea733 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -30,6 +30,7 @@ $overrides = [ 'declare_strict_types' => true, 'void_return' => true, + 'modernize_strpos' => false, ]; $options = [ diff --git a/src/Commands/Generators/NewShieldOauthGenerator.php b/src/Commands/Generators/NewShieldOauthGenerator.php index 56cecde..58b3a5c 100644 --- a/src/Commands/Generators/NewShieldOauthGenerator.php +++ b/src/Commands/Generators/NewShieldOauthGenerator.php @@ -103,8 +103,6 @@ public function run(array $params): int // The proper class name should contain the `OAuth` suffix if it doesn't exist $class = str_ireplace('oauth', 'OAuth', $params[0]); - - // @phpstan-ignore-next-line if (strpos($class, 'OAuth') === false) { $class .= 'OAuth'; }