From 8e9a532d4bd5d5423d60a4f5ee1eb988eb9f76bc Mon Sep 17 00:00:00 2001 From: Ariel Vallese Date: Thu, 21 Nov 2019 17:17:38 -0300 Subject: [PATCH] WIP --- .travis.yml | 2 +- composer.json | 9 +++++---- src/Alariva/EmailDomainBlacklist/Validator.php | 3 ++- tests/ConsoleTest.php | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08c17bd..f91fada 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: php php: - - '7.1' - '7.2' - '7.3' + - '7.4snapshot' env: matrix: diff --git a/composer.json b/composer.json index b0f981f..a792d94 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,13 @@ ], "minimum-stability": "stable", "require": { - "laravel/framework": "^5.6 || ^5.5 || ^5.4 || ^5.3 || ^5.2 || ^5.1", - "illuminate/support": "^5.6 || ^5.5 || ^5.4 || ^5.3 || ^5.2 || ^5.1" + "php": "^7.2 || ^8.0", + "laravel/framework": "~5.8 || ~6.0", + "illuminate/support": "~5.8 || ~6.0" }, "require-dev": { - "phpunit/phpunit": "^7.3", - "orchestra/testbench": "^3.6", + "phpunit/phpunit": "~7.5 || ~8.0", + "orchestra/testbench": "~3.9 ||~4.0", "mockery/mockery": "^1.1" }, "autoload": { diff --git a/src/Alariva/EmailDomainBlacklist/Validator.php b/src/Alariva/EmailDomainBlacklist/Validator.php index 7ade470..708eecb 100644 --- a/src/Alariva/EmailDomainBlacklist/Validator.php +++ b/src/Alariva/EmailDomainBlacklist/Validator.php @@ -5,6 +5,7 @@ use Alariva\EmailDomainBlacklist\Updater; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Str; class Validator { @@ -81,7 +82,7 @@ public function validate($attribute, $value, $parameters) { $this->refresh(); - $domain = str_after(strtolower($value), '@'); + $domain = Str::after(strtolower($value), '@'); return !in_array($domain, $this->domains); } diff --git a/tests/ConsoleTest.php b/tests/ConsoleTest.php index b5f1d7e..3e97dc1 100644 --- a/tests/ConsoleTest.php +++ b/tests/ConsoleTest.php @@ -14,9 +14,9 @@ class ConsoleTest extends BaseTestCase protected $commandTester; - protected $stubPath = __DIR__.'/stubs/source.json'; + protected $stubPath = __DIR__ . '/stubs/source.json'; - public function setUp() + protected function setUp() : void { parent::setUp();