Skip to content

Commit

Permalink
Merge pull request #4 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 9, 2020
2 parents e2f6f1f + 0042c2f commit 01879ad
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .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 Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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 @@ -19,7 +19,7 @@ This package allows to create & manage policies/abilities in a modular way.
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
* Laravel `6.x` to `7.x` are supported.
* Laravel `6.x` to `8.x` are supported.
* Made with :heart: & :coffee:.

## Table of contents
Expand All @@ -45,7 +45,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
- [ARCANEDEV][link-author]
- [All Contributors][link-contributors]

[badge_laravel]: https://img.shields.io/badge/Laravel-6.x%20to%207.x-orange.svg?style=flat-square
[badge_laravel]: https://img.shields.io/badge/Laravel-6.x%20to%208.x-orange.svg?style=flat-square
[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-policies.svg?style=flat-square
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/LaravelPolicies/run-tests?style=flat-square
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/LaravelPolicies.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 @@ -14,13 +14,13 @@
"type": "library",
"license": "MIT",
"require": {
"php": "^7.2.5",
"ext-json": "*",
"arcanedev/support": "^7.0"
"php": "^7.3",
"ext-json": "*",
"arcanedev/support": "^8.0"
},
"require-dev": {
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.5|^9.0"
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3"
},
"autoload": {
"psr-4": {
Expand All @@ -32,13 +32,23 @@
"Arcanedev\\LaravelPolicies\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"coverage": "phpunit --coverage-html build/coverage/html"
},
"extra": {
"branch-alias": {
"dev-develop": "3.x-dev"
},
"laravel": {
"providers": [
"Arcanedev\\LaravelPolicies\\PoliciesServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
33 changes: 14 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
<?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="DB_CONNECTION" 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>
</phpunit>
1 change: 0 additions & 1 deletion src/Ability.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class Ability
*
* @package Arcanedev\LaravelPolicies
* @author ARCANEDEV <[email protected]>
*/
class Ability implements AbilityContract
Expand Down
5 changes: 2 additions & 3 deletions src/Contracts/Ability.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
use JsonSerializable;

/**
* Interface Ability
* Interface Ability
*
* @package Arcanedev\LaravelPolicies\Contracts
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface Ability extends Arrayable, JsonSerializable, Jsonable
{
Expand Down
7 changes: 2 additions & 5 deletions src/Contracts/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
namespace Arcanedev\LaravelPolicies\Contracts;

/**
* Class Policy
* Interface Policy
*
* @package Arcanedev\LaravelPolicies\Contracts
* @author ARCANEDEV <[email protected]>
*
* @method \Arcanedev\LaravelPolicies\Ability[]|iterable abilities()
* @author ARCANEDEV <[email protected]>
*/
interface Policy
{
Expand Down
5 changes: 2 additions & 3 deletions src/Contracts/PolicyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
use Illuminate\Support\Collection;

/**
* Interface PolicyManager
* Interface PolicyManager
*
* @package Arcanedev\LaravelPolicies\Contracts
* @author ARCANEDEV <[email protected]>
* @author ARCANEDEV <[email protected]>
*/
interface PolicyManager
{
Expand Down
1 change: 0 additions & 1 deletion src/PoliciesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class PoliciesServiceProvider
*
* @package Arcanedev\LaravelPolicies
* @author ARCANEDEV <[email protected]>
*/
class PoliciesServiceProvider extends PackageServiceProvider implements DeferrableProvider
Expand Down
1 change: 0 additions & 1 deletion src/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class Policy
*
* @package Arcanedev\LaravelPolicies
* @author ARCANEDEV <[email protected]>
*/
abstract class Policy implements PolicyContract
Expand Down
1 change: 0 additions & 1 deletion src/PolicyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/**
* Class PolicyManager
*
* @package Arcanedev\LaravelPolicies
* @author ARCANEDEV <[email protected]>
*/
class PolicyManager implements PolicyManagerContract
Expand Down
1 change: 0 additions & 1 deletion tests/AbilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class AbilityTest
*
* @package Arcanedev\LaravelPolicies\Tests
* @author ARCANEDEV <[email protected]>
*/
class AbilityTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/AuthorizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* Class AuthorizationTest
*
* @package Arcanedev\LaravelPolicies\Tests
* @author ARCANEDEV <[email protected]>
*/
class AuthorizationTest extends TestCase
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/Policies/Abilities/DedicatedAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
use Illuminate\Foundation\Auth\User;

/**
* Class AbilityClass
* Class DedicatedAbility
*
* @package Arcanedev\LaravelPolicies\Tests\Fixtures\Policies\Abilities
* @author ARCANEDEV <[email protected]>
*/
class DedicatedAbility
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/Policies/PostsPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class PostsPolicy
*
* @package Arcanedev\LaravelPolicies\Tests\Fixtures\Policies
* @author ARCANEDEV <[email protected]>
*/
class PostsPolicy extends Policy
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/Policies/PrefixedPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* Class PrefixedPolicy
*
* @package Arcanedev\LaravelPolicies\Tests\Fixtures\Policies
* @author ARCANEDEV <[email protected]>
*/
class PrefixedPolicy extends Policy
Expand Down
3 changes: 2 additions & 1 deletion tests/PoliciesServiceProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

declare(strict_types=1);

namespace Arcanedev\LaravelPolicies\Tests;

use Arcanedev\LaravelPolicies\PoliciesServiceProvider;

/**
* Class PoliciesServiceProviderTest
*
* @package Arcanedev\LaravelPolicies\Tests
* @author ARCANEDEV <[email protected]>
*/
class PoliciesServiceProviderTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/PolicyManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Class PolicyManagerTest
*
* @package Arcanedev\LaravelPolicies\Tests
* @author ARCANEDEV <[email protected]>
*/
class PolicyManagerTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/PolicyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* Class PolicyTest
*
* @package Arcanedev\LaravelPolicies\Tests
* @author ARCANEDEV <[email protected]>
*/
class PolicyTest 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\LaravelPolicies\Tests
* @author ARCANEDEV <[email protected]>
*/
abstract class TestCase extends BaseTestCase
Expand Down

0 comments on commit 01879ad

Please sign in to comment.