8000 CS: general fixes · symfony/symfony@d3f671e · GitHub
[go: up one dir, main page]

Skip to content

Commit d3f671e

Browse files
committed
CS: general fixes
1 parent d9b8d0c commit d3f671e

File tree

13 files changed

+47
-39
lines changed

13 files changed

+47
-39
lines changed

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ public function updateToken($series, $tokenValue, \DateTime $lastUsed)
9292
{
9393
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
9494
.' WHERE series=:series';
95-
$paramValues = array('value' => $tokenValue,
96-
'lastUsed' => $lastUsed,
97-
'series' => $series,);
98-
$paramTypes = array('value' => \PDO::PARAM_STR,
99-
'lastUsed' => DoctrineType::DATETIME,
100-
'series' => \PDO::PARAM_STR,);
95+
$paramValues = array(
96+
'value' => $tokenValue,
97+
'lastUsed' => $lastUsed,
98+
'series' => $series,
99+
);
100+
$paramTypes = array(
101+
'value' => \PDO::PARAM_STR,
102+
'lastUsed' => DoctrineType::DATETIME,
103+
'series' => \PDO::PARAM_STR,
104+
);
101105
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
102106
if ($updated < 1) {
103107
throw new TokenNotFoundException('No token found.');
@@ -112,16 +116,20 @@ public function createNewToken(PersistentTokenInterface $token)
112116
$sql = 'INSERT INTO rememberme_token'
113117
.' (class, username, series, value, lastUsed)'
114118
.' VALUES (:class, :username, :series, :value, :lastUsed)';
115-
$paramValues = array('class' => $token->getClass(),
116-
'username' => $token->getUsername(),
117-
'series' => $token->getSeries(),
118-
'value' => $token->getTokenValue(),
119-
'lastUsed' => $token->getLastUsed(),);
120-
$paramTypes = array('class' => \PDO::PARAM_STR,
121-
'username' => \PDO::PARAM_STR,
122-
'series' => \PDO::PARAM_STR,
123-
'value' => \PDO::PARAM_STR,
124-
'lastUsed' => DoctrineType::DATETIME,);
119+
$paramValues = array(
120+
'class' => $token->getClass(),
121+
'username' => $token->getUsername(),
122+
'series' => $token->getSeries(),
123+
'value' => $token->getTokenValue(),
124+
'lastUsed' => $token->getLastUsed(),
125+
);
126+
$paramTypes = array(
127+
'class' => \PDO::PARAM_STR,
128+
'username' => \PDO::PARAM_STR,
129+
'series' => \PDO::PARAM_STR,
130+
'value' => \PDO::PARAM_STR,
131+
'lastUsed' => DoctrineType::DATETIME,
132+
);
125133
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
126134
}
127135
}

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testEscaping()
3232
public function testTrans($template, $expected, array $variables = array())
3333
{
3434
if ($expected != $this->getTemplate($template)->render($variables)) {
35-
print $template."\n";
35+
echo $template."\n";
3636
$loader = new \Twig_Loader_Array(array('index' => $template));
3737
$twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
3838
$twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector())));

src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ protected function setUp()
4848
$profiler = $this->mockProfiler();
4949
$twigEnvironment = $this->mockTwigEnvironment();
5050
$templates = array(
51-
'data_collector.foo' => array('foo','FooBundle:Collector:foo'),
52-
'data_collector.bar' => array('bar','FooBundle:Collector:bar'),
53-
'data_collector.baz' => array('baz','FooBundle:Collector:baz'),
51+
'data_collector.foo' => array('foo', 'FooBundle:Collector:foo'),
52+
'data_collector.bar' => array('bar', 'FooBundle:Collector:bar'),
53+
'data_collector.baz' => array('baz', 'FooBundle:Collector:baz'),
5454
);
5555

5656
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);

src/Symfony/Component/ClassLoader/ClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function addPrefix($prefix, $paths)
9797
$paths
9898
));
9999
} elseif (!in_array($paths, $this->prefixes[$prefix])) {
100-
$this->prefixes[$prefix][] = $paths;
100+
$this->prefixes[$prefix][] = $paths;
101101
}
102102
} else {
103103
$this->prefixes[$prefix] = array_unique((array) $paths);

src/Symfony/Component/Console/Tests/Input/StringInputTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getTokenizeData()
5454
array('"quoted"', array('quoted'), '->tokenize() parses quoted arguments'),
5555
array("'quoted'", array('quoted'), '->tokenize() parses quoted arguments'),
5656
array("'a\rb\nc\td'", array("a\rb\nc\td"), '->tokenize() parses whitespace chars in strings'),
57-
array("'a'\r'b'\n'c'\t'd'", array('a','b','c','d'), '->tokenize() parses whitespace chars between args as spaces'),
57+
array("'a'\r'b'\n'c'\t'd'", array('a', 'b', 'c', 'd'), '->tokenize() parses whitespace chars between args as spaces'),
5858
array('\"quoted\"', array('"quoted"'), '->tokenize() parses escaped-quoted arguments'),
5959
array("\'quoted\'", array('\'quoted\''), '->tokenize() parses escaped-quoted arguments'),
6060
array('-a', array('-a'), '->tokenize() parses short options'),

src/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getSpecificityValueTestData()
2929
return array(
3030
array(new ElementNode(), 0),
3131
array(new ElementNode(null, 'element'), 1),
32-
array(new ElementNode('namespace', 'element'),1),
32+
array(new ElementNode('namespace', 'element'), 1),
3333
);
3434
}
3535
}

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public function getFormatToMimeTypeMapProvider()
340340
array('json', array('application/json', 'application/x-json')),
341341
array('xml', array('text/xml', 'application/xml', 'application/x-xml')),
342342
array('rdf', array('application/rdf+xml')),
343-
array('atom',array('application/atom+xml')),
343+
array('atom', array('application/atom+xml')),
344344
);
345345
}
346346

src/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testDumpWithRoutes()
8686
public function testDumpWithTooManyRoutes()
8787
{
8888
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
89-
for ( $i = 0; $i < 32769; ++$i ) {
89+
for ($i = 0; $i < 32769; ++$i) {
9090
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
9191
}
9292
$this->routeCollection->add('Test2', new Route('/testing2'));

src/Symfony/Component/Security/Acl/Dbal/AclProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ private function hydrateObjectIdentities(Statement $stmt, array $oidLookup, arra
571571
$oidCache[$oidLookupKey] = new ObjectIdentity($objectIdentifier, $classType);
572572
}
573573

574-
$acl = new Acl((int) $aclId, $oidCache[$oidLookupKey], $permissionGrantingStrategy, $emptyArray, !!$entriesInheriting);
574+
$acl = new Acl((int) $aclId, $oidCache[$oidLookupKey], $permissionGrantingStrategy, $emptyArray, (bool) $entriesInheriting);
575575

576576
// keep a local, and global reference to this ACL
577577
$loadedAcls[$classType][$objectIdentifier] = $acl;
@@ -613,9 +613,9 @@ private function hydrateObjectIdentities(Statement $stmt, array $oidLookup, arra
613613
}
614614

615615
if (null === $fieldName) {
616-
$loadedAces[$aceId] = new Entry((int) $aceId, $acl, $sids[$key], $grantingStrategy, (int) $mask, !!$granting, !!$auditFailure, !!$auditSuccess);
616+
$loadedAces[$aceId] = new Entry((int) $aceId, $acl, $sids[$key], $grantingStrategy, (int) $mask, (bool) $granting, (bool) $auditFailure, (bool) $auditSuccess);
617617
} else {
618-
$loadedAces[$aceId] = new FieldEntry((int) $aceId, $acl, $fieldName, $sids[$key], $grantingStrategy, (int) $mask, !!$granting, !!$auditFailure, !!$auditSuccess);
618+
$loadedAces[$aceId] = new FieldEntry((int) $aceId, $acl, $fieldName, $sids[$key], $grantingStrategy, (int) $mask, (bool) $granting, (bool) $auditFailure, (bool) $auditSuccess);
619619
}
620620
}
621621
179B $ace = $loadedAces[$aceId];

src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function supportsClass($class)
9797
/**
9898
* Returns the user by given username.
9999
*
100-
* @param string $username The username.
100+
* @param string $username The username.
101101
*
102102
* @return User
103103
*

src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testAttributes()
7474
'@Type' => 'test',
7575
),
7676
'föo_bär' => 'a',
77-
'Bar' => array(1,2,3),
77+
'Bar' => array(1, 2, 3),
7878
'a' => 'b',
7979
);
8080
$expected = '<?xml version="1.0"?>'."\n".
@@ -283,7 +283,7 @@ public function testDecodeWithoutItemHash()
283283
'@Type' => 'test',
284284
),
285285
'föo_bär' => 'a',
286-
'Bar' => array(1,2,3),
286+
'Bar' => array(1, 2, 3),
287287
'a' => 'b',
288288
);
289289
$expected = array(
@@ -296,7 +296,7 @@ public function testDecodeWithoutItemHash()
296296
'@Type' => 'test',
297297
),
298298
'föo_bär' => 'a',
299-
'Bar' => array(1,2,3),
299+
'Bar' => array(1, 2, 3),
300300
'a' => 'b',
301301
);
302302
$xml = $this->encoder->encode($obj, 'xml');

src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ public function testFormatAttribute($attribute, $camelizedAttributes, $result)
9191
public function attributeProvider()
9292
{
9393
return array(
94-
array('attribute_test', array('attribute_test'),'AttributeTest'),
95-
array('attribute_test', array('any'),'attribute_test'),
96-
array('attribute', array('attribute'),'Attribute'),
94+
array('attribute_test', array('attribute_test'), 'AttributeTest'),
95+
array('attribute_test', array('any'), 'attribute_test'),
96+
array('attribute', array('attribute'), 'Attribute'),
9797
array('attribute', array(), 'attribute'),
9898
);
9999
}

src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public function testLangcodes($nplural, $langCodes)
6060
public function successLangcodes()
6161
{
6262
return array(
63-
array('1', array('ay','bo', 'cgg','dz','id', 'ja', 'jbo', 'ka','kk','km','ko','ky')),
63+
array('1', array('ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky')),
6464
array('2', array('nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM')),
65-
array('3', array('be','bs','cs','hr')),
66-
array('4', array('cy','mt', 'sl')),
65+
array('3', array('be', 'bs', 'cs', 'hr')),
66+
array('4', array('cy', 'mt', 'sl')),
6767
array('5', array()),
6868
array('6', array('ar')),
6969
);
@@ -83,7 +83,7 @@ public function failingLangcodes()
8383
array('1', array('fa')),
8484
array('2', array('jbo')),
8585
array('3', array('cbs')),
86-
array('4', array('gd','kw')),
86+
array('4', array('gd', 'kw')),
8787
array('5', array('ga')),
8888
array('6', array()),
8989
);

0 commit comments

Comments
 (0)
0