From 8871dea8414f1476d6c1f59f837d231e75a78300 Mon Sep 17 00:00:00 2001 From: hedii Date: Sat, 5 Mar 2022 20:33:44 +0100 Subject: [PATCH] Laravel 9 only support --- .github/workflows/build.yml | 2 +- composer.json | 9 ++++----- src/Facades/Recaptcha.php | 5 ----- src/Recaptcha.php | 22 +--------------------- src/RecaptchaServiceProvider.php | 10 ---------- 5 files changed, 6 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c39e844..1d9769b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '7.4', '8.0', '8.1' ] + php-versions: [ '8.0', '8.1' ] name: Testing on PHP ${{ matrix.php-versions }} steps: - name: Checkout diff --git a/composer.json b/composer.json index 081b14f..86bbefb 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,12 @@ } ], "require": { - "php": "^7.4.0|^8.0", - "ext-json": "*", - "laravel/framework": "^8.0", - "guzzlehttp/guzzle": "^6.0|^7.0" + "php": "^8.0", + "laravel/framework": "^9.0", + "guzzlehttp/guzzle": "^7.2" }, "require-dev": { - "orchestra/testbench": "^6.0" + "orchestra/testbench": "^7.0" }, "autoload": { "psr-4": { diff --git a/src/Facades/Recaptcha.php b/src/Facades/Recaptcha.php index 08c0eab..d00201f 100644 --- a/src/Facades/Recaptcha.php +++ b/src/Facades/Recaptcha.php @@ -6,11 +6,6 @@ class Recaptcha extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ protected static function getFacadeAccessor(): string { return 'recaptcha'; diff --git a/src/Recaptcha.php b/src/Recaptcha.php index 92cfd00..595c389 100644 --- a/src/Recaptcha.php +++ b/src/Recaptcha.php @@ -10,40 +10,24 @@ class Recaptcha { /** * The http request instance. - * - * @var \Illuminate\Http\Request */ private Request $request; /** * The recaptcha site key. - * - * @var string */ private string $siteKey; /** * The recaptcha secret key. - * - * @var string */ private string $secretKey; /** * The minimum score a recaptcha response must have to be valid. - * - * @var float */ private float $minimumScore; - /** - * Recaptcha constructor. - * - * @param \Illuminate\Http\Request $request - * @param string $siteKey - * @param string $secretKey - * @param float $minimumScore - */ public function __construct(Request $request, string $siteKey, string $secretKey, float $minimumScore) { $this->request = $request; @@ -55,7 +39,7 @@ public function __construct(Request $request, string $siteKey, string $secretKey /** * Resolve the captcha score. * - * @return bool + * @throws \GuzzleHttp\Exception\GuzzleException */ public function isValid(): bool { @@ -86,10 +70,6 @@ public function isValid(): bool /** * Get the required recaptcha js scripts. - * - * @param string|null $action - * @param string $elementId - * @return string */ public function script(?string $action = null, string $elementId = 'recaptchaResponse'): string { diff --git a/src/RecaptchaServiceProvider.php b/src/RecaptchaServiceProvider.php index 554ef15..e583c34 100644 --- a/src/RecaptchaServiceProvider.php +++ b/src/RecaptchaServiceProvider.php @@ -6,11 +6,6 @@ class RecaptchaServiceProvider extends ServiceProvider { - /** - * Register services. - * - * @return void - */ public function register(): void { $this->mergeConfigFrom(__DIR__ . '/../config/recaptcha.php', 'recaptcha'); @@ -27,11 +22,6 @@ public function register(): void $this->app->alias(Recaptcha::class, 'recaptcha'); } - /** - * Bootstrap services. - * - * @return void - */ public function boot(): void { $this->publishes([__DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php')]);