Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
cff4a1b
fix: Cleanup the autoloader from temporary variables (#866)
theofidry Oct 31, 2023
49bd7fa
test: Improve the test 035 (#867)
theofidry Nov 1, 2023
4fdcd61
feat: Add an inspect command (#868)
theofidry Nov 1, 2023
2133987
ci: Update the steps actions (#870)
theofidry Nov 1, 2023
fc1ac4e
feat: Do not swallow exceptions when scoping (#869)
theofidry Nov 1, 2023
4c427ad
doc: Update the specs example in the contribution guide (#873)
theofidry Nov 1, 2023
dc487ce
refactor: Fix invalid usages of "whitelist" (#872)
theofidry Nov 1, 2023
7771a7a
fix: Update the Reflector's symbols (#875)
theofidry Nov 1, 2023
aadfd24
fix: Allow the inspect command to initiate the init command (#876)
theofidry Nov 1, 2023
6cac228
fix: Correctly include all the JetBrains' stubs as excluded files (#874)
theofidry Nov 1, 2023
047314c
doc: Clarify scoping of excluded functions for which a declaration wa…
theofidry Nov 1, 2023
1937aca
ci: Add dependabot (#877)
theofidry Nov 1, 2023
625c41e
ci: Automatically bump the Composer root version (#879)
theofidry Nov 2, 2023
1bc4dda
feat: Make the JetBrains' stubs collector and patcher re-usable (#883)
theofidry Nov 2, 2023
2713ec1
test: Add an e2e test for PHPUnit (#881)
theofidry Nov 2, 2023
7dbccc0
feat: Mark all declarations as internal (#882)
theofidry Nov 2, 2023
ad9d0e2
doc: Add a doc entry for downloading the PHAR from GitHub (#885)
theofidry Nov 2, 2023
1512cb6
build: Add a docker image (#884)
theofidry Nov 2, 2023
9cea251
fix: Fix Symfony services (#886)
theofidry Nov 3, 2023
3dde183
fix: Correctly scope spl_autoload_register singule parameter (#887)
theofidry Nov 3, 2023
f1e494a
fix: Correctly scope is_callable() calls (#888)
theofidry Nov 3, 2023
b8fc1d1
fix: Correctly scope call_user_func_array() (#889)
theofidry Nov 3, 2023
cbef87b
fix: Correct the Composer autoload (#864)
theofidry Nov 4, 2023
83a0211
test: Add a test for the min PHP version (#890)
theofidry Nov 4, 2023
e5a152c
fix: Fix the compatibility of the dumped autoload (#891)
theofidry Nov 4, 2023
9fa37d8
test: Make the min PHP version test compatibility more complete (#892)
theofidry Nov 4, 2023
9386a0a
chore: Update to Box 4.5.1 (#893)
theofidry Nov 4, 2023
9c75832
fix: Update the Reflector with the ext-uv symbols (#894)
theofidry Nov 4, 2023
7558805
doc: Fix a broken link (#896)
theofidry Nov 4, 2023
b69c8cf
ci: Fix ComposerRootVersion workflow logic (#895)
szepeviktor Nov 4, 2023
a3d9e96
doc: Fix broken link (#897)
szepeviktor Nov 5, 2023
0e208d6
test: Fix a typo (#898)
szepeviktor Nov 5, 2023
bc9460d
build: Update .gitattributes (#899)
szepeviktor Nov 5, 2023
50843fa
build: Remove non-existent ignored files (#900)
szepeviktor Nov 5, 2023
3f8c3c3
build: Add rector to the Makefile rules (#905)
theofidry Nov 18, 2023
dd4bac9
test: Fix flaky test (#906)
theofidry Nov 18, 2023
1416c09
build: Upgrade rector (#907)
theofidry Nov 18, 2023
4cf769c
build: Add rector to the auto-review process (#908)
theofidry Nov 18, 2023
6a3a69e
ci: Re-use actions (#909)
theofidry Nov 18, 2023
514ff09
chore: Bump to PHP 8.2 (#904)
theofidry Nov 18, 2023
eba4b11
chore: Migrate to FidryConsole 0.6 (#903)
theofidry Nov 18, 2023
a56ad09
ci: Make dependabot check GitHub actions too (#910)
theofidry Nov 18, 2023
05fb4f2
build(deps): Bump the dependencies group (#911)
dependabot[bot] Nov 18, 2023
4eba1e3
ci: Add the requirement checker to dependabot (#913)
theofidry Nov 21, 2023
5cac6a7
build(deps): Bump the dependencies group (#914)
dependabot[bot] Nov 21, 2023
d7769c7
cs: Apply PHP-CS-Fixer to the rector.php file (#917)
theofidry Nov 21, 2023
bbd1ba2
cs: Upgrade PHP-CS-Fixer config to PHP 8.2 (#918)
theofidry Nov 21, 2023
e142c45
refactor(composer-root-version): Apply rector (#916)
theofidry Nov 21, 2023
f64cbc8
build(composer-root-version-checker): Add Rector (#919)
theofidry Nov 21, 2023
940c3ae
build: Simplify rector configuration (#920)
theofidry Nov 21, 2023
2853941
feat: Make it easier to serialize/unserialize a SymbolsRegistry (#915)
theofidry Nov 21, 2023
100bca6
refactor(composer-root-version-checker): Upgrade to PHPUnit 10 (#921)
theofidry Nov 21, 2023
dd0a672
ci: Allow write permissions for the release workflow (#923)
theofidry Nov 21, 2023
5f4e148
doc: Add a doc entry for Wordpress support (#922)
theofidry Nov 21, 2023
34fb3fa
build(deps): Bump the dependencies group (#926)
dependabot[bot] Dec 5, 2023
2f4a55b
build(deps-dev): Bump the dependencies group (#927)
dependabot[bot] Dec 5, 2023
dc2120a
Revert "feat: Mark all declarations as internal (#882)" (#928)
theofidry Dec 7, 2023
8c72a1b
build(deps-dev): Bump the dependencies group (#929)
dependabot[bot] Dec 11, 2023
548f5f6
build(deps-dev): Bump the dependencies group (#930)
dependabot[bot] Dec 19, 2023
cddf84c
build(deps): Bump the dependencies group (#931)
dependabot[bot] Dec 19, 2023
591f0fb
test: Fix PHPUnit scoping build (#934)
theofidry Jan 17, 2024
1104533
build(deps-dev): Bump the dependencies group (#935)
dependabot[bot] Jan 17, 2024
53d3cf2
chore: Bump the minimum required Symfony version to 6.4 (#936)
theofidry Jan 17, 2024
f01e3ab
chore: Add support for Symfony 7 (#937)
theofidry Jan 18, 2024
ebe236c
chore: Upgrade to PHPUnit 10 (#938)
theofidry Jan 18, 2024
f9efaf6
chore: Add PHP 8.3 to the matrix
theofidry Jan 19, 2024
fd7dd7e
update laravel
theofidry Jan 19, 2024
d348097
fix
theofidry Jan 19, 2024
d4df72a
ci: Add PHP 8.3 to the matrix (#941)
theofidry Jan 19, 2024
7f8eecf
build(deps): Bump the dependencies group (#943)
dependabot[bot] Jan 23, 2024
47d3937
build(deps-dev): Bump the dependencies group (#942)
dependabot[bot] Jan 23, 2024
a71fce2
build(deps): Bump the dependencies group (#945)
dependabot[bot] Feb 5, 2024
d4c0a33
build(deps-dev): Bump the dependencies group (#944)
dependabot[bot] Feb 5, 2024
cd909d4
build(deps-dev): Bump the dependencies group (#947)
dependabot[bot] Feb 13, 2024
022e596
build(deps): Bump the dependencies group (#950)
dependabot[bot] Mar 5, 2024
f4bd55c
build(deps-dev): Bump the dependencies group (#949)
dependabot[bot] Mar 6, 2024
ed52ce7
build(deps-dev): Bump the dependencies group (#955)
dependabot[bot] Mar 11, 2024
30a3145
build(deps): Bump the dependencies group (#954)
dependabot[bot] Mar 11, 2024
1e20797
docs: Remove nonsensical explanation (#957)
theofidry Mar 19, 2024
067fcfc
build(deps-dev): Bump the dependencies group (#956)
dependabot[bot] Mar 19, 2024
4170c1f
build(deps-dev): Bump the dependencies group (#959)
dependabot[bot] Mar 26, 2024
b6117ee
build(deps-dev): Bump the dependencies group (#961)
dependabot[bot] Apr 1, 2024
da3df6e
build(deps-dev): Bump phpunit/phpunit (#964)
dependabot[bot] Apr 8, 2024
9a42adc
test: Rename some test classes (#967)
theofidry Apr 10, 2024
802250f
ci: Enable dependabot for vendor-bin (#969)
theofidry Apr 10, 2024
8762ed2
build: Remove covers validator (#970)
theofidry Apr 10, 2024
bb0a6f9
build: Upgrade PHP-CS-Fixer (#971)
theofidry Apr 10, 2024
1e96862
build: Upgrade to Rector v1 (#972)
theofidry Apr 10, 2024
b64f8e3
build: Configure the platform for build tools (#973)
theofidry Apr 10, 2024
718843c
test: Add log entry for clarity in e2e 035 (#974)
theofidry Apr 10, 2024
fd80b6f
build: Fix Makefile help command (#975)
theofidry Apr 10, 2024
2418178
fix: Append alias class statement correct when the class/interface is…
theofidry Apr 10, 2024
62025c6
fix: Do not exclude all source code in the default template (#952)
theofidry Apr 10, 2024
d8ace1f
refactor: Improve readability of ConsoleScoper (#968)
theofidry Apr 10, 2024
71912be
test: Remove the NO_COLOR environment variable (#978)
theofidry Apr 11, 2024
6c5b8ee
docs: Add mention of the inspect commmand (#977)
theofidry Apr 11, 2024
82d6630
refactor: Fix typo (#976)
theofidry Apr 11, 2024
f2e6bc2
fix: Add an additional function_exists statement for excluded functio…
theofidry Apr 11, 2024
1913821
test: Move the logic of finding the spec files to a dedicated service…
theofidry Apr 13, 2024
0b11358
cs: Apply PHP-CS-Fixer to the specs (#984)
theofidry Apr 13, 2024
d1a937d
cs: Change the CS of parseSpecFile to reduce noise (#986)
theofidry Apr 13, 2024
f3867ef
test: Remove dead code (#988)
theofidry Apr 13, 2024
14ba8f0
test: Do not hide the original throwable stack trace when failing to …
theofidry Apr 14, 2024
2d85895
test: Extract the formatter and parser out of the PhpScoperSpecTest t…
theofidry Apr 14, 2024
d549f36
test: Make the SpecFinder not instantiable (#991)
theofidry Apr 14, 2024
683658b
test: Move the parsing of the file to the SpecParser (#992)
theofidry Apr 14, 2024
37440b1
test: Move the parsing of the file to the SpecParser (#990)
theofidry Apr 14, 2024
d596307
test: Fix SpecParser skipping some tests (#993)
theofidry Apr 14, 2024
8235cf3
test: Move the removal of trailing spaces into a dedicated service (#…
theofidry Apr 14, 2024
b13127c
test: Allow to configure the min/max PHP version at the fixture level…
theofidry Apr 14, 2024
a40b781
test: Give a better name to specs without a title (#996)
theofidry Apr 14, 2024
60c7b3a
test: Do not validate the meta key twice (#997)
theofidry Apr 14, 2024
585e3f1
test: Rename variables (#998)
theofidry Apr 14, 2024
e15b7e2
test: Extract pieces into dedicated methods (#1000)
theofidry Apr 14, 2024
2deb977
test: Introduce an UnparsableSpec exception (#1001)
theofidry Apr 14, 2024
e76c65d
test: Introduce a SpecScenario object (#999)
theofidry Apr 14, 2024
90375ab
test: Introduce a Meta object to replace the spec associative array (…
theofidry Apr 14, 2024
60cef8c
build: Upgrade jetbrains stubs (#980)
theofidry Apr 14, 2024
a070bde
test: Tweak the SpecFormatter (#1002)
theofidry Apr 14, 2024
f69a3f8
test: Move the spec framework into a dedicated directory (#1003)
theofidry Apr 14, 2024
73b3b80
feat: Introduce a new factory for SymbolsRegistry (#1004)
theofidry Apr 14, 2024
8abc37c
test: Forward the spec title as the dataprovider label (#1005)
theofidry Apr 14, 2024
23f1717
test: Include the test framework as part of the source code (#1006)
theofidry Apr 14, 2024
d387c6b
docs: Add Laravel support to the docs (#1008)
theofidry Apr 14, 2024
6d2f2f2
fix: Do not assume non-resolved symbols matches exposed or excluded s…
theofidry Apr 14, 2024
148a0f0
build(deps-dev): Bump phpunit/phpunit (#1009)
dependabot[bot] Apr 15, 2024
eafe8ac
build(deps): Upgrade to Box 4.6.2 (#1012)
theofidry Apr 23, 2024
069dd54
build(deps): Remove `symfony/deprecation-contracts` direct dependency…
theofidry Apr 23, 2024
6cff52b
fix: Update the list of internal symbols (#1013)
theofidry Apr 25, 2024
a75021c
test: Ensure assert cannot be accidentally exposed (#1014)
theofidry Apr 27, 2024
53a5f3f
build: Add support for direnv (#1016)
theofidry Apr 27, 2024
c112ae0
refactor: Move the calculation of the longest common path to a dedica…
theofidry Apr 27, 2024
69ba932
test: Ensure the laravel e2e test cannot fail due to a color detectio…
theofidry Apr 27, 2024
5337d6f
test: Add line numbers to the spec file (#1020)
theofidry Apr 28, 2024
0612fd7
build(deps-dev): Bump phpunit/phpunit (#1022)
dependabot[bot] Apr 30, 2024
bc0a7d8
fix: Make the scoper-autoload.php PHP 5.6 compatible (#1024)
marekdedic May 3, 2024
6ebbe53
refactor: Automatically assign the attributes when concatenating stri…
theofidry May 4, 2024
b532a5b
build(deps): Upgrade to PHP-Parser v5 (#1025)
theofidry May 5, 2024
4f8d70b
fix: Do not scope class-like strings that cannot be class names (#1027)
theofidry May 5, 2024
c1e866e
fix: Do not prefix excluded functions used in `call_user_func_array()…
theofidry May 5, 2024
ccf574d
test: standardize the autoload usage (#1031)
theofidry May 13, 2024
c9646d2
test: Fix the PHP version ID used (#1038)
theofidry Jun 10, 2024
49af316
refactor: Leverage the PhpParser v5 printer changes (#1040)
theofidry Jun 10, 2024
f21ea1b
test: Allow to specify the running PHP version (#1039)
theofidry Jun 10, 2024
ead99dc
fix: Preserve heredoc/newdoc indentation (#1037)
theofidry Jun 10, 2024
3224161
build(deps-dev): Bump phpunit/phpunit (#1041)
dependabot[bot] Jun 11, 2024
36b530c
refactor: Throw more friendly exceptions when loading a configuration…
theofidry Jun 15, 2024
7831a09
docs: Remove obsolete doc entry (#1046)
theofidry Jun 15, 2024
fbbcac0
refactor: Introduce a Parser and Printer factory (#1047)
theofidry Jun 16, 2024
5478f21
refactor: Introduce a Prefix value object (#1048)
theofidry Jun 16, 2024
226ba7d
feat: Allow to configure the parser PHP version (#1044)
theofidry Jun 16, 2024
41eff3d
fix: Configure the printer PHP version to 7.2 by default (#1049)
theofidry Jun 16, 2024
631bf7a
refactor: Move the PHP version option into a dedicated class (#1050)
theofidry Jun 16, 2024
72d5ba6
feat: Allow to pass host as the used PHP version (#1052)
theofidry Jun 16, 2024
d4e7ffa
fix: Fix missing var-dumper dependency (#1053)
theofidry Jun 16, 2024
b03acaf
build(deps-dev): Bump the dependencies group (#1055)
dependabot[bot] Jun 17, 2024
7f3d9b5
build(deps): Bump docker/build-push-action (#1056)
dependabot[bot] Jun 17, 2024
32bd12e
build(deps-dev): Bump phpunit/phpunit (#1057)
dependabot[bot] Jun 24, 2024
1cfc944
test: Fix missing symbols (#1065)
VincentLanglet Sep 2, 2024
d7a74ed
build(deps): Bump the dependencies group across 1 directory with 3 up…
dependabot[bot] Sep 2, 2024
5d3fda6
test: Fix e2e AutoReview test (#1070)
theofidry Sep 2, 2024
79b2b4e
fix: Fix aliasing functions with multiple-level namespaces (#1061)
VincentLanglet Sep 2, 2024
202cfc0
chore(deps): Allow PHPUnit 11 (#1085)
theofidry Dec 1, 2024
655f55b
build(deps): Bump peter-evans/create-pull-request (#1072)
dependabot[bot] Dec 1, 2024
190ee45
build(deps): Bump the dependencies group across 1 directory with 3 up…
dependabot[bot] Dec 1, 2024
9062b3c
chore(deps): Update PHPStorm's stubs (#1086)
theofidry Dec 1, 2024
6597bdb
test: Fix test for Symfony 7.2 (#1087)
theofidry Dec 1, 2024
34bf548
chore: Show the diff upon failure when executing PHP-CS-Fixer (#1088)
theofidry Dec 1, 2024
ff5abc7
build(deps-dev): Bump phpunit/phpunit (#1089)
dependabot[bot] Dec 2, 2024
8a1ee33
chore(deps): Update JetBrains' stubs (#1100)
sebastianbergmann Jan 12, 2025
0e1c7a0
feat: Update the reflector for PHP 8.4 symbols (#1105)
theofidry Jan 12, 2025
1b67fdc
feat: Add support for PHP 8.4 property hooks (#1090)
theofidry Jan 12, 2025
d87fdca
feat: Unlock intellisense for the finder component (#1104)
hirasso Jan 12, 2025
ab58aa0
build(deps-dev): Bump the dependencies group across 1 directory with …
dependabot[bot] Jan 12, 2025
aff0ef9
docs: Fix constant/function assignment in WP example (#1094)
tyrann0us Jan 12, 2025
87c7ca6
build(deps-dev): Bump phpunit/phpunit (#1106)
dependabot[bot] Jan 13, 2025
fcf09f9
docs: Add missing php tag
theofidry Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source .composer-root-version

export XDEBUG_MODE=off

use nix --packages \
gnumake

[[ -f .envrc.local ]] && source_env .envrc.local
11 changes: 7 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@
*.php text eol=lf

# Ignore all test and documentation with "export-ignore".
/.composer-root-version export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/.github/ export-ignore
/.php-cs-fixer.dist.php export-ignore
/.scrutinizer.yml export-ignore
/_specs/ export-ignore
/bin/infection.sh export-ignore
/box.json.dist export-ignore
/build/ export-ignore
/composer-root-version-checker/ export-ignore
/docs/ export-ignore
/Dockerfile export-ignore
/infection.json.dist export-ignore
/fixtures/ export-ignore
/.makefile/ export-ignore
/Makefile export-ignore
/phpstan.neo.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/rector.php export-ignore
/scoper.inc.php export-ignore
/specs/ export-ignore
/tests/ export-ignore
/vendor-bin/ export-ignore
/phpunit.xml.dist export-ignore
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ For general support, please use the #humbug Slack channel: https://symfony.com/s

<details>
<summary>scoper.inc.php</summary>

```php
<?php

declare(strict_types=1);

use Isolated\Symfony\Component\Finder\Finder;


/** @var Symfony\Component\Finder\Finder $finder */
$finder = Isolated\Symfony\Component\Finder\Finder::class;

return [
];

Expand All @@ -45,7 +46,7 @@ For general support, please use the #humbug Slack channel: https://symfony.com/s

<details>
<summary>Output</summary>

```bash
$ command
> output
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/install-tool/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Install a vendor-bin tool'

description: >
Install a tool installed via bamarni/composer-bin-plugin and runs the associated Makefile command to ensure the
target is up to date.

inputs:
vendor-bin-tool:
required: true
type: string
makefile-command:
required: true
type: string

runs:
using: composite
steps:
- name: Install PHP-CS-Fixer
uses: ramsey/composer-install@v2
with:
working-directory: 'vendor-bin/${{ inputs.vendor-bin-tool }}'

- name: Ensure PHP-CS-Fixer Makefile target is up to date
run: make ${{ inputs.makefile-command }}
shell: sh
25 changes: 25 additions & 0 deletions .github/actions/install-vendor/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Install Composer dependencies'

description: >
Install the dependencies installed via Composer.

inputs:
dependency-versions:
description: The ramsey/composer-install dependency-versions used.
required: false
default: locked

runs:
using: composite
steps:
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Configure composer root version
run: |
. ./.composer-root-version
echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> $GITHUB_ENV
shell: sh

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ inputs.dependency-versions }}
48 changes: 48 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "."
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "."
schedule:
interval: "weekly"
groups:
jetbrains-phpstorm-stubs:
patterns:
- "jetbrains/phpstorm-stubs"
update-types:
- "major"

- package-ecosystem: "composer"
directory: "vendor-bin/*/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "composer-root-version-checker"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
78 changes: 59 additions & 19 deletions .github/workflows/composer-root-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,29 @@ jobs:
name: Lint CS
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Configure composer root version
run: |
source .composer-root-version
echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> $GITHUB_ENV

- name: Install the Composer (root) dependencies
uses: ramsey/composer-install@v2
- name: Install Composer dependencies
uses: ./.github/actions/install-vendor

- name: Ensure that the root dependencies are updated correctly
run: make vendor_install

- name: Install PHP-CS-Fixer
uses: ramsey/composer-install@v2
uses: ./.github/actions/install-tool
with:
working-directory: 'vendor-bin/php-cs-fixer'

- name: Ensure that PHP-CS-Fixer dependencies are updated correctly
run: make php_cs_fixer_install
vendor-bin-tool: php-cs-fixer
makefile-command: php_cs_fixer_install

- name: Install the Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
working-directory: 'composer-root-version-checker'

Expand All @@ -62,11 +54,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2' ]
php: [ '8.3' ]

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -75,7 +67,7 @@ jobs:
tools: composer

- name: Install the Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
working-directory: 'composer-root-version-checker'

Expand All @@ -100,3 +92,51 @@ jobs:
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

update-composer-root-version:
name: Update the Composer root version
if: ${{ github.repository == 'humbug/php-scoper' && github.ref_name == 'main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: '0' # Ensures the tags are fetched
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
coverage: none

- name: Install the Composer dependencies
uses: ramsey/composer-install@v3
with:
working-directory: 'composer-root-version-checker'

- name: Dump the Composer too version
working-directory: composer-root-version-checker
run: make dump_root_version

- name: Check for changes
run: |
if git diff --exit-code; then
echo "🟢 No change detected."
echo "composer_root_version_changed=false" >> $GITHUB_ENV
else
echo "composer_root_version_changed=true" >> $GITHUB_ENV
fi

- name: Create Pull Request
if: env.composer_root_version_changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch-suffix: random
delete-branch: true
title: "build: Update the Composer root version"
committer: "php-scoper-bot <humbug-php-scoper-bot@example.com>"
commit-message: "Update the Composer root version"
Loading