From bec64be0b3494551a9d23a337cdd664c553728aa Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 22 Dec 2025 15:17:33 +0100 Subject: [PATCH] feat!: upgrade for php 8.5 Signed-off-by: Emilien Escalle --- .devcontainer/devcontainer.json | 30 +++++++ .github/dependabot.yml | 20 +++++ .github/workflows/__shared-ci.yml | 6 +- .github/workflows/greetings.yml | 2 +- .github/workflows/main-ci.yml | 90 ++++++--------------- .github/workflows/need-fix-to-issue.yml | 2 +- .github/workflows/prepare-release.yml | 22 +++++ .github/workflows/semantic-pull-request.yml | 3 +- .github/workflows/stale.yml | 2 +- Makefile | 5 +- README.md | 12 +-- src/CssLint/LintConfiguration.php | 2 +- 12 files changed, 111 insertions(+), 85 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/prepare-release.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..35e1d43 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "name": "Debian", + "image": "mcr.microsoft.com/devcontainers/base:bullseye", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "remoteEnv": { + "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}" + }, + "customizations": { + "vscode": { + "extensions": [ + "eamodio.gitlens", + "github.copilot", + "github.copilot-chat", + "github.vscode-github-actions", + "ms-vscode.makefile-tools", + "bmewburn.vscode-intelephense-client", + "calebporzio.better-phpunit" + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh" + }, + "mcp": { + "servers": {} + } + } + } +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 315788e..bdcd0fe 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,6 +13,18 @@ updates: dev-dependencies: dependency-type: development + - package-ecosystem: "docker" + open-pull-requests-limit: 20 + directory: "/" + schedule: + interval: "weekly" + day: friday + time: "04:00" + groups: + docker-dependencies: + patterns: + - "*" + - package-ecosystem: github-actions directory: "/" schedule: @@ -23,3 +35,11 @@ updates: github-actions-dependencies: patterns: - "*" + + - package-ecosystem: "devcontainers" + open-pull-requests-limit: 20 + directory: "/" + schedule: + interval: weekly + day: friday + time: "04:00" diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 3b0115a..97aea07 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -7,20 +7,18 @@ permissions: {} jobs: checks: + runs-on: ubuntu-latest permissions: contents: read id-token: write - strategy: matrix: include: - - php-versions: "8.1" - php-versions: "8.2" - php-versions: "8.3" - php-versions: "8.4" + - php-versions: "8.5" stable: true - - runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 17f17f5..1e0d330 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -10,7 +10,7 @@ permissions: {} jobs: greetings: - uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@b17226e57c8ef31f860719766656ebb6df017218 # 0.31.6 permissions: contents: read issues: write diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 146dd02..49bf5fd 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -20,73 +20,32 @@ jobs: id-token: write secrets: inherit - docs-generate-site: - runs-on: ubuntu-latest - needs: ci - permissions: - contents: read - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - - - run: | - mkdir -p ./_site - - echo -e "theme: jekyll-theme-cayman" > ./_site/_config.yml - - to_title_case() { - echo "$1" | awk '{ - for (i=1; i<=NF; i++) { - $i = toupper(substr($i, 1, 1)) tolower(substr($i, 2)) - } - print - }' - } - - create_site_page() { - page="$1" - title="$(to_title_case "$2")" - content_path="$3" - echo -e "---\nlayout: default\ntitle: $title\n---\n" > "$page" - echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" "$content_path")" >> "$page" - } - - create_site_page "./_site/index.md" "Home" "./README.md" - - for filepath in ./docs/*.md; do - filename=$(basename -- "$filepath") - section="${filename%.*}" - mkdir -p "./_site/$section" - create_site_page "./_site/$section/index.md" "$section" "$filepath" - done - - - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: docs-site - path: ./_site - docs-generate-phpdoc: runs-on: ubuntu-latest needs: ci - permissions: - contents: read + container: phpdoc/phpdoc:3 + env: + ARTIFACT_PATH: ./_site + outputs: + artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }} + artifact-path: ${{ env.ARTIFACT_PATH }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: 📃 Generate PHP documentation - run: docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -d ./src -t ./_site/phpdoc + run: phpdoc run -d ./src -t $ARTIFACT_PATH/phpdoc - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + id: upload-artifact with: name: docs-phpdoc - path: ./_site + path: ${{ env.ARTIFACT_PATH }} docs-publish: name: Publish documentation - needs: [docs-generate-site, docs-generate-phpdoc] + needs: docs-generate-phpdoc runs-on: ubuntu-latest permissions: pages: write @@ -95,24 +54,23 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: - pattern: "docs-*" - path: ./ - merge-multiple: true - - - name: ⚙️ Setup Pages - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + persist-credentials: false - - name: Build with Jekyll - uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13 + - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: - source: ./ - destination: ./_site + artifact-ids: ${{ needs.docs-generate-phpdoc.outputs.artifact-id }} + path: ${{ needs.docs-generate-phpdoc.outputs.artifact-path }} - - name: Upload artifact - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 + - uses: hoverkraft-tech/ci-github-publish/actions/deploy/jekyll@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1 + id: build + with: + site-path: ${{ needs.docs-generate-phpdoc.outputs.artifact-path }} + pages: | + ./docs/*.md - - name: 🚀 Deploy to GitHub Pages + - uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1 id: deployment - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + with: + build-path: ${{ steps.build.outputs.build-path }} diff --git a/.github/workflows/need-fix-to-issue.yml b/.github/workflows/need-fix-to-issue.yml index fe26fdb..66fdb3e 100644 --- a/.github/workflows/need-fix-to-issue.yml +++ b/.github/workflows/need-fix-to-issue.yml @@ -17,7 +17,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@0.31.6 permissions: contents: read issues: write diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..f94c125 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,22 @@ +--- +name: "Prepare release" + +on: + push: + branches: [main] + pull_request: + types: [opened, reopened, synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + release: + uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1 + permissions: + contents: write + id-token: write + pull-requests: write diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index cb57e34..234c948 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -1,4 +1,3 @@ ---- name: "Pull Request - Semantic Lint" on: @@ -12,7 +11,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@b17226e57c8ef31f860719766656ebb6df017218 # 0.31.6 permissions: contents: write pull-requests: write diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 207d3d3..8a99175 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@0.31.6 permissions: issues: write pull-requests: write diff --git a/Makefile b/Makefile index 6e7f333..786fb50 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PHP_VERSION=8.4 +PHP_VERSION=8.5 PROJECT_NAME=$(shell basename $(CURDIR)) UID=$(shell id -u) GID=$(shell id -g) @@ -58,8 +58,7 @@ phpstan: ## Execute PHPStan for given PHP version @$(call run-php,composer phpstan -- $(filter-out $@,$(MAKECMDGOALS))) ci: ## Execute CI scripts for given PHP version - $(MAKE) build-php - $(MAKE) install + $(MAKE) setup @$(call run-php,composer ci -- $(filter-out $@,$(MAKECMDGOALS))) generate-css-referentials: ## Generate referentials for given PHP version diff --git a/README.md b/README.md index 2dfc17e..3ac5e8b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ 📢 **Php CSS Lint** is a php script that lint css files and strings. It supports [W3C](https://www.w3.org/Style/CSS/) and [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS) CSS specifications. -``` +```txt =========================================================== ____ _ ____ ____ ____ _ _ _ @@ -40,8 +40,8 @@ It supports [W3C](https://www.w3.org/Style/CSS/) and [MDN](https://developer.moz # Documentation -1. [Installation](https://neilime.github.io/php-css-lint/installation) -2. [Usage](https://neilime.github.io/php-css-lint/usage) -3. [Code Coverage](https://codecov.io/gh/neilime/php-css-lint) -4. [PHP Doc](https://neilime.github.io/php-css-lint/phpdoc) -5. [Development](https://neilime.github.io/php-css-lint/development) +1. [Installation](./docs/installation.md) +2. [Usage](./docs/usage.md) +3. [Development](./docs/development.md) +4. [Code Coverage](https://codecov.io/gh/neilime/php-css-lint) +5. [PHP Doc](https://neilime.github.io/php-css-lint/phpdoc) diff --git a/src/CssLint/LintConfiguration.php b/src/CssLint/LintConfiguration.php index 9d79c77..be3aef4 100644 --- a/src/CssLint/LintConfiguration.php +++ b/src/CssLint/LintConfiguration.php @@ -139,7 +139,7 @@ public function propertyExists(string $property): bool $property ); - if ($propertyWithoutConstructor !== $property) { + if ($propertyWithoutConstructor && $propertyWithoutConstructor !== $property) { if (!empty($this->propertiesStandards[$propertyWithoutConstructor])) { return true; }