Skip to content

Commit

Permalink
Merge pull request #14 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Starting Laravel 8 support
  • Loading branch information
arcanedev-maroc authored Sep 10, 2020
2 parents 96f85e9 + 9ac7a88 commit eab40c4
Show file tree
Hide file tree
Showing 28 changed files with 47 additions and 66 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/LaravelImpers

### Features

* Laravel `5.4` to `7.x` are supported.
* Laravel `5.4` to `8.x` are supported.
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
Expand All @@ -44,7 +44,7 @@ Any ideas are welcome. Feel free to submit any issues or pull requests, please c
- [All Contributors][link-contributors]

[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-impersonator.svg?style=flat-square
[badge_laravel]: https://img.shields.io/badge/Laravel-5.4%20to%207.x-orange.svg?style=flat-square
[badge_laravel]: https://img.shields.io/badge/Laravel-5.4%20to%208.x-orange.svg?style=flat-square
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/LaravelImpersonator/run-tests?style=flat-square
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/LaravelImpersonator.svg?style=flat-square
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/LaravelImpersonator.svg?style=flat-square
Expand Down
20 changes: 15 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"type": "library",
"license": "MIT",
"require": {
"php": "^7.2.5",
"arcanedev/support": "^7.0"
"php": "^7.3",
"arcanedev/support": "^8.0"
},
"require-dev": {
"arcanedev/laravel-policies": "^2.0",
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.5"
"arcanedev/laravel-policies": "^3.0",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3"
},
"autoload": {
"psr-4": {
Expand All @@ -35,13 +35,23 @@
"Arcanedev\\LaravelImpersonator\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"coverage": "phpunit --coverage-html build/coverage/html"
},
"extra": {
"branch-alias": {
"dev-develop": "4.x-dev"
},
"laravel": {
"providers": [
"Arcanedev\\LaravelImpersonator\\ImpersonatorServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
34 changes: 14 additions & 20 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
<?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>
<directory suffix=".php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<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>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_CONNECTION" value="testing"/>
<env name="SESSION_DRIVER" value="array"/>
</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>
</phpunit>
5 changes: 2 additions & 3 deletions src/Contracts/Impersonatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
use Illuminate\Contracts\Auth\Authenticatable;

/**
* Interface Impersonatable
* Interface Impersonatable
*
* @package Arcanedev\LaravelImpersonator\Contracts
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface Impersonatable extends Authenticatable
{
Expand Down
5 changes: 2 additions & 3 deletions src/Contracts/Impersonator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
namespace Arcanedev\LaravelImpersonator\Contracts;

/**
* Interface Impersonator
* Interface Impersonator
*
* @package Arcanedev\LaravelImpersonator\Contracts
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface Impersonator
{
Expand Down
1 change: 0 additions & 1 deletion src/Events/AbstractImpersonationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* Class AbstractImpersonationEvent
*
* @package Arcanedev\LaravelImpersonator\Events
* @author ARCANEDEV <[email protected]>
*/
abstract class AbstractImpersonationEvent
Expand Down
1 change: 0 additions & 1 deletion src/Events/ImpersonationStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/**
* Class ImpersonationStarted
*
* @package Arcanedev\LaravelImpersonator\Events
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationStarted extends AbstractImpersonationEvent {}
3 changes: 1 addition & 2 deletions src/Events/ImpersonationStopped.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
namespace Arcanedev\LaravelImpersonator\Events;

/**
* Class ImpersonationEnded
* Class ImpersonationStopped
*
* @package Arcanedev\LaravelImpersonator\Events
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationStopped extends AbstractImpersonationEvent {}
1 change: 0 additions & 1 deletion src/Exceptions/ImpersonationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class ImpersonationException
*
* @package Arcanedev\LaravelImpersonator\Exceptions
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationException extends Exception
Expand Down
1 change: 0 additions & 1 deletion src/Guard/SessionGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class SessionGuard
*
* @package Arcanedev\LaravelImpersonator\Guard
* @author ARCANEDEV <[email protected]>
*/
class SessionGuard extends BaseSessionGuard
Expand Down
1 change: 0 additions & 1 deletion src/Http/Middleware/ImpersonationNotAllowed.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class ImpersonationNotAllowed
*
* @package Arcanedev\LaravelImpersonator\Http\Middleware
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationNotAllowed
Expand Down
1 change: 0 additions & 1 deletion src/Impersonator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/**
* Class Impersonator
*
* @package Arcanedev\LaravelImpersonator
* @author ARCANEDEV <[email protected]>
*/
class Impersonator implements ImpersonatorContract
Expand Down
1 change: 0 additions & 1 deletion src/ImpersonatorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/**
* Class ImpersonatorServiceProvider
*
* @package Arcanedev\LaravelImpersonator
* @author ARCANEDEV <[email protected]>
*/
class ImpersonatorServiceProvider extends PackageServiceProvider implements DeferrableProvider
Expand Down
1 change: 0 additions & 1 deletion src/Policies/ImpersonationPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class ImpersonationPolicy
*
* @package Arcanedev\LaravelImpersonator\Policies
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationPolicy extends Policy
Expand Down
3 changes: 1 addition & 2 deletions src/Traits/CanImpersonate.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
use Illuminate\Database\Eloquent\Model;

/**
* Trait HasImpersonation
* Trait CanImpersonate
*
* @package Arcanedev\LaravelImpersonator\Traits
* @author ARCANEDEV <[email protected]>
*/
trait CanImpersonate
Expand Down
1 change: 0 additions & 1 deletion tests/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class EventsTest
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
class EventsTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/ImpersonationPoliciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Class ImpersonationPoliciesTest
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationPoliciesTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/ImpersonationTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Class ImpersonationTraitTest
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationTraitTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/ImpersonatorServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/**
* Class ImpersonatorServiceProviderTest
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
class ImpersonatorServiceProviderTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/ImpersonatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class ImpersonatorTest
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
class ImpersonatorTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/MiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/**
* Class MiddlewareTest
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
class MiddlewareTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/Policies/ImpersonationPolicyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class ImpersonationPolicyTest
*
* @package Arcanedev\LaravelImpersonator\Tests\Policies
* @author ARCANEDEV <[email protected]>
*/
class ImpersonationPolicyTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/Stubs/Controllers/ImpersonatorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/**
* Class ImpersonatorController
*
* @package Arcanedev\LaravelImpersonator\Tests\Stubs\Controllers
* @author ARCANEDEV <[email protected]>
*/
class ImpersonatorController extends Controller
Expand Down
15 changes: 7 additions & 8 deletions tests/Stubs/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
/**
* Class User
*
* @package Arcanedev\LaravelImpersonator\Tests\Stubs\Models
* @author ARCANEDEV <[email protected]>
*
* @property int id
* @property string name
* @property string email
* @property string password
* @property string remember_token
* @property string created_at
* @property \Carbon\Carbon updated_at
* @property int id
* @property string name
* @property string email
* @property string password
* @property string remember_token
* @property \Illuminate\Support\Carbon created_at
* @property \Illuminate\Support\Carbon updated_at
*/
class User extends Authenticatable implements Impersonatable
{
Expand Down
1 change: 0 additions & 1 deletion tests/Stubs/Providers/AuthorizationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class AuthorizationServiceProvider
*
* @package Arcanedev\LaravelImpersonator\Tests\Stubs\Providers
* @author ARCANEDEV <[email protected]>
*/
class AuthorizationServiceProvider extends ServiceProvider
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/**
* Class TestCase
*
* @package Arcanedev\LaravelImpersonator\Tests
* @author ARCANEDEV <[email protected]>
*/
abstract class TestCase extends BaseTestCase
Expand Down

0 comments on commit eab40c4

Please sign in to comment.