Skip to content

Commit c801e21

Browse files
committed
Test against PHP 8.4
1 parent a3d45a2 commit c801e21

15 files changed

+137
-110
lines changed

.editorconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@ insert_final_newline = true
88
indent_style = space
99
indent_size = 4
1010

11-
[{*.yaml,*yml,*.neon}]
11+
[{*.yaml,*.yml,*.neon,*.json}]
1212
indent_size = 2
13+
14+
[*.md]
15+
max_line_length = 100
16+
17+
[{Dockerfile,Makefile}]
18+
indent_style = tab

.github/workflows/code-style.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66

77
jobs:
88
phpcs:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
- name: Install PHP
1414
uses: shivammathur/setup-php@v2
1515
with:

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ on:
77
jobs:
88
phpstan:
99
name: phpstan
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
- name: Install PHP
1515
uses: shivammathur/setup-php@v2
1616
with:
1717
php-version: "8.0"
1818
ini-values: memory_limit=-1
1919
tools: composer:v2
2020
- name: Cache dependencies
21-
uses: actions/cache@v2
21+
uses: actions/cache@v4
2222
with:
2323
path: |
2424
~/.composer/cache

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ on:
77
jobs:
88
phpunit:
99
name: phpunit
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
1313
php-version:
1414
- "8.0"
1515
- "8.1"
1616
- "8.2"
17+
- "8.4"
1718
steps:
1819
- name: Checkout
19-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2021
- name: Install PHP
2122
uses: shivammathur/setup-php@v2
2223
with:
@@ -25,7 +26,7 @@ jobs:
2526
ini-values: memory_limit=-1
2627
tools: composer:v2
2728
- name: Cache dependencies
28-
uses: actions/cache@v2
29+
uses: actions/cache@v4
2930
with:
3031
path: |
3132
~/.composer/cache

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.composer-attribute-collector
22
.phpunit.result.cache
3-
vendor
43
composer.lock
4+
vendor

MIGRATION.md renamed to CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Migration
1+
# CHANGELOG
22

33
## v1.2 to v2.0
44

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We accept contributions via Pull Requests.
88

99
- **Code style** — We're following a [Coding Standard][]. Check the code style with `make lint`.
1010
- **Code health** — We're using [PHPStan][] to analyse the code, with maximum scrutiny. Check the code with `make lint`.
11-
- **Add tests!** — Your contribution won't be accepted if it doesn't have tests.
11+
- **Add tests!** — Your contribution won't be accepted if it does not have tests.
1212
- **Document any change in behaviour** — Make sure the `README.md` and any other relevant documentation are kept
1313
up-to-date.
1414
- **Consider our release cycle** — We follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not

Dockerfile

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,42 @@
11
ARG PHP_VERSION=8.0
2-
FROM php:${PHP_VERSION}-cli-buster
2+
FROM php:${PHP_VERSION}-cli-bookworm
33

4-
RUN apt-get update && \
5-
apt-get install -y autoconf pkg-config && \
6-
pecl channel-update pecl.php.net && \
7-
pecl install xdebug && \
8-
docker-php-ext-enable opcache xdebug
4+
RUN <<-EOF
5+
docker-php-ext-enable opcache
96

10-
RUN echo '\
11-
xdebug.client_host=host.docker.internal\n\
12-
xdebug.mode=develop\n\
13-
xdebug.start_with_request=yes\n\
14-
' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
7+
if [ "$PHP_VERSION" \< "8.4" ]; then
8+
apt-get update
9+
apt-get install -y autoconf pkg-config
10+
pecl channel-update pecl.php.net
11+
pecl install xdebug
12+
docker-php-ext-enable xdebug
13+
fi
14+
EOF
1515

16-
RUN echo '\
17-
display_errors=On\n\
18-
error_reporting=E_ALL\n\
19-
date.timezone=UTC\n\
20-
' >> /usr/local/etc/php/conf.d/php.ini
16+
RUN <<-EOF
17+
cat <<-SHELL >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
18+
xdebug.client_host=host.docker.internal
19+
xdebug.mode=develop
20+
xdebug.start_with_request=yes
21+
SHELL
22+
23+
cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
24+
display_errors=On
25+
error_reporting=E_ALL
26+
date.timezone=UTC
27+
SHELL
28+
EOF
2129

2230
ENV COMPOSER_ALLOW_SUPERUSER 1
2331

24-
RUN apt-get update && \
25-
apt-get install unzip && \
26-
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
27-
mv composer.phar /usr/local/bin/composer && \
28-
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc
32+
RUN <<-EOF
33+
apt-get update
34+
apt-get install unzip
35+
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
36+
mv composer.phar /usr/local/bin/composer
37+
cat <<-SHELL >> /root/.bashrc
38+
export PATH="$HOME/.composer/vendor/bin:$PATH"
39+
SHELL
40+
EOF
2941

3042
RUN composer global require squizlabs/php_codesniffer

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# customization
22

3-
PACKAGE_NAME = olvlvl/composer-attribute-collector
43
PHPUNIT = vendor/bin/phpunit
54

65
# do not edit the following lines
@@ -37,8 +36,8 @@ test-container: test-container80
3736

3837
.PHONY: test-container80
3938
test-container80:
40-
@-docker-compose run --rm app80 bash
41-
@docker-compose down -v
39+
@-docker compose run --rm app80 bash
40+
@docker compose down -v
4241

4342
.PHONY: test-container81
4443
test-container81:
@@ -47,8 +46,13 @@ test-container81:
4746

4847
.PHONY: test-container82
4948
test-container82:
50-
@-docker-compose run --rm app82 bash
51-
@docker-compose down -v
49+
@-docker compose run --rm app82 bash
50+
@docker compose down -v
51+
52+
.PHONY: test-container84
53+
test-container84:
54+
@-docker compose run --rm app84 bash
55+
@docker compose down -v
5256

5357
.PHONY: lint
5458
lint:

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# composer-attribute-collector
22

3-
[![Packagist](https://img.shields.io/packagist/v/olvlvl/composer-attribute-collector.svg)](https://packagist.org/packages/olvlvl/composer-attribute-collector)
4-
[![Code Quality](https://img.shields.io/scrutinizer/g/olvlvl/composer-attribute-collector.svg)](https://scrutinizer-ci.com/g/olvlvl/composer-attribute-collector)
5-
[![Code Coverage](https://img.shields.io/coveralls/olvlvl/composer-attribute-collector.svg)](https://coveralls.io/r/olvlvl/composer-attribute-collector)
3+
[![Release](https://img.shields.io/packagist/v/olvlvl/composer-attribute-collector.svg)](https://packagist.org/packages/olvlvl/composer-attribute-collector)
4+
[![Code Coverage](https://coveralls.io/repos/github/olvlvl/composer-attribute-collector/badge.svg?branch=main)](https://coveralls.io/r/olvlvl/composer-attribute-collector?branch=main)
65
[![Downloads](https://img.shields.io/packagist/dt/olvlvl/composer-attribute-collector.svg)](https://packagist.org/packages/olvlvl/composer-attribute-collector)
76

87
composer-attribute-collector is a plugin for [Composer][]. Its ambition is to provide a convenient
@@ -282,28 +281,22 @@ enable caching and speed up consecutive runs.
282281

283282
The project is continuously tested by [GitHub actions](https://github.com/olvlvl/composer-attribute-collector/actions).
284283

285-
[![Tests](https://github.com/olvlvl/composer-attribute-collector/workflows/test/badge.svg?branch=main)](https://github.com/olvlvl/composer-attribute-collector/actions?query=workflow%3Atest)
286-
[![Static Analysis](https://github.com/olvlvl/composer-attribute-collector/workflows/static-analysis/badge.svg?branch=main)](https://github.com/olvlvl/composer-attribute-collector/actions?query=workflow%3Astatic-analysis)
287-
[![Code Style](https://github.com/olvlvl/composer-attribute-collector/workflows/code-style/badge.svg?branch=main)](https://github.com/olvlvl/composer-attribute-collector/actions?query=workflow%3Acode-style)
284+
[![Tests](https://github.com/olvlvl/composer-attribute-collector/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/olvlvl/composer-attribute-collector/actions/workflows/test.yml)
285+
[![Static Analysis](https://github.com/olvlvl/composer-attribute-collector/actions/workflows/static-analysis.yml/badge.svg?branch=main)](https://github.com/olvlvl/composer-attribute-collector/actions/workflows/static-analysis.yml)
286+
[![Code Style](https://github.com/olvlvl/composer-attribute-collector/actions/workflows/code-style.yml/badge.svg?branch=main)](https://github.com/olvlvl/composer-attribute-collector/actions/workflows/code-style.yml)
288287

289288

290289

291290
## Code of Conduct
292291

293292
This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in
294-
this project and its community, you are expected to uphold this code.
293+
this project and its community, you're expected to uphold this code.
295294

296295

297296

298297
## Contributing
299298

300-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
301-
302-
303-
304-
## License
305-
306-
**olvlvl/composer-attribute-collector** is released under the [BSD-3-Clause](LICENSE).
299+
See [CONTRIBUTING](CONTRIBUTING.md) for details.
307300

308301

309302

composer.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
{
2-
"name": "olvlvl/composer-attribute-collector",
3-
"type": "composer-plugin",
4-
"description": "A convenient and near zero-cost way to retrieve targets of PHP 8 attributes",
5-
"license": "BSD-3-Clause",
6-
"authors": [
7-
{
8-
"name": "Olivier Laviale",
9-
"email": "olivier.laviale@gmail.com",
10-
"homepage": "https://olvlvl.com/",
11-
"role": "Developer"
12-
}
13-
],
14-
"autoload": {
15-
"psr-4": {
16-
"olvlvl\\ComposerAttributeCollector\\": "src"
17-
}
18-
},
19-
"autoload-dev": {
20-
"psr-4": {
21-
"tests\\olvlvl\\ComposerAttributeCollector\\": "tests",
22-
"Acme\\": "tests/Acme",
23-
"Acme81\\": "tests/Acme81"
24-
},
25-
"classmap": [
26-
"tests/Acme/ClassMap"
27-
]
28-
},
29-
"config": {
30-
"sort-packages": true
31-
},
32-
"require": {
33-
"php": ">=8.0",
34-
"composer-plugin-api": "^2.0"
35-
},
36-
"require-dev": {
37-
"composer/composer": ">=2.4",
38-
"phpstan/phpstan": "^1.9",
39-
"phpunit/phpunit": "^9.5"
2+
"name": "olvlvl/composer-attribute-collector",
3+
"type": "composer-plugin",
4+
"description": "A convenient and near zero-cost way to retrieve targets of PHP 8 attributes",
5+
"license": "BSD-3-Clause",
6+
"authors": [
7+
{
8+
"name": "Olivier Laviale",
9+
"email": "olivier.laviale@gmail.com",
10+
"homepage": "https://olvlvl.com/",
11+
"role": "Developer"
12+
}
13+
],
14+
"autoload": {
15+
"psr-4": {
16+
"olvlvl\\ComposerAttributeCollector\\": "src"
17+
}
18+
},
19+
"autoload-dev": {
20+
"psr-4": {
21+
"tests\\olvlvl\\ComposerAttributeCollector\\": "tests",
22+
"Acme\\": "tests/Acme",
23+
"Acme81\\": "tests/Acme81"
4024
},
41-
"extra": {
42-
"class": "olvlvl\\ComposerAttributeCollector\\Plugin",
43-
"composer-attribute-collector": {
44-
"include": [
45-
"tests"
46-
],
47-
"exclude": [
48-
"tests/Acme/PSR4/IncompatibleSignature.php"
49-
]
50-
}
25+
"classmap": [
26+
"tests/Acme/ClassMap"
27+
]
28+
},
29+
"config": {
30+
"sort-packages": true
31+
},
32+
"require": {
33+
"php": ">=8.0",
34+
"composer-plugin-api": "^2.0"
35+
},
36+
"require-dev": {
37+
"composer/composer": ">=2.4",
38+
"phpstan/phpstan": "^1.9",
39+
"phpunit/phpunit": "^9.5"
40+
},
41+
"extra": {
42+
"class": "olvlvl\\ComposerAttributeCollector\\Plugin",
43+
"composer-attribute-collector": {
44+
"include": [
45+
"tests"
46+
],
47+
"exclude": [
48+
"tests/Acme/PSR4/IncompatibleSignature.php"
49+
]
5150
}
51+
}
5252
}

docker-compose.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
2-
version: "3.2"
32
services:
43
app80:
54
build:
65
context: .
76
args:
87
PHP_VERSION: '8.0'
98
environment:
10-
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
9+
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
1110
volumes:
12-
- .:/app:delegated
13-
- ~/.composer:/root/.composer:delegated
11+
- .:/app:delegated
12+
- ~/.composer:/root/.composer:delegated
1413
working_dir: /app
1514
app81:
1615
build:
@@ -29,8 +28,19 @@ services:
2928
args:
3029
PHP_VERSION: '8.2'
3130
environment:
32-
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
31+
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
3332
volumes:
34-
- .:/app:delegated
35-
- ~/.composer:/root/.composer:delegated
33+
- .:/app:delegated
34+
- ~/.composer:/root/.composer:delegated
35+
working_dir: /app
36+
app84:
37+
build:
38+
context: .
39+
args:
40+
PHP_VERSION: '8.4.0RC4'
41+
environment:
42+
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
43+
volumes:
44+
- .:/app:delegated
45+
- ~/.composer:/root/.composer:delegated
3646
working_dir: /app

phpcs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<exclude-pattern>tests/sandbox/*</exclude-pattern>
77
<exclude-pattern>tests/sandbox-memoize-classmap/*</exclude-pattern>
88

9-
<arg name="colors"/>
9+
<arg name="colors"/>
1010

1111
<rule ref="PSR1">
1212
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>

0 commit comments

Comments
 (0)