Skip to content

Ilariaorlando symfony 80#164

Merged
ilaria-orlando merged 19 commits intomasterfrom
ilariaorlando-symfony-80
Jan 19, 2026
Merged

Ilariaorlando symfony 80#164
ilaria-orlando merged 19 commits intomasterfrom
ilariaorlando-symfony-80

Conversation

@ilaria-orlando
Copy link
Contributor

@ilaria-orlando ilaria-orlando commented Jan 8, 2026

upgrade to symfony 8.0 and php 8.5

Summary by Sourcery

Upgrade the project to PHP 8.5 and Symfony 8 while adjusting configuration and CI to match the new runtime.

Enhancements:

  • Rewrite the routes configuration generation to produce a localized attribute-based controllers section with locale requirements and root trailing slash settings.
  • Adjust validator configuration rewriting to inject strict email validation under the validation section instead of replacing existing lines.
  • Bump framework-core and various Symfony and related package versions to Symfony 8-compatible releases.
  • Update development tooling dependencies, including doctrine fixtures bundle and deployer-sumo, to newer major versions.

Build:

  • Raise the minimum required PHP version to 8.5 in composer.json.

CI:

  • Switch GitLab CI images from PHP 8.4 to PHP 8.5 variants and update staging URL host to use the php85 environment.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 8, 2026

Reviewer's Guide

Upgrades the project to PHP 8.5 and Symfony 8.0, adjusts routing/validator post-create configuration to match new conventions, and updates CI images and related dependencies to the PHP 8.5 stack.

Class diagram for updated PostCreateProject configuration methods

classDiagram
    class PostCreateProject {
        -reconfigureAnnotations(Event event) void
        -reconfigureValidator(Event event) void
    }
Loading

Flow diagram for updated validator configuration insertion

flowchart TD
    A[Start_reconfigureValidator] --> B[Resolve_projectDir]
    B --> C[Set_file_path_to_config_packages_validator_yaml]
    C --> D[Read_file_into_lines_array]
    D --> E[Initialize_newLines_array_and_added_flag_false]
    E --> F{For_each_line_in_lines}
    F --> G[Append_current_line_to_newLines]
    G --> H{added_is_false_and_line_matches_^\s*validation:}
    H --> I[Append_email_validation_mode_strict_line]
    I --> J[Set_added_true]
    H --> K[Continue_without_inserting]
    J --> K
    K --> L{More_lines?}
    L --> F
    L --> M[Write_newLines_back_to_validator_yaml]
    M --> N[End_reconfigureValidator]
Loading

File-Level Changes

Change Details Files
Adjust post-create route configuration generation to write a Symfony 8-style controllers block directly instead of patching the existing YAML.
  • Replace regex-based insertion into config/routes.yaml with full overwrite of the controllers routing configuration.
  • Define controllers resource, namespace, attribute type, locale prefix, locale requirements and trailing_slash_on_root explicitly in the generated YAML.
  • Introduce a local $routesFile variable for the routes configuration path for clarity and reuse.
src/Skeleton/PostCreateProject.php
Modify validator configuration post-create logic to inject strict email validation under the validation: section rather than replacing an existing setting line.
  • Read validator.yaml as an array of lines and build a new list while scanning for the validation: key.
  • On first match of a validation: line, insert an indented email_validation_mode: strict entry immediately after it.
  • Write the modified content back to the original validator configuration file.
src/Skeleton/PostCreateProject.php
Upgrade PHP, Symfony, and related package constraints to versions compatible with Symfony 8.0 / PHP 8.5.
  • Bump PHP requirement from ^8.4 to ^8.5.
  • Increase sumocoders/framework-core-bundle and nelmio/security-bundle to newer compatible major/minor versions.
  • Update core Symfony packages (asset-mapper, debug-bundle, dotenv, expression-language, http-client, mailer, messenger, rate-limiter, runtime, security-bundle, validator, web-profiler-bundle, yaml, stopwatch) from ^7.3 to ^8.0.
  • Upgrade doctrine/doctrine-fixtures-bundle and tijsverkoyen/deployer-sumo dev requirements to newer versions.
  • Leave other dependencies unchanged.
composer.json
Update CI configuration and deployment URLs to use PHP 8.5-based images and environment.
  • Switch all GitLab CI jobs from sumocoders/cli-tools-php84 images to sumocoders/cli-tools-php85, and the PHPUnit job from sumocoders/framework-php84 to sumocoders/framework-php85.
  • Update staging deployment URL to use the php85 subdomain instead of php84.
  • Ensure all QA, dependency scanning, outdated packages, scheduled tasks and deploy stages run against PHP 8.5 containers.
.gitlab-ci.yml
.php-version

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new reconfigureAnnotations implementation now overwrites config/routes.yaml entirely with a hardcoded block, which will drop any existing custom routes or comments; consider updating only the relevant controllers section or appending the locale config instead of replacing the whole file.
  • In reconfigureValidator, the logic blindly injects email_validation_mode: strict after the first validation: match with fixed indentation and without checking for an existing key; it would be safer to detect and update an existing email_validation_mode entry or compute indentation from surrounding lines to avoid duplicates or malformed YAML.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `reconfigureAnnotations` implementation now overwrites `config/routes.yaml` entirely with a hardcoded block, which will drop any existing custom routes or comments; consider updating only the relevant `controllers` section or appending the locale config instead of replacing the whole file.
- In `reconfigureValidator`, the logic blindly injects `email_validation_mode: strict` after the first `validation:` match with fixed indentation and without checking for an existing key; it would be safer to detect and update an existing `email_validation_mode` entry or compute indentation from surrounding lines to avoid duplicates or malformed YAML.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ilaria-orlando ilaria-orlando merged commit 4af0749 into master Jan 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants