Skip to content

Commit 02ad0e9

Browse files
authored
Merge branch 'symfony:main' into main
2 parents 6184ab2 + 0b4264c commit 02ad0e9

96 files changed

Lines changed: 4765 additions & 2161 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
; top-most EditorConfig file
1+
# editorconfig.org
2+
23
root = true
34

4-
; Unix-style newlines
55
[*]
66
charset = utf-8
7-
end_of_line = LF
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
810
insert_final_newline = true
911
trim_trailing_whitespace = true
1012

11-
[*.{php,html,twig}]
12-
indent_style = space
13-
indent_size = 4
13+
[{compose.yaml,compose.*.yaml}]
14+
indent_size = 2
1415

1516
[*.md]
16-
max_line_length = 80
17-
18-
[COMMIT_EDITMSG]
19-
max_line_length = 0
17+
trim_trailing_whitespace = false

.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
###> symfony/framework-bundle ###
1818
APP_ENV=dev
1919
APP_SECRET=
20+
APP_SHARE_DIR=var/share
2021
###< symfony/framework-bundle ###
2122

2223
###> doctrine/doctrine-bundle ###
@@ -32,3 +33,9 @@ DATABASE_URL="sqlite:///%kernel.project_dir%/data/database.sqlite"
3233
###> symfony/mailer ###
3334
MAILER_DSN=null://null
3435
###< symfony/mailer ###
36+
37+
###> symfony/routing ###
38+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
39+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
40+
DEFAULT_URI=http://localhost
41+
###< symfony/routing ###

.env.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
# Define your env variables for the development environment here
2+
3+
###> symfony/framework-bundle ###
4+
# APP_SECRET=
5+
###< symfony/framework-bundle ###

.env.local.demo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This variable is for the demo app only!
2+
# See https://symfony.com/doc/current/reference/configuration/framework.html#configuration-framework-secret
3+
APP_SECRET=not-a-secret--read-the-doc!

.env.test

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# Define your env variables for the test environment here
22
KERNEL_CLASS='App\Kernel'
33
APP_SECRET='$ecretf0rt3st'
4-
SYMFONY_DEPRECATIONS_HELPER=999999
5-
PANTHER_APP_ENV=panther
6-
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
74
DATABASE_URL=sqlite:///%kernel.project_dir%/data/database_test.sqlite
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: End to End Tests
2+
3+
on:
4+
schedule:
5+
# run daily at 2:00 AM UTC
6+
- cron: '0 2 * * *'
7+
8+
# allow manual triggering for testing purposes
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test-symfony-cli-installation:
16+
name: Test Symfony CLI Installation
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
coverage: none
24+
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter
25+
php-version: '8.2'
26+
tools: symfony-cli
27+
28+
- name: Configure environment
29+
run: |
30+
git config --global init.defaultBranch main
31+
git config --global user.email "noreply@example.com"
32+
git config --global user.name "Symfony Demo"
33+
34+
- name: Create project using Symfony CLI
35+
run: symfony new --demo ${{ github.job }}
36+
37+
- name: Test application
38+
working-directory: ${{ github.job }}
39+
run: |
40+
php bin/console about
41+
symfony server:start -d --no-tls
42+
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
43+
symfony server:stop
44+
45+
test-composer-create-project:
46+
name: Test Composer Create Project
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Setup PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
coverage: none
54+
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter
55+
php-version: latest
56+
tools: symfony-cli
57+
58+
- name: Create project using Composer
59+
run: composer create-project symfony/symfony-demo ${{ github.job }}
60+
61+
- name: Test application
62+
working-directory: ${{ github.job }}
63+
run: |
64+
php bin/console about
65+
symfony server:start -d --no-tls
66+
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
67+
symfony server:stop
68+
69+
test-git-clone-installation:
70+
name: Test Git Clone Installation
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Setup PHP
75+
uses: shivammathur/setup-php@v2
76+
with:
77+
coverage: none
78+
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter
79+
php-version: '8.3'
80+
tools: symfony-cli
81+
82+
- name: Clone repository and install dependencies
83+
run: |
84+
git clone https://github.com/symfony/demo.git ${{ github.job }}
85+
cd ${{ github.job }}
86+
composer install
87+
88+
- name: Test application
89+
working-directory: ${{ github.job }}
90+
run: |
91+
php bin/console about
92+
symfony server:start -d --no-tls
93+
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
94+
symfony server:stop
95+
96+
notify-on-failure:
97+
if: ${{ always() && contains(needs.*.result, 'failure') }}
98+
name: Notify on Failure
99+
needs: [test-symfony-cli-installation, test-composer-create-project, test-git-clone-installation]
100+
runs-on: ubuntu-latest
101+
102+
permissions:
103+
issues: write
104+
105+
steps:
106+
- name: Create Issue on Failure
107+
uses: actions/github-script@v7
108+
env:
109+
NEEDS_CONTEXT: ${{ toJSON(needs) }}
110+
with:
111+
script: |
112+
const needsContext = JSON.parse(process.env.NEEDS_CONTEXT);
113+
114+
// Map job ids to human-readable names used in the workflow UI
115+
const jobNames = {
116+
'test-symfony-cli-installation': 'Test Symfony CLI Installation',
117+
'test-composer-create-project': 'Test Composer Create Project',
118+
'test-git-clone-installation': 'Test Git Clone Installation',
119+
};
120+
121+
const failedJobs = Object.entries(needsContext)
122+
.filter(([, v]) => v.result === 'failure')
123+
.map(([id]) => `- **${jobNames[id] || id}**: failed`);
124+
125+
const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
126+
const date = new Date().toISOString().split('T')[0];
127+
const title = `E2E Test Failure: ${date}`;
128+
129+
const body = [
130+
'The daily end-to-end test workflow has failed.',
131+
'',
132+
'This may indicate users are experiencing issues installing the Symfony Demo application.',
133+
'',
134+
`**Run**: ${runUrl}`,
135+
'',
136+
'### Failed Jobs',
137+
failedJobs.join('\n'),
138+
'',
139+
'Please investigate and fix the installation issues as soon as possible.'
140+
].join('\n');
141+
142+
// Ensure label exists
143+
const owner = context.repo.owner;
144+
const repo = context.repo.repo;
145+
const labelName = 'bug';
146+
try {
147+
await github.rest.issues.getLabel({ owner, repo, name: labelName });
148+
} catch {
149+
await github.rest.issues.createLabel({
150+
owner, repo, name: labelName, color: 'd73a4a', description: 'Something is broken'
151+
});
152+
}
153+
154+
// Reuse an open issue for today if it already exists to avoid duplicates
155+
const { data: issues } = await github.rest.issues.listForRepo({
156+
owner, repo, state: 'open', labels: labelName, per_page: 100
157+
});
158+
const existing = issues.find(i => i.title === title);
159+
160+
if (existing) {
161+
await github.rest.issues.createComment({
162+
owner, repo, issue_number: existing.number,
163+
body: `Another failing run detected.\n\n${body}`
164+
});
165+
} else {
166+
await github.rest.issues.create({ owner, repo, title, body, labels: [labelName] });
167+
}

.github/workflows/lint.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: "Checkout code"
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
2222

2323
- name: PHP-CS-Fixer
24-
uses: docker://oskarstark/php-cs-fixer-ga
24+
uses: docker://ghcr.io/php-cs-fixer/php-cs-fixer:3-php8.2
2525
with:
26-
args: --diff --dry-run
26+
args: check --diff --using-cache=no
2727

2828
linters:
2929
name: Linters
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: "Checkout code"
37-
uses: actions/checkout@v4
37+
uses: actions/checkout@v5
3838

3939
- name: "Install PHP with extensions"
4040
uses: shivammathur/setup-php@v2
@@ -85,7 +85,7 @@ jobs:
8585

8686
steps:
8787
- name: Checkout code
88-
uses: actions/checkout@v4
88+
uses: actions/checkout@v5
8989

9090
- name: Setup PHP
9191
uses: shivammathur/setup-php@v2

.github/workflows/tests.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
operating-system: ['ubuntu-latest']
24-
php-version: ['8.2', '8.3', '8.4']
24+
php-version: ['8.2', '8.3', '8.4', '8.5']
2525
include:
2626
- operating-system: 'macos-latest'
2727
php-version: '8.2'
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: "Checkout code"
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@v5
3434

3535
- name: "Install PHP with extensions"
3636
uses: shivammathur/setup-php@v2
@@ -46,11 +46,5 @@ jobs:
4646
- name: "Install dependencies"
4747
run: composer install --ansi --no-interaction --no-progress
4848

49-
- name: "Build and compile assets"
50-
run: |
51-
php bin/console importmap:install
52-
php bin/console sass:build
53-
php bin/console asset-map:compile
54-
5549
- name: "Run tests"
5650
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ phpstan.neon
2020
###< phpstan/phpstan ###
2121

2222
###> phpunit/phpunit ###
23-
.phpunit.result.cache
23+
/.phpunit.cache/
2424
/phpunit.xml
2525
###< phpunit/phpunit ###

.php-cs-fixer.dist.php

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
$fileHeaderComment = <<<COMMENT
413
This file is part of the Symfony package.
514
@@ -9,35 +18,20 @@
918
file that was distributed with this source code.
1019
COMMENT;
1120

12-
$finder = PhpCsFixer\Finder::create()
13-
->in(__DIR__)
14-
->exclude('config')
15-
->exclude('var')
16-
->exclude('public/bundles')
17-
->exclude('public/build')
18-
// exclude files generated by Symfony Flex recipes
19-
->notPath('public/index.php')
20-
->notPath('importmap.php')
21-
;
22-
2321
return (new PhpCsFixer\Config())
22+
->setFinder(
23+
PhpCsFixer\Finder::create()->in(['src', 'tests'])->append([__FILE__])
24+
)
2425
->setRiskyAllowed(true)
2526
->setRules([
2627
'@Symfony' => true,
2728
'@Symfony:risky' => true,
2829
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
29-
'linebreak_after_opening_tag' => true,
30-
'mb_str_functions' => true,
31-
'no_php4_constructor' => true,
32-
'no_unreachable_default_argument_value' => true,
3330
'no_useless_else' => true,
3431
'no_useless_return' => true,
3532
'php_unit_strict' => true,
36-
'phpdoc_order' => true,
3733
'strict_comparison' => true,
3834
'strict_param' => true,
39-
'blank_line_between_import_groups' => false,
4035
])
41-
->setFinder($finder)
4236
->setCacheFile(__DIR__.'/var/.php-cs-fixer.cache')
4337
;

0 commit comments

Comments
 (0)