diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a6da838..daffdd5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -11,12 +11,12 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4, 7.3, 7.2.15] - laravel: [7.*] + php: [8.0] + laravel: [8.*] dependency-version: [prefer-lowest, prefer-stable] include: - - laravel: 7.* - testbench: 5.* + - laravel: 8.* + testbench: ^6.14 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v1 - name: Setup PHP - uses: shivammathur/setup-php@v1 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: mbstring, intl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2f33387..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - -env: - global: - - CC_TEST_REPORTER_ID=3cb0149c1ae23214062407321730aa13a558d9e10aa7011e01282b5a46e7f100 - -install: - - travis_retry composer self-update - - travis_retry composer require php-coveralls/php-coveralls:2.1.* --dev - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - - travis_retry curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - -before_script: - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - -after_success: - - travis_retry php vendor/bin/php-coveralls --verbose diff --git a/README.md b/README.md index f7623c7..8d8ee11 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,10 @@ It uses your Laravel HTTP Client and **HTTP/2**, making your app **fast**. You o ## Requirements -* Laravel 7.x +* Laravel 8.x +* PHP 8.0 + +> If you need support for old versions, consider sponsoring or donating. ## Installation diff --git a/composer.json b/composer.json index 6f9bd17..be173bb 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,14 @@ } ], "require": { - "php": "^7.2", + "php": "^8.0", "ext-json": "*", - "illuminate/support": "^7.0", - "guzzlehttp/guzzle": "^6.3.1||^7.0" + "illuminate/support": "^8.0", + "guzzlehttp/guzzle": "^7.0" }, "require-dev": { - "orchestra/testbench": "^5.0" + "orchestra/testbench": "^6.14.0", + "phpunit/phpunit": "^9.5.2" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 12ba420..067cd56 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,21 @@ - - - - tests - - - - - src/ - - - - - - - - - + + + + src/ + + + + + + + + + + tests + + + + + diff --git a/src/Captchavel.php b/src/Captchavel.php index 94298bd..515c421 100644 --- a/src/Captchavel.php +++ b/src/Captchavel.php @@ -29,7 +29,7 @@ class Captchavel * * @var string */ - public const RECAPTCHA_ENDPOINT = 'www.google.com/recaptcha/api/siteverify'; + public const RECAPTCHA_ENDPOINT = 'https://www.google.com/recaptcha/api/siteverify'; /** * The name of the input for a reCAPTCHA frontend response. diff --git a/src/CaptchavelServiceProvider.php b/src/CaptchavelServiceProvider.php index 6f3bb60..f44df30 100644 --- a/src/CaptchavelServiceProvider.php +++ b/src/CaptchavelServiceProvider.php @@ -34,7 +34,7 @@ public function boot(Router $router, Repository $config) { if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__.'/../config/config.php' => config_path('captchavel.php'), + __DIR__.'/../config/captchavel.php' => config_path('captchavel.php'), ], 'config'); if ($this->app->runningUnitTests()) { diff --git a/src/Facades/Captchavel.php b/src/Facades/Captchavel.php index 4a71a81..5a3d9e3 100644 --- a/src/Facades/Captchavel.php +++ b/src/Facades/Captchavel.php @@ -2,9 +2,9 @@ namespace DarkGhostHunter\Captchavel\Facades; -use Illuminate\Support\Facades\Facade; -use DarkGhostHunter\Captchavel\CaptchavelFake; use DarkGhostHunter\Captchavel\Captchavel as BaseCaptchavel; +use DarkGhostHunter\Captchavel\CaptchavelFake; +use Illuminate\Support\Facades\Facade; /** * @method static \DarkGhostHunter\Captchavel\Captchavel getFacadeRoot() @@ -26,7 +26,7 @@ protected static function getFacadeAccessor() * * @return \DarkGhostHunter\Captchavel\CaptchavelFake */ - protected static function fake() + public static function fake() { if (static::$resolvedInstance instanceof CaptchavelFake) { return static::$resolvedInstance; diff --git a/src/helpers.php b/src/helpers.php index 3f6c4c5..4487514 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -18,6 +18,6 @@ function captchavel(string $credentials) return $key; } - throw new LogicException("The reCAPTCHA site key for [$credentials] doesn't exists."); + throw new LogicException("The reCAPTCHA site key for [$credentials] doesn't exist."); } } diff --git a/tests/HelperTest.php b/tests/HelperTest.php index 437eec1..63481a6 100644 --- a/tests/HelperTest.php +++ b/tests/HelperTest.php @@ -13,7 +13,7 @@ class HelperTest extends TestCase public function test_exception_when_no_v3_key_loaded() { $this->expectException(LogicException::class); - $this->expectExceptionMessage('The reCAPTCHA site key for [3] doesn\'t exists.'); + $this->expectExceptionMessage('The reCAPTCHA site key for [3] doesn\'t exist.'); captchavel(3); }