Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #35 from DarkGhostHunter/master
Browse files Browse the repository at this point in the history
Laravel 8.0 support, and PHP 8.0 support
  • Loading branch information
DarkGhostHunter authored Mar 16, 2021
2 parents cb78abc + 5bf62cb commit 1984f19
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 69 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
46 changes: 19 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" />
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion src/Captchavel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/CaptchavelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
6 changes: 3 additions & 3 deletions src/Facades/Captchavel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
2 changes: 1 addition & 1 deletion tests/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1984f19

Please sign in to comment.