Merge branch '3.4' into 4.4

* 3.4:
  Fix CS
  [Validator] Add Polish translation for ISIN constraint
This commit is contained in:
Fabien Potencier 2020-08-17 09:31:35 +02:00
commit c9cdac153f
14 changed files with 36 additions and 12 deletions

View File

@ -65,7 +65,9 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
case self::$useDeprecatedConstants ? Type::BOOLEAN : Types::BOOLEAN:
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CheckboxType', [], Guess::HIGH_CONFIDENCE);
case self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE:
// no break
case self::$useDeprecatedConstants ? Type::DATETIMETZ : Types::DATETIMETZ_MUTABLE:
// no break
case 'vardatetime':
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', [], Guess::HIGH_CONFIDENCE);
case 'datetime_immutable':
@ -86,7 +88,9 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
case self::$useDeprecatedConstants ? Type::FLOAT : Types::FLOAT:
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\NumberType', [], Guess::MEDIUM_CONFIDENCE);
case self::$useDeprecatedConstants ? Type::INTEGER : Types::INTEGER:
// no break
case self::$useDeprecatedConstants ? Type::BIGINT : Types::BIGINT:
// no break
case self::$useDeprecatedConstants ? Type::SMALLINT : Types::SMALLINT:
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\IntegerType', [], Guess::MEDIUM_CONFIDENCE);
case self::$useDeprecatedConstants ? Type::STRING : Types::STRING:

View File

@ -154,8 +154,11 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
case Type::BUILTIN_TYPE_OBJECT:
switch ($typeOfField) {
case self::$useDeprecatedConstants ? DBALType::DATE : Types::DATE_MUTABLE:
// no break
case self::$useDeprecatedConstants ? DBALType::DATETIME : Types::DATETIME_MUTABLE:
// no break
case self::$useDeprecatedConstants ? DBALType::DATETIMETZ : Types::DATETIMETZ_MUTABLE:
// no break
case 'vardatetime':
case self::$useDeprecatedConstants ? DBALType::TIME : Types::TIME_MUTABLE:
return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')];
@ -174,6 +177,7 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
case Type::BUILTIN_TYPE_ARRAY:
switch ($typeOfField) {
case self::$useDeprecatedConstants ? DBALType::TARRAY : Types::ARRAY:
// no break
case 'json_array':
return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)];
@ -253,6 +257,7 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
{
switch ($doctrineType) {
case self::$useDeprecatedConstants ? DBALType::SMALLINT : Types::SMALLINT:
// no break
case self::$useDeprecatedConstants ? DBALType::INTEGER : Types::INTEGER:
return Type::BUILTIN_TYPE_INT;
@ -260,9 +265,13 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
return Type::BUILTIN_TYPE_FLOAT;
case self::$useDeprecatedConstants ? DBALType::BIGINT : Types::BIGINT:
// no break
case self::$useDeprecatedConstants ? DBALType::STRING : Types::STRING:
// no break
case self::$useDeprecatedConstants ? DBALType::TEXT : Types::TEXT:
// no break
case self::$useDeprecatedConstants ? DBALType::GUID : Types::GUID:
// no break
case self::$useDeprecatedConstants ? DBALType::DECIMAL : Types::DECIMAL:
return Type::BUILTIN_TYPE_STRING;
@ -270,15 +279,21 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
return Type::BUILTIN_TYPE_BOOL;
case self::$useDeprecatedConstants ? DBALType::BLOB : Types::BLOB:
// no break
case 'binary':
return Type::BUILTIN_TYPE_RESOURCE;
case self::$useDeprecatedConstants ? DBALType::OBJECT : Types::OBJECT:
// no break
case self::$useDeprecatedConstants ? DBALType::DATE : Types::DATE_MUTABLE:
// no break
case self::$useDeprecatedConstants ? DBALType::DATETIME : Types::DATETIME_MUTABLE:
// no break
case self::$useDeprecatedConstants ? DBALType::DATETIMETZ : Types::DATETIMETZ_MUTABLE:
// no break
case 'vardatetime':
case self::$useDeprecatedConstants ? DBALType::TIME : Types::TIME_MUTABLE:
// no break
case 'date_immutable':
case 'datetime_immutable':
case 'datetimetz_immutable':
@ -287,7 +302,9 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
return Type::BUILTIN_TYPE_OBJECT;
case self::$useDeprecatedConstants ? DBALType::TARRAY : Types::ARRAY:
// no break
case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
// no break
case 'json_array':
return Type::BUILTIN_TYPE_ARRAY;
}

View File

@ -81,7 +81,7 @@ EOT
['<info>PHP</>'],
new TableSeparator(),
['Version', PHP_VERSION],
['Architecture', (PHP_INT_SIZE * 8).' bits'],
['Architecture', (\PHP_INT_SIZE * 8).' bits'],
['Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'],
['Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'],
['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],

View File

@ -168,7 +168,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
if (false !== strpos($value, $decSep)) {
$type = \NumberFormatter::TYPE_DOUBLE;
} else {
$type = PHP_INT_SIZE === 8
$type = \PHP_INT_SIZE === 8
? \NumberFormatter::TYPE_INT64
: \NumberFormatter::TYPE_INT32;
}

View File

@ -928,7 +928,7 @@ class DateTypeTest extends BaseTypeTest
public function testYearsFor32BitsMachines()
{
if (4 !== PHP_INT_SIZE) {
if (4 !== \PHP_INT_SIZE) {
$this->markTestSkipped('PHP 32 bit is required.');
}

View File

@ -68,7 +68,7 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a',
'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a',
'php_version' => PHP_VERSION,
'php_architecture' => PHP_INT_SIZE * 8,
'php_architecture' => \PHP_INT_SIZE * 8,
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
'php_timezone' => date_default_timezone_get(),
'xdebug_enabled' => \extension_loaded('xdebug'),

View File

@ -32,7 +32,7 @@ class ConfigDataCollectorTest extends TestCase
$this->assertSame('config', $c->getName());
$this->assertMatchesRegularExpression('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION);
$this->assertMatchesRegularExpression('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION);
$this->assertSame(PHP_INT_SIZE * 8, $c->getPhpArchitecture());
$this->assertSame(\PHP_INT_SIZE * 8, $c->getPhpArchitecture());
$this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());

View File

@ -826,7 +826,7 @@ abstract class NumberFormatter
return false;
}
if (PHP_INT_SIZE !== 8 && ($value > self::$int32Max || $value < -self::$int32Max - 1)) {
if (\PHP_INT_SIZE !== 8 && ($value > self::$int32Max || $value < -self::$int32Max - 1)) {
return (float) $value;
}

View File

@ -74,7 +74,7 @@ set_error_handler(function ($type, $msg, $file, $line) {
throw new \ErrorException($msg, 0, $type, $file, $line);
});
set_exception_handler(function (\Throwable $exception) {
set_exception_handler(function (Throwable $exception) {
echo "\n";
$cause = $exception;

View File

@ -168,7 +168,7 @@ class IntlDateFormatterTest extends AbstractIntlDateFormatterTest
public function testParseThreeDigitsYears()
{
if (PHP_INT_SIZE < 8) {
if (\PHP_INT_SIZE < 8) {
$this->markTestSkipped('Parsing three digits years requires a 64bit PHP.');
}

View File

@ -86,7 +86,7 @@ class IntlTestHelper
*/
public static function require32Bit(TestCase $testCase)
{
if (4 !== PHP_INT_SIZE) {
if (4 !== \PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP 32 bit is required.');
}
}
@ -96,7 +96,7 @@ class IntlTestHelper
*/
public static function require64Bit(TestCase $testCase)
{
if (8 !== PHP_INT_SIZE) {
if (8 !== \PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP 64 bit is required.');
}
}

View File

@ -29,8 +29,8 @@ use Symfony\Component\Lock\Strategy\StrategyInterface;
*/
class CombinedStore implements StoreInterface, LoggerAwareInterface
{
use LoggerAwareTrait;
use ExpiringStoreTrait;
use LoggerAwareTrait;
/** @var PersistingStoreInterface[] */
private $stores;

View File

@ -382,6 +382,10 @@
<source>Each element of this collection should satisfy its own set of constraints.</source>
<target>Każdy element w tym zbiorze powinien spełniać własny zestaw reguł.</target>
</trans-unit>
<trans-unit id="99">
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
<target>Ta wartość nie jest prawidłowym Międzynarodowym Numerem Identyfikacyjnym Papierów Wartościowych (ISIN).</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -114,7 +114,6 @@ class VarCloner extends AbstractCloner
case \is_int($v):
case \is_float($v):
continue 2;
case \is_string($v):
if ('' === $v) {
continue 2;