Skip to content

Commit

Permalink
minor symfony#19121 Php cs fixer (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.7 branch.

Discussion
----------

Php cs fixer

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

7cc3ca5 fixed CS
fdef804 tweaked default CS fixer config
  • Loading branch information
fabpot committed Jun 21, 2016
2 parents a0cdcb0 + 7cc3ca5 commit 0854c12
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .php_cs
Expand Up @@ -3,6 +3,10 @@
return Symfony\CS\Config\Config::create()
->setUsingLinter(false)
->setUsingCache(true)
->fixers(array(
'long_array_syntax',
'php_unit_construct',
))
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__)
Expand All @@ -12,6 +16,7 @@ return Symfony\CS\Config\Config::create()
'src/Symfony/Component/Routing/Tests/Fixtures/dumper',
// fixture templates
'src/Symfony/Component/Templating/Tests/Fixtures/templates',
'src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
// resource templates
'src/Symfony/Bundle/FrameworkBundle/Resources/views/Form',
))
Expand Down
Expand Up @@ -32,7 +32,7 @@ protected function listBundles(OutputInterface $output)
$rows = array();

$bundles = $this->getContainer()->get('kernel')->getBundles();
usort($bundles, function($bundleA, $bundleB) {
usort($bundles, function ($bundleA, $bundleB) {
return strcmp($bundleA->getName(), $bundleB->getName());
});

Expand Down
Expand Up @@ -139,7 +139,6 @@ private function updateFactoryReference(array $replacements, $factory)
$factory[0] = new Reference($replacements[$referenceId], $factory[0]->getInvalidBehavior());
}


return $factory;
}
}
Expand Up @@ -68,7 +68,7 @@ public function testReverseTransform()

$this->assertSame($out, $this->transformer->reverseTransform($in));
// values are expected to be valid choices and stay the same
$inWithNull = array('0','1','2','3');
$inWithNull = array('0', '1', '2', '3');
$out[] = null;

$this->assertSame($out, $this->transformerWithNull->reverseTransform($inWithNull));
Expand Down
Expand Up @@ -694,8 +694,7 @@ private function getMergeStatement($sessionId, $data, $maxlifetime)
$mergeStmt->bindParam(6, $data, \PDO::PARAM_LOB);
$mergeStmt->bindParam(7, $maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(8, time(), \PDO::PARAM_INT);
}
else {
} else {
$mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB);
$mergeStmt->bindParam(':lifetime', $maxlifetime, \PDO::PARAM_INT);
Expand Down
6 changes: 4 additions & 2 deletions src/Symfony/Component/Process/Tests/ProcessTest.php
Expand Up @@ -1180,7 +1180,8 @@ public function pipesCodeProvider()
/**
* @dataProvider provideVariousIncrementals
*/
public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) {
public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method)
{
$process = $this->getProcess(self::$phpBin.' -r '.escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }'), null, null, null, null);
$process->start();
$result = '';
Expand All @@ -1195,7 +1196,8 @@ public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method)
$process->stop();
}

public function provideVariousIncrementals() {
public function provideVariousIncrementals()
{
return array(
array('php://stdout', 'getIncrementalOutput'),
array('php://stderr', 'getIncrementalErrorOutput'),
Expand Down
Expand Up @@ -69,7 +69,7 @@ public function supports($resource, $type = null)
if (!is_string($resource)) {
return false;
}

try {
$path = $this->locator->locate($resource);
} catch (\Exception $e) {
Expand Down
Expand Up @@ -249,7 +249,8 @@ public function testEncodeSerializerXmlRootNodeNameOption()
$this->assertEquals($expected, $serializer->serialize($array, 'xml', $options));
}

public function testEncodeTraversableWhenNormalizable() {
public function testEncodeTraversableWhenNormalizable()
{
$this->encoder = new XmlEncoder();
$serializer = new Serializer(array(new CustomNormalizer()), array('xml' => new XmlEncoder()));
$this->encoder->setSerializer($serializer);
Expand All @@ -261,7 +262,6 @@ public function testEncodeTraversableWhenNormalizable() {
XML;

$this->assertEquals($expected, $serializer->serialize(new NormalizableTraversableDummy(), 'xml'));

}

public function testDecode()
Expand Down
Expand Up @@ -654,7 +654,7 @@ public static function setStaticObject($object)

protected function getPrivate()
{
throw new \RuntimeException('Dummy::getPrivate() should not be called');
throw new \RuntimeException('Dummy::getPrivate() should not be called');
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Translation/Tests/TranslatorTest.php
Expand Up @@ -285,12 +285,12 @@ public function testFallbackCatalogueResources()

$resources = $translator->getCatalogue('en')->getResources();
$this->assertCount(1, $resources);
$this->assertContains( __DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'resources.yml', $resources);
$this->assertContains(__DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'resources.yml', $resources);

$resources = $translator->getCatalogue('en_GB')->getResources();
$this->assertCount(2, $resources);
$this->assertContains( __DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'empty.yml', $resources);
$this->assertContains( __DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'resources.yml', $resources);
$this->assertContains(__DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'empty.yml', $resources);
$this->assertContains(__DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'resources.yml', $resources);
}

/**
Expand Down

0 comments on commit 0854c12

Please sign in to comment.