add dump() case as well

This commit is contained in:
Tomas Votruba 2018-07-18 16:15:20 +02:00
parent 9aa4915838
commit c4c0b094af
5 changed files with 43 additions and 0 deletions

View File

@ -36,3 +36,17 @@ services:
position: 1
before: 'false'
after: 0
-
class: 'Symfony\Component\Yaml\Yaml'
method: 'dump'
position: 3
before: ['false', 'true']
after: 'Symfony\Component\Yaml\Yaml::DUMP_OBJECT'
-
class: 'Symfony\Component\Yaml\Yaml'
method: 'dump'
position: 3
before: 'true'
after: 'Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE'

View File

@ -24,6 +24,7 @@ final class ArgumentDefaultValueReplacerRectorTest extends AbstractRectorTestCas
yield [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'];
yield [__DIR__ . '/Wrong/wrong3.php.inc', __DIR__ . '/Correct/correct3.php.inc'];
yield [__DIR__ . '/Wrong/wrong4.php.inc', __DIR__ . '/Correct/correct4.php.inc'];
yield [__DIR__ . '/Wrong/wrong5.php.inc', __DIR__ . '/Correct/correct5.php.inc'];
}
protected function provideConfig(): string

View File

@ -0,0 +1,7 @@
<?php declare(strict_types=1);
use Symfony\Component\Yaml\Yaml;
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, \Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE);
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, \Symfony\Component\Yaml\Yaml::DUMP_OBJECT);

View File

@ -0,0 +1,7 @@
<?php declare(strict_types=1);
use Symfony\Component\Yaml\Yaml;
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, true);
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, false, true);

View File

@ -35,3 +35,17 @@ services:
position: 1
before: 'true'
after: 'Symfony\Component\Yaml\Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE'
-
class: 'Symfony\Component\Yaml\Yaml'
method: 'dump'
position: 3
before: ['false', 'true']
after: 'Symfony\Component\Yaml\Yaml::DUMP_OBJECT'
-
class: 'Symfony\Component\Yaml\Yaml'
method: 'dump'
position: 3
before: 'true'
after: 'Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE'