Skip to content

Commit e3e55a7

Browse files
authored
Support Laravel 11 and Statamic v5 (#17)
* update deps * update matrix * update composer.json * update * exclude Statamic 5 w/ L9 * update nunomaduro/collision * exclude laravel 11 and php8.1 * support v5 * update laravel
1 parent 3aefb86 commit e3e55a7

4 files changed

Lines changed: 40 additions & 15 deletions

File tree

.github/workflows/test.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: run-tests
2-
32
on: [push]
43

54
jobs:
@@ -8,22 +7,38 @@ jobs:
87
strategy:
98
fail-fast: true
109
matrix:
11-
php: [7.4, 8.0, 8.1, 8.2]
12-
laravel: [8.*, 9.*, 10.*]
13-
statamic: [3.*, 4.*]
14-
exclude:
10+
php: [7.4, 8.0, 8.1, 8.2, 8.3]
11+
laravel: [8.*, 9.*, 10.*, 11.*]
12+
statamic: [3.*, 4.*, 5.*]
13+
exclude:
1514
- laravel: 8.*
1615
php: 8.2
17-
- laravel: 9.*
18-
php: 7.4
16+
- laravel: 8.*
17+
php: 8.3
18+
- laravel: 8.*
19+
statamic: 5.*
1920
- laravel: 8.*
2021
statamic: 4.*
22+
- laravel: 9.*
23+
php: 7.4
24+
- laravel: 9.*
25+
statamic: 5.*
2126
- laravel: 10.*
2227
statamic: 3.*
2328
- laravel: 10.*
2429
php: 7.4
2530
- laravel: 10.*
2631
php: 8.0
32+
- laravel: 11.*
33+
php: 7.4
34+
- laravel: 11.*
35+
php: 8.0
36+
- laravel: 11.*
37+
php: 8.1
38+
- laravel: 11.*
39+
statamic: 3.*
40+
- laravel: 11.*
41+
statamic: 4.*
2742
dependency-version: [prefer-stable]
2843

2944
name: P${{ matrix.php }} - L${{ matrix.laravel }} - S${{ matrix.statamic }}
@@ -47,4 +62,4 @@ jobs:
4762
run: composer require laravel/framework:${{ matrix.laravel }} statamic/cms:${{ matrix.statamic }} --prefer-dist --no-interaction --no-suggest
4863

4964
- name: Execute tests
50-
run: vendor/bin/phpunit
65+
run: vendor/bin/phpunit

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
[![Latest Version on Packagist](https://img.shields.io/packagist/v/swiftmade/statamic-clear-assets.svg?style=for-the-badge)](https://packagist.org/packages/swiftmade/statamic-clear-assets)
55
![Downloads](https://img.shields.io/packagist/dt/swiftmade/statamic-clear-assets?style=for-the-badge)
66

7+
8+
> Supports Statamic 3, 4 and 5.
9+
710
Clean up unused images and assets from your Statamic site. Saves storage, keep things tidy.
811

912
The addon scans your entire `content` and `users` directory. If an asset is not referenced anywhere, it will be marked as unused. You can review the list of unused assets and delete them.

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
],
1515
"require": {
1616
"php": "^7.4|^8.0",
17-
"laravel/framework": "^7.30.3 || ^8.24 || ^9.0 || ^10.0",
18-
"statamic/cms": "^3.0.0|^4.0"
17+
"laravel/framework": "^7.30.3|^8.24|^9.0|^10.0|^11.0",
18+
"statamic/cms": "^3.0.0|^4.0|^5.0"
1919
},
2020
"require-dev": {
2121
"friendsofphp/php-cs-fixer": "^3.8",
22-
"nunomaduro/collision": "^4.1 || ^5.0 || ^6.0",
23-
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0",
24-
"phpunit/phpunit": "^9.5"
22+
"nunomaduro/collision": "^4.1|^5.0|^6.0|^8.1",
23+
"orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0",
24+
"phpunit/phpunit": "^9.5|^10.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

tests/TestCase.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,16 @@ protected function resolveApplicationConfiguration($app)
100100
];
101101

102102
foreach ($configs as $config) {
103+
104+
$path = __DIR__ . "/../vendor/statamic/cms/config/{$config}.php";
105+
106+
if (!file_exists($path)) {
107+
continue;
108+
}
109+
103110
$app['config']->set(
104111
"statamic.$config",
105-
require(__DIR__ . "/../vendor/statamic/cms/config/{$config}.php")
112+
require($path)
106113
);
107114
}
108115

@@ -111,7 +118,7 @@ protected function resolveApplicationConfiguration($app)
111118

112119
protected function initializeDirectory($directory)
113120
{
114-
if (! file_exists($directory)) {
121+
if (!file_exists($directory)) {
115122
mkdir($directory);
116123
}
117124
}

0 commit comments

Comments
 (0)