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:
Alexandre Gain committed 2026-11-21 11:23:33 +01:00
1 parent 07773acb8d
commit b138056e43
90 files changed
+622 -272

No files matched your search

+15 -15
View File
@@ -141,16 +141,16 @@ class Audience extends FormEntity
public function __construct()
{
$this->stages = new ArrayCollection();
$this->segments = new ArrayCollection();
$this->stages = new ArrayCollection();
$this->segments = new ArrayCollection();
$this->programLinks = new ArrayCollection();
}
public function __clone()
{
$this->id = null;
$this->stages = new ArrayCollection();
$this->segments = new ArrayCollection();
$this->id = null;
$this->stages = new ArrayCollection();
$this->segments = new ArrayCollection();
$this->programLinks = new ArrayCollection();
parent::__clone();
@@ -171,21 +171,21 @@ class Audience extends FormEntity
// Mapped on the raw metadata: ClassMetadataBuilder::addField() forces every string to VARCHAR(191).
$metadata->mapField([
'fieldName' => 'audienceType',
'fieldName' => 'audienceType',
'columnName' => 'audience_type',
'type' => Types::STRING,
'length' => 30,
'enumType' => AudienceType::class,
'options' => ['default' => AudienceType::Persona->value],
'type' => Types::STRING,
'length' => 30,
'enumType' => AudienceType::class,
'options' => ['default' => AudienceType::Persona->value],
]);
foreach ([
'tagline' => 'tagline',
'tagline' => 'tagline',
'profileCriteria' => 'profile_criteria',
'motivations' => 'motivations',
'barriers' => 'barriers',
'frustrations' => 'frustrations',
'triggers' => 'triggers',
'motivations' => 'motivations',
'barriers' => 'barriers',
'frustrations' => 'frustrations',
'triggers' => 'triggers',
] as $field => $column) {
$metadata->mapField([
'fieldName' => $field,
+10 -8
View File
@@ -105,12 +105,12 @@ class Program extends FormEntity implements DateRangeInterface
public function __construct()
{
$this->objectives = new ArrayCollection();
$this->descriptionItems = new ArrayCollection();
$this->allocationItems = new ArrayCollection();
$this->objectives = new ArrayCollection();
$this->descriptionItems = new ArrayCollection();
$this->allocationItems = new ArrayCollection();
$this->audiences = new ArrayCollection();
$this->stakeholders = new ArrayCollection();
$this->tasks = new ArrayCollection();
$this->stakeholders = new ArrayCollection();
$this->tasks = new ArrayCollection();
}
public function __clone()
@@ -163,8 +163,10 @@ class Program extends FormEntity implements DateRangeInterface
->setCustomRepositoryClass(ProgramRepository::class)
->addIndex(['status'], 'program_status');
// id and name; no description column (replaced by description items).
$builder->addIdColumns('name', false);
// id and name; no description column (replaced by description items). The false is
// core's own way to skip the column (addIdColumns checks it for truthiness); core's
// @param string docblock just doesn't mention it.
$builder->addIdColumns('name', false); // @phpstan-ignore argument.type (false is core's own way to skip the column; its @param string docblock doesn't mention it)
// Mapped on the raw metadata: ClassMetadataBuilder::addField() forces every string to VARCHAR(191).
$metadata->mapField([
@@ -468,7 +470,7 @@ class Program extends FormEntity implements DateRangeInterface
}
/**
* @template T of ProgramObjective|ProgramDescriptionItem|ProgramAllocationItem|Audience|ProgramStakeholder
* @template T of ProgramObjective|ProgramDescriptionItem|ProgramAllocationItem|ProgramAudience|ProgramStakeholder
*
* @param Collection<int, T> $collection
*
+1 -1
View File
@@ -49,7 +49,7 @@ class ProgramAllocationItem
public function __clone()
{
$this->id = null;
$this->id = null;
$this->program = null;
}
+1 -1
View File
@@ -43,7 +43,7 @@ class ProgramAudience
public function __clone()
{
$this->id = null;
$this->id = null;
$this->program = null;
}
+1 -1
View File
@@ -15,4 +15,4 @@ class ProgramAudienceRepository extends CommonRepository
{
return 'pa';
}
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ class ProgramDescriptionItem
public function __clone()
{
$this->id = null;
$this->id = null;
$this->program = null;
}
+1 -1
View File
@@ -53,7 +53,7 @@ class ProgramObjective
public function __clone()
{
$this->id = null;
$this->id = null;
$this->program = null;
}
+1 -1
View File
@@ -40,7 +40,7 @@ class ProgramStakeholder
public function __clone()
{
$this->id = null;
$this->id = null;
$this->program = null;
}
+4 -4
View File
@@ -24,10 +24,10 @@ enum ProgramStatus: string
public function getLabelClass(): string
{
return match ($this) {
self::Active => 'label-success',
self::Completed => 'label-info',
self::Paused => 'label-warning',
self::Archived => 'label-default',
self::Active => 'label-success',
self::Completed => 'label-info',
self::Paused => 'label-warning',
self::Archived => 'label-default',
self::Draft, self::Planned => 'label-primary',
};
}
+4
View File
@@ -71,10 +71,13 @@ class SmartLinkRepository extends CommonRepository
$this->getTableAlias().'.destinationUrl',
]);
}
/**
* The Hits column of the list sorts by the number of hits of each link: the virtual
* "hitCount" order by maps to the HIDDEN hitCount scalar of the list query. Everything
* else falls back to core's column handling.
*
* @param array<string, mixed> $args
*/
protected function buildOrderByClause($q, array $args): void
{
@@ -92,6 +95,7 @@ class SmartLinkRepository extends CommonRepository
parent::buildOrderByClause($q, $args);
}
/**
* @return array<array{0: string, 1: string}>
*/
+3 -2
View File
@@ -19,9 +19,10 @@ class StakeholderRepository extends CommonRepository
}
/**
* The list's search box matches the name, email, role and type.
* The list's search box matches the name, email, role and type. Core passes the filter
* as an object with ->string and ->strict (its own docblock), not an array.
*
* @param array<int, mixed> $filter
* @param \stdClass $filter
*
* @return array<int, mixed>
*/
+5 -5
View File
@@ -51,12 +51,12 @@ class TaskDependency
->build();
$metadata->mapField([
'fieldName' => 'dependencyType',
'fieldName' => 'dependencyType',
'columnName' => 'dependency_type',
'type' => Types::STRING,
'length' => 20,
'enumType' => DependencyType::class,
'options' => ['default' => DependencyType::EndToStart->value],
'type' => Types::STRING,
'length' => 20,
'enumType' => DependencyType::class,
'options' => ['default' => DependencyType::EndToStart->value],
]);
$builder->createField('position', Types::INTEGER)
+1 -1
View File
@@ -4,9 +4,9 @@ declare(strict_types=1);
namespace MauticPlugin\MT3SMarketingProgramBundle\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping\ClassMetadata as OrmClassMetadata;
use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder;
+2 -2
View File
@@ -59,7 +59,7 @@ class UtmTaxonomy extends FormEntity
// Mapped on the raw metadata: ClassMetadataBuilder::addField() forces VARCHAR(191) on strings.
$metadata->mapField([
'fieldName' => 'parameters',
'fieldName' => 'parameters',
'columnName' => 'parameters',
'type' => Types::JSON,
]);
@@ -140,4 +140,4 @@ class UtmTaxonomy extends FormEntity
{
return array_keys($this->parameters);
}
}
}
+1 -1
View File
@@ -60,4 +60,4 @@ class UtmTaxonomyRepository extends CommonRepository
[$this->getTableAlias().'.name', 'ASC'],
];
}
}
}