Skip to content

Commit 2d14689

Browse files
committed
minor symfony#16790 CS: general fixes (keradus)
This PR was merged into the 2.3 branch. Discussion ---------- CS: general fixes | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | ? | Fixed tickets | N/A | License | MIT | Doc PR | N/A Commits ------- d3f671e CS: general fixes
2 parents d3247d8 + d3f671e commit 2d14689

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
$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
*

0 commit comments

Comments
 (0)