Skip to content

Commit 3be3343

Browse files
authored
Merge pull request #427 from thephpleague/3.x
3.x
2 parents b8e946d + c8847e0 commit 3be3343

File tree

112 files changed

+3594
-1562
lines changed

Some content is hidden

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

112 files changed

+3594
-1562
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.{yml,yaml}]
14+
indent_size = 2
15+
16+
[*.neon]
17+
indent_style = tab

.gitattributes

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
/.github export-ignore
44
/.gitattributes export-ignore
55
/.gitignore export-ignore
6-
/.php_cs.dist export-ignore
6+
/.editorconfig export-ignore
7+
/.php-cs-fixer.dist.php export-ignore
8+
/CHANGELOG.md export-ignore
9+
/CONTRIBUTING.md export-ignore
10+
/Dockerfile export-ignore
11+
/docker-compose.yml export-ignore
712
/docs export-ignore
13+
/phpstan.neon export-ignore
814
/phpunit.xml.dist export-ignore
9-
/psalm.xml export-ignore
1015
/psalm-baseline.xml export-ignore
16+
/psalm.xml export-ignore
1117
/tests export-ignore
12-
/CHANGELOG.md export-ignore
13-
/CONTRIBUTING.md export-ignore

.github/workflows/test.yaml

Lines changed: 73 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,84 @@
11
name: glide
22

33
on:
4-
pull_request: ~
5-
push:
6-
branches:
7-
- master
4+
pull_request: ~
5+
push:
6+
branches:
7+
- master
88

99
jobs:
10-
coding-style:
11-
runs-on: ubuntu-22.04
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: '7.4'
17-
extensions: gd, imagick
18-
- name: php-cs-fixer
19-
run: |
20-
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.4/php-cs-fixer.phar -q
21-
php php-cs-fixer.phar fix --dry-run --diff
10+
tests:
11+
runs-on: ubuntu-22.04
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php-version: ['8.1', '8.2', '8.3', '8.4']
16+
dependencies: [highest]
17+
include:
18+
- php-version: '8.1'
19+
dependencies: lowest
20+
steps:
21+
- uses: actions/checkout@v4
2222

23-
tests:
24-
runs-on: ubuntu-22.04
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
29-
prefer-lowest: ['']
30-
include:
31-
- php-version: '7.2'
32-
prefer-lowest: 'prefer-lowest'
33-
steps:
34-
- uses: actions/checkout@v4
23+
- uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
extensions: gd, imagick
27+
coverage: pcov
3528

36-
- uses: shivammathur/setup-php@v2
37-
with:
38-
php-version: ${{ matrix.php-version }}
39-
extensions: gd, imagick
40-
coverage: pcov
29+
- name: Composer install
30+
uses: ramsey/composer-install@v3
31+
with:
32+
dependency-versions: ${{ matrix.dependencies }}
4133

42-
- name: Composer
43-
run: |
44-
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
45-
composer update --no-interaction --no-ansi --no-progress --prefer-lowest
46-
else
47-
composer update --no-interaction --no-ansi --no-progress
48-
fi
34+
- name: PHPUnit
35+
run: |
36+
if [[ ${{ matrix.php-version }} == '8.3' ]]; then
37+
vendor/bin/phpunit --display-incomplete --display-skipped --display-deprecations --display-phpunit-deprecations --coverage-clover=coverage.xml
38+
else
39+
vendor/bin/phpunit
40+
fi
4941
50-
- name: PHPUnit
51-
run: |
52-
if [[ ${{ matrix.php-version }} == '8.3' ]]; then
53-
vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
54-
else
55-
vendor/bin/phpunit
56-
fi
42+
- name: Code Coverage Report
43+
if: matrix.php-version == '8.3'
44+
uses: codecov/codecov-action@v3
5745

58-
- name: Code Coverage Report
59-
if: matrix.php-version == '8.3'
60-
uses: codecov/codecov-action@v3
46+
coding-style:
47+
runs-on: ubuntu-22.04
48+
steps:
49+
- uses: actions/checkout@v4
6150

62-
psalm:
63-
runs-on: ubuntu-22.04
64-
steps:
65-
- uses: actions/checkout@v4
66-
- uses: shivammathur/setup-php@v2
67-
with:
68-
php-version: '8.3'
69-
extensions: gd, imagick
70-
tools: vimeo/psalm:5
71-
- name: psalm
72-
run: |
73-
composer update --no-interaction --no-ansi --no-progress
74-
psalm --output-format=github
51+
- uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: '8.3'
54+
extensions: gd, imagick
55+
56+
- name: Composer install
57+
uses: ramsey/composer-install@v3
58+
59+
- name: php-cs-fixer
60+
run: |
61+
vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
62+
63+
static-analysis:
64+
runs-on: ubuntu-22.04
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: shivammathur/setup-php@v2
69+
with:
70+
php-version: '8.3'
71+
extensions: gd, imagick
72+
tools: vimeo/psalm:5, phpstan:2
73+
74+
- name: Composer install
75+
uses: ramsey/composer-install@v3
76+
77+
- name: psalm
78+
run: |
79+
psalm --output-format=github
80+
81+
- name: phpstan
82+
if: always()
83+
run: |
84+
phpstan --error-format=github

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
build
22
vendor
33
docs/_site
4-
.php_cs.cache
4+
.php-cs-fixer.cache
55
.phpunit.result.cache
6+
.phpunit.cache
67
composer.lock
8+
.history

.php-cs-fixer.dist.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in('src')
5+
->in('tests')
6+
;
7+
8+
return (new PhpCsFixer\Config())
9+
->setRules([
10+
'@Symfony' => true,
11+
'declare_strict_types' => true,
12+
'phpdoc_annotation_without_dot' => false,
13+
'nullable_type_declaration_for_default_null_value' => [
14+
'use_nullable_type_declaration' => true,
15+
],
16+
'phpdoc_to_comment' => [
17+
'ignored_tags' => ['psalm-suppress', 'phpstan-ignore-line', 'phpstan-ignore-next-line'],
18+
],
19+
])
20+
->setFinder($finder)
21+
;

.php_cs.dist

Lines changed: 0 additions & 13 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,30 @@ We accept contributions via Pull Requests on [Github](https://github.com/thephpl
1717
## Running Tests
1818

1919
``` bash
20-
$ phpunit
20+
## Local environment
21+
$ ./vendor/bin/phpunit
22+
23+
## Docker
24+
$ docker compose run --rm tests
25+
```
26+
## Statis Analysis
27+
28+
``` bash
29+
## Local environment
30+
$ ./vendor/bin/phpstan
31+
32+
## Docker
33+
$ docker compose run --rm analysis
34+
```
35+
36+
## Code standards
37+
38+
``` bash
39+
## Local environment
40+
$ ./vendor/bin/php-cs-fixer fix --allow-risky=yes
41+
42+
## Docker
43+
$ docker compose run --rm cs
2144
```
2245

2346
**Happy coding**!

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM php:8.1-cli
2+
3+
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
4+
5+
# install dependencies
6+
RUN apt update && apt install -y --no-install-recommends \
7+
libexif-dev \
8+
git \
9+
unzip \
10+
zip
11+
12+
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
13+
14+
# install composer
15+
COPY --from=composer /usr/bin/composer /usr/bin/composer
16+
17+
# Install PHP extensions
18+
RUN install-php-extensions zip gd imagick exif xdebug

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Glide is a wonderfully easy on-demand image manipulation library written in PHP.
1919
- Adjust, resize and add effects to images using a simple HTTP based API.
2020
- Manipulated images are automatically cached and served with far-future expires headers.
2121
- Create your own image processing server or integrate Glide directly into your app.
22-
- Supports both the [GD](http://php.net/manual/en/book.image.php) library and the [Imagick](http://php.net/manual/en/book.imagick.php) PHP extension.
22+
- Supports the [GD](http://php.net/manual/en/book.image.php) library, the [Imagick](http://php.net/manual/en/book.imagick.php) PHP extension and [libvips](https://github.com/libvips/php-vips) PHP extension.
2323
- Supports many response methods, including PSR-7, HttpFoundation and more.
2424
- Ability to secure image URLs using HTTP signatures.
2525
- Works with many different file systems, thanks to the [Flysystem](http://flysystem.thephpleague.com/) library.

composer.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,25 @@
2626
}
2727
],
2828
"require": {
29-
"php": "^7.2|^8.0",
30-
"intervention/image": "^2.7",
31-
"league/flysystem": "^2.0|^3.0",
29+
"php": "^8.1",
30+
"intervention/image": "^3.9.1",
31+
"league/flysystem": "^3.0",
3232
"psr/http-message": "^1.0|^2.0"
3333
},
3434
"require-dev": {
35-
"mockery/mockery": "^1.3.3",
36-
"phpunit/phpunit": "^8.5|^9.0",
37-
"phpunit/php-token-stream": "^3.1|^4.0"
35+
"mockery/mockery": "^1.6",
36+
"phpunit/phpunit": "^10.5 || ^11.0",
37+
"friendsofphp/php-cs-fixer": "^3.48",
38+
"phpstan/phpstan": "^2.0"
3839
},
3940
"autoload": {
4041
"psr-4": {
4142
"League\\Glide\\": "src/"
4243
}
44+
},
45+
"autoload-dev": {
46+
"psr-4": {
47+
"League\\Glide\\": "tests/"
48+
}
4349
}
4450
}

0 commit comments

Comments
 (0)