Skip to content

Commit f7b0781

Browse files
Merge pull request #2 from laravel-shift/l11-compatibility
Laravel 11.x Compatibility
2 parents eac376d + 932430e commit f7b0781

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1331
-1305
lines changed

.github/workflows/tests.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
name: tests
22

3-
on: [push]
3+
on:
4+
- push
45

56
jobs:
67
build:
78
runs-on: ubuntu-latest
9+
810
timeout-minutes: 10
11+
912
strategy:
1013
matrix:
1114
php: ['8.0', '8.1', '8.2', '8.3']
12-
laravel: ['9.2', '9.52', '10.0', '10.32']
15+
laravel: ['9.2', '9.52', '10.0', '10.32', '11.x']
1316
exclude:
1417
- php: '8.0'
1518
laravel: '10.0'
1619
- php: '8.0'
1720
laravel: '10.32'
1821
name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }}
22+
1923
steps:
2024
- name: Checkout
2125
uses: actions/checkout@master
26+
2227
- name: Installing PHP
2328
uses: shivammathur/setup-php@master
2429
with:
2530
php-version: ${{ matrix.php }}
2631
extensions: mbstring, json, sqlite3
2732
tools: composer:v2
33+
2834
- name: Lock Laravel Version
2935
run: composer require "illuminate/support:${{ matrix.laravel }}.*" --no-update -v && composer require "illuminate/console:${{ matrix.laravel }}.*" --no-update -v
30-
- name: Testbench Version Adjustments
31-
run: |
32-
is_smaller_version() [[ $(echo -e "$1\n$2"|sort -V|head -1) != $2 ]]
33-
is_smaller_version "${{ matrix.laravel }}" "9.36" && composer req "orchestra/testbench-core:7.10.2" --no-update
34-
is_smaller_version "${{ matrix.laravel }}" "9.34" && composer req "orchestra/testbench-core:7.8.1" --no-update
35-
is_smaller_version "${{ matrix.laravel }}" "9.32" && composer req "orchestra/testbench-core:7.7.1" --no-update
36-
is_smaller_version "${{ matrix.laravel }}" "9.12" && composer req "orchestra/testbench-core:7.4.0" --no-update
37-
is_smaller_version "${{ matrix.laravel }}" "9.7" && composer req "orchestra/testbench-core:7.3.0" --no-update
38-
is_smaller_version "${{ matrix.laravel }}" "9.6" && composer req "orchestra/testbench-core:7.2.0" --no-update
39-
is_smaller_version "${{ matrix.laravel }}" "9.5" && composer req "orchestra/testbench-core:7.1.0" --no-update || true
36+
4037
- name: Composer Install
4138
run: composer install --prefer-dist --no-progress --no-interaction
39+
4240
- name: Create Database
4341
run: mkdir -p database && touch database/database.sqlite
42+
4443
- name: Run Tests
4544
run: php vendor/bin/phpunit --testdox

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
build
22
composer.lock
3-
docs
43
vendor
54
tests/temp
65
.idea/
76
/.phpunit.result.cache
7+
/.phpunit.cache/test-results

.styleci.yml

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
1-
preset: psr2
2-
1+
preset: psr12
2+
risky: true
33
enabled:
44
- align_phpdoc
5-
- align_double_arrow
6-
- align_equals
5+
- alpha_ordered_imports
6+
- cast_spaces
7+
- clean_namespace
8+
- declare_strict_types
9+
- fully_qualified_strict_types
10+
- implode_call
11+
- no_extra_block_blank_lines
12+
- no_extra_consecutive_blank_lines
13+
- no_spaces_inside_offset
14+
- no_spaces_outside_offset
15+
- no_whitespace_before_comma_in_array
16+
- no_unneeded_curly_braces
17+
- no_unneeded_control_parentheses
18+
- no_unneeded_final_method
19+
- no_unused_imports
20+
- no_unused_lambda_imports
21+
- no_useless_sprintf
22+
- normalize_index_brace
23+
- object_operator_without_whitespace
24+
- ordered_class_elements
25+
- print_to_echo
26+
- property_separation
27+
- short_array_syntax
28+
- short_list_syntax
29+
- standardize_not_equals
30+
- unalign_equals
31+
- unalign_double_arrow
32+
- yoda_style

CONTRIBUTING.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ We accept contributions via Pull Requests on [Github](https://github.com/artkone
77

88
## Pull Requests
99

10-
- **[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).
10+
- **[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).
1111

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

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

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

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

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

2727
``` bash
28-
$ phpunit
28+
$ vendor/bin/phpunit
2929
```
3030

31-
3231
**Happy coding**!

Changelog.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Konekt Acl Changelog
22

3+
# 2.x Series
4+
5+
- Dropped Laravel 9 support
6+
- Dropped PHP 8.0 & 8.1 support
7+
- Added PHP 8.3 support
8+
- Added the `Ownable` interface to be used by Models
9+
- Added the `HasRoles::havingPermission()` query scope that accept a single `string|Permission` parameter
10+
- Added the `HasRoles::havingRole()` query scope that accept a single `string|Role` parameter
11+
- BC: The 'Permission::findByName()' method no longer throws an exception when a permission was not found, but returns NULL instead
12+
- BC: The 'Role::findByName()' method no longer throws an exception when a role was not found, but returns NULL instead
13+
- BC: The 'Role::findById()' method no longer throws an exception when a role was not found, but returns NULL instead
14+
- BC: The `givePermissionTo()` method no longer accepts an array or a Collection parameter, only a variadic `string|Permission` parameter list
15+
- BC: The `HasRoles::permission()` query scope has been renamed to `havingPermissions()`
16+
- BC: The renamed `havingPermissions()` scope no longer accepts and array or Collection, only a variadic `string|Permission` parameter list
17+
- BC: The `HasRoles::role()` query scope has been renamed to `havingRoles()`
18+
- BC: Added the `getName()` method to the `Permission` and `Role` interfaces
19+
320
# 1.x Series
421

522
## 1.7.1

0 commit comments

Comments
 (0)