Skip to content

Commit

Permalink
Merge pull request #2 from laravel-shift/l11-compatibility
Browse files Browse the repository at this point in the history
Laravel 11.x Compatibility
  • Loading branch information
fulopattila122 authored Feb 27, 2024
2 parents eac376d + 932430e commit f7b0781
Show file tree
Hide file tree
Showing 67 changed files with 1,331 additions and 1,305 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
name: tests

on: [push]
on:
- push

jobs:
build:
runs-on: ubuntu-latest

timeout-minutes: 10

strategy:
matrix:
php: ['8.0', '8.1', '8.2', '8.3']
laravel: ['9.2', '9.52', '10.0', '10.32']
laravel: ['9.2', '9.52', '10.0', '10.32', '11.x']
exclude:
- php: '8.0'
laravel: '10.0'
- php: '8.0'
laravel: '10.32'
name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }}

steps:
- name: Checkout
uses: actions/checkout@master

- name: Installing PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring, json, sqlite3
tools: composer:v2

- name: Lock Laravel Version
run: composer require "illuminate/support:${{ matrix.laravel }}.*" --no-update -v && composer require "illuminate/console:${{ matrix.laravel }}.*" --no-update -v
- name: Testbench Version Adjustments
run: |
is_smaller_version() [[ $(echo -e "$1\n$2"|sort -V|head -1) != $2 ]]
is_smaller_version "${{ matrix.laravel }}" "9.36" && composer req "orchestra/testbench-core:7.10.2" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.34" && composer req "orchestra/testbench-core:7.8.1" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.32" && composer req "orchestra/testbench-core:7.7.1" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.12" && composer req "orchestra/testbench-core:7.4.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.7" && composer req "orchestra/testbench-core:7.3.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.6" && composer req "orchestra/testbench-core:7.2.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.5" && composer req "orchestra/testbench-core:7.1.0" --no-update || true

- name: Composer Install
run: composer install --prefer-dist --no-progress --no-interaction

- name: Create Database
run: mkdir -p database && touch database/database.sqlite

- name: Run Tests
run: php vendor/bin/phpunit --testdox
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build
composer.lock
docs
vendor
tests/temp
.idea/
/.phpunit.result.cache
/.phpunit.cache/test-results
34 changes: 30 additions & 4 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
preset: psr2

preset: psr12
risky: true
enabled:
- align_phpdoc
- align_double_arrow
- align_equals
- alpha_ordered_imports
- cast_spaces
- clean_namespace
- declare_strict_types
- fully_qualified_strict_types
- implode_call
- no_extra_block_blank_lines
- no_extra_consecutive_blank_lines
- no_spaces_inside_offset
- no_spaces_outside_offset
- no_whitespace_before_comma_in_array
- no_unneeded_curly_braces
- no_unneeded_control_parentheses
- no_unneeded_final_method
- no_unused_imports
- no_unused_lambda_imports
- no_useless_sprintf
- normalize_index_brace
- object_operator_without_whitespace
- ordered_class_elements
- print_to_echo
- property_separation
- short_array_syntax
- short_list_syntax
- standardize_not_equals
- unalign_equals
- unalign_double_arrow
- yoda_style
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ We accept contributions via Pull Requests on [Github](https://github.com/artkone

## Pull Requests

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
- **[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **Consider our release cycle** - We follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

Expand All @@ -25,8 +25,7 @@ We accept contributions via Pull Requests on [Github](https://github.com/artkone
## Running Tests

``` bash
$ phpunit
$ vendor/bin/phpunit
```


**Happy coding**!
17 changes: 17 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Konekt Acl Changelog

# 2.x Series

- Dropped Laravel 9 support
- Dropped PHP 8.0 & 8.1 support
- Added PHP 8.3 support
- Added the `Ownable` interface to be used by Models
- Added the `HasRoles::havingPermission()` query scope that accept a single `string|Permission` parameter
- Added the `HasRoles::havingRole()` query scope that accept a single `string|Role` parameter
- BC: The 'Permission::findByName()' method no longer throws an exception when a permission was not found, but returns NULL instead
- BC: The 'Role::findByName()' method no longer throws an exception when a role was not found, but returns NULL instead
- BC: The 'Role::findById()' method no longer throws an exception when a role was not found, but returns NULL instead
- BC: The `givePermissionTo()` method no longer accepts an array or a Collection parameter, only a variadic `string|Permission` parameter list
- BC: The `HasRoles::permission()` query scope has been renamed to `havingPermissions()`
- BC: The renamed `havingPermissions()` scope no longer accepts and array or Collection, only a variadic `string|Permission` parameter list
- BC: The `HasRoles::role()` query scope has been renamed to `havingRoles()`
- BC: Added the `getName()` method to the `Permission` and `Role` interfaces

# 1.x Series

## 1.7.1
Expand Down
Loading

0 comments on commit f7b0781

Please sign in to comment.