Skip to content

Commit 6025412

Browse files
authored
Merge pull request #24 from robinmalburn/feature.laravel12
Adds Laravel 12 support
2 parents 603157e + 996a015 commit 6025412

File tree

7 files changed

+29
-20
lines changed

7 files changed

+29
-20
lines changed

.github/workflows/PHPUnit.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,27 @@ jobs:
1212
- name: Setup PHP
1313
uses: shivammathur/setup-php@v2
1414
with:
15-
php-version: '8.0'
15+
php-version: "8.2"
1616
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
1717
coverage: none
1818

1919
- name: Create database
2020
run: |
2121
sudo /etc/init.d/mysql start
2222
mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS laravel;'
23-
- name: Cache composer dependencies
24-
uses: actions/cache@v2
23+
24+
- name: Get Composer Cache Directory
25+
id: composer-cache
26+
run: |
27+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
28+
29+
- name: Cache Composer dependencies
30+
uses: actions/cache@v4
2531
with:
26-
path: vendor
27-
key: composer-${{ hashFiles('composer.lock') }}
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-composer-
2836
2937
- name: Run composer install
3038
run: composer install -n --prefer-dist

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor/
22
composer.lock
3+
.phpunit.result.cache

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ I prefer using them to make for easier unit testing in large projects.
2929
| 6.0 | 2.0 |
3030
| 7.0, 8.0 | 2.1 |
3131
| 9.0 | 3.0, 4.0 |
32+
| 10.0 | 4.2 |
33+
| 11.0 | 4.3 |
34+
| 12.0 | 4.4 |
3235

3336
### Warning
3437

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
}
2121
],
2222
"require": {
23-
"php" : "^8.1",
24-
"illuminate/support": "^9.0 || ^10.0 || ^11.0",
25-
"illuminate/database": "^9.0 || ^10.0 || ^11.0",
23+
"php": "^8.2",
24+
"illuminate/support": "^11.0 || ^12.0",
25+
"illuminate/database": "^11.0 || ^12.0",
2626
"myclabs/php-enum": "^1.7"
2727
},
2828
"require-dev": {
2929
"astrotomic/laravel-translatable": "^11.10",
3030
"czim/laravel-listify": "^2.0",
31-
"orchestra/testbench": "^8.0",
32-
"nunomaduro/larastan": "^2.2",
33-
"phpstan/phpstan-mockery": "^1.1",
34-
"phpstan/phpstan-phpunit": "^1.1",
35-
"phpunit/phpunit" : "^9.5",
31+
"orchestra/testbench": "^8.0 || ^9.0",
32+
"larastan/larastan": "^2.10 || 3.3",
33+
"phpstan/phpstan-mockery": "^2.0",
34+
"phpstan/phpstan-phpunit": "^2.0",
35+
"phpunit/phpunit": "^10 || ^11.0",
3636
"watson/rememberable": "^6.0"
3737
},
3838
"autoload": {

phpstan.neon.dist

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
includes:
2-
- ./vendor/nunomaduro/larastan/extension.neon
2+
- ./vendor/larastan/larastan/extension.neon
33
- ./vendor/phpstan/phpstan-phpunit/extension.neon
44
- ./vendor/phpstan/phpstan-mockery/extension.neon
55

66
parameters:
7+
level: 0
78
paths:
89
- src
9-
ignoreErrors:
10-
-
11-
message: '#Call to an undefined method .*::remember\(\)#'
12-
path: src/Criteria/Common/UseCache.php

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
>
1212
<testsuites>
1313
<testsuite name="Repository Package Test Suite">
14-
<directory suffix=".php">./tests/</directory>
14+
<directory suffix="Test.php">./tests/</directory>
1515
<exclude>./tests/TestCase.php</exclude>
1616
</testsuite>
1717
</testsuites>

src/Criteria/Common/UseCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(?int $timeToLive = null)
4848
protected function applyToQuery(
4949
Model|Relation|DatabaseBuilder|EloquentBuilder $model
5050
): Model|Relation|DatabaseBuilder|EloquentBuilder {
51-
/** @var $model RememberableBuilder */
51+
/** @var RememberableBuilder $model */
5252
return $model->remember($this->timeToLive);
5353
}
5454
}

0 commit comments

Comments
 (0)