Skip to content
Permalink
Browse files

Merge branch '3.4' into 4.2

* 3.4:
  fixed CS
  [HttpKernel] Remove TestEventDispatcher.
  • Loading branch information...
fabpot committed Jun 13, 2019
2 parents b856ab5 + a0b6d3d commit 0f958aabfa906eafa92d61210f10102c1bb405b8
Showing with 33 additions and 69 deletions.
  1. +1 −1 .php_cs.dist
  2. +1 −1 src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php
  3. +1 −1 src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
  4. +1 −1 src/Symfony/Bridge/Twig/UndefinedCallableHandler.php
  5. +1 −1 src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
  6. +1 −1 src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php
  7. +3 −3 src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php
  8. +1 −1 src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
  9. +0 −36 src/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php
  10. +1 −1 src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
  11. +1 −1 src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php
  12. +1 −1 src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php
  13. +1 −1 src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php
  14. +1 −1 src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php
  15. +5 −5 src/Symfony/Component/Security/Core/Encoder/Argon2iPasswordEncoder.php
  16. +1 −1 src/Symfony/Component/Security/Core/Exception/AccountStatusException.php
  17. +1 −1 src/Symfony/Component/Security/Core/Exception/AuthenticationException.php
  18. +1 −1 src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php
  19. +1 −1 src/Symfony/Component/Security/Core/Exception/UsernameNotFoundException.php
  20. +1 −1 src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php
  21. +1 −1 src/Symfony/Component/Security/Guard/Token/PostAuthenticationGuardToken.php
  22. +1 −1 src/Symfony/Component/Security/Http/Firewall/SimpleFormAuthenticationListener.php
  23. +1 −1 src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php
  24. +1 −1 src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
  25. +4 −4 src/Symfony/Component/Translation/Resources/bin/translation-status.php
@@ -15,7 +15,7 @@ return PhpCsFixer\Config::create()
'ordered_imports' => true,
'protected_to_private' => false,
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
// Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
])
@@ -58,7 +58,7 @@ public static function createTestConfiguration()
$config = new Configuration();
$config->setEntityNamespaces(['SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures']);
$config->setAutoGenerateProxyClasses(true);
$config->setProxyDir(\sys_get_temp_dir());
$config->setProxyDir(sys_get_temp_dir());
$config->setProxyNamespace('SymfonyTests\Doctrine');
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader()));
$config->setQueryCacheImpl(new ArrayCache());
@@ -186,7 +186,7 @@ private function formatWithIdentifiers(ObjectManager $em, ClassMetadata $class,
return $this->formatValue($value, self::PRETTY_DATE);
}
if (\method_exists($value, '__toString')) {
if (method_exists($value, '__toString')) {
return (string) $value;
}
@@ -85,7 +85,7 @@ public static function onUndefinedFunction($name)
private static function onUndefined($name, $type, $component)
{
if (\class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
if (class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::$fullStackEnable[$component], $type, $name));
}
@@ -681,7 +681,7 @@ private function doAdvisoryLock(string $sessionId)
switch ($this->driver) {
case 'mysql':
// MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced.
$lockId = \substr($sessionId, 0, 64);
$lockId = substr($sessionId, 0, 64);
// should we handle the return value? 0 on timeout, null on error
// we use a timeout of 50 seconds which is also the default for innodb_lock_wait_timeout
$stmt = $this->pdo->prepare('SELECT GET_LOCK(:key, 50)');
@@ -47,7 +47,7 @@ public function collect(Request $request, Response $response, \Exception $except
'token' => $response->headers->get('X-Debug-Token'),
'start_time' => $startTime * 1000,
'events' => [],
'stopwatch_installed' => \class_exists(Stopwatch::class, false),
'stopwatch_installed' => class_exists(Stopwatch::class, false),
];
}
@@ -132,20 +132,20 @@ public function update(Response $response)
$maxAge = null;
$sMaxage = null;
if (\is_numeric($this->ageDirectives['max-age'])) {
if (is_numeric($this->ageDirectives['max-age'])) {
$maxAge = $this->ageDirectives['max-age'] + $this->age;
$response->headers->addCacheControlDirective('max-age', $maxAge);
}
if (\is_numeric($this->ageDirectives['s-maxage'])) {
if (is_numeric($this->ageDirectives['s-maxage'])) {
$sMaxage = $this->ageDirectives['s-maxage'] + $this->age;
if ($maxAge !== $sMaxage) {
$response->headers->addCacheControlDirective('s-maxage', $sMaxage);
}
}
if (\is_numeric($this->ageDirectives['expires'])) {
if (is_numeric($this->ageDirectives['expires'])) {
$date = clone $response->getDate();
$date->modify('+'.($this->ageDirectives['expires'] + $this->age).' seconds');
$response->setExpires($date);
@@ -52,6 +52,6 @@ public function testCollect()
$c->collect($request, new Response());
$this->assertEquals(123456000, $c->getStartTime());
$this->assertSame(\class_exists(Stopwatch::class, false), $c->isStopwatchInstalled());
$this->assertSame(class_exists(Stopwatch::class, false), $c->isStopwatchInstalled());
}
}

This file was deleted.

@@ -138,7 +138,7 @@ public function serialize()
{
$serialized = [$this->user, $this->authenticated, $this->roles, $this->attributes];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -61,7 +61,7 @@ public function serialize()
{
$serialized = [$this->secret, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -81,7 +81,7 @@ public function serialize()
{
$serialized = [$this->credentials, $this->providerKey, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -96,7 +96,7 @@ public function serialize()
{
$serialized = [$this->secret, $this->providerKey, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -93,7 +93,7 @@ public function serialize()
{
$serialized = [$this->credentials, $this->providerKey, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -47,7 +47,7 @@ public static function isSupported()
return true;
}
if (\class_exists('ParagonIE_Sodium_Compat') && \method_exists('ParagonIE_Sodium_Compat', 'crypto_pwhash_is_available')) {
if (class_exists('ParagonIE_Sodium_Compat') && method_exists('ParagonIE_Sodium_Compat', 'crypto_pwhash_is_available')) {
return \ParagonIE_Sodium_Compat::crypto_pwhash_is_available();
}
@@ -87,8 +87,8 @@ public function isPasswordValid($encoded, $raw, $salt)
return !$this->isPasswordTooLong($raw) && password_verify($raw, $encoded);
}
if (\function_exists('sodium_crypto_pwhash_str_verify')) {
$valid = !$this->isPasswordTooLong($raw) && \sodium_crypto_pwhash_str_verify($encoded, $raw);
\sodium_memzero($raw);
$valid = !$this->isPasswordTooLong($raw) && sodium_crypto_pwhash_str_verify($encoded, $raw);
sodium_memzero($raw);
return $valid;
}
@@ -109,12 +109,12 @@ private function encodePasswordNative($raw)
private function encodePasswordSodiumFunction($raw)
{
$hash = \sodium_crypto_pwhash_str(
$hash = sodium_crypto_pwhash_str(
$raw,
\SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
\SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
);
\sodium_memzero($raw);
sodium_memzero($raw);
return $hash;
}
@@ -46,7 +46,7 @@ public function serialize()
{
$serialized = [$this->user, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -51,7 +51,7 @@ public function serialize()
$this->line,
];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -62,7 +62,7 @@ public function serialize()
{
$serialized = [parent::serialize(true), $this->messageKey, $this->messageData];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -56,7 +56,7 @@ public function serialize()
{
$serialized = [$this->username, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -50,7 +50,7 @@ public function serialize()
{
$serialized = [$this->credentials, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
public function unserialize($serialized)
@@ -78,7 +78,7 @@ public function serialize()
{
$serialized = [$this->providerKey, parent::serialize(true)];
return $this->doSerialize($serialized, \func_num_args() ? \func_get_arg(0) : null);
return $this->doSerialize($serialized, \func_num_args() ? func_get_arg(0) : null);
}
/**
@@ -97,7 +97,7 @@ protected function attemptAuthentication(Request $request)
$password = ParameterBagUtils::getRequestParameterValue($request, $this->options['password_parameter']);
}
if (!\is_string($username) && (!\is_object($username) || !\method_exists($username, '__toString'))) {
if (!\is_string($username) && (!\is_object($username) || !method_exists($username, '__toString'))) {
throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['username_parameter'], \gettype($username)));
}
@@ -85,7 +85,7 @@ protected function attemptAuthentication(Request $request)
$password = ParameterBagUtils::getRequestParameterValue($request, $this->options['password_parameter']);
}
if (!\is_string($username) && (!\is_object($username) || !\method_exists($username, '__toString'))) {
if (!\is_string($username) && (!\is_object($username) || !method_exists($username, '__toString'))) {
throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['username_parameter'], \gettype($username)));
}
@@ -507,7 +507,7 @@ private function isMaxDepthReached(array $attributesMetadata, string $class, str
protected function createChildContext(array $parentContext, $attribute/*, string $format = null */)
{
if (\func_num_args() >= 3) {
$format = \func_get_arg(2);
$format = func_get_arg(2);
} else {
// will be deprecated in version 4
$format = null;
@@ -73,7 +73,7 @@
$translationStatus = calculateTranslationStatus($originalFilePath, $translationFilePaths);
$totalMissingTranslations += array_sum(array_map(function ($translation) {
return \count($translation['missingKeys']);
return count($translation['missingKeys']);
}, array_values($translationStatus)));
printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output']);
@@ -113,8 +113,8 @@ function calculateTranslationStatus($originalFilePath, $translationFilePaths)
$missingKeys = array_diff_key($allTranslationKeys, $translatedKeys);
$translationStatus[$locale] = [
'total' => \count($allTranslationKeys),
'translated' => \count($translatedKeys),
'total' => count($allTranslationKeys),
'translated' => count($translatedKeys),
'missingKeys' => $missingKeys,
];
}
@@ -176,7 +176,7 @@ function printTable($translations, $verboseOutput)
textColorNormal();
if (true === $verboseOutput && \count($translation['missingKeys']) > 0) {
if (true === $verboseOutput && count($translation['missingKeys']) > 0) {
echo str_repeat('-', 80).PHP_EOL;
echo '| Missing Translations:'.PHP_EOL;

0 comments on commit 0f958aa

Please sign in to comment.
You can’t perform that action at this time.