Skip to content

Commit

Permalink
Merge branch 'master' into fix-no-useless-concat-operator-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirone committed Mar 11, 2024
2 parents 28edf77 + 291fdbf commit 7219dea
Show file tree
Hide file tree
Showing 180 changed files with 2,605 additions and 2,879 deletions.
71 changes: 16 additions & 55 deletions .github/workflows/docker.yml
@@ -1,74 +1,35 @@
name: Create and publish a Docker images
name: Docker

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
branches:
- "master"
pull_request:
paths:
- "compose.yaml"
- "Dockerfile"
- "docker/**"
# Allow running on demand using Github UI
workflow_dispatch:
schedule:
- cron: "0 5 * * *"

jobs:
build-and-push-image:
name: PHP ${{ matrix.php-version }}, Fixer ${{ github.ref_name }}
if: github.repository == 'PHP-CS-Fixer/PHP-CS-Fixer'
docker-compose-build:
name: Compose build PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: '7.4'
alpine-version: '3.16'
- php-version: '8.0'
alpine-version: '3.16'
- php-version: '8.1'
alpine-version: '3.18'
- php-version: '8.2'
alpine-version: '3.18'
- php-version: '8.3'
alpine-version: '3.18'

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Make image lowercase
run: |
echo IMAGE_NAME_LOWER=$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]') >> ${GITHUB_ENV}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
suffix=-php${{ matrix.php-version }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
target: dist
build-args: |
PHP_VERSION=${{ matrix.php-version }}
ALPINE_VERSION=${{ matrix.alpine-version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Docker Compose build
run: docker compose build --no-cache --pull php-${{ matrix.php-version }}
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,74 @@
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker-images:
name: Docker with PHP ${{ matrix.php-version }}, Fixer ${{ github.ref_name }}
if: github.repository == 'PHP-CS-Fixer/PHP-CS-Fixer'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: '7.4'
alpine-version: '3.16'
- php-version: '8.0'
alpine-version: '3.16'
- php-version: '8.1'
alpine-version: '3.18'
- php-version: '8.2'
alpine-version: '3.18'
- php-version: '8.3'
alpine-version: '3.18'

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Make image lowercase
run: |
echo IMAGE_NAME_LOWER=$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]') >> ${GITHUB_ENV}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
suffix=-php${{ matrix.php-version }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
target: dist
build-args: |
PHP_VERSION=${{ matrix.php-version }}
ALPINE_VERSION=${{ matrix.alpine-version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions .php-cs-fixer.php-lowest.php
Expand Up @@ -26,6 +26,8 @@
'src/DocBlock/Annotation.php',
'src/Doctrine/Annotation/Tokens.php',
'src/Tokenizer/Tokens.php',
// @TODO add `mixed` return type to `ExecutorWithoutErrorHandler::execute` when PHP 8.0+ is required and remove the exception from this list
'src/ExecutorWithoutErrorHandler.php',
]);

$config->setRules([
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,51 @@ CHANGELOG for PHP CS Fixer

This file contains changelogs for stable releases only.

Changelog for v3.51.0
---------------------

* chore: add missing tests for non-documentation classes (#7848)
* chore: do not perform type analysis in tests (#7852)
* chore: list over array in more places (#7857)
* chore: tests documentation classes (#7855)
* feat: `@Symfony` - add nullable_type_declaration (#7856)
* test: fix wrong type in param annotation (#7858)

Changelog for v3.50.0
---------------------

* chore: add missing types (#7842)
* chore: BlocksAnalyzer - raise exception on invalid index (#7819)
* chore: DataProviderAnalysis - expect list over array (#7800)
* chore: do not use `@large` on method level (#7832)
* chore: do not use `@medium` on method level (#7833)
* chore: Fix typos (#7835)
* chore: rename variables (#7847)
* chore: some improvements around array typehints (#7799)
* CI: fix PHP 8.4 job (#7829)
* DX: Include `symfony/var-dumper` in dev tools (#7795)
* feat: Ability to remove unused imports from multi-use statements (#7815)
* feat: allow PHPUnit 11 (#7824)
* feat: Allow shortening symbols from multi-use statements (only classes for now) (#7816)
* feat: introduce `PhpdocArrayTypeFixer` (#7812)
* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v11 methods (#7822)
* feat: Support for multi-use statements in `NamespaceUsesAnalyzer` (#7814)
* feat: `MbStrFunctionsFixer` - add support for `mb_trim`, `mb_ltrim` and `mb_rtrim` functions (#7840)
* feat: `NoEmptyPhpdocFixer` - do not leave empty line after removing PHPDoc (#7820)
* feat: `no_superfluous_phpdoc_tags` - introduce `allow_future_params` option (#7743)
* fix: do not use wrongly named arguments in data providers (#7823)
* fix: Ensure PCNTL extension is always installed in Docker (#7782)
* fix: PhpdocListTypeFixer - support key types containing `<…>` (#7817)
* fix: Proper build target for local Docker Compose (#7834)
* fix: union PHPDoc support in `fully_qualified_strict_types` fixer (#7719)
* fix: `ExecutorWithoutErrorHandler` - remove invalid PHP 7.4 type (#7845)
* fix: `fully_qualified_strict_types` must honor template/local type identifiers (#7724)
* fix: `MethodArgumentSpaceFixer` - do not break heredoc/nowdoc (#7828)
* fix: `NumericLiteralSeparatorFixer` - do not change `float` to `int` when there is nothing after the dot (#7805)
* fix: `PhpUnitStrictFixer` - do not crash on property having the name of method to fix (#7804)
* fix: `SingleSpaceAroundConstructFixer` - correctly recognise multiple constants (#7700)
* fix: `TypeExpression` - handle array shape key with dash (#7841)

Changelog for v3.49.0
---------------------

Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:
php-7.4: &php
build:
target: php
target: dev
args:
ALPINE_VERSION: "3.16"
PHP_VERSION: "7.4"
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/composer.json
Expand Up @@ -7,8 +7,8 @@
"mi-schi/phpmd-extension": "^4.3.0",
"phpmd/phpmd": "^2.15.0",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.51",
"phpstan/phpstan-phpunit": "^1.3.15",
"phpstan/phpstan": "^1.10.60",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpstan/phpstan-strict-rules": "^1.5.2"
},
"config": {
Expand Down

0 comments on commit 7219dea

Please sign in to comment.