add more cases

This commit is contained in:
Tomas Votruba 2018-07-18 21:25:27 +02:00
parent 31302f6835
commit fa878f0af7
4 changed files with 13 additions and 3 deletions

View File

@ -1,6 +1,7 @@
services:
# yaml
# covers https://github.com/symfony/symfony/blob/3.4/UPGRADE-3.2.md#yaml
# https://github.com/symfony/symfony/pull/19504
Rector\Symfony\Rector\Yaml\SpaceBetweenKeyAndValueYamlRector: ~
# dependency-injection

View File

@ -11,8 +11,9 @@ final class SpaceBetweenKeyAndValueYamlRector implements YamlRectorInterface
{
/**
* @var string
* @see https://regex101.com/r/UDlB41/2/
*/
private const KEY_WITHOUT_SPACE_AFTER_PATTERN = '#(\w+)\:(\/?\w+)#';
private const KEY_WITHOUT_SPACE_AFTER_PATTERN = '#(\w+):([^ ,\[\]{}:\n])#';
public function getDefinition(): RectorDefinition
{

View File

@ -4,4 +4,8 @@ key:
about_us:
key: value
key: /value
controller: App\Controller\CompanyController::about
controller: App\Controller\CompanyController::about
{1: ""}
{foo: bar,bar: foo,false: false,null: null,integer: 12}

View File

@ -4,4 +4,8 @@ key:
about_us:
key:value
key:/value
controller: App\Controller\CompanyController::about
controller: App\Controller\CompanyController::about
{1:""}
{foo:bar,bar:foo,false:false,null:null,integer:12}