mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 08:20:53 +00:00
Updated Rector to commit 6e73a1f069
6e73a1f069
[DowngradePhp70] Allow property fetch and static property fetch on DowngradeNullCoalesceRector (#540)
This commit is contained in:
parent
ff5108a964
commit
d162a45f40
|
@ -4,12 +4,11 @@ declare (strict_types=1);
|
|||
namespace Rector\DowngradePhp70\Rector\Coalesce;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
||||
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\Expr\Ternary;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use Rector\Core\NodeAnalyzer\CoalesceAnalyzer;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
|
@ -20,6 +19,14 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
|||
*/
|
||||
final class DowngradeNullCoalesceRector extends \Rector\Core\Rector\AbstractRector
|
||||
{
|
||||
/**
|
||||
* @var \Rector\Core\NodeAnalyzer\CoalesceAnalyzer
|
||||
*/
|
||||
private $coalesceAnalyzer;
|
||||
public function __construct(\Rector\Core\NodeAnalyzer\CoalesceAnalyzer $coalesceAnalyzer)
|
||||
{
|
||||
$this->coalesceAnalyzer = $coalesceAnalyzer;
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
|
@ -44,7 +51,7 @@ CODE_SAMPLE
|
|||
{
|
||||
$if = $node->left;
|
||||
$else = $node->right;
|
||||
if ($if instanceof \PhpParser\Node\Expr\Variable || $if instanceof \PhpParser\Node\Expr\ArrayDimFetch) {
|
||||
if ($this->coalesceAnalyzer->hasIssetableLeft($node)) {
|
||||
$cond = new \PhpParser\Node\Expr\Isset_([$if]);
|
||||
} else {
|
||||
$cond = new \PhpParser\Node\Expr\BinaryOp\NotIdentical($if, $this->nodeFactory->createNull());
|
||||
|
|
|
@ -8,12 +8,10 @@ use PhpParser\Node\Expr\Assign;
|
|||
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
||||
use PhpParser\Node\Expr\BooleanNot;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\StaticPropertyFetch;
|
||||
use PhpParser\Node\Expr\Throw_;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use Rector\Core\NodeAnalyzer\CoalesceAnalyzer;
|
||||
use Rector\Core\NodeManipulator\IfManipulator;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
|
@ -29,9 +27,14 @@ final class DowngradeThrowExprRector extends \Rector\Core\Rector\AbstractRector
|
|||
* @var \Rector\Core\NodeManipulator\IfManipulator
|
||||
*/
|
||||
private $ifManipulator;
|
||||
public function __construct(\Rector\Core\NodeManipulator\IfManipulator $ifManipulator)
|
||||
/**
|
||||
* @var \Rector\Core\NodeAnalyzer\CoalesceAnalyzer
|
||||
*/
|
||||
private $coalesceAnalyzer;
|
||||
public function __construct(\Rector\Core\NodeManipulator\IfManipulator $ifManipulator, \Rector\Core\NodeAnalyzer\CoalesceAnalyzer $coalesceAnalyzer)
|
||||
{
|
||||
$this->ifManipulator = $ifManipulator;
|
||||
$this->coalesceAnalyzer = $coalesceAnalyzer;
|
||||
}
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
{
|
||||
|
@ -99,7 +102,7 @@ CODE_SAMPLE
|
|||
if (!$coalesce->right instanceof \PhpParser\Node\Expr\Throw_) {
|
||||
return null;
|
||||
}
|
||||
if (!$coalesce->left instanceof \PhpParser\Node\Expr\Variable && !$coalesce->left instanceof \PhpParser\Node\Expr\PropertyFetch && !$coalesce->left instanceof \PhpParser\Node\Expr\StaticPropertyFetch) {
|
||||
if (!$this->coalesceAnalyzer->hasIssetableLeft($coalesce)) {
|
||||
return null;
|
||||
}
|
||||
$booleanNot = new \PhpParser\Node\Expr\BooleanNot(new \PhpParser\Node\Expr\Isset_([$coalesce->left]));
|
||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'cdad000d81c83a9f828281ff85fa67f0adfeee24';
|
||||
public const PACKAGE_VERSION = '6e73a1f069afe9609437b2d4848ab323f03d0d20';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-07-29 00:32:22';
|
||||
public const RELEASE_DATE = '2021-07-29 09:16:05';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210729\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
23
src/NodeAnalyzer/CoalesceAnalyzer.php
Normal file
23
src/NodeAnalyzer/CoalesceAnalyzer.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\NodeAnalyzer;
|
||||
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\StaticPropertyFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
final class CoalesceAnalyzer
|
||||
{
|
||||
/**
|
||||
* @var array<class-string<Expr>>
|
||||
*/
|
||||
private const ISSETABLE_EXPR = [\PhpParser\Node\Expr\Variable::class, \PhpParser\Node\Expr\ArrayDimFetch::class, \PhpParser\Node\Expr\PropertyFetch::class, \PhpParser\Node\Expr\StaticPropertyFetch::class];
|
||||
public function hasIssetableLeft(\PhpParser\Node\Expr\BinaryOp\Coalesce $coalesce) : bool
|
||||
{
|
||||
$leftClass = \get_class($coalesce->left);
|
||||
return \in_array($leftClass, self::ISSETABLE_EXPR, \true);
|
||||
}
|
||||
}
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8::getLoader();
|
||||
return ComposerAutoloaderInitc87132382a4bb65142243642edd4101b::getLoader();
|
||||
|
|
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
|
@ -1835,6 +1835,7 @@ return array(
|
|||
'Rector\\Core\\NodeAnalyzer\\CallAnalyzer' => $baseDir . '/src/NodeAnalyzer/CallAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\ChangedNodeAnalyzer' => $baseDir . '/src/NodeAnalyzer/ChangedNodeAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\ClassAnalyzer' => $baseDir . '/src/NodeAnalyzer/ClassAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\CoalesceAnalyzer' => $baseDir . '/src/NodeAnalyzer/CoalesceAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\CompactFuncCallAnalyzer' => $baseDir . '/src/NodeAnalyzer/CompactFuncCallAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\ConstFetchAnalyzer' => $baseDir . '/src/NodeAnalyzer/ConstFetchAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\EnumAnalyzer' => $baseDir . '/src/NodeAnalyzer/EnumAnalyzer.php',
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8
|
||||
class ComposerAutoloaderInitc87132382a4bb65142243642edd4101b
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc87132382a4bb65142243642edd4101b', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc87132382a4bb65142243642edd4101b', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc87132382a4bb65142243642edd4101b::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitc87132382a4bb65142243642edd4101b::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequiread4ea66b0b9d169855b18f44b4a1e2f8($fileIdentifier, $file);
|
||||
composerRequirec87132382a4bb65142243642edd4101b($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequiread4ea66b0b9d169855b18f44b4a1e2f8($fileIdentifier, $file)
|
||||
function composerRequirec87132382a4bb65142243642edd4101b($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
|
9
vendor/composer/autoload_static.php
vendored
9
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8
|
||||
class ComposerStaticInitc87132382a4bb65142243642edd4101b
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
@ -2190,6 +2190,7 @@ class ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8
|
|||
'Rector\\Core\\NodeAnalyzer\\CallAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/CallAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\ChangedNodeAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/ChangedNodeAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\ClassAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/ClassAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\CoalesceAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/CoalesceAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\CompactFuncCallAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/CompactFuncCallAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\ConstFetchAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/ConstFetchAnalyzer.php',
|
||||
'Rector\\Core\\NodeAnalyzer\\EnumAnalyzer' => __DIR__ . '/../..' . '/src/NodeAnalyzer/EnumAnalyzer.php',
|
||||
|
@ -3851,9 +3852,9 @@ class ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitad4ea66b0b9d169855b18f44b4a1e2f8::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc87132382a4bb65142243642edd4101b::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc87132382a4bb65142243642edd4101b::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc87132382a4bb65142243642edd4101b::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
103
vendor/composer/installed.json
vendored
103
vendor/composer/installed.json
vendored
|
@ -1853,7 +1853,7 @@
|
|||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/console\/tree\/5.3"
|
||||
"source": "https:\/\/github.com\/symfony\/console\/tree\/v5.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -2488,17 +2488,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/http-foundation",
|
||||
"version": "v5.3.4",
|
||||
"version_normalized": "5.3.4.0",
|
||||
"version": "v5.3.6",
|
||||
"version_normalized": "5.3.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/http-foundation.git",
|
||||
"reference": "d6602aca7d3e11f401a0b24f43b611c530abfad3"
|
||||
"reference": "a8388f7b7054a7401997008ce9cd8c6b0ab7ac75"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/http-foundation\/zipball\/d6602aca7d3e11f401a0b24f43b611c530abfad3",
|
||||
"reference": "d6602aca7d3e11f401a0b24f43b611c530abfad3",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/http-foundation\/zipball\/a8388f7b7054a7401997008ce9cd8c6b0ab7ac75",
|
||||
"reference": "a8388f7b7054a7401997008ce9cd8c6b0ab7ac75",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2516,7 +2516,7 @@
|
|||
"suggest": {
|
||||
"symfony\/mime": "To use the file extension guesser"
|
||||
},
|
||||
"time": "2021-07-23T15:55:36+00:00",
|
||||
"time": "2021-07-27T17:08:17+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -2544,7 +2544,7 @@
|
|||
"description": "Defines an object-oriented layer for the HTTP specification",
|
||||
"homepage": "https:\/\/symfony.com",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/http-foundation\/tree\/v5.3.4"
|
||||
"source": "https:\/\/github.com\/symfony\/http-foundation\/tree\/v5.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -2564,17 +2564,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/http-kernel",
|
||||
"version": "v5.3.5",
|
||||
"version_normalized": "5.3.5.0",
|
||||
"version": "v5.3.6",
|
||||
"version_normalized": "5.3.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/http-kernel.git",
|
||||
"reference": "9eb3ee3cb6c69e12ba5770665b89fe82f0b99033"
|
||||
"reference": "60030f209018356b3b553b9dbd84ad2071c1b7e0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/http-kernel\/zipball\/9eb3ee3cb6c69e12ba5770665b89fe82f0b99033",
|
||||
"reference": "9eb3ee3cb6c69e12ba5770665b89fe82f0b99033",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/http-kernel\/zipball\/60030f209018356b3b553b9dbd84ad2071c1b7e0",
|
||||
"reference": "60030f209018356b3b553b9dbd84ad2071c1b7e0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2631,7 +2631,7 @@
|
|||
"symfony\/console": "",
|
||||
"symfony\/dependency-injection": ""
|
||||
},
|
||||
"time": "2021-07-27T04:39:22+00:00",
|
||||
"time": "2021-07-29T07:06:27+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -2659,7 +2659,7 @@
|
|||
"description": "Provides a structured process for converting a Request into a Response",
|
||||
"homepage": "https:\/\/symfony.com",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/http-kernel\/tree\/v5.3.5"
|
||||
"source": "https:\/\/github.com\/symfony\/http-kernel\/tree\/v5.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -2761,17 +2761,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/polyfill-intl-grapheme",
|
||||
"version": "v1.23.0",
|
||||
"version_normalized": "1.23.0.0",
|
||||
"version": "v1.23.1",
|
||||
"version_normalized": "1.23.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/polyfill-intl-grapheme.git",
|
||||
"reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab"
|
||||
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-intl-grapheme\/zipball\/24b72c6baa32c746a4d0840147c9715e42bb68ab",
|
||||
"reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-intl-grapheme\/zipball\/16880ba9c5ebe3642d1995ab866db29270b36535",
|
||||
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2780,7 +2780,7 @@
|
|||
"suggest": {
|
||||
"ext-intl": "For best performance"
|
||||
},
|
||||
"time": "2021-05-27T09:17:38+00:00",
|
||||
"time": "2021-05-27T12:26:48+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -2825,7 +2825,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/polyfill-intl-grapheme\/tree\/v1.23.0"
|
||||
"source": "https:\/\/github.com\/symfony\/polyfill-intl-grapheme\/tree\/v1.23.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -2932,17 +2932,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/polyfill-mbstring",
|
||||
"version": "v1.23.0",
|
||||
"version_normalized": "1.23.0.0",
|
||||
"version": "v1.23.1",
|
||||
"version_normalized": "1.23.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/polyfill-mbstring.git",
|
||||
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1"
|
||||
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-mbstring\/zipball\/2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
|
||||
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-mbstring\/zipball\/9174a3d80210dca8daa7f31fec659150bbeabfc6",
|
||||
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2951,7 +2951,7 @@
|
|||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"time": "2021-05-27T09:27:20+00:00",
|
||||
"time": "2021-05-27T12:26:48+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -2995,7 +2995,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/polyfill-mbstring\/tree\/v1.23.0"
|
||||
"source": "https:\/\/github.com\/symfony\/polyfill-mbstring\/tree\/v1.23.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3097,23 +3097,23 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/polyfill-php80",
|
||||
"version": "v1.23.0",
|
||||
"version_normalized": "1.23.0.0",
|
||||
"version": "v1.23.1",
|
||||
"version_normalized": "1.23.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/polyfill-php80.git",
|
||||
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0"
|
||||
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-php80\/zipball\/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
|
||||
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-php80\/zipball\/1100343ed1a92e3a38f9ae122fc0eb21602547be",
|
||||
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"time": "2021-02-19T12:13:01+00:00",
|
||||
"time": "2021-07-28T13:41:28+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -3163,7 +3163,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/polyfill-php80\/tree\/v1.23.0"
|
||||
"source": "https:\/\/github.com\/symfony\/polyfill-php80\/tree\/v1.23.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3498,17 +3498,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/var-dumper",
|
||||
"version": "v5.3.4",
|
||||
"version_normalized": "5.3.4.0",
|
||||
"version": "v5.3.6",
|
||||
"version_normalized": "5.3.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/var-dumper.git",
|
||||
"reference": "a895407f7cf55da42aa1480935d707684b690bfc"
|
||||
"reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/var-dumper\/zipball\/a895407f7cf55da42aa1480935d707684b690bfc",
|
||||
"reference": "a895407f7cf55da42aa1480935d707684b690bfc",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/var-dumper\/zipball\/3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0",
|
||||
"reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3531,7 +3531,7 @@
|
|||
"ext-intl": "To show region name in time zone dump",
|
||||
"symfony\/console": "To use the ServerDumpCommand and\/or the bin\/var-dump-server script"
|
||||
},
|
||||
"time": "2021-07-23T15:55:36+00:00",
|
||||
"time": "2021-07-27T01:56:02+00:00",
|
||||
"bin": [
|
||||
"Resources\/bin\/var-dump-server"
|
||||
],
|
||||
|
@ -3569,7 +3569,7 @@
|
|||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/var-dumper\/tree\/v5.3.4"
|
||||
"source": "https:\/\/github.com\/symfony\/var-dumper\/tree\/v5.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3665,24 +3665,23 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony\/yaml",
|
||||
"version": "v5.3.4",
|
||||
"version_normalized": "5.3.4.0",
|
||||
"version": "v5.3.6",
|
||||
"version_normalized": "5.3.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/yaml.git",
|
||||
"reference": "90909bd7352ae57411a93fcd67b09e6199340547"
|
||||
"reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/yaml\/zipball\/90909bd7352ae57411a93fcd67b09e6199340547",
|
||||
"reference": "90909bd7352ae57411a93fcd67b09e6199340547",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/yaml\/zipball\/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7",
|
||||
"reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony\/deprecation-contracts": "^2.1",
|
||||
"symfony\/polyfill-ctype": "~1.8",
|
||||
"symfony\/polyfill-php80": "^1.16"
|
||||
"symfony\/polyfill-ctype": "~1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony\/console": "<4.4"
|
||||
|
@ -3693,7 +3692,7 @@
|
|||
"suggest": {
|
||||
"symfony\/console": "For validating YAML files using the lint command"
|
||||
},
|
||||
"time": "2021-07-21T12:40:44+00:00",
|
||||
"time": "2021-07-29T06:20:01+00:00",
|
||||
"bin": [
|
||||
"Resources\/bin\/yaml-lint"
|
||||
],
|
||||
|
@ -3724,7 +3723,7 @@
|
|||
"description": "Loads and dumps YAML files",
|
||||
"homepage": "https:\/\/symfony.com",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/yaml\/tree\/v5.3.4"
|
||||
"source": "https:\/\/github.com\/symfony\/yaml\/tree\/v5.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20210729\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8', false) && !interface_exists('ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8', false) && !trait_exists('ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8', false)) {
|
||||
spl_autoload_call('RectorPrefix20210729\ComposerAutoloaderInitad4ea66b0b9d169855b18f44b4a1e2f8');
|
||||
if (!class_exists('ComposerAutoloaderInitc87132382a4bb65142243642edd4101b', false) && !interface_exists('ComposerAutoloaderInitc87132382a4bb65142243642edd4101b', false) && !trait_exists('ComposerAutoloaderInitc87132382a4bb65142243642edd4101b', false)) {
|
||||
spl_autoload_call('RectorPrefix20210729\ComposerAutoloaderInitc87132382a4bb65142243642edd4101b');
|
||||
}
|
||||
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
|
||||
spl_autoload_call('RectorPrefix20210729\Doctrine\Inflector\Inflector');
|
||||
|
@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20210729\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequiread4ea66b0b9d169855b18f44b4a1e2f8')) {
|
||||
function composerRequiread4ea66b0b9d169855b18f44b4a1e2f8() {
|
||||
return \RectorPrefix20210729\composerRequiread4ea66b0b9d169855b18f44b4a1e2f8(...func_get_args());
|
||||
if (!function_exists('composerRequirec87132382a4bb65142243642edd4101b')) {
|
||||
function composerRequirec87132382a4bb65142243642edd4101b() {
|
||||
return \RectorPrefix20210729\composerRequirec87132382a4bb65142243642edd4101b(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
|
2
vendor/symfony/http-foundation/Response.php
vendored
2
vendor/symfony/http-foundation/Response.php
vendored
|
@ -331,7 +331,7 @@ class Response
|
|||
$this->setProtocolVersion('1.1');
|
||||
}
|
||||
// Check if we need to send extra expire info headers
|
||||
if ('1.0' == $this->getProtocolVersion() && \strpos($headers->get('Cache-Control'), 'no-cache') !== \false) {
|
||||
if ('1.0' == $this->getProtocolVersion() && \strpos($headers->get('Cache-Control', ''), 'no-cache') !== \false) {
|
||||
$headers->set('pragma', 'no-cache');
|
||||
$headers->set('expires', -1);
|
||||
}
|
||||
|
|
6
vendor/symfony/http-kernel/Kernel.php
vendored
6
vendor/symfony/http-kernel/Kernel.php
vendored
|
@ -68,11 +68,11 @@ abstract class Kernel implements \RectorPrefix20210729\Symfony\Component\HttpKer
|
|||
private $requestStackSize = 0;
|
||||
private $resetServices = \false;
|
||||
private static $freshCache = [];
|
||||
public const VERSION = '5.3.5';
|
||||
public const VERSION_ID = 50305;
|
||||
public const VERSION = '5.3.6';
|
||||
public const VERSION_ID = 50306;
|
||||
public const MAJOR_VERSION = 5;
|
||||
public const MINOR_VERSION = 3;
|
||||
public const RELEASE_VERSION = 5;
|
||||
public const RELEASE_VERSION = 6;
|
||||
public const EXTRA_VERSION = '';
|
||||
public const END_OF_MAINTENANCE = '01/2022';
|
||||
public const END_OF_LIFE = '01/2022';
|
||||
|
|
|
@ -34,6 +34,7 @@ final class Grapheme
|
|||
// (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control])
|
||||
// This regular expression is a work around for http://bugs.exim.org/1279
|
||||
public const GRAPHEME_CLUSTER_RX = '(?:\\r\\n|(?:[ -~\\x{200C}\\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\\p{Cc}\\p{Cf}\\p{Zl}\\p{Zp}])[\\p{Mn}\\p{Me}\\x{09BE}\\x{09D7}\\x{0B3E}\\x{0B57}\\x{0BBE}\\x{0BD7}\\x{0CC2}\\x{0CD5}\\x{0CD6}\\x{0D3E}\\x{0D57}\\x{0DCF}\\x{0DDF}\\x{200C}\\x{200D}\\x{1D165}\\x{1D16E}-\\x{1D172}]*|[\\p{Cc}\\p{Cf}\\p{Zl}\\p{Zp}])';
|
||||
private const CASE_FOLD = [['µ', 'ſ', "ͅ", 'ς', "ϐ", "ϑ", "ϕ", "ϖ", "ϰ", "ϱ", "ϵ", "ẛ", "ι"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "ṡ", 'ι']];
|
||||
public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0)
|
||||
{
|
||||
if (0 > $start) {
|
||||
|
@ -191,9 +192,13 @@ final class Grapheme
|
|||
// Use the same case folding mode as mbstring does for mb_stripos().
|
||||
// Stick to SIMPLE case folding to avoid changing the length of the string, which
|
||||
// might result in offsets being shifted.
|
||||
$mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_UPPER;
|
||||
$mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER;
|
||||
$s = \mb_convert_case($s, $mode, 'UTF-8');
|
||||
$needle = \mb_convert_case($needle, $mode, 'UTF-8');
|
||||
if (!\defined('MB_CASE_FOLD_SIMPLE')) {
|
||||
$s = \str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s);
|
||||
$needle = \str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle);
|
||||
}
|
||||
}
|
||||
if ($reverse) {
|
||||
$needlePos = \strrpos($s, $needle);
|
||||
|
|
|
@ -67,10 +67,10 @@ namespace RectorPrefix20210729\Symfony\Polyfill\Mbstring;
|
|||
final class Mbstring
|
||||
{
|
||||
public const MB_CASE_FOLD = \PHP_INT_MAX;
|
||||
private const CASE_FOLD = [['µ', 'ſ', "ͅ", 'ς', "ϐ", "ϑ", "ϕ", "ϖ", "ϰ", "ϱ", "ϵ", "ẛ", "ι"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "ṡ", 'ι']];
|
||||
private static $encodingList = ['ASCII', 'UTF-8'];
|
||||
private static $language = 'neutral';
|
||||
private static $internalEncoding = 'UTF-8';
|
||||
private static $caseFold = [['µ', 'ſ', "ͅ", 'ς', "ϐ", "ϑ", "ϕ", "ϖ", "ϰ", "ϱ", "ϵ", "ẛ", "ι"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "ṡ", 'ι']];
|
||||
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
|
||||
{
|
||||
if (\is_array($fromEncoding) || \false !== \strpos($fromEncoding, ',')) {
|
||||
|
@ -251,7 +251,7 @@ final class Mbstring
|
|||
$map = $upper;
|
||||
} else {
|
||||
if (self::MB_CASE_FOLD === $mode) {
|
||||
$s = \str_replace(self::$caseFold[0], self::$caseFold[1], $s);
|
||||
$s = \str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s);
|
||||
}
|
||||
static $lower = null;
|
||||
if (null === $lower) {
|
||||
|
|
2
vendor/symfony/polyfill-php80/README.md
vendored
2
vendor/symfony/polyfill-php80/README.md
vendored
|
@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core:
|
|||
- [`get_resource_id`](https://php.net/get_resource_id)
|
||||
|
||||
More information can be found in the
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
|
||||
|
||||
License
|
||||
=======
|
||||
|
|
12
vendor/symfony/polyfill-php80/bootstrap.php
vendored
12
vendor/symfony/polyfill-php80/bootstrap.php
vendored
|
@ -30,21 +30,21 @@ if (!\function_exists('preg_last_error_msg')) {
|
|||
}
|
||||
}
|
||||
if (!\function_exists('str_contains')) {
|
||||
function str_contains(string $haystack, string $needle) : bool
|
||||
function str_contains(?string $haystack, ?string $needle) : bool
|
||||
{
|
||||
return \RectorPrefix20210729\Symfony\Polyfill\Php80\Php80::str_contains($haystack, $needle);
|
||||
return \RectorPrefix20210729\Symfony\Polyfill\Php80\Php80::str_contains($haystack ?? '', $needle ?? '');
|
||||
}
|
||||
}
|
||||
if (!\function_exists('str_starts_with')) {
|
||||
function str_starts_with(string $haystack, string $needle) : bool
|
||||
function str_starts_with(?string $haystack, ?string $needle) : bool
|
||||
{
|
||||
return \RectorPrefix20210729\Symfony\Polyfill\Php80\Php80::str_starts_with($haystack, $needle);
|
||||
return \RectorPrefix20210729\Symfony\Polyfill\Php80\Php80::str_starts_with($haystack ?? '', $needle ?? '');
|
||||
}
|
||||
}
|
||||
if (!\function_exists('str_ends_with')) {
|
||||
function str_ends_with(string $haystack, string $needle) : bool
|
||||
function str_ends_with(?string $haystack, ?string $needle) : bool
|
||||
{
|
||||
return \RectorPrefix20210729\Symfony\Polyfill\Php80\Php80::str_ends_with($haystack, $needle);
|
||||
return \RectorPrefix20210729\Symfony\Polyfill\Php80\Php80::str_ends_with($haystack ?? '', $needle ?? '');
|
||||
}
|
||||
}
|
||||
if (!\function_exists('get_debug_type')) {
|
||||
|
|
|
@ -72,7 +72,7 @@ class HtmlDumper extends \RectorPrefix20210729\Symfony\Component\VarDumper\Dumpe
|
|||
}
|
||||
/**
|
||||
* Sets an HTML header that will be dumped once in the output stream.
|
||||
* @param string $header
|
||||
* @param string|null $header
|
||||
*/
|
||||
public function setDumpHeader($header)
|
||||
{
|
||||
|
|
4
vendor/symfony/yaml/Command/LintCommand.php
vendored
4
vendor/symfony/yaml/Command/LintCommand.php
vendored
|
@ -148,7 +148,7 @@ EOF
|
|||
++$erroredFiles;
|
||||
$io->text('<error> ERROR </error>' . ($info['file'] ? \sprintf(' in %s', $info['file']) : ''));
|
||||
$io->text(\sprintf('<error> >> %s</error>', $info['message']));
|
||||
if (\strpos($info['message'], 'PARSE_CUSTOM_TAGS') !== \false) {
|
||||
if (\false !== \strpos($info['message'], 'PARSE_CUSTOM_TAGS')) {
|
||||
$suggestTagOption = \true;
|
||||
}
|
||||
if ($errorAsGithubAnnotations) {
|
||||
|
@ -171,7 +171,7 @@ EOF
|
|||
if (!$v['valid']) {
|
||||
++$errors;
|
||||
}
|
||||
if (isset($v['message']) && \strpos($v['message'], 'PARSE_CUSTOM_TAGS') !== \false) {
|
||||
if (isset($v['message']) && \false !== \strpos($v['message'], 'PARSE_CUSTOM_TAGS')) {
|
||||
$v['message'] .= ' Use the --parse-tags option if you want parse custom tags.';
|
||||
}
|
||||
});
|
||||
|
|
4
vendor/symfony/yaml/Dumper.php
vendored
4
vendor/symfony/yaml/Dumper.php
vendored
|
@ -59,7 +59,7 @@ class Dumper
|
|||
if ('' !== $output && "\n" !== $output[-1]) {
|
||||
$output .= "\n";
|
||||
}
|
||||
if (\RectorPrefix20210729\Symfony\Component\Yaml\Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && \strpos($value, "\n") !== \false && \strpos($value, "\r") === \false) {
|
||||
if (\RectorPrefix20210729\Symfony\Component\Yaml\Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && \false !== \strpos($value, "\n") && \false === \strpos($value, "\r")) {
|
||||
// If the first line starts with a space character, the spec requires a blockIndicationIndicator
|
||||
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
||||
$blockIndentationIndicator = ' ' === \substr($value, 0, 1) ? (string) $this->indentation : '';
|
||||
|
@ -82,7 +82,7 @@ class Dumper
|
|||
}
|
||||
if ($value instanceof \RectorPrefix20210729\Symfony\Component\Yaml\Tag\TaggedValue) {
|
||||
$output .= \sprintf('%s%s !%s', $prefix, $dumpAsMap ? \RectorPrefix20210729\Symfony\Component\Yaml\Inline::dump($key, $flags) . ':' : '-', $value->getTag());
|
||||
if (\RectorPrefix20210729\Symfony\Component\Yaml\Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && \strpos($value->getValue(), "\n") !== \false && \strpos($value->getValue(), "\r\n") === \false) {
|
||||
if (\RectorPrefix20210729\Symfony\Component\Yaml\Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && \false !== \strpos($value->getValue(), "\n") && \false === \strpos($value->getValue(), "\r\n")) {
|
||||
// If the first line starts with a space character, the spec requires a blockIndicationIndicator
|
||||
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
||||
$blockIndentationIndicator = ' ' === \substr($value->getValue(), 0, 1) ? (string) $this->indentation : '';
|
||||
|
|
|
@ -96,7 +96,7 @@ class ParseException extends \RectorPrefix20210729\Symfony\Component\Yaml\Except
|
|||
{
|
||||
$this->message = $this->rawMessage;
|
||||
$dot = \false;
|
||||
if (\substr_compare($this->message, '.', -\strlen('.')) === 0) {
|
||||
if ('.' === \substr($this->message, -1)) {
|
||||
$this->message = \substr($this->message, 0, -1);
|
||||
$dot = \true;
|
||||
}
|
||||
|
|
16
vendor/symfony/yaml/Inline.php
vendored
16
vendor/symfony/yaml/Inline.php
vendored
|
@ -339,7 +339,7 @@ class Inline
|
|||
$isQuoted = \in_array($sequence[$i], ['"', "'"], \true);
|
||||
$value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references);
|
||||
// the value can be an array if a reference has been resolved to an array var
|
||||
if (\is_string($value) && !$isQuoted && \strpos($value, ': ') !== \false) {
|
||||
if (\is_string($value) && !$isQuoted && \false !== \strpos($value, ': ')) {
|
||||
// embedded mapping?
|
||||
try {
|
||||
$pos = 0;
|
||||
|
@ -501,7 +501,7 @@ class Inline
|
|||
private static function evaluateScalar(string $scalar, int $flags, array &$references = [])
|
||||
{
|
||||
$scalar = \trim($scalar);
|
||||
if (\strncmp($scalar, '*', \strlen('*')) === 0) {
|
||||
if (0 === \strpos($scalar, '*')) {
|
||||
if (\false !== ($pos = \strpos($scalar, '#'))) {
|
||||
$value = \substr($scalar, 1, $pos - 2);
|
||||
} else {
|
||||
|
@ -528,11 +528,11 @@ class Inline
|
|||
return \false;
|
||||
case '!' === $scalar[0]:
|
||||
switch (\true) {
|
||||
case \strncmp($scalar, '!!str ', \strlen('!!str ')) === 0:
|
||||
case 0 === \strpos($scalar, '!!str '):
|
||||
return (string) \substr($scalar, 6);
|
||||
case \strncmp($scalar, '! ', \strlen('! ')) === 0:
|
||||
case 0 === \strpos($scalar, '! '):
|
||||
return \substr($scalar, 2);
|
||||
case \strncmp($scalar, '!php/object', \strlen('!php/object')) === 0:
|
||||
case 0 === \strpos($scalar, '!php/object'):
|
||||
if (self::$objectSupport) {
|
||||
if (!isset($scalar[12])) {
|
||||
trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/object tag without a value is deprecated.');
|
||||
|
@ -544,7 +544,7 @@ class Inline
|
|||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException('Object support when parsing a YAML file has been disabled.', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||
}
|
||||
return null;
|
||||
case \strncmp($scalar, '!php/const', \strlen('!php/const')) === 0:
|
||||
case 0 === \strpos($scalar, '!php/const'):
|
||||
if (self::$constantSupport) {
|
||||
if (!isset($scalar[11])) {
|
||||
trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/const tag without a value is deprecated.');
|
||||
|
@ -560,9 +560,9 @@ class Inline
|
|||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException(\sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||
}
|
||||
return null;
|
||||
case \strncmp($scalar, '!!float ', \strlen('!!float ')) === 0:
|
||||
case 0 === \strpos($scalar, '!!float '):
|
||||
return (float) \substr($scalar, 8);
|
||||
case \strncmp($scalar, '!!binary ', \strlen('!!binary ')) === 0:
|
||||
case 0 === \strpos($scalar, '!!binary '):
|
||||
return self::evaluateBinaryScalar(\substr($scalar, 9));
|
||||
default:
|
||||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException(\sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename);
|
||||
|
|
20
vendor/symfony/yaml/Parser.php
vendored
20
vendor/symfony/yaml/Parser.php
vendored
|
@ -147,14 +147,14 @@ class Parser
|
|||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
|
||||
}
|
||||
// array
|
||||
if (isset($values['value']) && \strncmp(\ltrim($values['value'], ' '), '-', \strlen('-')) === 0) {
|
||||
if (isset($values['value']) && 0 === \strpos(\ltrim($values['value'], ' '), '-')) {
|
||||
// Inline first child
|
||||
$currentLineNumber = $this->getRealCurrentLineNb();
|
||||
$sequenceIndentation = \strlen($values['leadspaces']) + 1;
|
||||
$sequenceYaml = \substr($this->currentLine, $sequenceIndentation);
|
||||
$sequenceYaml .= "\n" . $this->getNextEmbedBlock($sequenceIndentation, \true);
|
||||
$data[] = $this->parseBlock($currentLineNumber, \rtrim($sequenceYaml), $flags);
|
||||
} elseif (!isset($values['value']) || '' == \trim($values['value'], ' ') || \strncmp(\ltrim($values['value'], ' '), '#', \strlen('#')) === 0) {
|
||||
} elseif (!isset($values['value']) || '' == \trim($values['value'], ' ') || 0 === \strpos(\ltrim($values['value'], ' '), '#')) {
|
||||
$data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, \true) ?? '', $flags);
|
||||
} elseif (null !== ($subTag = $this->getLineTag(\ltrim($values['value'], ' '), $flags))) {
|
||||
$data[] = new \RectorPrefix20210729\Symfony\Component\Yaml\Tag\TaggedValue($subTag, $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, \true), $flags));
|
||||
|
@ -174,7 +174,7 @@ class Parser
|
|||
$this->refs[$isRef] = \end($data);
|
||||
\array_pop($this->refsBeingParsed);
|
||||
}
|
||||
} elseif (self::preg_match('#^(?P<key>(?:![^\\s]++\\s++)?(?:' . \RectorPrefix20210729\Symfony\Component\Yaml\Inline::REGEX_QUOTED_STRING . '|(?:!?!php/const:)?[^ \'"\\[\\{!].*?)) *\\:(( |\\t)++(?P<value>.+))?$#u', \rtrim($this->currentLine), $values) && (\strpos($values['key'], ' #') === \false || \in_array($values['key'][0], ['"', "'"]))) {
|
||||
} elseif (self::preg_match('#^(?P<key>(?:![^\\s]++\\s++)?(?:' . \RectorPrefix20210729\Symfony\Component\Yaml\Inline::REGEX_QUOTED_STRING . '|(?:!?!php/const:)?[^ \'"\\[\\{!].*?)) *\\:(( |\\t)++(?P<value>.+))?$#u', \rtrim($this->currentLine), $values) && (\false === \strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"]))) {
|
||||
if ($context && 'sequence' == $context) {
|
||||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ class Parser
|
|||
$subTag = null;
|
||||
if ($mergeNode) {
|
||||
// Merge keys
|
||||
} elseif (!isset($values['value']) || '' === $values['value'] || \strncmp($values['value'], '#', \strlen('#')) === 0 || null !== ($subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) {
|
||||
} elseif (!isset($values['value']) || '' === $values['value'] || 0 === \strpos($values['value'], '#') || null !== ($subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) {
|
||||
// hash
|
||||
// if next line is less indented or equal, then it means that the current value is null
|
||||
if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) {
|
||||
|
@ -384,7 +384,7 @@ class Parser
|
|||
if (0 === $this->offset && !$deprecatedUsage && isset($line[0]) && ' ' === $line[0]) {
|
||||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
if (\strpos($line, ': ') !== \false) {
|
||||
if (\false !== \strpos($line, ': ')) {
|
||||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
if ('' === $trimmedLine) {
|
||||
|
@ -392,7 +392,7 @@ class Parser
|
|||
} elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) {
|
||||
$value .= ' ';
|
||||
}
|
||||
if ('' !== $trimmedLine && \substr_compare($line, '\\', -\strlen('\\')) === 0) {
|
||||
if ('' !== $trimmedLine && '\\' === \substr($line, -1)) {
|
||||
$value .= \ltrim(\substr($line, 0, -1));
|
||||
} elseif ('' !== $trimmedLine) {
|
||||
$value .= $trimmedLine;
|
||||
|
@ -400,7 +400,7 @@ class Parser
|
|||
if ('' === $trimmedLine) {
|
||||
$previousLineWasNewline = \true;
|
||||
$previousLineWasTerminatedWithBackslash = \false;
|
||||
} elseif (\substr_compare($line, '\\', -\strlen('\\')) === 0) {
|
||||
} elseif ('\\' === \substr($line, -1)) {
|
||||
$previousLineWasNewline = \false;
|
||||
$previousLineWasTerminatedWithBackslash = \true;
|
||||
} else {
|
||||
|
@ -600,7 +600,7 @@ class Parser
|
|||
*/
|
||||
private function parseValue(string $value, int $flags, string $context)
|
||||
{
|
||||
if (\strncmp($value, '*', \strlen('*')) === 0) {
|
||||
if (0 === \strpos($value, '*')) {
|
||||
if (\false !== ($pos = \strpos($value, '#'))) {
|
||||
$value = \substr($value, 1, $pos - 2);
|
||||
} else {
|
||||
|
@ -666,7 +666,7 @@ class Parser
|
|||
}
|
||||
\RectorPrefix20210729\Symfony\Component\Yaml\Inline::$parsedLineNumber = $this->getRealCurrentLineNb();
|
||||
$parsedValue = \RectorPrefix20210729\Symfony\Component\Yaml\Inline::parse($value, $flags, $this->refs);
|
||||
if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && \strpos($parsedValue, ': ') !== \false) {
|
||||
if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && \false !== \strpos($parsedValue, ': ')) {
|
||||
throw new \RectorPrefix20210729\Symfony\Component\Yaml\Exception\ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename);
|
||||
}
|
||||
return $parsedValue;
|
||||
|
@ -890,7 +890,7 @@ class Parser
|
|||
*/
|
||||
private function isStringUnIndentedCollectionItem() : bool
|
||||
{
|
||||
return '-' === \rtrim($this->currentLine) || \strncmp($this->currentLine, '- ', \strlen('- ')) === 0;
|
||||
return '-' === \rtrim($this->currentLine) || 0 === \strpos($this->currentLine, '- ');
|
||||
}
|
||||
/**
|
||||
* A local wrapper for "preg_match" which will throw a ParseException if there
|
||||
|
|
3
vendor/symfony/yaml/composer.json
vendored
3
vendor/symfony/yaml/composer.json
vendored
|
@ -18,8 +18,7 @@
|
|||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony\/deprecation-contracts": "^2.1",
|
||||
"symfony\/polyfill-ctype": "~1.8",
|
||||
"symfony\/polyfill-php80": "^1.16"
|
||||
"symfony\/polyfill-ctype": "~1.8"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony\/console": "^4.4|^5.0"
|
||||
|
|
Loading…
Reference in New Issue
Block a user