minor #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
This commit is contained in:
commit
2d14689485
@ -92,12 +92,16 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
{
|
{
|
||||||
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
|
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
|
||||||
.' WHERE series=:series';
|
.' WHERE series=:series';
|
||||||
$paramValues = array('value' => $tokenValue,
|
$paramValues = array(
|
||||||
|
'value' => $tokenValue,
|
||||||
'lastUsed' => $lastUsed,
|
'lastUsed' => $lastUsed,
|
||||||
'series' => $series,);
|
'series' => $series,
|
||||||
$paramTypes = array('value' => \PDO::PARAM_STR,
|
);
|
||||||
|
$paramTypes = array(
|
||||||
|
'value' => \PDO::PARAM_STR,
|
||||||
'lastUsed' => DoctrineType::DATETIME,
|
'lastUsed' => DoctrineType::DATETIME,
|
||||||
'series' => \PDO::PARAM_STR,);
|
'series' => \PDO::PARAM_STR,
|
||||||
|
);
|
||||||
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||||
if ($updated < 1) {
|
if ($updated < 1) {
|
||||||
throw new TokenNotFoundException('No token found.');
|
throw new TokenNotFoundException('No token found.');
|
||||||
@ -112,16 +116,20 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
$sql = 'INSERT INTO rememberme_token'
|
$sql = 'INSERT INTO rememberme_token'
|
||||||
.' (class, username, series, value, lastUsed)'
|
.' (class, username, series, value, lastUsed)'
|
||||||
.' VALUES (:class, :username, :series, :value, :lastUsed)';
|
.' VALUES (:class, :username, :series, :value, :lastUsed)';
|
||||||
$paramValues = array('class' => $token->getClass(),
|
$paramValues = array(
|
||||||
|
'class' => $token->getClass(),
|
||||||
'username' => $token->getUsername(),
|
'username' => $token->getUsername(),
|
||||||
'series' => $token->getSeries(),
|
'series' => $token->getSeries(),
|
||||||
'value' => $token->getTokenValue(),
|
'value' => $token->getTokenValue(),
|
||||||
'lastUsed' => $token->getLastUsed(),);
|
'lastUsed' => $token->getLastUsed(),
|
||||||
$paramTypes = array('class' => \PDO::PARAM_STR,
|
);
|
||||||
|
$paramTypes = array(
|
||||||
|
'class' => \PDO::PARAM_STR,
|
||||||
'username' => \PDO::PARAM_STR,
|
'username' => \PDO::PARAM_STR,
|
||||||
'series' => \PDO::PARAM_STR,
|
'series' => \PDO::PARAM_STR,
|
||||||
'value' => \PDO::PARAM_STR,
|
'value' => \PDO::PARAM_STR,
|
||||||
'lastUsed' => DoctrineType::DATETIME,);
|
'lastUsed' => DoctrineType::DATETIME,
|
||||||
|
);
|
||||||
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class TranslationExtensionTest extends TestCase
|
|||||||
public function testTrans($template, $expected, array $variables = array())
|
public function testTrans($template, $expected, array $variables = array())
|
||||||
{
|
{
|
||||||
if ($expected != $this->getTemplate($template)->render($variables)) {
|
if ($expected != $this->getTemplate($template)->render($variables)) {
|
||||||
print $template."\n";
|
echo $template."\n";
|
||||||
$loader = new \Twig_Loader_Array(array('index' => $template));
|
$loader = new \Twig_Loader_Array(array('index' => $template));
|
||||||
$twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
|
$twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
|
||||||
$twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector())));
|
$twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector())));
|
||||||
|
@ -48,9 +48,9 @@ class TemplateManagerTest extends TestCase
|
|||||||
$profiler = $this->mockProfiler();
|
$profiler = $this->mockProfiler();
|
||||||
$twigEnvironment = $this->mockTwigEnvironment();
|
$twigEnvironment = $this->mockTwigEnvironment();
|
||||||
$templates = array(
|
$templates = array(
|
||||||
'data_collector.foo' => array('foo','FooBundle:Collector:foo'),
|
'data_collector.foo' => array('foo', 'FooBundle:Collector:foo'),
|
||||||
'data_collector.bar' => array('bar','FooBundle:Collector:bar'),
|
'data_collector.bar' => array('bar', 'FooBundle:Collector:bar'),
|
||||||
'data_collector.baz' => array('baz','FooBundle:Collector:baz'),
|
'data_collector.baz' => array('baz', 'FooBundle:Collector:baz'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
|
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
|
||||||
|
@ -54,7 +54,7 @@ class StringInputTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('"quoted"', array('quoted'), '->tokenize() parses quoted arguments'),
|
array('"quoted"', array('quoted'), '->tokenize() parses quoted arguments'),
|
||||||
array("'quoted'", array('quoted'), '->tokenize() parses quoted arguments'),
|
array("'quoted'", array('quoted'), '->tokenize() parses quoted arguments'),
|
||||||
array("'a\rb\nc\td'", array("a\rb\nc\td"), '->tokenize() parses whitespace chars in strings'),
|
array("'a\rb\nc\td'", array("a\rb\nc\td"), '->tokenize() parses whitespace chars in strings'),
|
||||||
array("'a'\r'b'\n'c'\t'd'", array('a','b','c','d'), '->tokenize() parses whitespace chars between args as spaces'),
|
array("'a'\r'b'\n'c'\t'd'", array('a', 'b', 'c', 'd'), '->tokenize() parses whitespace chars between args as spaces'),
|
||||||
array('\"quoted\"', array('"quoted"'), '->tokenize() parses escaped-quoted arguments'),
|
array('\"quoted\"', array('"quoted"'), '->tokenize() parses escaped-quoted arguments'),
|
||||||
array("\'quoted\'", array('\'quoted\''), '->tokenize() parses escaped-quoted arguments'),
|
array("\'quoted\'", array('\'quoted\''), '->tokenize() parses escaped-quoted arguments'),
|
||||||
array('-a', array('-a'), '->tokenize() parses short options'),
|
array('-a', array('-a'), '->tokenize() parses short options'),
|
||||||
|
@ -29,7 +29,7 @@ class ElementNodeTest extends AbstractNodeTest
|
|||||||
return array(
|
return array(
|
||||||
array(new ElementNode(), 0),
|
array(new ElementNode(), 0),
|
||||||
array(new ElementNode(null, 'element'), 1),
|
array(new ElementNode(null, 'element'), 1),
|
||||||
array(new ElementNode('namespace', 'element'),1),
|
array(new ElementNode('namespace', 'element'), 1),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('json', array('application/json', 'application/x-json')),
|
array('json', array('application/json', 'application/x-json')),
|
||||||
array('xml', array('text/xml', 'application/xml', 'application/x-xml')),
|
array('xml', array('text/xml', 'application/xml', 'application/x-xml')),
|
||||||
array('rdf', array('application/rdf+xml')),
|
array('rdf', array('application/rdf+xml')),
|
||||||
array('atom',array('application/atom+xml')),
|
array('atom', array('application/atom+xml')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testDumpWithTooManyRoutes()
|
public function testDumpWithTooManyRoutes()
|
||||||
{
|
{
|
||||||
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
|
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
|
||||||
for ( $i = 0; $i < 32769; ++$i ) {
|
for ($i = 0; $i < 32769; ++$i) {
|
||||||
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
|
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
|
||||||
}
|
}
|
||||||
$this->routeCollection->add('Test2', new Route('/testing2'));
|
$this->routeCollection->add('Test2', new Route('/testing2'));
|
||||||
|
@ -571,7 +571,7 @@ QUERY;
|
|||||||
$oidCache[$oidLookupKey] = new ObjectIdentity($objectIdentifier, $classType);
|
$oidCache[$oidLookupKey] = new ObjectIdentity($objectIdentifier, $classType);
|
||||||
}
|
}
|
||||||
|
|
||||||
$acl = new Acl((int) $aclId, $oidCache[$oidLookupKey], $permissionGrantingStrategy, $emptyArray, !!$entriesInheriting);
|
$acl = new Acl((int) $aclId, $oidCache[$oidLookupKey], $permissionGrantingStrategy, $emptyArray, (bool) $entriesInheriting);
|
||||||
|
|
||||||
// keep a local, and global reference to this ACL
|
// keep a local, and global reference to this ACL
|
||||||
$loadedAcls[$classType][$objectIdentifier] = $acl;
|
$loadedAcls[$classType][$objectIdentifier] = $acl;
|
||||||
@ -613,9 +613,9 @@ QUERY;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null === $fieldName) {
|
if (null === $fieldName) {
|
||||||
$loadedAces[$aceId] = new Entry((int) $aceId, $acl, $sids[$key], $grantingStrategy, (int) $mask, !!$granting, !!$auditFailure, !!$auditSuccess);
|
$loadedAces[$aceId] = new Entry((int) $aceId, $acl, $sids[$key], $grantingStrategy, (int) $mask, (bool) $granting, (bool) $auditFailure, (bool) $auditSuccess);
|
||||||
} else {
|
} else {
|
||||||
$loadedAces[$aceId] = new FieldEntry((int) $aceId, $acl, $fieldName, $sids[$key], $grantingStrategy, (int) $mask, !!$granting, !!$auditFailure, !!$auditSuccess);
|
$loadedAces[$aceId] = new FieldEntry((int) $aceId, $acl, $fieldName, $sids[$key], $grantingStrategy, (int) $mask, (bool) $granting, (bool) $auditFailure, (bool) $auditSuccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ace = $loadedAces[$aceId];
|
$ace = $loadedAces[$aceId];
|
||||||
|
@ -74,7 +74,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase
|
|||||||
'@Type' => 'test',
|
'@Type' => 'test',
|
||||||
),
|
),
|
||||||
'föo_bär' => 'a',
|
'föo_bär' => 'a',
|
||||||
'Bar' => array(1,2,3),
|
'Bar' => array(1, 2, 3),
|
||||||
'a' => 'b',
|
'a' => 'b',
|
||||||
);
|
);
|
||||||
$expected = '<?xml version="1.0"?>'."\n".
|
$expected = '<?xml version="1.0"?>'."\n".
|
||||||
@ -283,7 +283,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase
|
|||||||
'@Type' => 'test',
|
'@Type' => 'test',
|
||||||
),
|
),
|
||||||
'föo_bär' => 'a',
|
'föo_bär' => 'a',
|
||||||
'Bar' => array(1,2,3),
|
'Bar' => array(1, 2, 3),
|
||||||
'a' => 'b',
|
'a' => 'b',
|
||||||
);
|
);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
@ -296,7 +296,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase
|
|||||||
'@Type' => 'test',
|
'@Type' => 'test',
|
||||||
),
|
),
|
||||||
'föo_bär' => 'a',
|
'föo_bär' => 'a',
|
||||||
'Bar' => array(1,2,3),
|
'Bar' => array(1, 2, 3),
|
||||||
'a' => 'b',
|
'a' => 'b',
|
||||||
);
|
);
|
||||||
$xml = $this->encoder->encode($obj, 'xml');
|
$xml = $this->encoder->encode($obj, 'xml');
|
||||||
|
@ -91,9 +91,9 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function attributeProvider()
|
public function attributeProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('attribute_test', array('attribute_test'),'AttributeTest'),
|
array('attribute_test', array('attribute_test'), 'AttributeTest'),
|
||||||
array('attribute_test', array('any'),'attribute_test'),
|
array('attribute_test', array('any'), 'attribute_test'),
|
||||||
array('attribute', array('attribute'),'Attribute'),
|
array('attribute', array('attribute'), 'Attribute'),
|
||||||
array('attribute', array(), 'attribute'),
|
array('attribute', array(), 'attribute'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -60,10 +60,10 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function successLangcodes()
|
public function successLangcodes()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('1', array('ay','bo', 'cgg','dz','id', 'ja', 'jbo', 'ka','kk','km','ko','ky')),
|
array('1', array('ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky')),
|
||||||
array('2', array('nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM')),
|
array('2', array('nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM')),
|
||||||
array('3', array('be','bs','cs','hr')),
|
array('3', array('be', 'bs', 'cs', 'hr')),
|
||||||
array('4', array('cy','mt', 'sl')),
|
array('4', array('cy', 'mt', 'sl')),
|
||||||
array('5', array()),
|
array('5', array()),
|
||||||
array('6', array('ar')),
|
array('6', array('ar')),
|
||||||
);
|
);
|
||||||
@ -83,7 +83,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('1', array('fa')),
|
array('1', array('fa')),
|
||||||
array('2', array('jbo')),
|
array('2', array('jbo')),
|
||||||
array('3', array('cbs')),
|
array('3', array('cbs')),
|
||||||
array('4', array('gd','kw')),
|
array('4', array('gd', 'kw')),
|
||||||
array('5', array('ga')),
|
array('5', array('ga')),
|
||||||
array('6', array()),
|
array('6', array()),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user