Skip to content

Commit

Permalink
v10 (spatie#2723)
Browse files Browse the repository at this point in the history
* wip

* wip

* Fix styling

* wip

* Fix styling

* wip

* Fix styling

* wip

* wip

* wip

* PHPUnit to Pest Converter (spatie#2724)

* Add Pest dependencies

* Add base Pest file

* Convert test cases

* Remove non-compound imports

* Adopt expectation API

* Optimize uses

* Set return type of base TestCase methods

From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type:

- `setUpBeforeClass()`
- `setUp()`
- `assertPreConditions()`
- `assertPostConditions()`
- `tearDown()`
- `tearDownAfterClass()`
- `onNotSuccessfulTest()`

[1]: https://phpunit.de/announcements/phpunit-8.html

* Use Pest test runner

* Shift cleanup

* Fix styling

* wip

* wip

* wip

* wip

* wip

* Fix styling

Co-authored-by: Shift <[email protected]>
Co-authored-by: freekmurze <[email protected]>

* wip

* Fix styling

* wip

* wip

* wip

* Fix styling

* wip

* wip

* wip

* wip

* wip

* Fix styling

* test fix (spatie#2726)

* wip

* wip

* wip

* wip

* Fix styling

* wip

* wip

* wip

* wip

* Fix styling

* wip

* wip

Co-authored-by: freekmurze <[email protected]>
Co-authored-by: Shift <[email protected]>
Co-authored-by: Fabio Ivona <[email protected]>
  • Loading branch information
4 people authored Jan 14, 2022
1 parent 4780750 commit 6a355b2
Show file tree
Hide file tree
Showing 109 changed files with 5,629 additions and 5,432 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
pull_request:
paths:
- '**.php'
- 'phpstan.neon.dist'


jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
14 changes: 6 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ on:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * *'

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1]
laravel: [8.*]
php: [8.1, 8.0]
laravel: [9.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: ^6.23
- laravel: 9.*
testbench: ^7.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

Expand Down Expand Up @@ -54,10 +52,10 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
run: vendor/bin/pest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ phpunit.xml
.env
.phpunit.result.cache
.php-cs-fixer.cache
phpstan.neon
4 changes: 4 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Because there are many breaking changes an upgrade is not that easy. There are many edge cases this guide does not cover. We accept PRs to improve this guide.

## From v9 to v10

Upgrading from v9 to v10 is straightforward. The biggest change is that we dropped support for PHP 7, and are using PHP 8 features.

## From v8 to v9

- add a `json` column `generated_conversions` to the `media` table (take a look at the default migration for the exact definition). You should copy the values you now have in the `generated_conversions` key of the `custom_properties` column to `generated_conversions`
Expand Down
51 changes: 29 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,38 @@
}
],
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",
"ext-exif": "*",
"ext-fileinfo": "*",
"ext-json": "*",
"illuminate/bus": "^8.71",
"illuminate/console": "^8.71",
"illuminate/database": "^8.71",
"illuminate/pipeline": "^8.71",
"illuminate/support": "^8.71",
"illuminate/bus": "^9.0",
"illuminate/console": "^9.0",
"illuminate/database": "^9.0",
"illuminate/pipeline": "^9.0",
"illuminate/support": "^9.0",
"intervention/image": "^2.7",
"league/flysystem": "^1.0.64",
"league/glide": "^1.7",
"maennchen/zipstream-php": "^1.0|^2.0",
"spatie/image": "^1.10.5",
"spatie/temporary-directory": "^1.1|^2.0",
"symfony/console": "^4.4|^5.0"
"laravel/framework": "9.*",
"maennchen/zipstream-php": "^2.0",
"nunomaduro/larastan": "^1.0",
"orchestra/testbench": "7.*",
"phpstan/extension-installer": "^1.1",
"spatie/image": "^2.2",
"spatie/temporary-directory": "^2.0",
"symfony/console": "^6.0"
},
"require-dev": {
"ext-pdo_sqlite": "*",
"ext-zip": "*",
"ext-imagick": "*",
"aws/aws-sdk-php": "^3.133.11",
"doctrine/dbal": "^2.12",
"guzzlehttp/guzzle": "^7.0",
"league/flysystem-aws-s3-v3": "^1.0.23",
"doctrine/dbal": "^2.13",
"guzzlehttp/guzzle": "^7.4",
"league/flysystem-aws-s3-v3": "^2.1",
"mockery/mockery": "^1.4",
"orchestra/testbench": "^5.20|^6.23",
"phpunit/phpunit": "^9.3",
"spatie/laravel-ray": "^1.24",
"spatie/laravel-ray": "^1.28",
"spatie/pdf-to-image": "^2.1",
"spatie/phpunit-snapshot-assertions": "^4.0"
"spatie/phpunit-snapshot-assertions": "^4.2",
"pestphp/pest": "^1.20"
},
"conflict": {
"php-ffmpeg/php-ffmpeg": "<0.6.1"
Expand All @@ -67,8 +69,9 @@
}
},
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"test": "vendor/bin/phpunit"
"test": "vendor/bin/pest"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -83,8 +86,12 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This is the content you should put in `auth.json`:
With the configuration above in place, you'll be able to install the Media Library Pro into your project using this command:

```bash
composer require "spatie/laravel-medialibrary-pro:^1.0.0"
composer require "spatie/laravel-medialibrary-pro:^2.0.0"
```

## Prepare the database
Expand Down
4 changes: 1 addition & 3 deletions docs/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: Requirements
weight: 5
---

Laravel Media Library requires **PHP 7.4+** and **Laravel 7+**.

This package uses `json` columns. MySQL 5.7 or higher is required.
Laravel Media Library requires **PHP 8+** and **Laravel 9+**.

The [exif extension](http://php.net/manual/en/exif.installation.php) is required (on most systems it will be installed by default).
To create derived images **[GD](http://php.net/manual/en/book.image.php)** needs to be installed on your server.
Expand Down
Loading

0 comments on commit 6a355b2

Please sign in to comment.