diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index 4ab64b428c..6e4e112842 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -69,7 +69,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 'dateinterval': @@ -79,10 +81,13 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface case self::$useDeprecatedConstants ? Type::TIME : Types::TIME_MUTABLE: return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TimeType', [], Guess::HIGH_CONFIDENCE); case self::$useDeprecatedConstants ? Type::DECIMAL : Types::DECIMAL: + // no break 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: diff --git a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php index 8917ce4327..bafd97a50c 100644 --- a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php +++ b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php @@ -157,8 +157,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')]; @@ -177,6 +180,7 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE case Type::BUILTIN_TYPE_ARRAY: switch ($typeOfField) { case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array': + // no break case 'json_array': return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)]; @@ -229,6 +233,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; @@ -236,9 +241,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; @@ -246,15 +255,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': @@ -263,7 +278,9 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE return Type::BUILTIN_TYPE_OBJECT; case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array': + // no break case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY: + // no break case 'json_array': return Type::BUILTIN_TYPE_ARRAY; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php index e40114abe8..118d0aed27 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php @@ -81,7 +81,7 @@ EOT ['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().' ('.(new \DateTime())->format(\DateTime::W3C).')'], ['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'], diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php index 986458bbff..bdd3d2aef2 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php @@ -171,7 +171,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; } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php index cb2c2d0a30..dd96d2efe7 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php @@ -891,7 +891,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.'); } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php index 673bf5c5fd..5895ef37d7 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -64,7 +64,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'), diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php index f2cc4fa0dd..dc455915fa 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -33,7 +33,7 @@ class ConfigDataCollectorTest extends TestCase $this->assertSame('testkernel', $c->getAppName()); $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()); diff --git a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php index 7792a1e757..f562c3dbea 100644 --- a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php +++ b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php @@ -847,7 +847,7 @@ 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; } diff --git a/src/Symfony/Component/Intl/Resources/bin/common.php b/src/Symfony/Component/Intl/Resources/bin/common.php index 8ebf9fdc60..5a93e40487 100644 --- a/src/Symfony/Component/Intl/Resources/bin/common.php +++ b/src/Symfony/Component/Intl/Resources/bin/common.php @@ -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; diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php index f6d02dcc00..14100d4d6f 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php @@ -167,7 +167,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.'); } diff --git a/src/Symfony/Component/Intl/Util/IntlTestHelper.php b/src/Symfony/Component/Intl/Util/IntlTestHelper.php index a9f68140f9..7d0174c75c 100644 --- a/src/Symfony/Component/Intl/Util/IntlTestHelper.php +++ b/src/Symfony/Component/Intl/Util/IntlTestHelper.php @@ -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.'); } } diff --git a/src/Symfony/Component/Lock/Store/CombinedStore.php b/src/Symfony/Component/Lock/Store/CombinedStore.php index d1ffaba653..bd0753bcdf 100644 --- a/src/Symfony/Component/Lock/Store/CombinedStore.php +++ b/src/Symfony/Component/Lock/Store/CombinedStore.php @@ -28,8 +28,8 @@ use Symfony\Component\Lock\Strategy\StrategyInterface; */ class CombinedStore implements StoreInterface, LoggerAwareInterface { - use LoggerAwareTrait; use ExpiringStoreTrait; + use LoggerAwareTrait; /** @var StoreInterface[] */ private $stores; diff --git a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php index 07e6b4ca2e..e69e44407c 100644 --- a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php +++ b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php @@ -120,7 +120,6 @@ class VarCloner extends AbstractCloner case \is_int($v): case \is_float($v): continue 2; - case \is_string($v): if ('' === $v) { continue 2; @@ -310,7 +309,7 @@ class VarCloner extends AbstractCloner private static function initHashMask() { $obj = (object) []; - self::$hashOffset = 16 - PHP_INT_SIZE; + self::$hashOffset = 16 - \PHP_INT_SIZE; self::$hashMask = -1; if (\defined('HHVM_VERSION')) { @@ -331,6 +330,6 @@ class VarCloner extends AbstractCloner } } - self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, PHP_INT_SIZE)); + self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, \PHP_INT_SIZE)); } }