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:
Christophe Coevoet 2015-12-05 13:33:53 +01:00
commit 2d14689485
13 changed files with 47 additions and 39 deletions

View File

@ -92,12 +92,16 @@ class DoctrineTokenProvider implements TokenProviderInterface
{
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
.' WHERE series=:series';
$paramValues = array('value' => $tokenValue,
$paramValues = array(
'value' => $tokenValue,
'lastUsed' => $lastUsed,
'series' => $series,);
$paramTypes = array('value' => \PDO::PARAM_STR,
'series' => $series,
);
$paramTypes = array(
'value' => \PDO::PARAM_STR,
'lastUsed' => DoctrineType::DATETIME,
'series' => \PDO::PARAM_STR,);
'series' => \PDO::PARAM_STR,
);
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
if ($updated < 1) {
throw new TokenNotFoundException('No token found.');
@ -112,16 +116,20 @@ class DoctrineTokenProvider implements TokenProviderInterface
$sql = 'INSERT INTO rememberme_token'
.' (class, username, series, value, lastUsed)'
.' VALUES (:class, :username, :series, :value, :lastUsed)';
$paramValues = array('class' => $token->getClass(),
$paramValues = array(
'class' => $token->getClass(),
'username' => $token->getUsername(),
'series' => $token->getSeries(),
'value' => $token->getTokenValue(),
'lastUsed' => $token->getLastUsed(),);
$paramTypes = array('class' => \PDO::PARAM_STR,
'lastUsed' => $token->getLastUsed(),
);
$paramTypes = array(
'class' => \PDO::PARAM_STR,
'username' => \PDO::PARAM_STR,
'series' => \PDO::PARAM_STR,
'value' => \PDO::PARAM_STR,
'lastUsed' => DoctrineType::DATETIME,);
'lastUsed' => DoctrineType::DATETIME,
);
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
}
}

View File

@ -32,7 +32,7 @@ class TranslationExtensionTest extends TestCase
public function testTrans($template, $expected, array $variables = array())
{
if ($expected != $this->getTemplate($template)->render($variables)) {
print $template."\n";
echo $template."\n";
$loader = new \Twig_Loader_Array(array('index' => $template));
$twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
$twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector())));

View File

@ -571,7 +571,7 @@ QUERY;
$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
$loadedAcls[$classType][$objectIdentifier] = $acl;
@ -613,9 +613,9 @@ QUERY;
}
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 {
$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];