Skip to content

Commit 6a3b980

Browse files
authored
Merge branch '3.x' into tests
2 parents d8be376 + 4456541 commit 6a3b980

File tree

225 files changed

+3681
-1819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+3681
-1819
lines changed

.github/workflows/coding-conventions.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55
workflow_dispatch:
66

7-
# CSFixer and Rector are temporarily disabled until they have proper PHP 8.4 support
87
jobs:
98
check-style:
109
name: Run style check
@@ -15,12 +14,12 @@ jobs:
1514
- name: Setup PHP
1615
uses: shivammathur/setup-php@v2
1716
with:
18-
php-version: 8.4
17+
php-version: 8.5
1918
coverage: none
2019

2120
- name: Install dependencies
2221
run: |
23-
composer update --prefer-dist --no-interaction
22+
composer update --prefer-dist --no-interaction --ignore-platform-reqs
2423
composer mago:install-binary
2524
2625
- name: Run Mago
@@ -46,7 +45,7 @@ jobs:
4645
- name: Setup PHP
4746
uses: shivammathur/setup-php@v2
4847
with:
49-
php-version: 8.4
48+
php-version: 8.5
5049
coverage: none
5150

5251
- name: Install composer dependencies
@@ -65,7 +64,7 @@ jobs:
6564
# - name: Setup PHP
6665
# uses: shivammathur/setup-php@v2
6766
# with:
68-
# php-version: 8.4
67+
# php-version: 8.5
6968
# coverage: none
7069
#
7170
# - name: Install composer dependencies

.github/workflows/integration-tests-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
php:
19-
- 8.4
19+
- 8.5
2020
os:
2121
- windows-latest
2222
env:
@@ -55,7 +55,7 @@ jobs:
5555
os:
5656
- windows-latest
5757
php:
58-
- 8.4
58+
- 8.5
5959
database:
6060
- sqlite
6161
- mysql
@@ -84,7 +84,7 @@ jobs:
8484
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
8585
8686
- name: Install dependencies
87-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
87+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ignore-platform-reqs
8888

8989
- name: "Setup Redis"
9090
if: ${{ matrix.os != 'windows-latest' }}

.github/workflows/integration-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
php:
23-
- 8.4
23+
- 8.5
2424
os:
2525
- ubuntu-latest
2626
# - windows-latest
@@ -59,7 +59,7 @@ jobs:
5959
- ubuntu-latest
6060
# - windows-latest
6161
php:
62-
- 8.4
62+
- 8.5
6363
database:
6464
- sqlite
6565
- mysql
@@ -90,7 +90,7 @@ jobs:
9090
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
9191
9292
- name: Install dependencies
93-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
93+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ignore-platform-reqs
9494

9595
- name: "Setup Redis"
9696
if: ${{ matrix.os != 'windows-latest' }}

.github/workflows/isolated-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: 8.4
20+
php-version: 8.5
2121
coverage: none
2222

2323
- uses: actions/checkout@v4
@@ -43,7 +43,7 @@ jobs:
4343
- ubuntu-latest
4444
package: ${{ fromJson(needs.get_packages.outputs.matrix) }}
4545
php:
46-
- 8.4
46+
- 8.5
4747
stability:
4848
- prefer-stable
4949
- prefer-lowest
@@ -75,9 +75,9 @@ jobs:
7575
7676
- name: Install dependencies
7777
run: |
78-
./bin/build-changed-packages
78+
./bin/build-packages
7979
cd "packages/${{ matrix.package.basename }}"
80-
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
80+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ignore-platform-reqs
8181
8282
- name: Execute tests
8383
run: phpunit -c "packages/${{ matrix.package.basename }}/phpunit.xml"

.github/workflows/subsplit-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set Up PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: 8.4
20+
php-version: 8.5
2121
coverage: none
2222

2323
- uses: actions/checkout@v4

.github/workflows/validate-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: 8.4
21+
php-version: 8.5
2222
extensions: dom, curl, libxml, mbstring, pcntl, fileinfo, intl
2323
coverage: none
2424

bin/build-changed-packages

Lines changed: 0 additions & 56 deletions
This file was deleted.

bin/build-packages

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/**
5+
* Though this script attempts to simplify, it borrows heavily from Symfony's approach.
6+
*
7+
* @see https://github.com/symfony/symfony/blob/7.2/.github/build-packages.php
8+
*/
9+
10+
$output = shell_exec(__DIR__ . '/get-packages');
11+
$tempestPackages = json_decode($output, associative: true);
12+
13+
// Determine the dev version from inter-package dependencies.
14+
// This ensures we bundle packages with the same version that deps expect.
15+
$devVersion = 'dev-main';
16+
17+
foreach ($tempestPackages as $package) {
18+
$composerPath = sprintf('%s/composer.json', $package['directory']);
19+
$composerFile = json_decode(file_get_contents($composerPath), true);
20+
21+
foreach ($composerFile['require'] ?? [] as $dep => $version) {
22+
if (str_starts_with($dep, 'tempest/') && str_starts_with($version, 'dev-')) {
23+
$devVersion = $version;
24+
break 2;
25+
}
26+
}
27+
}
28+
29+
$composerPackages = [
30+
'packages' => [],
31+
];
32+
33+
foreach ($tempestPackages as $package) {
34+
$composerPath = sprintf('%s/composer.json', $package['directory']);
35+
$composerFile = json_decode(file_get_contents($composerPath), true);
36+
37+
// Bundle ALL packages as tar files to ensure consistent versions.
38+
// This ensures all inter-package dependencies (e.g., dev-3.x) can be
39+
// resolved from the local repository.
40+
passthru(sprintf("cd %s && tar -cf package.tar --exclude='package.tar' *", $package['directory']));
41+
42+
$composerFile['version'] = $devVersion;
43+
$composerFile['dist']['type'] = 'tar';
44+
$composerFile['dist']['url'] = 'file://'. $package['directory'] . '/package.tar';
45+
46+
// Add the package details to the root "packages.json."
47+
$composerPackages['packages'][$composerFile['name']][$composerFile['version']] = $composerFile;
48+
49+
// Load the packages from the root "packages.json" file we will write in a second.
50+
$composerFile['repositories'] = [
51+
[
52+
'type' => 'composer',
53+
'url' => realpath(__DIR__ . '/../'),
54+
]
55+
];
56+
57+
file_put_contents($composerPath, json_encode($composerFile, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
58+
}
59+
60+
file_put_contents(__DIR__ . '/../packages.json', json_encode($composerPackages, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
61+
62+
var_dump(file_get_contents(__DIR__ . '/../packages.json'));

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"monolog/monolog": "^3.7.0",
2525
"nette/php-generator": "^4.1.6",
2626
"nikic/php-parser": "^5.3",
27-
"php": "^8.4",
27+
"php": "^8.5",
2828
"psr-discovery/http-client-implementations": "^1.4",
2929
"psr-discovery/http-factory-implementations": "^1.2",
3030
"psr/cache": "^3.0",

docs/1-essentials/01-routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Once you have created a request class, you may simply inject it into a controlle
368368
```php app/AirportController.php
369369
use Tempest\Router\Post;
370370
use Tempest\Http\Responses\Redirect;
371-
use function Tempest\map;
371+
use function Tempest\Mapper\map;
372372
use function Tempest\Router\uri;
373373

374374
final readonly class AirportController

0 commit comments

Comments
 (0)