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
+15
-15
@@ -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
@@ -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
|
||||
*
|
||||
|
||||
@@ -49,7 +49,7 @@ class ProgramAllocationItem
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->id = null;
|
||||
$this->program = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class ProgramAudience
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->id = null;
|
||||
$this->program = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,4 +15,4 @@ class ProgramAudienceRepository extends CommonRepository
|
||||
{
|
||||
return 'pa';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class ProgramDescriptionItem
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->id = null;
|
||||
$this->program = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class ProgramObjective
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->id = null;
|
||||
$this->program = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class ProgramStakeholder
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->id = null;
|
||||
$this->program = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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}>
|
||||
*/
|
||||
|
||||
@@ -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>
|
||||
*/
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,4 +60,4 @@ class UtmTaxonomyRepository extends CommonRepository
|
||||
[$this->getTableAlias().'.name', 'ASC'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user