Updated Rector to commit 46301c10a803d2b6727270a738e8c9c297b0b10c

46301c10a8 Use isFloat() (#3572)
This commit is contained in:
Tomas Votruba 2023-04-08 00:59:02 +00:00
parent 3ff4433fbb
commit be3c7cb235
13 changed files with 29 additions and 28 deletions

View File

@ -245,7 +245,7 @@ final class NodeTypeResolver
if ($nodeType instanceof IntegerType) {
return \true;
}
return $nodeType instanceof FloatType;
return $nodeType->isFloat()->yes();
}
/**
* @api

View File

@ -66,7 +66,7 @@ final class StaticTypeAnalyzer
if ($type instanceof IntegerType) {
return \true;
}
return $type instanceof FloatType;
return $type->isFloat()->yes();
}
private function isAlwaysTruableUnionType(Type $type) : bool
{

View File

@ -25,7 +25,7 @@ final class ScalarTypeComparator
if ($firstType instanceof IntegerType && $secondType instanceof IntegerType) {
return \true;
}
if ($firstType instanceof FloatType && $secondType instanceof FloatType) {
if ($firstType->isFloat()->yes() && $secondType->isFloat()->yes()) {
return \true;
}
if (!$firstType instanceof BooleanType) {
@ -61,7 +61,7 @@ final class ScalarTypeComparator
if ($type instanceof StringType) {
return \true;
}
if ($type instanceof FloatType) {
if ($type->isFloat()->yes()) {
return \true;
}
if ($type instanceof IntegerType) {

View File

@ -93,7 +93,7 @@ final class UnionTypeAnalyzer
if ($type instanceof StringType && !$type instanceof ConstantStringType) {
continue;
}
if ($type instanceof FloatType) {
if ($type->isFloat()->yes()) {
continue;
}
if ($type instanceof IntegerType) {

View File

@ -149,7 +149,7 @@ CODE_SAMPLE
if ($exprType instanceof IntegerType) {
return $this->resolveInteger($isNegated, $expr);
}
if ($exprType instanceof FloatType) {
if ($exprType->isFloat()->yes()) {
return $this->resolveFloat($isNegated, $expr);
}
if ($this->nodeTypeResolver->isNullableTypeOfSpecificType($expr, ObjectType::class)) {

View File

@ -118,7 +118,7 @@ final class AlwaysStrictScalarExprAnalyzer
if ($type->isString()->yes() && !$type instanceof ConstantStringType) {
return \true;
}
if ($type instanceof FloatType) {
if ($type->isFloat()->yes()) {
return \true;
}
if ($type instanceof IntegerType) {

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '073f2d62a5beb49e270b2eab2433b60adb974cb6';
public const PACKAGE_VERSION = '46301c10a803d2b6727270a738e8c9c297b0b10c';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-04-07 09:33:45';
public const RELEASE_DATE = '2023-04-08 07:55:01';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitf9b2724fb56b7d23d6cb5855c9b84f8f::getLoader();
return ComposerAutoloaderInitb87a105ea4b2e04341b242afae2f083b::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitf9b2724fb56b7d23d6cb5855c9b84f8f
class ComposerAutoloaderInitb87a105ea4b2e04341b242afae2f083b
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitf9b2724fb56b7d23d6cb5855c9b84f8f
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitf9b2724fb56b7d23d6cb5855c9b84f8f', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitb87a105ea4b2e04341b242afae2f083b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitf9b2724fb56b7d23d6cb5855c9b84f8f', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitb87a105ea4b2e04341b242afae2f083b', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitb87a105ea4b2e04341b242afae2f083b::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitb87a105ea4b2e04341b242afae2f083b::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f
class ComposerStaticInitb87a105ea4b2e04341b242afae2f083b
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3135,9 +3135,9 @@ class ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf9b2724fb56b7d23d6cb5855c9b84f8f::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitb87a105ea4b2e04341b242afae2f083b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb87a105ea4b2e04341b242afae2f083b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb87a105ea4b2e04341b242afae2f083b::$classMap;
}, null, ClassLoader::class);
}

View File

@ -821,17 +821,17 @@
},
{
"name": "phpstan\/phpdoc-parser",
"version": "1.18.0",
"version_normalized": "1.18.0.0",
"version": "1.18.1",
"version_normalized": "1.18.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
"reference": "882eabc9b6a12e25c27091a261397f9c8792e722"
"reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/882eabc9b6a12e25c27091a261397f9c8792e722",
"reference": "882eabc9b6a12e25c27091a261397f9c8792e722",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/22dcdfd725ddf99583bfe398fc624ad6c5004a0f",
"reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f",
"shasum": ""
},
"require": {
@ -846,7 +846,7 @@
"phpunit\/phpunit": "^9.5",
"symfony\/process": "^5.2"
},
"time": "2023-04-06T07:26:43+00:00",
"time": "2023-04-07T11:51:11+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -863,7 +863,7 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.18.0"
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.18.1"
},
"install-path": "..\/phpstan\/phpdoc-parser"
},

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@ use PHPStan\PhpDocParser\Lexer\Lexer;
use function assert;
use function json_encode;
use function sprintf;
use const JSON_INVALID_UTF8_SUBSTITUTE;
use const JSON_UNESCAPED_SLASHES;
use const JSON_UNESCAPED_UNICODE;
class ParserException extends Exception
@ -53,7 +54,7 @@ class ParserException extends Exception
}
private function formatValue(string $value) : string
{
$json = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$json = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE);
assert($json !== \false);
return $json;
}