style: fix indentation, alignment, and docblock annotations
- Correct getChoices() docblock to reflect translated label => enum backing value order instead of value => label - Re-indent Smart Links menu config to match actual array nesting - Align assignment operators in RefreshStatsCommand - Add missing newline at end of RefreshStatsCommand.php
This commit is contained in:
1 parent
07773acb8d
commit
b138056e43
90 files changed
+622
-272
No files matched your search
@@ -56,6 +56,29 @@ cd ../mautic-dev-env
|
||||
|
||||
For the complete list of commands, see the dev environment's README.
|
||||
|
||||
## Coding standards
|
||||
|
||||
The plugin runs the same code quality tools as Mautic core, configured in the repository root:
|
||||
|
||||
- **PHP-CS-Fixer** (`.php-cs-fixer.dist.php`): core's own ruleset — `@Symfony` plus its tweaks (aligned `=>`/`=` operators, ordered imports, short arrays, no unused imports, no header comments) minus the custom fixer of the `mautic/coding-standards` package, which a standalone plugin repository cannot require.
|
||||
- **PHPStan** (`phpstan.neon`): level 6, with the same pragmatic ignores core keeps, and the plugin's `Tests/bootstrap.php` as the bootstrap so the analysis resolves the classes of the Mautic installation. The documented pre-existing debt (Doctrine-assigned entity ids, historical migrations referencing the pre-rename entity classes, core's generic `AbstractCommonModel::getRepository()` annotations) is recorded in `phpstan-baseline.neon`; new errors still fail the analysis. Regenerate after fixing entries: `vendor/bin/phpstan analyse --generate-baseline -c phpstan.neon`.
|
||||
- **GitLab CI** (`.gitlab-ci.yml`): every push runs `composer cs-check` and `composer phpstan`. The PHPUnit suite is not run in CI: it needs a full Mautic installation (its bootstrap walks up to the nearest `vendor/autoload.php`).
|
||||
|
||||
The tools are `require-dev` dependencies (`composer install` in the plugin directory pulls `mautic/core-lib` and the tools, so the analysis sees the real Mautic signatures):
|
||||
|
||||
```bash
|
||||
composer install # once, in the plugin directory
|
||||
composer cs-check # dry run with the diff
|
||||
composer cs-fix # fix in place
|
||||
composer phpstan # PHPStan level 6
|
||||
```
|
||||
|
||||
From the dev environment's running Mautic container instead (no local `composer install` needed):
|
||||
|
||||
```bash
|
||||
docker compose exec mautic_web php vendor/bin/phpunit -c docroot/plugins/MT3SMarketingProgramBundle/phpunit.xml.dist
|
||||
```
|
||||
|
||||
## Plugin structure
|
||||
|
||||
The plugin uses the IntegrationsBundle conventions:
|
||||
|
||||
Reference in new issue
Block a user