Skip to content

Commit

Permalink
Test against PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Nov 20, 2024
1 parent a3d45a2 commit 159938e
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 112 deletions.
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ insert_final_newline = true
indent_style = space
indent_size = 4

[{*.yaml,*yml,*.neon}]
[{*.yaml,*.yml,*.neon,*.json}]
indent_size = 2

[*.md]
max_line_length = 100

[{Dockerfile,Makefile}]
indent_style = tab
4 changes: 2 additions & 2 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:

jobs:
phpcs:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ on:
jobs:
phpstan:
name: phpstan
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
ini-values: memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.composer/cache
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:
jobs:
phpunit:
name: phpunit
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.4"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -25,7 +26,7 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.composer/cache
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.composer-attribute-collector
.phpunit.result.cache
vendor
composer.lock
vendor
2 changes: 1 addition & 1 deletion MIGRATION.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Migration
# CHANGELOG

## v1.2 to v2.0

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We accept contributions via Pull Requests.

- **Code style** — We're following a [Coding Standard][]. Check the code style with `make lint`.
- **Code health** — We're using [PHPStan][] to analyse the code, with maximum scrutiny. Check the code with `make lint`.
- **Add tests!** — Your contribution won't be accepted if it doesn't have tests.
- **Add tests!** — Your contribution won't be accepted if it does not have tests.
- **Document any change in behaviour** — Make sure the `README.md` and any other relevant documentation are kept
up-to-date.
- **Consider our release cycle** — We follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not
Expand Down
54 changes: 33 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
ARG PHP_VERSION=8.0
FROM php:${PHP_VERSION}-cli-buster
FROM php:${PHP_VERSION}-cli-bookworm

RUN apt-get update && \
apt-get install -y autoconf pkg-config && \
pecl channel-update pecl.php.net && \
pecl install xdebug && \
docker-php-ext-enable opcache xdebug
RUN <<-EOF
docker-php-ext-enable opcache

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

RUN echo '\
display_errors=On\n\
error_reporting=E_ALL\n\
date.timezone=UTC\n\
' >> /usr/local/etc/php/conf.d/php.ini
RUN <<-EOF
cat <<-SHELL >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
xdebug.client_host=host.docker.internal
xdebug.mode=develop
xdebug.start_with_request=yes
SHELL

cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
display_errors=On
error_reporting=E_ALL
date.timezone=UTC
SHELL
EOF

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN apt-get update && \
apt-get install unzip && \
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
mv composer.phar /usr/local/bin/composer && \
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc
RUN <<-EOF
apt-get update
apt-get install unzip
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
mv composer.phar /usr/local/bin/composer
cat <<-SHELL >> /root/.bashrc
export PATH="$HOME/.composer/vendor/bin:$PATH"
SHELL
EOF

RUN composer global require squizlabs/php_codesniffer
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# customization

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

# do not edit the following lines
Expand Down Expand Up @@ -37,8 +36,8 @@ test-container: test-container80

.PHONY: test-container80
test-container80:
@-docker-compose run --rm app80 bash
@docker-compose down -v
@-docker compose run --rm app80 bash
@docker compose down -v

.PHONY: test-container81
test-container81:
Expand All @@ -47,8 +46,13 @@ test-container81:

.PHONY: test-container82
test-container82:
@-docker-compose run --rm app82 bash
@docker-compose down -v
@-docker compose run --rm app82 bash
@docker compose down -v

.PHONY: test-container84
test-container84:
@-docker compose run --rm app84 bash
@docker compose down -v

.PHONY: lint
lint:
Expand Down
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# composer-attribute-collector

[![Packagist](https://img.shields.io/packagist/v/olvlvl/composer-attribute-collector.svg)](https://packagist.org/packages/olvlvl/composer-attribute-collector)
[![Code Quality](https://img.shields.io/scrutinizer/g/olvlvl/composer-attribute-collector.svg)](https://scrutinizer-ci.com/g/olvlvl/composer-attribute-collector)
[![Code Coverage](https://img.shields.io/coveralls/olvlvl/composer-attribute-collector.svg)](https://coveralls.io/r/olvlvl/composer-attribute-collector)
[![Downloads](https://img.shields.io/packagist/dt/olvlvl/composer-attribute-collector.svg)](https://packagist.org/packages/olvlvl/composer-attribute-collector)
[![Release](https://img.shields.io/packagist/v/icanboogie/<name>.svg)](https://packagist.org/packages/icanboogie/<name>)
[![Code Coverage](https://coveralls.io/repos/github/ICanBoogie/<Name>/badge.svg?branch=6.0)](https://coveralls.io/r/ICanBoogie/<Name>?branch=6.0)
[![Downloads](https://img.shields.io/packagist/dt/icanboogie/<name>.svg)](https://packagist.org/packages/icanboogie/<name>)

composer-attribute-collector is a plugin for [Composer][]. Its ambition is to provide a convenient
way—and near zero cost—to retrieve targets of PHP 8 attributes. After the autoloader has been
Expand Down Expand Up @@ -280,30 +279,24 @@ enable caching and speed up consecutive runs.

## Continuous Integration

The project is continuously tested by [GitHub actions](https://github.com/olvlvl/composer-attribute-collector/actions).
The project is continuously tested by [GitHub actions](https://github.com/ICanBoogie/<Name>/actions).

[![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)
[![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)
[![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)
[![Tests](https://github.com/ICanBoogie/<Name>/actions/workflows/test.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/<Name>/actions/workflows/test.yml)
[![Static Analysis](https://github.com/ICanBoogie/<Name>/actions/workflows/static-analysis.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/<Name>/actions/workflows/static-analysis.yml)
[![Code Style](https://github.com/ICanBoogie/<Name>/actions/workflows/code-style.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/<Name>/actions/workflows/code-style.yml)



## Code of Conduct

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



## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.



## License

**olvlvl/composer-attribute-collector** is released under the [BSD-3-Clause](LICENSE).
See [CONTRIBUTING](CONTRIBUTING.md) for details.



Expand Down
96 changes: 48 additions & 48 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
{
"name": "olvlvl/composer-attribute-collector",
"type": "composer-plugin",
"description": "A convenient and near zero-cost way to retrieve targets of PHP 8 attributes",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Olivier Laviale",
"email": "[email protected]",
"homepage": "https://olvlvl.com/",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"olvlvl\\ComposerAttributeCollector\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"tests\\olvlvl\\ComposerAttributeCollector\\": "tests",
"Acme\\": "tests/Acme",
"Acme81\\": "tests/Acme81"
},
"classmap": [
"tests/Acme/ClassMap"
]
},
"config": {
"sort-packages": true
},
"require": {
"php": ">=8.0",
"composer-plugin-api": "^2.0"
},
"require-dev": {
"composer/composer": ">=2.4",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5"
"name": "olvlvl/composer-attribute-collector",
"type": "composer-plugin",
"description": "A convenient and near zero-cost way to retrieve targets of PHP 8 attributes",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Olivier Laviale",
"email": "[email protected]",
"homepage": "https://olvlvl.com/",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"olvlvl\\ComposerAttributeCollector\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"tests\\olvlvl\\ComposerAttributeCollector\\": "tests",
"Acme\\": "tests/Acme",
"Acme81\\": "tests/Acme81"
},
"extra": {
"class": "olvlvl\\ComposerAttributeCollector\\Plugin",
"composer-attribute-collector": {
"include": [
"tests"
],
"exclude": [
"tests/Acme/PSR4/IncompatibleSignature.php"
]
}
"classmap": [
"tests/Acme/ClassMap"
]
},
"config": {
"sort-packages": true
},
"require": {
"php": ">=8.0",
"composer-plugin-api": "^2.0"
},
"require-dev": {
"composer/composer": ">=2.4",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5"
},
"extra": {
"class": "olvlvl\\ComposerAttributeCollector\\Plugin",
"composer-attribute-collector": {
"include": [
"tests"
],
"exclude": [
"tests/Acme/PSR4/IncompatibleSignature.php"
]
}
}
}
24 changes: 17 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
version: "3.2"
services:
app80:
build:
context: .
args:
PHP_VERSION: '8.0'
environment:
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
app81:
build:
Expand All @@ -29,8 +28,19 @@ services:
args:
PHP_VERSION: '8.2'
environment:
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
app84:
build:
context: .
args:
PHP_VERSION: '8.4.0RC4'
environment:
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<exclude-pattern>tests/sandbox/*</exclude-pattern>
<exclude-pattern>tests/sandbox-memoize-classmap/*</exclude-pattern>

<arg name="colors"/>
<arg name="colors"/>

<rule ref="PSR1">
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
Expand Down
Loading

0 comments on commit 159938e

Please sign in to comment.