Skip to content

Conversation

@COil
Copy link
Member

@COil COil commented Oct 6, 2024

[2026-01-16] Update from main, Symfony 8.

The goal of this feature is to use Doctrine DBAL to display the content of a user table of a SQLite database. It is the same feature as in the eloquent feature branch.

@COil COil added the feature branch Feeature branch demo label Oct 6, 2024
@COil COil self-assigned this Oct 6, 2024
@COil COil changed the title feat: use Doctrine DBAL to query a SQLite database feature branch: use Doctrine DBAL Oct 6, 2024
@COil COil force-pushed the doctrine-dbal branch 13 times, most recently from b824659 to c538040 Compare October 11, 2024 20:29
@COil COil force-pushed the doctrine-dbal branch 2 times, most recently from ec2fa69 to f0b7064 Compare December 22, 2024 18:58
@COil COil changed the title feature branch: use Doctrine DBAL feature branch: use Doctrine Feb 21, 2025
Copilot AI review requested due to automatic review settings January 16, 2026 20:38
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

This PR integrates Doctrine DBAL to display user data from a SQLite database, mirroring functionality from a previous Eloquent implementation. It adds database migrations, fixture loading, and a users list page.

Changes:

  • Adds Doctrine DBAL/ORM packages and configures database connection to SQLite
  • Creates user table migration and fixtures loading command
  • Implements users list controller and template to display database records

Reviewed changes

Copilot reviewed 13 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
composer.json Adds Doctrine dependencies and disables security audit blocking
config/bundles.php Registers Doctrine and Doctrine Migrations bundles
config/packages/doctrine.php Configures Doctrine DBAL/ORM with SQLite connection
config/packages/doctrine_migrations.php Configures migrations path and disables profiler
.env Adds DATABASE_URL configuration for SQLite database
migrations/Version20241005210212.php Creates user table schema with id, email, password, pseudo, and timestamps
src/Command/LoadFixturesCommand.php Implements command to populate user table with test data
src/Controller/ListUsersAction.php Controller to fetch and display all users from database
templates/App/Controller/ListUsersAction.html.twig Template displaying user data in a table
templates/base.html.twig Adds navigation link to users list page
Makefile Adds load-fixtures target and updates coverage to run fixtures
castor.php Adds loadFixures function and integrates it into test/coverage tasks
tests/Integration/Command/LoadFixturesCommandTest.php Integration test for fixtures loading command

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

@COil COil requested a review from Copilot January 16, 2026 20:45
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

Copilot reviewed 13 out of 19 changed files in this pull request and generated 3 comments.


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

@COil COil requested a review from Copilot January 16, 2026 20:59
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

Copilot reviewed 13 out of 19 changed files in this pull request and generated 1 comment.


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

@COil COil requested a review from Copilot January 16, 2026 21:02
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

Copilot reviewed 13 out of 19 changed files in this pull request and generated 3 comments.


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

@COil COil requested a review from Copilot January 16, 2026 21:07
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

Copilot reviewed 13 out of 19 changed files in this pull request and generated 2 comments.


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

for ($i = 1; $i <= 10; ++$i) {
$this->connection->insert('user', [
'email' => \sprintf('user%[email protected]', $i),
'password' => password_hash(ByteString::fromRandom(32)->toString(), \PASSWORD_DEFAULT),
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The PASSWORD_DEFAULT algorithm constant may change in future PHP versions, which could cause inconsistencies in fixture data across different environments or PHP versions. Consider explicitly specifying PASSWORD_BCRYPT or PASSWORD_ARGON2ID for predictable fixture behavior.

Suggested change
'password' => password_hash(ByteString::fromRandom(32)->toString(), \PASSWORD_DEFAULT),
'password' => password_hash(ByteString::fromRandom(32)->toString(), \PASSWORD_BCRYPT),

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +26
'orm' => [
'validate_xml_mapping' => true,
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
'auto_mapping' => true,
'mappings' => [
'App' => [
'type' => 'attribute',
'is_bundle' => false,
'dir' => '%kernel.project_dir%/src/Entity',
'prefix' => 'App\Entity',
'alias' => 'App',
],
],
],
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

ORM configuration is present but the PR only uses Doctrine DBAL (as stated in the description and controller implementation). This ORM configuration references a non-existent Entity directory and may cause confusion. Consider removing the ORM configuration or documenting why it's included for future use.

Suggested change
'orm' => [
'validate_xml_mapping' => true,
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
'auto_mapping' => true,
'mappings' => [
'App' => [
'type' => 'attribute',
'is_bundle' => false,
'dir' => '%kernel.project_dir%/src/Entity',
'prefix' => 'App\Entity',
'alias' => 'App',
],
],
],

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature branch Feeature branch demo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants