Skip to content

Commit

Permalink
Merge pull request #10 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 10, 2020
2 parents b87baed + 99025ae commit 47f4861
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 44 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
22 changes: 17 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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
}
36 changes: 14 additions & 22 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +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="Application Test Suite">
<testsuite name="Package Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
</php>
<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>
4 changes: 2 additions & 2 deletions src/Agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

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;

/**
* Class Agent
*
* @package Arcanedev\Agent
* @author ARCANEDEV <[email protected]>
*
* @method \Arcanedev\Agent\Detectors\DeviceDetector device()
Expand Down
1 change: 0 additions & 1 deletion src/AgentServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class AgentServiceProvider
*
* @package Arcanedev\Agent
* @author ARCANEDEV <[email protected]>
*/
class AgentServiceProvider extends PackageServiceProvider implements DeferrableProvider
Expand Down
1 change: 0 additions & 1 deletion src/Contracts/Agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Interface Agent
*
* @package Arcanedev\Agent\Contracts
* @author ARCANEDEV <[email protected]>
*/
interface Agent
Expand Down
5 changes: 2 additions & 3 deletions src/Contracts/Detector.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
use Illuminate\Http\Request;

/**
* Interface Detector
* Interface Detector
*
* @package Arcanedev\Agent\Contracts
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface Detector
{
Expand Down
1 change: 0 additions & 1 deletion src/Detectors/DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class DeviceDetector
*
* @package Arcanedev\Agent\Detectors
* @author ARCANEDEV <[email protected]>
*
* @mixin \DeviceDetector\DeviceDetector
Expand Down
1 change: 0 additions & 1 deletion src/Detectors/LanguageDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class LanguageDetector
*
* @package Arcanedev\Agent\Detectors
* @author ARCANEDEV <[email protected]>
*/
class LanguageDetector implements Detector
Expand Down
7 changes: 4 additions & 3 deletions tests/AgentServiceProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php namespace Arcanedev\Agent\Tests;
<?php

use Illuminate\Contracts\Support\DeferrableProvider;
declare(strict_types=1);

namespace Arcanedev\Agent\Tests;

/**
* Class AgentServiceProviderTest
*
* @package Arcanedev\Agent\Tests
* @author ARCANEDEV <[email protected]>
*/
class AgentServiceProviderTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Class AgentTest
*
* @package Arcanedev\Agent\Tests
* @author ARCANEDEV <[email protected]>
*/
class AgentTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Class TestCase
*
* @package Arcanedev\Agent\Tests
* @author ARCANEDEV <[email protected]>
*/
abstract class TestCase extends BaseTestCase
Expand Down

0 comments on commit 47f4861

Please sign in to comment.