diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index abe2e14..5b8e007 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/README.md b/README.md index 174c3f3..4f629f1 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 diff --git a/composer.json b/composer.json index 8f00fcc..1ad52f0 100644 --- a/composer.json +++ b/composer.json @@ -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": { @@ -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 } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d3492cf..27c3be4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,33 +1,27 @@ - +> - ./tests/ + ./tests - - - ./src/ - - + + + ./src + + + + + + + - - - - - - diff --git a/src/Contracts/Impersonatable.php b/src/Contracts/Impersonatable.php index 4f62b63..b55e62d 100644 --- a/src/Contracts/Impersonatable.php +++ b/src/Contracts/Impersonatable.php @@ -7,10 +7,9 @@ use Illuminate\Contracts\Auth\Authenticatable; /** - * Interface Impersonatable + * Interface Impersonatable * - * @package Arcanedev\LaravelImpersonator\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface Impersonatable extends Authenticatable { diff --git a/src/Contracts/Impersonator.php b/src/Contracts/Impersonator.php index 298fc43..c4368bd 100644 --- a/src/Contracts/Impersonator.php +++ b/src/Contracts/Impersonator.php @@ -5,10 +5,9 @@ namespace Arcanedev\LaravelImpersonator\Contracts; /** - * Interface Impersonator + * Interface Impersonator * - * @package Arcanedev\LaravelImpersonator\Contracts - * @author ARCANEDEV + * @author ARCANEDEV */ interface Impersonator { diff --git a/src/Events/AbstractImpersonationEvent.php b/src/Events/AbstractImpersonationEvent.php index 637d70b..08850ea 100644 --- a/src/Events/AbstractImpersonationEvent.php +++ b/src/Events/AbstractImpersonationEvent.php @@ -12,7 +12,6 @@ /** * Class AbstractImpersonationEvent * - * @package Arcanedev\LaravelImpersonator\Events * @author ARCANEDEV */ abstract class AbstractImpersonationEvent diff --git a/src/Events/ImpersonationStarted.php b/src/Events/ImpersonationStarted.php index 630747d..2004cfa 100644 --- a/src/Events/ImpersonationStarted.php +++ b/src/Events/ImpersonationStarted.php @@ -7,7 +7,6 @@ /** * Class ImpersonationStarted * - * @package Arcanedev\LaravelImpersonator\Events * @author ARCANEDEV */ class ImpersonationStarted extends AbstractImpersonationEvent {} diff --git a/src/Events/ImpersonationStopped.php b/src/Events/ImpersonationStopped.php index e99b990..0f72366 100644 --- a/src/Events/ImpersonationStopped.php +++ b/src/Events/ImpersonationStopped.php @@ -5,9 +5,8 @@ namespace Arcanedev\LaravelImpersonator\Events; /** - * Class ImpersonationEnded + * Class ImpersonationStopped * - * @package Arcanedev\LaravelImpersonator\Events * @author ARCANEDEV */ class ImpersonationStopped extends AbstractImpersonationEvent {} diff --git a/src/Exceptions/ImpersonationException.php b/src/Exceptions/ImpersonationException.php index 579cf90..89ed8dc 100644 --- a/src/Exceptions/ImpersonationException.php +++ b/src/Exceptions/ImpersonationException.php @@ -10,7 +10,6 @@ /** * Class ImpersonationException * - * @package Arcanedev\LaravelImpersonator\Exceptions * @author ARCANEDEV */ class ImpersonationException extends Exception diff --git a/src/Guard/SessionGuard.php b/src/Guard/SessionGuard.php index 1aa8f03..180d7c4 100644 --- a/src/Guard/SessionGuard.php +++ b/src/Guard/SessionGuard.php @@ -10,7 +10,6 @@ /** * Class SessionGuard * - * @package Arcanedev\LaravelImpersonator\Guard * @author ARCANEDEV */ class SessionGuard extends BaseSessionGuard diff --git a/src/Http/Middleware/ImpersonationNotAllowed.php b/src/Http/Middleware/ImpersonationNotAllowed.php index e11286e..cf147ad 100644 --- a/src/Http/Middleware/ImpersonationNotAllowed.php +++ b/src/Http/Middleware/ImpersonationNotAllowed.php @@ -10,7 +10,6 @@ /** * Class ImpersonationNotAllowed * - * @package Arcanedev\LaravelImpersonator\Http\Middleware * @author ARCANEDEV */ class ImpersonationNotAllowed diff --git a/src/Impersonator.php b/src/Impersonator.php index 8b925ab..2693755 100644 --- a/src/Impersonator.php +++ b/src/Impersonator.php @@ -13,7 +13,6 @@ /** * Class Impersonator * - * @package Arcanedev\LaravelImpersonator * @author ARCANEDEV */ class Impersonator implements ImpersonatorContract diff --git a/src/ImpersonatorServiceProvider.php b/src/ImpersonatorServiceProvider.php index b01a454..2242a17 100644 --- a/src/ImpersonatorServiceProvider.php +++ b/src/ImpersonatorServiceProvider.php @@ -13,7 +13,6 @@ /** * Class ImpersonatorServiceProvider * - * @package Arcanedev\LaravelImpersonator * @author ARCANEDEV */ class ImpersonatorServiceProvider extends PackageServiceProvider implements DeferrableProvider diff --git a/src/Policies/ImpersonationPolicy.php b/src/Policies/ImpersonationPolicy.php index 9349c06..597e58c 100644 --- a/src/Policies/ImpersonationPolicy.php +++ b/src/Policies/ImpersonationPolicy.php @@ -11,7 +11,6 @@ /** * Class ImpersonationPolicy * - * @package Arcanedev\LaravelImpersonator\Policies * @author ARCANEDEV */ class ImpersonationPolicy extends Policy diff --git a/src/Traits/CanImpersonate.php b/src/Traits/CanImpersonate.php index 2921424..99004f9 100644 --- a/src/Traits/CanImpersonate.php +++ b/src/Traits/CanImpersonate.php @@ -8,9 +8,8 @@ use Illuminate\Database\Eloquent\Model; /** - * Trait HasImpersonation + * Trait CanImpersonate * - * @package Arcanedev\LaravelImpersonator\Traits * @author ARCANEDEV */ trait CanImpersonate diff --git a/tests/EventsTest.php b/tests/EventsTest.php index 424846a..619fdef 100644 --- a/tests/EventsTest.php +++ b/tests/EventsTest.php @@ -11,7 +11,6 @@ /** * Class EventsTest * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ class EventsTest extends TestCase diff --git a/tests/ImpersonationPoliciesTest.php b/tests/ImpersonationPoliciesTest.php index 772540b..8cffb81 100644 --- a/tests/ImpersonationPoliciesTest.php +++ b/tests/ImpersonationPoliciesTest.php @@ -9,7 +9,6 @@ /** * Class ImpersonationPoliciesTest * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ class ImpersonationPoliciesTest extends TestCase diff --git a/tests/ImpersonationTraitTest.php b/tests/ImpersonationTraitTest.php index f635074..a9b7679 100644 --- a/tests/ImpersonationTraitTest.php +++ b/tests/ImpersonationTraitTest.php @@ -9,7 +9,6 @@ /** * Class ImpersonationTraitTest * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ class ImpersonationTraitTest extends TestCase diff --git a/tests/ImpersonatorServiceProviderTest.php b/tests/ImpersonatorServiceProviderTest.php index 310a045..7044f86 100644 --- a/tests/ImpersonatorServiceProviderTest.php +++ b/tests/ImpersonatorServiceProviderTest.php @@ -14,7 +14,6 @@ /** * Class ImpersonatorServiceProviderTest * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ class ImpersonatorServiceProviderTest extends TestCase diff --git a/tests/ImpersonatorTest.php b/tests/ImpersonatorTest.php index f2a7df2..81161be 100644 --- a/tests/ImpersonatorTest.php +++ b/tests/ImpersonatorTest.php @@ -11,7 +11,6 @@ /** * Class ImpersonatorTest * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ class ImpersonatorTest extends TestCase diff --git a/tests/MiddlewareTest.php b/tests/MiddlewareTest.php index 02c0116..127fb68 100644 --- a/tests/MiddlewareTest.php +++ b/tests/MiddlewareTest.php @@ -7,7 +7,6 @@ /** * Class MiddlewareTest * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ class MiddlewareTest extends TestCase diff --git a/tests/Policies/ImpersonationPolicyTest.php b/tests/Policies/ImpersonationPolicyTest.php index f06dfd5..3e031c7 100644 --- a/tests/Policies/ImpersonationPolicyTest.php +++ b/tests/Policies/ImpersonationPolicyTest.php @@ -10,7 +10,6 @@ /** * Class ImpersonationPolicyTest * - * @package Arcanedev\LaravelImpersonator\Tests\Policies * @author ARCANEDEV */ class ImpersonationPolicyTest extends TestCase diff --git a/tests/Stubs/Controllers/ImpersonatorController.php b/tests/Stubs/Controllers/ImpersonatorController.php index e5b2f64..44ade1c 100644 --- a/tests/Stubs/Controllers/ImpersonatorController.php +++ b/tests/Stubs/Controllers/ImpersonatorController.php @@ -13,7 +13,6 @@ /** * Class ImpersonatorController * - * @package Arcanedev\LaravelImpersonator\Tests\Stubs\Controllers * @author ARCANEDEV */ class ImpersonatorController extends Controller diff --git a/tests/Stubs/Models/User.php b/tests/Stubs/Models/User.php index 85119ae..654b2c5 100644 --- a/tests/Stubs/Models/User.php +++ b/tests/Stubs/Models/User.php @@ -12,16 +12,15 @@ /** * Class User * - * @package Arcanedev\LaravelImpersonator\Tests\Stubs\Models * @author ARCANEDEV * - * @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 { diff --git a/tests/Stubs/Providers/AuthorizationServiceProvider.php b/tests/Stubs/Providers/AuthorizationServiceProvider.php index d062725..73bb607 100644 --- a/tests/Stubs/Providers/AuthorizationServiceProvider.php +++ b/tests/Stubs/Providers/AuthorizationServiceProvider.php @@ -11,7 +11,6 @@ /** * Class AuthorizationServiceProvider * - * @package Arcanedev\LaravelImpersonator\Tests\Stubs\Providers * @author ARCANEDEV */ class AuthorizationServiceProvider extends ServiceProvider diff --git a/tests/TestCase.php b/tests/TestCase.php index 3ca8430..c407fb9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -16,7 +16,6 @@ /** * Class TestCase * - * @package Arcanedev\LaravelImpersonator\Tests * @author ARCANEDEV */ abstract class TestCase extends BaseTestCase