Skip to content

Conversation

@gothick
Copy link
Owner

@gothick gothick commented Feb 10, 2026

A frankly enormous PR to upgrade to Symfony 6.4 from 5.4 and try to future-proof a lot of stuff for a possible future upgrade to 7.4. Though that will need me to upgrade PHP.

@gitguardian
Copy link

gitguardian bot commented Feb 10, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
27002287 Triggered Generic High Entropy Secret 45e5ff3 .env View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@gothick
Copy link
Owner Author

gothick commented Feb 10, 2026

@copilot Please don't sweat the details on this enormous PR. I only want to know about really important things, like stuff that would actually break the production system.

Copy link
Contributor

Copilot AI commented Feb 10, 2026

@gothick I've opened a new pull request, #290, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the application from Symfony 5.4 to Symfony 6.4 (and related tooling), modernizing the codebase to be more compatible with future Symfony/PHP upgrades (e.g., attributes, typed properties, newer PHPUnit, updated frontend tooling).

Changes:

  • Migrates routing and various framework integrations to Symfony 6.4 conventions (attributes, updated config/recipes, DI via constructors).
  • Modernizes PHP code style and typing (readonly promoted properties, stricter comparisons, #[Override], updated Doctrine repository/entity annotations/attributes).
  • Updates test/tooling/frontend stack (PHPUnit 12 config, Rector config, Encore/core-js versions).

Reviewed changes

Copilot reviewed 131 out of 135 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
webpack.config.js Updates Encore config and core-js version reference.
tests/symfony-container.php Adds helper to provide a booted container for Rector rules.
tests/TwigMarkdownExtraFilterTest.php Modernizes PHPUnit/Twig integration test class declarations/overrides.
tests/TwigGeneralExtensionTest.php Modernizes PHPUnit/Twig integration test class declarations/overrides.
tests/MarkdownServiceTest.php Updates to PHPUnit attributes, iterators for data providers, and stricter patterns.
tests/LocationServiceTest.php Updates kernel/container usage and fixture class references.
tests/ImageTagTest.php Updates PHPUnit group attributes and mocking style.
tests/ImageServiceTest.php Updates stubs/mocks and assertion strictness for EXIF-derived fields.
tests/FeaturedImageTest.php Tightens assertions and fixture loading usage with Symfony 6 test container patterns.
tests/Controller/WanderControllerTest.php Modernizes WebTestCase setup and request method constants.
tests/Controller/HomeControllerTest.php Modernizes WebTestCase setup and request method constants.
tests/Controller/Admin/SettingsControllerTest.php Modernizes WebTestCase setup, fixtures, and request method constants.
templates/base.html.twig Adjusts Encore asset inclusion in base layout.
symfony.lock Updates Symfony recipes/versions to Symfony 6.4 ecosystem and removes deprecated packages/recipes.
src/Utils/ExifHelperInterface.php Minor formatting/spacing adjustments to interface.
src/Utils/ExifHelper.php Refactors to promoted readonly properties and modern callable usage.
src/Twig/WanderRuntime.php Refactors to promoted readonly properties and renames internal fields.
src/Twig/WanderExtension.php Adds #[Override] to extension method.
src/Twig/SrcsetRuntime.php Refactors to promoted readonly properties and simplifies srcset generation.
src/Twig/SrcsetExtension.php Adds #[Override] to extension method.
src/Twig/GeneralRuntime.php Refactors to promoted readonly properties and small control-flow cleanups.
src/Twig/GeneralExtension.php Adds #[Override] to extension method.
src/Service/UploadHelper.php Refactors to promoted readonly properties and improves exception variable naming.
src/Service/TagSluggerService.php Refactors to promoted readonly properties and stricter equality.
src/Service/StatsService.php Refactors DI + simplifies cache callbacks and query execution patterns.
src/Service/SpellingService.php Removes redundant phpdoc and minor formatting.
src/Service/SettingsService.php Tightens type checking for settings row and small formatting.
src/Service/ProblemService.php Refactors DI and modernizes string checks and emptiness checks.
src/Service/NeighbourhoodService.php Refactors DI and minor formatting.
src/Service/MarkdownService.php Refactors constructor signature and minor formatting.
src/Service/ImaggaService.php Refactors DI and minor formatting.
src/Service/ImageService.php Refactors DI, EXIF toolpath handling, and exception variable naming.
src/Service/GpxService.php Refactors DI and fixes boolean operator usage.
src/Service/GoogleLocationTaggingService.php Refactors DI and minor formatting.
src/Service/GoogleImageTaggingService.php Refactors DI, adds typed constants, and modernizes array destructuring.
src/Service/DummyLocationTaggingService.php Refactors DI and exception variable naming.
src/Service/DummyImageTaggingService.php Refactors DI.
src/Repository/WanderRepository.php Adds generics docblocks, overrides findAll, and minor array syntax modernizations.
src/Repository/UserRepository.php Updates password upgrade signature and improves phpdoc typing.
src/Repository/TagRepository.php Adds generics docblocks and uses ::class for DQL delete target.
src/Repository/SettingsRepository.php Adds generics docblocks.
src/Repository/ProblemRepository.php Adds generics docblocks and uses ::class for DQL delete target.
src/Repository/NeighbourhoodRepository.php Adds generics docblocks.
src/Repository/ImageRepository.php Adds generics docblocks and tightens type checks for optional relations.
src/Migrations/Factory/MigrationFactoryDecorator.php Refactors DI to promoted readonly properties.
src/MessageHandler/WarmImageCacheHandler.php Migrates Messenger handler wiring to #[AsMessageHandler] and promoted readonly DI.
src/MessageHandler/RecogniseImageHandler.php Migrates to #[AsMessageHandler] and adds explicit missing-image checks.
src/MessageHandler/GeolocateImageHandler.php Migrates to #[AsMessageHandler] and promoted readonly DI.
src/Message/WarmImageCache.php Refactors message to promoted readonly properties.
src/Message/RecogniseImage.php Refactors message to promoted readonly properties.
src/Message/GeolocateImage.php Refactors message to promoted readonly properties.
src/Form/WanderType.php Adds void return types for Symfony 6 form type signatures.
src/Form/UserChangePasswordType.php Adds void return types for Symfony 6 form type signatures.
src/Form/SettingsType.php Adds void return types for Symfony 6 form type signatures.
src/Form/ImageType.php Adds void return type and modernizes query_builder closure.
src/Form/ImageFilterType.php Adds void return type and uses Request method constant.
src/Form/ImageFilterData.php Adjusts defaults and URL override logic for filter parameters.
src/Exception/ThirdPartyAPIException.php Refactors to promoted readonly property for extra error details.
src/EventListener/WanderUploadListener.php Refactors DI to promoted readonly properties.
src/EventListener/WanderDeleteListener.php Refactors DI and tightens relation null/type checks.
src/EventListener/StatsCacheClearer.php Migrates Doctrine subscriber to attribute-based listeners and refactors DI.
src/EventListener/SearchWanderCustomPropertyListener.php Refactors DI and modernizes array_map callable usage.
src/EventListener/SearchIndexer.php Refactors DI and tightens relation null/type checks.
src/EventListener/ImageUploadListener.php Refactors DI and simplifies listener dependencies.
src/EventListener/ImageGeneralPostPersistListener.php Refactors DI to promoted readonly properties.
src/EventListener/ImageCalculatedFieldSetterListener.php Refactors DI and minor formatting.
src/Entity/Wander.php Migrates ORM mapping to attributes/types and modernizes collection filtering and featured-image typing.
src/Entity/User.php Migrates ORM mapping to DBAL Types constants and adds typed properties.
src/Entity/Tag.php Migrates ORM mapping to DBAL Types constants and implements Stringable.
src/Entity/Settings.php Migrates ORM mapping to DBAL Types constants and adds typed properties.
src/Entity/Problem.php Migrates ORM mapping to DBAL Types constants and switches createdAt init to Carbon.
src/Entity/Neighbourhood.php Migrates ORM mapping to DBAL Types constants and adds typed properties.
src/Entity/Image.php Migrates ORM mapping to DBAL Types constants, modernizes setters, and normalizes tag text handling.
src/DataFixtures/WanderFixtures.php Refactors DI to promoted readonly properties.
src/DataFixtures/UserFixtures.php Refactors DI to promoted readonly properties.
src/DataFixtures/TwoImageFixtures.php Improves exception variable naming and error wrapping.
src/DataFixtures/ThreeWanderFixtures.php Refactors DI to promoted readonly properties.
src/DataFixtures/SingleWanderFixture.php Refactors DI to promoted readonly properties and minor formatting.
src/Controller/Wander/WanderController.php Migrates to attribute routes and constructor DI for repositories/paginator.
src/Controller/UserController.php Migrates to attribute routes and constructor DI; updates password change flow.
src/Controller/TagController.php Migrates to attribute routes and constructor DI for finder/paginator.
src/Controller/StatsController.php Migrates to attribute routes and constructor DI for stats + chart builder.
src/Controller/SecurityController.php Migrates to attribute routes and constructor DI for AuthenticationUtils.
src/Controller/Search/SearchController.php Migrates to attribute routes and constructor DI for finder/paginator.
src/Controller/Image/ImageController.php Migrates to attribute routes and constructor DI for repo/paginator/logger.
src/Controller/HomeController.php Migrates to attribute routes and constructor DI for StatsService.
src/Controller/ExperimentalController.php Migrates to attribute routes.
src/Controller/Api/ApiController.php Migrates to attribute routes and constructor DI for repos/router; updates caching toggle logic.
src/Controller/Admin/WanderController.php Migrates to attribute routes and constructor DI; replaces deprecated getDoctrine() usage.
src/Controller/Admin/SettingsController.php Migrates to attribute routes and constructor DI.
src/Controller/Admin/ProblemController.php Migrates to attribute routes and constructor DI for repos/services.
src/Controller/Admin/ImageController.php Migrates to attribute routes and constructor DI for repo/paginator/services/bus.
src/Controller/Admin/AdminController.php Migrates to attribute routes and constructor DI; cache invalidation via injected cache pool.
src/Controller/AboutController.php Migrates to attribute routes.
src/Command/WanderUpdateFromGpxCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/WanderSetImageNeighbourhoodsCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/UpdateImagesFromExifCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/ImagesUpdateNeighbourhoodsCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/ImagesUpdateLocationsCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/ImagesTagCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/DeleteImagesNewerThanCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/DeleteAllWandersCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/DeleteAllImagesCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
src/Command/AdminCreateAdminCommand.php Migrates to #[AsCommand] and refactors DI to promoted readonly properties.
rector.php Expands Rector configuration for Symfony/Doctrine/PHPUnit/coding style and adds Twig processing.
public/index.php Minor formatting.
phpunit.xml.docker Updates PHPUnit 12 config and temporarily excludes some Twig tests.
phpunit.xml.dev Updates PHPUnit version config and coverage/source configuration.
phpunit.xml.bak Removes outdated backup config.
phpunit.dist.xml Adds Symfony PHPUnit bridge env settings for PHPUnit 12.
phpstan.neon.dist Adjusts bootstrap file to use vendor autoload.
package.json Updates Encore/core-js tooling and removes webpack-notifier dependency.
docker/parseurl.php Adds return type never, modernizes arrays, and tightens comparisons.
config/services.yaml Removes StatsCacheClearer doctrine.event_subscriber service wiring (now attribute-based).
config/routes/security.yaml Adds service-based logout route loader.
config/routes.yaml Switches to attribute-based controller routing import.
config/packages/web_profiler.yaml Updates profiler config for Symfony 6.4.
config/packages/twig.yaml Adds twig file name pattern configuration.
config/packages/translation.yaml Removes translator fallback config entry.
config/packages/sensio_framework_extra.yaml Removes Sensio Framework Extra config (bundle removed).
config/packages/security.yaml Removes enable_authenticator_manager (Symfony 6 default behavior).
config/packages/messenger.yaml Removes reset_on_message and adds commented test transport note.
config/packages/lock.yaml Removes lock configuration (lock component removed).
config/packages/framework.yaml Disables annotations, enables handle_all_throwables, updates session config.
config/packages/doctrine.yaml Updates ORM settings for Symfony 6/Doctrine config (attributes mapping, profiling backtrace, etc.).
config/bundles.php Removes SensioFrameworkExtraBundle registration.
composer.json Updates dependency constraints to Symfony 6.4 ecosystem; removes Sensio extra bundle; updates PHPUnit/fixtures tooling.
bin/phpunit Simplifies PHPUnit entrypoint to vendor phpunit binary.
assets/app.js Imports bootstrap.js explicitly.
Makefile Adds cache:pool clear-all and container shell target.
.vscode/launch.json Refreshes Xdebug launch configs and adds PHP script/webserver launchers.
.env Updates defaults and adds APP_SECRET + DB serverVersion examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

phpunit.xml.dev Outdated
Comment on lines 33 to 36
<bootstrap class="App\Tests\BypassFinalHook"/>
</extensions>
<testsuites>
<testsuite name="Project Test Suite">
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

phpunit.xml.dev references App\\Tests\\BypassFinalHook, but that class does not exist anywhere in the repository (no matches found). PHPUnit will fail to bootstrap; either add the missing class or remove this bootstrap entry.

Suggested change
<bootstrap class="App\Tests\BypassFinalHook"/>
</extensions>
<testsuites>
<testsuite name="Project Test Suite">
</extensions>
<testsuites>
<testsuite name="Project Test Suite">
<testsuite name="Project Test Suite">

Copilot uses AI. Check for mistakes.
Comment on lines 34 to 36
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{{ encore_entry_script_tags('app') }}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

encore_entry_script_tags('app') is rendered twice inside the javascripts block, which will duplicate JS <script> tags and can cause double-execution of modules. Remove the duplicate call so the entry is included only once.

Copilot uses AI. Check for mistakes.
Comment on lines 86 to 90
if (!$endDate instanceof \DateTimeInterface) {
$this->endDate = null;
}

$this->endDate = new CarbonImmutable($endDate);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

setEndDate() sets $this->endDate = null when $endDate is null, but then unconditionally executes new CarbonImmutable($endDate), which will throw a TypeError. Make the CarbonImmutable assignment conditional (e.g., else/early-return) so null stays null.

Copilot uses AI. Check for mistakes.
Comment on lines 47 to 50
return $this->render('admin/settings/edit.html.twig', [
'settings' => $settings,
'form' => $form->createView(),
'form' => $form,
]);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

admin/settings/edit.html.twig renders the form with form_start(form), which expects a FormView, but the controller passes the FormInterface directly. Pass $form->createView() to avoid Twig errors.

Copilot uses AI. Check for mistakes.
Comment on lines 143 to 146
return $this->render('search/index.html.twig', [
'query_string' => $queryString,
'form' => $form->createView(),
'form' => $form,
'pagination' => $pagination
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The template renders the form via form_start(form) and expects a FormView, but the controller passes $form (a FormInterface) instead of $form->createView(). This will break Twig form rendering.

Copilot uses AI. Check for mistakes.
Comment on lines 103 to 106
return $this->render('image/index.html.twig', [
'image_pagination' => $pagination,
'filter_form' => $filterForm->createView()
'filter_form' => $filterForm
]);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

image/index.html.twig uses form_start(filter_form), which expects a FormView, but the controller passes $filterForm (a FormInterface) instead of $filterForm->createView(). Pass the view to prevent Twig errors.

Copilot uses AI. Check for mistakes.
Comment on lines 109 to 112

return $this->render('admin/wander/new.html.twig', [
'form' => $form->createView(),
'form' => $form,
]);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

admin/wander/_form.html.twig uses form_start(form) and expects a FormView, but the controller passes the FormInterface directly. Pass $form->createView() when rendering to avoid Twig form rendering failures.

Copilot uses AI. Check for mistakes.
Comment on lines 136 to 139
return $this->render('admin/image/edit.html.twig', [
'image' => $image,
'form' => $form->createView(),
'form' => $form,
]);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

admin/image/_form.html.twig renders form_start(form) and expects a FormView, but the controller passes the FormInterface directly. Pass $form->createView() when rendering.

Copilot uses AI. Check for mistakes.
.env Outdated
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'

APP_SECRET=59d03d44df133996ab6e79e7b8285385
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

.env now contains a concrete APP_SECRET value committed to the repo. Since this secret is used for things like CSRF and cookie signing, it should not be committed; keep .env with a placeholder and set the real secret via .env.local/runtime env vars/Symfony secrets.

Suggested change
APP_SECRET=59d03d44df133996ab6e79e7b8285385
APP_SECRET=ChangeMeUseEnvOrSymfonySecrets

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI commented Feb 10, 2026

@gothick I've opened a new pull request, #291, to work on those changes. Once the pull request is ready, I'll request review from you.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
21.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@gothick
Copy link
Owner Author

gothick commented Feb 11, 2026

I cannot for the life of me find out how to configure SonarCloud to ignore duplicate code in things like datafixtures, where it's detecting 25% code duplication+ because of a single data fixture of a hardcoded PHP array that has a lot of lines like '[' nad ']' alone, and it detecting those as code duplication. Ignore their stupid quality gate.

@gothick gothick merged commit f52cbcc into main Feb 11, 2026
2 of 3 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.

2 participants