Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
1d761ac
Remove Travis CI badge from README
szepeviktor Apr 9, 2023
a18d415
fix named arg w json_decode to be consistent with php
dpi Dec 27, 2023
e75af75
[PHP 8.4] Fixes for implicit nullability deprecation
Ayesh Mar 18, 2024
9201255
Drop double \ from parameter types
WyriHaximus May 11, 2024
38b6a09
Updated deps, fixed parsing
Jul 22, 2024
426d969
Updated deps
Jul 22, 2024
a33f15c
Updated github actions version
indy2kro Jul 22, 2024
ae9cc58
Updated actions versions
indy2kro Jul 22, 2024
f08d21e
Updated tests
indy2kro Jul 22, 2024
6698e39
Updated github actions to run only for php 8.3
indy2kro Jul 22, 2024
6538a52
Updated test
indy2kro Jul 22, 2024
1e42f71
Updated phpstan commands
indy2kro Jul 22, 2024
a881e12
Updated phpstan
indy2kro Jul 22, 2024
a478b19
Updated codecov config
indy2kro Jul 22, 2024
9980c91
Added CI/CD for php 8.1 and 8.2 as well
indy2kro Jul 22, 2024
da2850d
Removed php 8.1 from github actions
indy2kro Jul 22, 2024
4904bf2
Updated php deps
indy2kro Jul 22, 2024
63f5e85
Added rector
indy2kro Jul 22, 2024
80b6a0e
phpcs fix
indy2kro Jul 22, 2024
395d65e
Update special_cases.php
indy2kro Jul 22, 2024
53fe9a3
Update special_cases.php
indy2kro Jul 22, 2024
aea8889
Updated generated files
Jul 24, 2024
a87deb9
Fixed module ignore
Jul 24, 2024
3af9799
Rector fixes
Jul 24, 2024
c2f2e71
Regenerated
Jul 26, 2024
58e6a46
Automatically regenerate the files
indy2kro Aug 2, 2024
c960b1c
Merge pull request #2 from indy2kro/create-pull-request/regenerate-files
indy2kro Aug 2, 2024
b99f48b
Regenerated files
Aug 2, 2024
4416717
Automatically regenerate the files
indy2kro Aug 12, 2024
648b7c0
Merge pull request #3 from indy2kro/create-pull-request/regenerate-files
indy2kro Aug 12, 2024
a9fa9d9
Automatically regenerate the files
indy2kro Aug 21, 2024
f1a16f5
Merge pull request #4 from indy2kro/create-pull-request/regenerate-files
indy2kro Aug 21, 2024
349a85a
Automatically regenerate the files
indy2kro Aug 23, 2024
7f6f7b1
Merge pull request #5 from indy2kro/create-pull-request/regenerate-files
indy2kro Aug 23, 2024
fdb2c37
Automatically regenerate the files
indy2kro Aug 27, 2024
a9ec9eb
Merge pull request #6 from indy2kro/create-pull-request/regenerate-files
indy2kro Aug 27, 2024
3cbf367
Skip `json_last_error` check when `JSON_THROW_ON_ERROR` flag is set i…
marmichalski Sep 5, 2024
cd3e3bb
Merge pull request #5 from dpi/json_decode-named-arg
shish Sep 9, 2024
c7722e4
Merge pull request #6 from szepeviktor/patch-1
shish Sep 9, 2024
ef989d4
Merge pull request #3 from indy2kro/master
shish Sep 9, 2024
382904a
Merge pull request #2 from WyriHaximus/patch-1
shish Sep 9, 2024
8bea9c6
fix named arg w json_decode to be consistent with php
dpi Dec 27, 2023
12e6dad
Remove Travis CI badge from README
szepeviktor Apr 9, 2023
be36ff3
Updated deps, fixed parsing
Jul 22, 2024
0b3cf2e
Updated deps
Jul 22, 2024
5bafc8c
Updated github actions version
indy2kro Jul 22, 2024
49238c8
Updated actions versions
indy2kro Jul 22, 2024
d973880
Updated tests
indy2kro Jul 22, 2024
9876104
Updated github actions to run only for php 8.3
indy2kro Jul 22, 2024
a92a101
Updated test
indy2kro Jul 22, 2024
eca44d9
Updated phpstan commands
indy2kro Jul 22, 2024
67bf49c
Updated phpstan
indy2kro Jul 22, 2024
b6f4044
Updated codecov config
indy2kro Jul 22, 2024
5daf397
Added CI/CD for php 8.1 and 8.2 as well
indy2kro Jul 22, 2024
86903fd
Removed php 8.1 from github actions
indy2kro Jul 22, 2024
fc400eb
Updated php deps
indy2kro Jul 22, 2024
9831b41
Added rector
indy2kro Jul 22, 2024
275e249
phpcs fix
indy2kro Jul 22, 2024
54df8b3
Update special_cases.php
indy2kro Jul 22, 2024
040c343
Update special_cases.php
indy2kro Jul 22, 2024
fb97b0a
Updated generated files
Jul 24, 2024
d785a5a
Fixed module ignore
Jul 24, 2024
4afb0ea
Rector fixes
Jul 24, 2024
bdc4ae5
Automatically regenerate the files
indy2kro Aug 2, 2024
3a4a2df
Regenerated files
Aug 2, 2024
01c2ca8
Drop double \ from parameter types
WyriHaximus May 11, 2024
2d5aac2
Merge branch 'Ayesh-php84/nullability'
shish Sep 9, 2024
476b800
fix named arg w json_decode to be consistent with php
dpi Dec 27, 2023
b4a36cc
Remove Travis CI badge from README
szepeviktor Apr 9, 2023
15f93a8
Updated deps, fixed parsing
Jul 22, 2024
8faa9d5
Updated deps
Jul 22, 2024
ae44bfb
Updated github actions version
indy2kro Jul 22, 2024
404bda0
Updated actions versions
indy2kro Jul 22, 2024
9996962
Updated tests
indy2kro Jul 22, 2024
f250b39
Updated github actions to run only for php 8.3
indy2kro Jul 22, 2024
af109c1
Updated test
indy2kro Jul 22, 2024
aee7a2d
Updated phpstan commands
indy2kro Jul 22, 2024
f387c88
Updated phpstan
indy2kro Jul 22, 2024
6413942
Updated codecov config
indy2kro Jul 22, 2024
53c1c63
Added CI/CD for php 8.1 and 8.2 as well
indy2kro Jul 22, 2024
50069cb
Removed php 8.1 from github actions
indy2kro Jul 22, 2024
d7d9d26
Updated php deps
indy2kro Jul 22, 2024
979c2bb
Added rector
indy2kro Jul 22, 2024
f5385ef
phpcs fix
indy2kro Jul 22, 2024
500f2af
Update special_cases.php
indy2kro Jul 22, 2024
6cfffc6
Update special_cases.php
indy2kro Jul 22, 2024
698d6c7
Updated generated files
Jul 24, 2024
7857408
Fixed module ignore
Jul 24, 2024
a371e5e
Rector fixes
Jul 24, 2024
888843d
Regenerated
Jul 26, 2024
c052455
Automatically regenerate the files
indy2kro Aug 2, 2024
47f289e
Regenerated files
Aug 2, 2024
04546b0
Automatically regenerate the files
indy2kro Aug 12, 2024
9b1b564
Automatically regenerate the files
indy2kro Aug 21, 2024
0687e9a
Automatically regenerate the files
indy2kro Aug 23, 2024
80e92f8
Automatically regenerate the files
indy2kro Aug 27, 2024
886de54
Drop double \ from parameter types
WyriHaximus May 11, 2024
b3785d8
[PHP 8.4] Fixes for implicit nullability deprecation
Ayesh Mar 18, 2024
7d90f50
Updated deps, fixed parsing
Jul 22, 2024
a749c6e
Updated tests
indy2kro Jul 22, 2024
449aec5
Updated test
indy2kro Jul 22, 2024
2699abe
Updated phpstan commands
indy2kro Jul 22, 2024
2d15181
Added CI/CD for php 8.1 and 8.2 as well
indy2kro Jul 22, 2024
40907fc
Removed php 8.1 from github actions
indy2kro Jul 22, 2024
0de2cfb
Added rector
indy2kro Jul 22, 2024
34acc6c
phpcs fix
indy2kro Jul 22, 2024
ec8e3a7
Update special_cases.php
indy2kro Jul 22, 2024
36f29b5
Update special_cases.php
indy2kro Jul 22, 2024
271ab4c
Updated generated files
Jul 24, 2024
fee83f9
Fixed module ignore
Jul 24, 2024
c617d90
Automatically regenerate the files
indy2kro Aug 2, 2024
a43ee90
Regenerated files
Aug 2, 2024
d423424
regen
shish Sep 9, 2024
be5bcb2
regen-again
shish Sep 9, 2024
9644394
devcontainer
shish Sep 9, 2024
295547e
remove no-longer-needed workaround
shish Sep 9, 2024
cb8126f
update generator to remove implicit nulls
shish Sep 9, 2024
7b1f211
case...
shish Sep 9, 2024
88bdb3e
format
shish Sep 9, 2024
b10f2c6
rename package so it can be installed by itself
shish Sep 9, 2024
06d435c
don't alias to ancient build
shish Sep 9, 2024
3f1000f
drop support for officially-dead versions of php
shish Sep 10, 2024
ba86821
test against currently-live versions of php
shish Sep 10, 2024
8fe00eb
doc updates
shish Sep 10, 2024
3ac284e
tests
shish Sep 10, 2024
c704959
details
shish Sep 10, 2024
0df9170
unbump
shish Sep 10, 2024
99eba73
php8.1 can't handle the truth (in php8.2 onwards a function can retur…
shish Sep 10, 2024
c402532
bumpetty bump
shish Sep 10, 2024
90c6ca6
weird formatting standard, but ok
shish Sep 10, 2024
4cc60b2
non-idempotent formatting??
shish Sep 10, 2024
dc4c0ff
disable uploading to codecov.io
shish Sep 10, 2024
1458545
Let's give this a try...
shish Sep 10, 2024
0f22eab
handle another case of nullability
shish Sep 10, 2024
6350620
weird formatting again
shish Sep 10, 2024
c5d1cd0
parallel tests
shish Sep 10, 2024
0c5c04c
Merge pull request #7 from shish/partest
shish Sep 10, 2024
af57ff3
simpler regen
shish Sep 12, 2024
2da9195
Merge pull request #9 from shish/reg
shish Sep 12, 2024
5cb4580
ubuntu-latest is not actually latest
shish Sep 13, 2024
a365d79
avoid setting the regen workflow to "failed" if it does the regen
shish Sep 15, 2024
7fd6955
also allow sync on manual button push
shish Sep 15, 2024
27860c7
sync
shish Sep 15, 2024
398faa9
Merge pull request #10 from shish/reg
shish Sep 15, 2024
3cbdc9e
argh github actions
shish Sep 15, 2024
cd5bec8
Merge branch 'reg'
shish Sep 15, 2024
5617f57
argh
shish Sep 15, 2024
9bb6608
Automatically regenerate the files
shish Sep 22, 2024
9ddd6ea
Merge pull request #11 from shish/create-pull-request/regenerate-files
shish Sep 22, 2024
a620b7e
Update README.md
shish Sep 22, 2024
836bda5
Merge pull request #12 from shish/shish-patch-1
shish Sep 22, 2024
3e3a855
Automatically regenerate the files
shish Sep 23, 2024
9963394
Merge pull request #13 from shish/create-pull-request/regenerate-files
shish Sep 23, 2024
1c259fc
Automatically regenerate the files
shish Sep 29, 2024
fdff28b
Merge pull request #14 from shish/create-pull-request/regenerate-files
shish Sep 29, 2024
448f4cd
Automatically regenerate the files
shish Oct 8, 2024
1337e25
Merge pull request #16 from shish/create-pull-request/regenerate-files
shish Oct 8, 2024
2549558
phpstan-safe-rule needed to be forked too
shish Oct 8, 2024
6035086
Merge pull request #17 from shish/shish-patch-1
shish Oct 8, 2024
2e8be3c
Automatically regenerate the files
shish Oct 8, 2024
9e0b360
Merge pull request #18 from shish/create-pull-request/regenerate-files
shish Oct 8, 2024
e7d5834
ext-intl isn't actually needed?
shish Oct 8, 2024
88c2cf5
Merge pull request #20 from shish/no-intl
shish Oct 8, 2024
e746641
Automatically regenerate the files
shish Oct 12, 2024
1641af0
Merge pull request #22 from shish/create-pull-request/regenerate-files
shish Oct 12, 2024
54ea9c7
Automatically regenerate the files
shish Oct 25, 2024
9ea5daa
Merge pull request #23 from shish/create-pull-request/regenerate-files
shish Oct 25, 2024
6308042
Automatically regenerate the files
shish Oct 28, 2024
8a75cc2
Merge pull request #24 from shish/create-pull-request/regenerate-files
shish Oct 29, 2024
518efb0
Automatically regenerate the files
shish Oct 31, 2024
a1a1a3a
Merge pull request #25 from shish/create-pull-request/regenerate-files
shish Oct 31, 2024
ac1c3da
Automatically regenerate the files
shish Nov 4, 2024
c64370c
Merge pull request #26 from shish/create-pull-request/regenerate-files
shish Nov 4, 2024
a14ec20
Automatically regenerate the files
shish Nov 9, 2024
3a3d6ad
Merge pull request #27 from shish/create-pull-request/regenerate-files
shish Nov 9, 2024
eb514b8
Automatically regenerate the files
shish Nov 17, 2024
16c0076
Automatically regenerate the files
shish Nov 18, 2024
75dec96
Automatically regenerate the files
shish Nov 20, 2024
282f509
Automatically regenerate the files
shish Nov 22, 2024
5dff0a7
Automatically regenerate the files
shish Nov 25, 2024
82b933f
Automatically regenerate the files
shish Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:stable
ARG DEBIAN_FRONTEND=noninteractive
ARG XDEBUG_MODE=coverage
RUN apt update -y && apt install -y git composer php-cli php-dom php-curl php-xdebug vim
WORKDIR /app
CMD cd /app/generator/doc && ./update.sh && cd /app/generator && composer install && php ./safe.php generate && composer cs-fix
3 changes: 3 additions & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd $(dirname $0)/../
docker run --rm -v ${PWD}:/app $(docker build -q -f .devcontainer/Dockerfile .)
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Safe PHP",
"build": {
"context": "..",
"dockerfile": "./Dockerfile"
},

"workspaceMount": "source=${localWorkspaceFolder},target=/app,type=bind",
"workspaceFolder": "/app"
}
3 changes: 3 additions & 0 deletions .devcontainer/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd $(dirname $0)/../
docker run --rm -ti -v ${PWD}:/app $(docker build -q . -f .devcontainer/Dockerfile) /bin/bash
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: shish # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: shish2k # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
-
package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
versioning-strategy: auto
groups:
dev-dependencies:
dependency-type: "development"
39 changes: 13 additions & 26 deletions .github/workflows/auto-regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ name: "Auto Regenerate"
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:

jobs:

auto-regenerate:
name: "Tries to regenerate the files"
runs-on: "ubuntu-latest"
name: "Auto Regenerate"
runs-on: "ubuntu-24.04"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "8.0"
php-version: "8.3"

- name: "Check out salathe/phpdoc-base"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
with:
path: "generator/doc/doc-en/doc-base"
repository: "salathe/phpdoc-base"

- name: "Check out php/doc-en"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
with:
path: "generator/doc/doc-en/en"
repository: "php/doc-en"
Expand All @@ -43,33 +44,19 @@ jobs:
run: "composer dump-autoload"

- name: "Regenerate files"
run: "./safe.php generate"
id: regen
run: "./safe.php generate && git diff --exit-code && (echo regen=no-diff >> $GITHUB_OUTPUT) || (echo regen=diff >> $GITHUB_OUTPUT)"
working-directory: "generator"

- name: "Check if regenerated files are different"
run: |
if output=$(git status --porcelain) && [ -z "$output" ]; then
# all is good
echo "Generated files are the same as committed file: OK"
else
# Uncommitted changes
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
echo "Detected changes:"
git status
git diff
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
exit 1;
fi

- name: "Create a pr if the files are different"
if: ${{ failure() }}
uses: peter-evans/create-pull-request@v3
if: "${{ steps.regen.outputs.regen == 'diff' }}"
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automatically regenerate the files"
branch: create-pull-request/regenerate-files
title: "Automatically regenerate the files"
labels: "regenerate, auto"
assignees: "kharhamel, moufmouf"
assignees: "shish"




204 changes: 131 additions & 73 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,124 +1,182 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Continuous Integration"
name: "Tests"

on:
- "pull_request"
- "push"
push:
branches:
- main
- master
tags:
- 'v*'
pull_request:

jobs:

continuous-integration:
name: "Continuous Integration"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.0"

dependencies:
- "highest"

fetch_defs:
name: "Fetch Definitions"
runs-on: "ubuntu-24.04"
outputs:
date: ${{ steps.date.outputs.date }}
steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"

uses: "actions/checkout@v4"
- name: "Get current date for the daily cache"
id: 'date'
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: "Cache the php documentation"
id: cache-php-doc
uses: "actions/cache@v1"
uses: "actions/cache@v4"
with:
path: "generator/doc/doc-en"
key: php-doc-${{ steps.date.outputs.date }}

- name: "Check out salathe/phpdoc-base"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
if: steps.cache-php-doc.outputs.cache-hit != 'true'
with:
path: "generator/doc/doc-en/doc-base"
repository: "salathe/phpdoc-base"

- name: "Check out php/doc-en"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"
if: steps.cache-php-doc.outputs.cache-hit != 'true'
with:
path: "generator/doc/doc-en/en"
repository: "php/doc-en"

generator_tests:
name: "Generator Tests"
runs-on: "ubuntu-24.04"
needs: "fetch_defs"
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
- name: "Fetch cached docs"
id: cache-php-doc
uses: "actions/cache@v4"
with:
path: "generator/doc/doc-en"
key: php-doc-${{ needs.fetch_defs.outputs.date }}
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install dependencies with composer in generator/ directory"
run: "composer install --no-interaction"
working-directory: "generator"

- name: "Install dependencies with composer in root directory"
run: "composer install --no-interaction"

- name: "Run tests with phpunit/phpunit in root directory"
run: "vendor/bin/phpunit"

- name: "Run tests with phpunit/phpunit in generator/ directory"
run: "vendor/bin/phpunit"
working-directory: "generator"

- name: "Run coding standard checks with squizlabs/php_codesniffer in generator/ directory"
run: "composer cs-check"
working-directory: "generator"

- name: "Run static code analysis with phpstan/phpstan in generator/ directory"
run: "composer phpstan"
working-directory: "generator"
- name: "Run static code analysis with rector/rector in generator/ directory"
run: "composer rector --dry-run"
working-directory: "generator"

generated_tests:
name: "Generated Tests"
runs-on: "ubuntu-24.04"
needs: "fetch_defs"
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
- name: "Fetch cached docs"
id: cache-php-doc
uses: "actions/cache@v4"
with:
path: "generator/doc/doc-en"
key: php-doc-${{ needs.fetch_defs.outputs.date }}
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install dependencies with composer in root directory"
run: "composer install --no-interaction"
- name: "Run tests with phpunit/phpunit in root directory"
run: "vendor/bin/phpunit"
- name: "Dump autoloader with composer in root directory"
run: "composer dump-autoload"

- name: "Run coding standard checks with squizlabs/php_codesniffer in root directory"
run: "composer cs-check"

- name: "Run static code analysis with phpstan/phpstan in root directory"
run: "composer phpstan"

- name: "Regenerate files"
run: "./safe.php generate"
check_sync:
name: "Check Sync"
runs-on: "ubuntu-24.04"
needs: "fetch_defs"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "8.4"
- name: "Fetch cached docs"
id: cache-php-doc
uses: "actions/cache@v4"
with:
path: "generator/doc/doc-en"
key: php-doc-${{ needs.fetch_defs.outputs.date }}
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install dependencies with composer in generator/ directory"
run: "composer install --no-interaction"
working-directory: "generator"
- name: "Install dependencies with composer in root directory"
run: "composer install --no-interaction"
- name: "Regenerate files and check for differences"
run: "./safe.php generate && git diff --exit-code"
working-directory: "generator"

- name: "Check if regenerated files are different"
run: |
if output=$(git status --porcelain) && [ -z "$output" ]; then
# all is good
echo "Generated files are the same as committed file: OK"
else
# Uncommitted changes
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
echo "Detected changes:"
git status
git diff
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
exit 1;
fi

- name: "Archive code coverage results"
uses: "actions/upload-artifact@v1"
rector:
name: "Rector Tests"
runs-on: "ubuntu-24.04"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
name: "build"
path: "generator/build"
php-version: "8.4"
- name: "Composer install"
run: "composer install && composer rector && composer test"
working-directory: "generator/tests/rector"
- name: "Run rector"
run: "composer rector"
working-directory: "generator/tests/rector"
- name: "Run tests"
run: "composer test"
working-directory: "generator/tests/rector"

- uses: codecov/codecov-action@v1 # upload the coverage to codecov
with:
fail_ci_if_error: true # optional (default = false)
Loading