diff --git a/src/Rules/Punctuation/PunctuationSpacingRule.php b/src/Rules/Punctuation/PunctuationSpacingRule.php index 940c95ec..1727262d 100644 --- a/src/Rules/Punctuation/PunctuationSpacingRule.php +++ b/src/Rules/Punctuation/PunctuationSpacingRule.php @@ -23,6 +23,7 @@ final class PunctuationSpacingRule extends AbstractSpacingRule implements Config '.' => 0, ',' => 0, '|' => 0, + '?:' => 0, ]; private const DEFAULT_SPACE_AFTER = [ '(' => 0, @@ -32,6 +33,7 @@ final class PunctuationSpacingRule extends AbstractSpacingRule implements Config '|' => 0, ':' => 1, ',' => 1, + '?:' => 1, ]; /** @var array */ diff --git a/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.fixed.twig b/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.fixed.twig index 0f82cced..8a1fafa9 100644 --- a/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.fixed.twig +++ b/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.fixed.twig @@ -6,3 +6,4 @@ {{ a|trans }} {{ [{a: 1,},] }} {{ 'test'[1:2] }} +{% types {foo: 'int', bar?: 'string'} %} diff --git a/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.twig b/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.twig index faf592f2..306329d0 100644 --- a/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.twig +++ b/tests/Rules/Punctuation/PunctuationSpacing/PunctuationSpacingRuleTest.twig @@ -6,3 +6,4 @@ {{ a | trans }} {{ [{a: 1, }, ] }} {{ 'test'[1:2] }} +{% types {foo: 'int', bar?: 'string'} %}