Skip to content

Mago#240

Open
tijsverkoyen wants to merge 18 commits into
masterfrom
mago
Open

Mago#240
tijsverkoyen wants to merge 18 commits into
masterfrom
mago

Conversation

@tijsverkoyen

Copy link
Copy Markdown
Member

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @tijsverkoyen, your pull request is larger than the review limit of 300000 diff characters

Copilot AI left a comment

Copy link
Copy Markdown

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 appears to introduce the “Mago”/code-quality toolchain (formatter + lint/analyser) and align the codebase with stricter typing and modern style rules across PHP, Twig, SCSS, and JS, including new CI workflows/configs.

Changes:

  • Add/enforce new quality tooling (Mago, PHPStan, PHP_CodeSniffer, Twig-CS-Fixer, Stylelint, StandardJS) and CI workflows.
  • Modernize/standardize code style and types across the bundle (typed returns, nullable handling, Twig hash syntax, SCSS/JS formatting).
  • Remove legacy PHPUnit bootstrap/config in favor of the new tooling focus.

Reviewed changes

Copilot reviewed 82 out of 86 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/bootstrap.php Removes legacy PHPUnit bootstrap.
templates/user.html.twig Switches to include() function call style.
templates/Twig/pagination.html.twig Twig hash syntax modernization in route param merges.
templates/navigation.html.twig Twig hash syntax modernization for menu render options.
templates/languagetoggler.html.twig Twig hash syntax modernization for locale param merge.
templates/head.html.twig Twig hash syntax modernization for importmap nonce options.
templates/Form/fields.html.twig Twig style/spacing consistency updates and hash syntax changes.
templates/Error/error.html.twig Minor formatting normalization.
templates/empty.html.twig Switches to include() function call style.
templates/base_no_sidebar.html.twig Switches to include() function call style.
templates/base_error.html.twig Switches to include() function call style.
src/ValueObject/Route.php Adds Mago expectation annotations for analysis.
src/ValueObject/BelgiumPostCode.php Adds return type to __toString().
src/ValueObject/AbstractImage.php Tightens null-handling for paths and fallback behavior.
src/ValueObject/AbstractFile.php Tightens null-handling, typing, and internal flow around file operations.
src/Twig/PaginatorExtension.php Formatting + Mago expectation annotations.
src/Twig/FrameworkExtension.php Constructor formatting + Mago expectation annotations around request access.
src/Twig/ContentExtension.php Constructor formatting (trailing comma).
src/Service/Security/NonceGenerator.php Simplifies control flow and adds Mago expectation for unused parameter.
src/Service/PageTitle.php Adds breadcrumb typing and clarifies empty checks/array_map typing.
src/Service/BreadcrumbTrail.php Adds iterator generics docs + breadcrumb array typing.
src/Serializer/MaxDepthHandler.php Adds parameter/return typing and refactors reflection handling.
src/Serializer/CircularReferenceHandler.php Adds parameter/return typing and refactors reflection handling.
src/Pagination/Paginator.php Adds generics docs, typed constants, and typing/iterator adjustments.
src/Menu/MenuBuilder.php Formatting updates + stricter comparisons and array handling.
src/Logger/AuditLogger.php Adds docs/expectations and formatting updates.
src/Intl/BelgiumPostCodes.php Adds Mago expectation for mixed return.
src/Form/Type/ImageType.php Adds typing, static closures, and stricter required/empty checks.
src/Form/Type/FileType.php Adds typing, static closures, and stricter required/empty checks.
src/Form/Type/BelgiumPostCodeType.php Adds ChoiceLoaderInterface typing and refactors closures/formatting.
src/Form/Extension/TogglePasswordTypeExtension.php Refactors view building, formatting, and explicit controller value map.
src/Form/Extension/TimeTypeExtension.php Uses str_contains, formatting normalization.
src/Form/Extension/DateTypeExtension.php Uses str_contains, formatting normalization.
src/Form/Extension/DateTimeTypeExtension.php Uses str_contains, formatting normalization.
src/Form/Extension/CollectionTypeExtension.php Adds validation logic structure, typing casts, and formatting.
src/Form/Extension/BirthdayTypeExtension.php Minor formatting normalization.
src/Extensions/Doctrine/MatchAgainst.php Removes custom Doctrine DQL function implementation.
src/EventListener/TitleListener.php Refactors checks/formatting and adds Mago expectation annotations.
src/EventListener/DoctrineExtensionListener.php Constructor formatting + Mago expectation annotations.
src/EventListener/DefaultMenuListener.php Import ordering, constructor formatting, and null request handling.
src/EventListener/BreadcrumbListener.php Major formatting/typing/annotation pass + Mago expectation annotations.
src/Event/ConfigureMenuEvent.php Typed constant + unused private setters annotated/ignored.
src/DoctrineListener/DoctrineAuditListener.php Adds docs, refactors checks/formatting, and adjusts transform typing/behavior.
src/DependencyInjection/SumoCodersFrameworkCoreExtension.php Import ordering and trailing comma formatting.
src/DependencyInjection/Configuration.php Simplifies return to direct TreeBuilder instantiation.
src/DBALType/EncryptedDBALType.php Tightens env validation and refactors conversion error handling.
src/DBALType/AbstractImageType.php Normalizes DBAL signatures and adds null handling.
src/DBALType/AbstractFileType.php Normalizes DBAL signatures and adds null handling.
src/Command/TranslateCommand.php Adds expectations/ignores for foreach typing.
src/Command/Maintenance/CreatePrForOutdatedDependenciesCommand.php Refactors command execution/logging + formatting and typing hints.
src/Attribute/Title.php Tightens types and route construction shape docs.
src/Attribute/Breadcrumb.php Tightens types/docs and route/parent construction shape docs.
src/Attribute/AuditTrail/AuditTrail.php Formats constructor, adds typing expectations.
phpunit.xml.dist Removes PHPUnit configuration file.
phpstan.dist.neon Adds PHPStan configuration (level, paths, ignores).
phpcs.xml.dist Adds PHPCS ruleset configuration (PSR12).
mago.dist.toml Adds Mago configuration (PHP version, rules, integrations).
composer.json Adds new dev tooling deps and adds Symfony validator/http-client.
assets/scss/plugins/_bootstrap-tagsinput.scss SCSS modernization (color syntax, pseudo-element, spacing).
assets/scss/mail/_variables.scss Normalizes font-family casing.
assets/scss/mail.scss Minor formatting (blank line).
assets/scss/layouts/_search.scss Shorthand margin normalization.
assets/scss/error.scss Removes trailing blank line.
assets/scss/components/_cards.scss Uses inset: 0 instead of individual offsets.
assets/scss/components/_alerts.scss Normalizes font-family quoting style.
assets/scss/base/_fonts.scss Comment spacing normalization.
assets/scss/base/_error.scss Shorthand margin normalization.
assets/scss/_bootstrap-variables-dark.scss Large formatting normalization + attribute selector quoting.
assets/scss/_bootstrap-imports.scss Comment spacing normalization + trailing blank line.
assets-public/js/ajax_client.js StandardJS style tweaks (object key quoting, const).
assets-public/controllers/theme_controller.js Removes unused imports and adjusts linting for globals.
assets-public/controllers/form_collection_controller.js Uses const for non-reassigned variable.
assets-public/controllers/date_time_picker_controller.js ESLint disable/enable around unused locale imports.
assets-public/controllers/confirm_controller.js Removes trailing comma + adds spacing.
assets-public/controllers/busy_submit_controller.js StandardJS semicolon removal + const spinner.
.twig-cs-fixer.dist.php Adds Twig-CS-Fixer configuration.
.stylelintrc Adds Stylelint configuration for SCSS standard rules.
.stylelintignore Adds Stylelint ignore patterns.
.php-version Pins PHP version to 8.5.
.gitlab-ci.yml Adds GitLab CI pipeline for the new toolchain.
.gitignore Updates ignored caches (PHPCS/Twig-CS-Fixer).
.github/workflows/install.yml Adds reusable install workflow.
.github/workflows/dependency-scanning.yml Adds dependency audit/outdated GitHub workflow.
.github/workflows/code-quality.yml Adds code-quality GitHub workflow for Mago/PHPStan/PHPCS/Twig/Stylelint/StandardJS.

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

Comment thread src/Attribute/Title.php
Comment on lines 17 to +21
public function __construct(
string $title,
?array $parent = null,
$extend = true,
// @mago-expect analysis:unused-parameter
bool $extend = true,
Comment on lines 19 to 22
foreach ($properties as $property) {
if ($property->getAttributes(Id::class)) {
$property->setAccessible(true);
return (string) $property->getValue($object);
}
Comment on lines +354 to 355
return $value;
}
Comment on lines 137 to 141
public function count(): int
{
// @mago-expect analysis:possibly-invalid-argument
return count($this->getResults());
}
Comment on lines 26 to 29
foreach ($properties as $property) {
if ($property->getAttributes(Id::class)) {
$property->setAccessible(true);
return (string) $property->getValue($entity);
return (string) $property->getValue($object);
}
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