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
@@ -26,8 +26,8 @@ final class SmartlinksSettingsTypeTest extends TypeTestCase
|
||||
{
|
||||
protected function getExtensions(): array
|
||||
{
|
||||
$catalog = new UtmParameterCatalog();
|
||||
$translator = new IdentityTranslator();
|
||||
$catalog = new UtmParameterCatalog();
|
||||
$translator = new IdentityTranslator();
|
||||
$transformer = new UtmSettingsTransformer(new UtmConfigurationNormalizer($catalog), $catalog, $translator);
|
||||
|
||||
return [
|
||||
@@ -57,7 +57,7 @@ final class SmartlinksSettingsTypeTest extends TypeTestCase
|
||||
|
||||
public function testValuesSubmittedForAFreeParameterAreIgnored(): void
|
||||
{
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission['parameters']['utm_source']['mode'] = 'free';
|
||||
$submission['parameters']['utm_source']['values'] = [
|
||||
['value' => 'NOT VALID', 'label' => ''],
|
||||
@@ -72,7 +72,7 @@ final class SmartlinksSettingsTypeTest extends TypeTestCase
|
||||
|
||||
public function testEnabledDropdownWithoutValuesIsRejected(): void
|
||||
{
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission['parameters']['utm_source']['enabled'] = '1';
|
||||
|
||||
$form = $this->submit($submission);
|
||||
@@ -85,7 +85,7 @@ final class SmartlinksSettingsTypeTest extends TypeTestCase
|
||||
|
||||
public function testDropdownValuesAreStoredInOrderWithTheirDefault(): void
|
||||
{
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission['parameters']['utm_source']['enabled'] = '1';
|
||||
$submission['parameters']['utm_source']['values'] = [
|
||||
['value' => 'newsletter', 'label' => 'Newsletter'],
|
||||
@@ -109,7 +109,7 @@ final class SmartlinksSettingsTypeTest extends TypeTestCase
|
||||
|
||||
public function testDuplicateAndInvalidValuesAreRejected(): void
|
||||
{
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission['parameters']['utm_medium']['enabled'] = '1';
|
||||
$submission['parameters']['utm_medium']['values'] = [
|
||||
['value' => 'email', 'label' => 'Email', 'is_default' => '1'],
|
||||
@@ -176,7 +176,7 @@ final class SmartlinksSettingsTypeTest extends TypeTestCase
|
||||
public function testLabelCannotContainPercent(): void
|
||||
{
|
||||
$submission = $this->defaultSubmission();
|
||||
$submission['parameters']['utm_campaign']['label'] = '50% off';
|
||||
$submission['parameters']['utm_campaign']['label'] = '50% off';
|
||||
|
||||
$form = $this->submit($submission);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ final class SmartLinkValidatorTest extends TestCase
|
||||
'parameters' => [
|
||||
'utm_source' => [
|
||||
'enabled' => '1', 'label' => 'Source', 'mode' => 'dropdown',
|
||||
'values' => [
|
||||
'values' => [
|
||||
['value' => 'newsletter', 'label' => 'Newsletter'],
|
||||
['value' => 'linkedin', 'label' => 'LinkedIn'],
|
||||
],
|
||||
@@ -35,6 +35,9 @@ final class SmartLinkValidatorTest extends TestCase
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $raw
|
||||
*/
|
||||
private function createValidator(array $raw = self::RAW_CONFIG): SmartLinkValidator
|
||||
{
|
||||
$parameters = $this->createMock(CoreParametersHelper::class);
|
||||
@@ -55,6 +58,9 @@ final class SmartLinkValidatorTest extends TestCase
|
||||
return new SmartLinkValidator($this->createMock(SmartLinkModel::class), $provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $parameters
|
||||
*/
|
||||
private function createTaxonomy(array $parameters): UtmTaxonomy
|
||||
{
|
||||
$taxonomy = new UtmTaxonomy();
|
||||
@@ -152,4 +158,4 @@ final class SmartLinkValidatorTest extends TestCase
|
||||
$validator->validateUtmParameters(['utm_source' => 'facebook'])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user