Skip to content

Commit

Permalink
Merge pull request #99 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Adding Laravel 8 support
  • Loading branch information
arcanedev-maroc authored Sep 9, 2020
2 parents 57d7640 + e416985 commit 537348f
Show file tree
Hide file tree
Showing 35 changed files with 119 additions and 122 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
php: [7.3, 7.4]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
Expand All @@ -22,7 +22,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-7-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
key: dependencies-laravel-8-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 6
runs: 4
php_code_sniffer:
enabled: true
config:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ reCAPTCHA comes in the form of a widget that you can easily add to your blog, fo
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
* Laravel `4.2` to `7.x` are supported.
* Laravel `4.2` to `8.x` are supported.
* PSR-7 Support (ServerRequest verification).
* Made with :heart: & :coffee:.

Expand Down
2 changes: 1 addition & 1 deletion _docs/0-Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ reCAPTCHA comes in the form of a widget that you can easily add to your blog, fo
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
* Laravel `4.2` to `7.x` are supported.
* Laravel `4.2` to `8.x` are supported.
* PSR-7 Support (ServerRequest verification).
* Made with :heart: & :coffee:.

Expand Down
70 changes: 38 additions & 32 deletions _docs/1-Installation-and-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,49 @@ For more details, check the [official documentation](https://developers.google.c

## Version Compatibility

| noCaptcha | Laravel |
|:--------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
| ![noCaptcha v11.x][no_captcha_11_x] | ![Laravel v7.x][laravel_7_x] |
| ![noCaptcha v10.x][no_captcha_10_x] | ![Laravel v6.x][laravel_6_x] |
| ![noCaptcha v9.x][no_captcha_9_x] | ![Laravel v5.8][laravel_5_8] |
| ![noCaptcha v7.x][no_captcha_7_x] ![noCaptcha v8.x][no_captcha_8_x] | ![Laravel v5.7][laravel_5_7] |
| ![noCaptcha v6.x][no_captcha_6_x] | ![Laravel v5.6][laravel_5_6] |
| ![noCaptcha v5.x][no_captcha_5_x] | ![Laravel v5.5][laravel_5_5] |
| ![noCaptcha v4.x][no_captcha_4_x] | ![Laravel v5.4][laravel_5_4] |
| ![noCaptcha v3.x][no_captcha_3_x] | ![Laravel v5.0][laravel_5_0] ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] |
| ![noCaptcha v1.x][no_captcha_1_x] | ![Laravel v4.2][laravel_4_2] |
| Laravel | noCaptcha |
|:-----------------------------|:--------------------------------------------------------------------|
| ![Laravel v8.x][laravel_8_x] | ![noCaptcha v12.x][no_captcha_12_x] |
| ![Laravel v7.x][laravel_7_x] | ![noCaptcha v11.x][no_captcha_11_x] |
| ![Laravel v6.x][laravel_6_x] | ![noCaptcha v10.x][no_captcha_10_x] |
| ![Laravel v5.8][laravel_5_8] | ![noCaptcha v9.x][no_captcha_9_x] |
| ![Laravel v5.7][laravel_5_7] | ![noCaptcha v7.x][no_captcha_7_x] ![noCaptcha v8.x][no_captcha_8_x] |
| ![Laravel v5.6][laravel_5_6] | ![noCaptcha v6.x][no_captcha_6_x] |
| ![Laravel v5.5][laravel_5_5] | ![noCaptcha v5.x][no_captcha_5_x] |
| ![Laravel v5.4][laravel_5_4] | ![noCaptcha v4.x][no_captcha_4_x] |
| ![Laravel v5.3][laravel_5_3] | ![noCaptcha v3.x][no_captcha_3_x] |
| ![Laravel v5.2][laravel_5_2] | ![noCaptcha v3.x][no_captcha_3_x] |
| ![Laravel v5.1][laravel_5_1] | ![noCaptcha v3.x][no_captcha_3_x] |
| ![Laravel v5.0][laravel_5_0] | ![noCaptcha v3.x][no_captcha_3_x] |
| ![Laravel v4.2][laravel_4_2] | ![noCaptcha v1.x][no_captcha_1_x] |

> **Note :** This is a framework-agnostic package, so you can use any version of this package in your PHP project.
[laravel_7_x]: https://img.shields.io/badge/v7.x-supported-brightgreen.svg?style=flat-square "Laravel v7.x"
[laravel_6_x]: https://img.shields.io/badge/v6.x-supported-brightgreen.svg?style=flat-square "Laravel v6.x"
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"
[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
[laravel_4_2]: https://img.shields.io/badge/v4.2-supported-brightgreen.svg?style=flat-square "Laravel v4.2"

[laravel_8_x]: https://img.shields.io/badge/version-8.x-blue.svg?style=flat-square "Laravel v8.x"
[laravel_7_x]: https://img.shields.io/badge/version-7.x-blue.svg?style=flat-square "Laravel v7.x"
[laravel_6_x]: https://img.shields.io/badge/version-6.x-blue.svg?style=flat-square "Laravel v6.x"
[laravel_5_8]: https://img.shields.io/badge/version-5.8-blue.svg?style=flat-square "Laravel v5.8"
[laravel_5_7]: https://img.shields.io/badge/version-5.7-blue.svg?style=flat-square "Laravel v5.7"
[laravel_5_6]: https://img.shields.io/badge/version-5.6-blue.svg?style=flat-square "Laravel v5.6"
[laravel_5_5]: https://img.shields.io/badge/version-5.5-blue.svg?style=flat-square "Laravel v5.5"
[laravel_5_4]: https://img.shields.io/badge/version-5.4-blue.svg?style=flat-square "Laravel v5.4"
[laravel_5_3]: https://img.shields.io/badge/version-5.3-blue.svg?style=flat-square "Laravel v5.3"
[laravel_5_2]: https://img.shields.io/badge/version-5.2-blue.svg?style=flat-square "Laravel v5.2"
[laravel_5_1]: https://img.shields.io/badge/version-5.1-blue.svg?style=flat-square "Laravel v5.1"
[laravel_5_0]: https://img.shields.io/badge/version-5.0-blue.svg?style=flat-square "Laravel v5.0"
[laravel_4_2]: https://img.shields.io/badge/version-4.2-blue.svg?style=flat-square "Laravel v4.2"

[no_captcha_12_x]: https://img.shields.io/badge/version-12.x-blue.svg?style=flat-square "noCaptcha v12.x"
[no_captcha_11_x]: https://img.shields.io/badge/version-11.x-blue.svg?style=flat-square "noCaptcha v11.x"
[no_captcha_10_x]: https://img.shields.io/badge/version-10.x-blue.svg?style=flat-square "noCaptcha v10.x"
[no_captcha_9_x]: https://img.shields.io/badge/version-9.x-blue.svg?style=flat-square "noCaptcha v9.x"
[no_captcha_8_x]: https://img.shields.io/badge/version-8.x-blue.svg?style=flat-square "noCaptcha v8.x"
[no_captcha_7_x]: https://img.shields.io/badge/version-7.x-blue.svg?style=flat-square "noCaptcha v7.x"
[no_captcha_6_x]: https://img.shields.io/badge/version-6.x-blue.svg?style=flat-square "noCaptcha v6.x"
[no_captcha_5_x]: https://img.shields.io/badge/version-5.x-blue.svg?style=flat-square "noCaptcha v5.x"
[no_captcha_4_x]: https://img.shields.io/badge/version-4.x-blue.svg?style=flat-square "noCaptcha v4.x"
[no_captcha_3_x]: https://img.shields.io/badge/version-3.x-blue.svg?style=flat-square "noCaptcha v3.x"
[no_captcha_1_x]: https://img.shields.io/badge/version-1.x-blue.svg?style=flat-square "noCaptcha v1.x"
[no_captcha_9_x]: https://img.shields.io/badge/version-9.x-blue.svg?style=flat-square "noCaptcha v9.x"
[no_captcha_8_x]: https://img.shields.io/badge/version-8.x-blue.svg?style=flat-square "noCaptcha v8.x"
[no_captcha_7_x]: https://img.shields.io/badge/version-7.x-blue.svg?style=flat-square "noCaptcha v7.x"
[no_captcha_6_x]: https://img.shields.io/badge/version-6.x-blue.svg?style=flat-square "noCaptcha v6.x"
[no_captcha_5_x]: https://img.shields.io/badge/version-5.x-blue.svg?style=flat-square "noCaptcha v5.x"
[no_captcha_4_x]: https://img.shields.io/badge/version-4.x-blue.svg?style=flat-square "noCaptcha v4.x"
[no_captcha_3_x]: https://img.shields.io/badge/version-3.x-blue.svg?style=flat-square "noCaptcha v3.x"
[no_captcha_1_x]: https://img.shields.io/badge/version-1.x-blue.svg?style=flat-square "noCaptcha v1.x"

## Composer

Expand Down
27 changes: 19 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
"type": "library",
"license": "MIT",
"require": {
"php": "^7.2.5",
"ext-curl": "*",
"ext-json": "*",
"arcanedev/php-html": "^4.0",
"arcanedev/support": "^7.0",
"psr/http-message": "^1.0"
"php": "^7.3",
"ext-curl": "*",
"ext-json": "*",
"arcanedev/php-html": "^5.0",
"arcanedev/support": "^8.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.5|^9.0"
"orchestra/testbench": "^6.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.3"
},
"autoload": {
"psr-4": {
Expand All @@ -36,13 +37,23 @@
"Arcanedev\\NoCaptcha\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"coverage": "phpunit --coverage-html build/coverage/html"
},
"extra": {
"branch-alias": {
"dev-develop": "12.x-dev"
},
"laravel": {
"providers": [
"Arcanedev\\NoCaptcha\\NoCaptchaServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
31 changes: 13 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-text" target="build/logs/coverage.txt"/>
<log type="coverage-html" target="build/logs/coverage"/>
</logging>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="build/coverage/clover.xml"/>
<html outputDirectory="build/coverage/html"/>
<text outputFile="build/coverage/coverage.txt" showOnlySummary="true"/>
</report>
</coverage>
</phpunit>
1 change: 0 additions & 1 deletion src/AbstractNoCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class AbstractNoCaptcha
*
* @package Arcanedev\NoCaptcha
* @author ARCANEDEV <[email protected]>
*/
abstract class AbstractNoCaptcha implements Contracts\NoCaptcha
Expand Down
1 change: 0 additions & 1 deletion src/Contracts/NoCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Interface NoCaptcha
*
* @package Arcanedev\NoCaptcha\Contracts
* @author ARCANEDEV <[email protected]>
*/
interface NoCaptcha
Expand Down
5 changes: 2 additions & 3 deletions src/Contracts/NoCaptchaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
namespace Arcanedev\NoCaptcha\Contracts;

/**
* Interface NoCaptchaManager
* Interface NoCaptchaManager
*
* @package Arcanedev\NoCaptcha\Contracts
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface NoCaptchaManager
{
Expand Down
3 changes: 1 addition & 2 deletions src/Contracts/Utilities/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
namespace Arcanedev\NoCaptcha\Contracts\Utilities;

/**
* Interface RequestInterface
* Interface Request
*
* @package Arcanedev\NoCaptcha\Contracts\Utilities
* @author ARCANEDEV <[email protected]>
*/
interface Request
Expand Down
8 changes: 3 additions & 5 deletions src/Contracts/Utilities/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

namespace Arcanedev\NoCaptcha\Contracts\Utilities;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\{Arrayable, Jsonable};
use JsonSerializable;

/**
* Interface Response
* Interface Response
*
* @package Arcanedev\NoCaptcha\Contracts\Utilities
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface Response extends Arrayable, Jsonable, JsonSerializable
{
Expand Down
1 change: 0 additions & 1 deletion src/Exceptions/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/**
* Class ApiException
*
* @package Arcanedev\NoCaptcha\Exceptions
* @author ARCANEDEV <[email protected]>
*/
class ApiException extends NoCaptchaException {}
1 change: 0 additions & 1 deletion src/Exceptions/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/**
* Class InvalidArgumentException
*
* @package Arcanedev\NoCaptcha\Exceptions
* @author ARCANEDEV <[email protected]>
*/
class InvalidArgumentException extends NoCaptchaException {}
1 change: 0 additions & 1 deletion src/Exceptions/InvalidUrlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/**
* Class InvalidUrlException
*
* @package Arcanedev\NoCaptcha\Exceptions
* @author ARCANEDEV <[email protected]>
*/
class InvalidUrlException extends NoCaptchaException {}
1 change: 0 additions & 1 deletion src/Exceptions/NoCaptchaException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/**
* Class NoCaptchaException
*
* @package Arcanedev\NoCaptcha\Exceptions
* @author ARCANEDEV <[email protected]>
*/
abstract class NoCaptchaException extends \Exception {}
7 changes: 2 additions & 5 deletions src/NoCaptchaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
namespace Arcanedev\NoCaptcha;

use Illuminate\Support\Manager;
use Arcanedev\NoCaptcha\Contracts\{
NoCaptchaManager as NoCaptchaManagerContract,
NoCaptcha as NoCaptchaContract,
};
use Arcanedev\NoCaptcha\Contracts\NoCaptcha as NoCaptchaContract;
use Arcanedev\NoCaptcha\Contracts\NoCaptchaManager as NoCaptchaManagerContract;

/**
* Class NoCaptchaManager
*
* @package Arcanedev\NoCaptcha
* @author ARCANEDEV <[email protected]>
*/
class NoCaptchaManager extends Manager implements NoCaptchaManagerContract
Expand Down
1 change: 0 additions & 1 deletion src/NoCaptchaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/**
* Class NoCaptchaServiceProvider
*
* @package Arcanedev\NoCaptcha
* @author ARCANEDEV <[email protected]>
*/
class NoCaptchaServiceProvider extends ServiceProvider implements DeferrableProvider
Expand Down
1 change: 0 additions & 1 deletion src/NoCaptchaV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* Class NoCaptchaV2
*
* @package Arcanedev\NoCaptcha
* @author ARCANEDEV <[email protected]>
*/
class NoCaptchaV2 extends AbstractNoCaptcha
Expand Down
1 change: 0 additions & 1 deletion src/NoCaptchaV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class NoCaptchaV3
*
* @package Arcanedev\NoCaptcha
* @author ARCANEDEV <[email protected]>
*/
class NoCaptchaV3 extends AbstractNoCaptcha
Expand Down
7 changes: 5 additions & 2 deletions src/Rules/CaptchaRule.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php namespace Arcanedev\NoCaptcha\Rules;
<?php

declare(strict_types=1);

namespace Arcanedev\NoCaptcha\Rules;

use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Arr;

/**
* Class CaptchaRule
*
* @package Arcanedev\NoCaptcha\Rules
* @author ARCANEDEV <[email protected]>
*/
class CaptchaRule implements Rule
Expand Down
Loading

0 comments on commit 537348f

Please sign in to comment.