8000 Alternative · symfony/symfony@11a6498 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11a6498

Browse files
committed
Alternative
1 parent ab6d8a1 commit 11a6498

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testLintCorrectFile()
3636
$filename = $this->createFile('foo: bar');
3737

3838
$tester->execute(
39-
array('filename' => array($filename)),
39+
array('filename' => $filename),
4040
array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)
4141
);
4242

@@ -52,7 +52,7 @@ public function testLintIncorrectFile()
5252
$tester = $this->createCommandTester();
5353
$filename = $this->createFile($incorrectContent);
5454

55-
$tester->execute(array('filename' => array($filename)), array('decorated' => false));
55+
$tester->execute(array('filename' => $filename), array('decorated' => false));
5656

5757
$this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
5858
$this->assertContains('Unable to parse at line 3 (near "bar").', trim($tester->getDisplay()));
@@ -67,7 +67,7 @@ public function testLintFileNotReadable()
6767
$filename = $this->createFile('');
6868
unlink($filename);
6969

70-
$tester->execute(array('filename' => array($filename)), array('decorated' => false));
70+
$tester->execute(array('filename' => $filename), array('decorated' => false));
7171
}
7272

7373
public function testGetHelp()
@@ -103,7 +103,7 @@ public function testLintFilesFromBundleDirectory()
103103
{
104104
$tester = $this->createCommandTester($this->getKernelAwareApplicationMock());
105105
$tester->execute(
106-
array('filename' => array('@AppBundle/Resources')),
106+
array('filename' => '@AppBundle/Resources'),
107107
array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)
108108
);
109109

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"symfony/validator": "^4.1",
5353
"symfony/var-dumper": "~3.4|~4.0",
5454
"symfony/workflow": "^4.1",
55-
"symfony/yaml": "~4.2",
55+
"symfony/yaml": "~3.4|~4.0",
5656
"symfony/property-info": "~3.4|~4.0",
5757
"symfony/lock": "~3.4|~4.0",
5858
"symfony/web-link": "~3.4|~4.0",
@@ -74,8 +74,7 @@
7474
"symfony/translation": "<4.2",
7575
"symfony/twig-bridge": "<4.1.1",
7676
"symfony/validator": "<4.1",
77-
"symfony/workflow": "<4.1",
78-
"symfony/yaml": "<4.2"
77+
"symfony/workflow": "<4.1"
7978
},
8079
"suggest": {
8180
"ext-apcu": "For best performance of the system caches",

src/Symfony/Component/Yaml/Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function configure()
8282
protected function execute(InputInterface $input, OutputInterface $output)
8383
{
8484
$io = new SymfonyStyle($input, $output);
85-
$filenames = $input->getArgument('filename');
85+
$filenames = (array) $input->getArgument('filename');
8686
$this->format = $input->getOption('format');
8787
$this->displayCorrectFiles = $output->isVerbose();
8888
$flags = $input->getOption('parse-tags') ? Yaml::PARSE_CUSTOM_TAGS : 0;

src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testLintCorrectFile()
3131
$tester = $this->createCommandTester();
3232
$filename = $this->createFile('foo: bar');
3333

34-
$ret = $tester->execute(array('filename' => array($filename)), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
34+
$ret = $tester->execute(array('filename' => $filename), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
3535

3636
$this->assertEquals(0, $ret, 'Returns 0 in case of success');
3737
$this->assertRegExp('/^\/\/ OK in /', trim($tester->getDisplay()));
@@ -57,7 +57,7 @@ public function testLintIncorrectFile()
5757
$tester = $this->createCommandTester();
5858
$filename = $this->createFile($incorrectContent);
5959

60-
$ret = $tester->execute(array('filename' => array($filename)), array('decorated' => false));
60+
$ret = $tester->execute(array('filename' => $filename), array('decorated' => false));
6161

6262
$this->assertEquals(1, $ret, 'Returns 1 in case of error');
6363
$this->assertContains('Unable to parse at line 3 (near "bar").', trim($tester->getDisplay()));
@@ -68,7 +68,7 @@ public function testConstantAsKey()
6868
$yaml = <<<YAML
6969
!php/const 'Symfony\Component\Yaml\Tests\Command\Foo::TEST': bar
7070
YAML;
71-
$ret = $this->createCommandTester()->execute(array('filename' => array($this->createFile($yaml))), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
71+
$ret = $this->createCommandTester()->execute(array('filename' => $this->createFile($yaml)), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
7272
$this->assertSame(0, $ret, 'lint:yaml exits with code 0 in case of success');
7373
}
7474

@@ -77,7 +77,7 @@ public function testCustomTags()
7777
$yaml = <<<YAML
7878
foo: !my_tag {foo: bar}
7979
YAML;
80-
$ret = $this->createCommandTester()->execute(array('filename' => array($this->createFile($yaml)), '--parse-tags' => true), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
80+
$ret = $this->createCommandTester()->execute(array('filename' => $this->createFile($yaml), '--parse-tags' => true), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
8181
$this->assertSame(0, $ret, 'lint:yaml exits with code 0 in case of success');
8282
}
8383

@@ -86,7 +86,7 @@ public function testCustomTagsError()
8686
$yaml = <<<YAML
8787
foo: !my_tag {foo: bar}
8888
YAML;
89-
$ret = $this->createCommandTester()->execute(array('filename' => array($this->createFile($yaml))), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
89+
$ret = $this->createCommandTester()->execute(array('filename' => $this->createFile($yaml)), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false));
9090
$this->assertSame(1, $ret, 'lint:yaml exits with code 1 in case of error');
9191
}
9292

@@ -99,7 +99,7 @@ public function testLintFileNotReadable()
9999
$filename = $this->createFile('');
100100
unlink($filename);
101101

102-
$tester->execute(array('filename' => array($filename)), array('decorated' => false));
102+
$ret = $tester->execute(array('filename' => $filename), array('decorated' => false));
103103
}
104104

105105
/**
@@ -147,5 +147,5 @@ protected function tearDown()
147147

148148
class Foo
149149
{
150-
public const TEST = 'foo';
150+
const TEST = 'foo';
151151
}

0 commit comments

Comments
 (0)
0