From 99025ae3b58e9fb72ff98ace557ddadb5f19fc5a Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Thu, 10 Sep 2020 11:08:51 +0100 Subject: [PATCH] Adding Laravel 8 support --- .github/workflows/run-tests.yml | 4 ++-- .scrutinizer.yml | 2 +- composer.json | 22 +++++++++++++----- phpunit.xml.dist | 36 ++++++++++++------------------ src/Agent.php | 4 ++-- src/AgentServiceProvider.php | 1 - src/Contracts/Agent.php | 1 - src/Contracts/Detector.php | 5 ++--- src/Detectors/DeviceDetector.php | 1 - src/Detectors/LanguageDetector.php | 1 - tests/AgentServiceProviderTest.php | 7 +++--- tests/AgentTest.php | 1 - tests/TestCase.php | 1 - 13 files changed, 42 insertions(+), 44 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 60802a3..b22ed2a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 }} @@ -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 diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 8a9285f..69d4755 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -22,7 +22,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 6 + runs: 4 php_code_sniffer: enabled: true config: diff --git a/composer.json b/composer.json index 484df9e..0bbd773 100644 --- a/composer.json +++ b/composer.json @@ -14,13 +14,13 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.2.5", - "arcanedev/support": "^7.1", + "php": "^7.3", + "arcanedev/support": "^8.0", "piwik/device-detector": "^3.13" }, "require-dev": { - "orchestra/testbench": "^5.0", - "phpunit/phpunit": "^8.0|^9.0" + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.3" }, "autoload": { "psr-4": { @@ -32,11 +32,23 @@ "Arcanedev\\Agent\\Tests\\": "tests/" } }, + "scripts": { + "test": "phpunit", + "coverage": "phpunit --coverage-html build/coverage/html" + }, "extra": { + "branch-alias": { + "dev-develop": "9.x-dev" + }, "laravel": { "providers": [ "Arcanedev\\Agent\\AgentServiceProvider" ] } - } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6d4a0ac..7ff2bcc 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,30 +1,22 @@ - +> - + ./tests - - - ./src/ - - - - - - - - - - + + + ./src + + + + + + + diff --git a/src/Agent.php b/src/Agent.php index bd8fbf9..db840ec 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -4,7 +4,8 @@ namespace Arcanedev\Agent; -use Arcanedev\Agent\Contracts\{Agent as AgentContract, Detector}; +use Arcanedev\Agent\Contracts\Agent as AgentContract; +use Arcanedev\Agent\Contracts\Detector; use BadMethodCallException; use Illuminate\Contracts\Foundation\Application; use Illuminate\Http\Request; @@ -12,7 +13,6 @@ /** * Class Agent * - * @package Arcanedev\Agent * @author ARCANEDEV * * @method \Arcanedev\Agent\Detectors\DeviceDetector device() diff --git a/src/AgentServiceProvider.php b/src/AgentServiceProvider.php index c8b507f..9a12e10 100644 --- a/src/AgentServiceProvider.php +++ b/src/AgentServiceProvider.php @@ -10,7 +10,6 @@ /** * Class AgentServiceProvider * - * @package Arcanedev\Agent * @author ARCANEDEV */ class AgentServiceProvider extends PackageServiceProvider implements DeferrableProvider diff --git a/src/Contracts/Agent.php b/src/Contracts/Agent.php index 3956e8c..d0142e0 100644 --- a/src/Contracts/Agent.php +++ b/src/Contracts/Agent.php @@ -9,7 +9,6 @@ /** * Interface Agent * - * @package Arcanedev\Agent\Contracts * @author ARCANEDEV */ interface Agent diff --git a/src/Contracts/Detector.php b/src/Contracts/Detector.php index 8abecea..c44d059 100644 --- a/src/Contracts/Detector.php +++ b/src/Contracts/Detector.php @@ -7,10 +7,9 @@ use Illuminate\Http\Request; /** - * Interface Detector + * Interface Detector * - * @package Arcanedev\Agent\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface Detector { diff --git a/src/Detectors/DeviceDetector.php b/src/Detectors/DeviceDetector.php index c240240..8950422 100644 --- a/src/Detectors/DeviceDetector.php +++ b/src/Detectors/DeviceDetector.php @@ -11,7 +11,6 @@ /** * Class DeviceDetector * - * @package Arcanedev\Agent\Detectors * @author ARCANEDEV * * @mixin \DeviceDetector\DeviceDetector diff --git a/src/Detectors/LanguageDetector.php b/src/Detectors/LanguageDetector.php index ecc456c..1fe068e 100644 --- a/src/Detectors/LanguageDetector.php +++ b/src/Detectors/LanguageDetector.php @@ -10,7 +10,6 @@ /** * Class LanguageDetector * - * @package Arcanedev\Agent\Detectors * @author ARCANEDEV */ class LanguageDetector implements Detector diff --git a/tests/AgentServiceProviderTest.php b/tests/AgentServiceProviderTest.php index 2cf463d..6ba556d 100644 --- a/tests/AgentServiceProviderTest.php +++ b/tests/AgentServiceProviderTest.php @@ -1,11 +1,12 @@ - */ class AgentServiceProviderTest extends TestCase diff --git a/tests/AgentTest.php b/tests/AgentTest.php index 6aafb99..ba630a2 100644 --- a/tests/AgentTest.php +++ b/tests/AgentTest.php @@ -9,7 +9,6 @@ /** * Class AgentTest * - * @package Arcanedev\Agent\Tests * @author ARCANEDEV */ class AgentTest extends TestCase diff --git a/tests/TestCase.php b/tests/TestCase.php index 0631a0a..115349a 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -9,7 +9,6 @@ /** * Class TestCase * - * @package Arcanedev\Agent\Tests * @author ARCANEDEV */ abstract class TestCase extends BaseTestCase