diff --git a/composer.json b/composer.json index 0b85ea22..dddfa396 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Jekyll.", "require": { "league/html-to-markdown": "^5.0", - "symfony/yaml": "^5.0 || ^6.0" + "symfony/yaml": "^5.0" }, "license": "GPLv3 or later", "authors": [{ diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 2635e3f8..3d91534d 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -20,6 +20,5 @@ '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '3937806105cc8e221b8fa8db5b70d2f2' => $vendorDir . '/wp-cli/mustangostang-spyc/includes/functions.php', 'be01b9b16925dcb22165c40b46681ac6' => $vendorDir . '/wp-cli/php-cli-tools/lib/cli/cli.php', - '04c6c5c2f7095ccf6c481d3e53e1776f' => $vendorDir . '/mustangostang/spyc/Spyc.php', '7d3b315c4f303f2fc14aca642a738e50' => $vendorDir . '/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php', ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 5d1bb74a..998b03df 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -21,7 +21,6 @@ class ComposerStaticInit85c237256145ae68b71a77045d81d88a '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '3937806105cc8e221b8fa8db5b70d2f2' => __DIR__ . '/..' . '/wp-cli/mustangostang-spyc/includes/functions.php', 'be01b9b16925dcb22165c40b46681ac6' => __DIR__ . '/..' . '/wp-cli/php-cli-tools/lib/cli/cli.php', - '04c6c5c2f7095ccf6c481d3e53e1776f' => __DIR__ . '/..' . '/mustangostang/spyc/Spyc.php', '7d3b315c4f303f2fc14aca642a738e50' => __DIR__ . '/..' . '/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 8961654d..267f8023 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -622,59 +622,6 @@ }, "install-path": "../mustache/mustache" }, - { - "name": "mustangostang/spyc", - "version": "0.6.3", - "version_normalized": "0.6.3.0", - "source": { - "type": "git", - "url": "git@github.com:mustangostang/spyc.git", - "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0", - "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "4.3.*@dev" - }, - "time": "2019-09-10T13:16:29+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "Spyc.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "mustangostang", - "email": "vlad.andersen@gmail.com" - } - ], - "description": "A simple YAML loader/dumper class for PHP", - "homepage": "https://github.com/mustangostang/spyc/", - "keywords": [ - "spyc", - "yaml", - "yml" - ], - "install-path": "../mustangostang/spyc" - }, { "name": "myclabs/deep-copy", "version": "1.10.2", @@ -4175,33 +4122,34 @@ }, { "name": "symfony/yaml", - "version": "v6.0.2", - "version_normalized": "6.0.2.0", + "version": "v5.4.2", + "version_normalized": "5.4.2.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ed602f38b8636a2ea21af760d2578f3d2f92fc60" + "reference": "b9eb163846a61bb32dfc147f7859e274fab38b58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ed602f38b8636a2ea21af760d2578f3d2f92fc60", - "reference": "ed602f38b8636a2ea21af760d2578f3d2f92fc60", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b9eb163846a61bb32dfc147f7859e274fab38b58", + "reference": "b9eb163846a61bb32dfc147f7859e274fab38b58", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<5.3" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.3|^6.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" }, - "time": "2021-12-16T22:13:01+00:00", + "time": "2021-12-16T21:58:21+00:00", "bin": [ "Resources/bin/yaml-lint" ], @@ -4232,7 +4180,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.0.2" + "source": "https://github.com/symfony/yaml/tree/v5.4.2" }, "funding": [ { @@ -4717,7 +4665,6 @@ "squizlabs/php_codesniffer", "symfony/config", "symfony/console", - "symfony/deprecation-contracts", "symfony/filesystem", "symfony/finder", "symfony/polyfill-intl-grapheme", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 7c54950b..c877b6d1 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '5021c22e155cca0977a7ec5448e087058380c1aa', + 'reference' => '158de6e273b64eaea79ace3a0677f59637b3938a', 'name' => 'benbalter/wordpress-to-jekyll-exporter', 'dev' => true, ), @@ -16,7 +16,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '5021c22e155cca0977a7ec5448e087058380c1aa', + 'reference' => '158de6e273b64eaea79ace3a0677f59637b3938a', 'dev_requirement' => false, ), 'dealerdirect/phpcodesniffer-composer-installer' => array( @@ -82,15 +82,6 @@ 'reference' => '579ffa5c96e1d292c060b3dd62811ff01ad8c24e', 'dev_requirement' => true, ), - 'mustangostang/spyc' => array( - 'pretty_version' => '0.6.3', - 'version' => '0.6.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mustangostang/spyc', - 'aliases' => array(), - 'reference' => '4627c838b16550b666d15aeae1e5289dd5b77da0', - 'dev_requirement' => false, - ), 'myclabs/deep-copy' => array( 'pretty_version' => '1.10.2', 'version' => '1.10.2.0', @@ -491,7 +482,7 @@ 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'symfony/filesystem' => array( 'pretty_version' => 'v6.0.0', @@ -584,12 +575,12 @@ 'dev_requirement' => true, ), 'symfony/yaml' => array( - 'pretty_version' => 'v6.0.2', - 'version' => '6.0.2.0', + 'pretty_version' => 'v5.4.2', + 'version' => '5.4.2.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), - 'reference' => 'ed602f38b8636a2ea21af760d2578f3d2f92fc60', + 'reference' => 'b9eb163846a61bb32dfc147f7859e274fab38b58', 'dev_requirement' => false, ), 'theseer/tokenizer' => array( diff --git a/vendor/symfony/yaml/Command/LintCommand.php b/vendor/symfony/yaml/Command/LintCommand.php index 1412360c..3ebd570e 100644 --- a/vendor/symfony/yaml/Command/LintCommand.php +++ b/vendor/symfony/yaml/Command/LintCommand.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Yaml\Command; -use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\CI\GithubActionReporter; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Completion\CompletionInput; @@ -33,21 +32,23 @@ * @author Grégoire Pineau * @author Robin Chalas */ -#[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')] class LintCommand extends Command { + protected static $defaultName = 'lint:yaml'; + protected static $defaultDescription = 'Lint a YAML file and outputs encountered errors'; + private $parser; - private ?string $format = null; - private bool $displayCorrectFiles; - private ?\Closure $directoryIteratorProvider; - private ?\Closure $isReadableProvider; + private $format; + private $displayCorrectFiles; + private $directoryIteratorProvider; + private $isReadableProvider; public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) { parent::__construct($name); - $this->directoryIteratorProvider = null === $directoryIteratorProvider || $directoryIteratorProvider instanceof \Closure ? $directoryIteratorProvider : \Closure::fromCallable($directoryIteratorProvider); - $this->isReadableProvider = null === $isReadableProvider || $isReadableProvider instanceof \Closure ? $isReadableProvider : \Closure::fromCallable($isReadableProvider); + $this->directoryIteratorProvider = $directoryIteratorProvider; + $this->isReadableProvider = $isReadableProvider; } /** @@ -56,6 +57,7 @@ public function __construct(string $name = null, callable $directoryIteratorProv protected function configure() { $this + ->setDescription(self::$defaultDescription) ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') ->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude') @@ -86,7 +88,7 @@ protected function configure() ; } - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $filenames = (array) $input->getArgument('filename'); @@ -242,7 +244,11 @@ private function getFiles(string $fileOrDirectory): iterable private function getParser(): Parser { - return $this->parser ??= new Parser(); + if (!$this->parser) { + $this->parser = new Parser(); + } + + return $this->parser; } private function getDirectoryIterator(string $directory): iterable diff --git a/vendor/symfony/yaml/Dumper.php b/vendor/symfony/yaml/Dumper.php index 0b13a986..db3e346b 100644 --- a/vendor/symfony/yaml/Dumper.php +++ b/vendor/symfony/yaml/Dumper.php @@ -24,8 +24,10 @@ class Dumper { /** * The amount of spaces to use for indentation of nested nodes. + * + * @var int */ - private int $indentation; + protected $indentation; public function __construct(int $indentation = 4) { @@ -44,7 +46,7 @@ public function __construct(int $indentation = 4) * @param int $indent The level of indentation (used internally) * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string */ - public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string + public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string { $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; diff --git a/vendor/symfony/yaml/Exception/ParseException.php b/vendor/symfony/yaml/Exception/ParseException.php index 005470a3..8748d2b2 100644 --- a/vendor/symfony/yaml/Exception/ParseException.php +++ b/vendor/symfony/yaml/Exception/ParseException.php @@ -18,10 +18,10 @@ */ class ParseException extends RuntimeException { - private ?string $parsedFile; - private int $parsedLine; - private ?string $snippet; - private string $rawMessage; + private $parsedFile; + private $parsedLine; + private $snippet; + private $rawMessage; /** * @param string $message The error message @@ -43,8 +43,10 @@ public function __construct(string $message, int $parsedLine = -1, string $snipp /** * Gets the snippet of code near the error. + * + * @return string */ - public function getSnippet(): string + public function getSnippet() { return $this->snippet; } @@ -63,8 +65,10 @@ public function setSnippet(string $snippet) * Gets the filename where the error occurred. * * This method returns null if a string is parsed. + * + * @return string */ - public function getParsedFile(): string + public function getParsedFile() { return $this->parsedFile; } @@ -81,8 +85,10 @@ public function setParsedFile(string $parsedFile) /** * Gets the line where the error occurred. + * + * @return int */ - public function getParsedLine(): int + public function getParsedLine() { return $this->parsedLine; } diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php index 104b7b0a..e005666c 100644 --- a/vendor/symfony/yaml/Inline.php +++ b/vendor/symfony/yaml/Inline.php @@ -26,13 +26,13 @@ class Inline { public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'; - public static int $parsedLineNumber = -1; - public static ?string $parsedFilename = null; + public static $parsedLineNumber = -1; + public static $parsedFilename; - private static bool $exceptionOnInvalidType = false; - private static bool $objectSupport = false; - private static bool $objectForMap = false; - private static bool $constantSupport = false; + private static $exceptionOnInvalidType = false; + private static $objectSupport = false; + private static $objectForMap = false; + private static $constantSupport = false; public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null) { @@ -50,12 +50,15 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri /** * Converts a YAML string to a PHP value. * - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * @param array $references Mapping of variable names to values + * @param string $value A YAML string + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param array $references Mapping of variable names to values + * + * @return mixed * * @throws ParseException */ - public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed + public static function parse(string $value = null, int $flags = 0, array &$references = []) { self::initialize($flags); @@ -65,31 +68,42 @@ public static function parse(string $value = null, int $flags = 0, array &$refer return ''; } - $i = 0; - $tag = self::parseTag($value, $i, $flags); - switch ($value[$i]) { - case '[': - $result = self::parseSequence($value, $flags, $i, $references); - ++$i; - break; - case '{': - $result = self::parseMapping($value, $flags, $i, $references); - ++$i; - break; - default: - $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references); + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); } - // some comments are allowed at the end - if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } + try { + $i = 0; + $tag = self::parseTag($value, $i, $flags); + switch ($value[$i]) { + case '[': + $result = self::parseSequence($value, $flags, $i, $references); + ++$i; + break; + case '{': + $result = self::parseMapping($value, $flags, $i, $references); + ++$i; + break; + default: + $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references); + } - if (null !== $tag && '' !== $tag) { - return new TaggedValue($tag, $result); - } + // some comments are allowed at the end + if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) { + throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename); + } - return $result; + if (null !== $tag && '' !== $tag) { + return new TaggedValue($tag, $result); + } + + return $result; + } finally { + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + } } /** @@ -100,7 +114,7 @@ public static function parse(string $value = null, int $flags = 0, array &$refer * * @throws DumpException When trying to dump PHP resource */ - public static function dump(mixed $value, int $flags = 0): string + public static function dump($value, int $flags = 0): string { switch (true) { case \is_resource($value): @@ -188,8 +202,10 @@ public static function dump(mixed $value, int $flags = 0): string /** * Check if given array is hash or just normal indexed array. + * + * @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check */ - public static function isHash(array|\ArrayObject|\stdClass $value): bool + public static function isHash($value): bool { if ($value instanceof \stdClass || $value instanceof \ArrayObject) { return true; @@ -245,9 +261,11 @@ private static function dumpNull(int $flags): string /** * Parses a YAML scalar. * + * @return mixed + * * @throws ParseException When malformed inline YAML string is parsed */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null): mixed + public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null) { if (\in_array($scalar[$i], ['"', "'"], true)) { // quoted scalar @@ -390,9 +408,11 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, /** * Parses a YAML mapping. * + * @return array|\stdClass + * * @throws ParseException When malformed inline YAML string is parsed */ - private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = []): array|\stdClass + private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = []) { $output = []; $len = \strlen($mapping); @@ -534,9 +554,11 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a /** * Evaluates scalars and replaces magic values. * + * @return mixed + * * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved */ - private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null): mixed + private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null) { $isQuotedString = false; $scalar = trim($scalar); @@ -587,7 +609,9 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer case 0 === strpos($scalar, '!php/object'): if (self::$objectSupport) { if (!isset($scalar[12])) { - throw new ParseException('Missing value for tag "!php/object".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/object tag without a value is deprecated.'); + + return false; } return unserialize(self::parseScalar(substr($scalar, 12))); @@ -601,7 +625,9 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer case 0 === strpos($scalar, '!php/const'): if (self::$constantSupport) { if (!isset($scalar[11])) { - throw new ParseException('Missing value for tag "!php/const".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/const tag without a value is deprecated.'); + + return ''; } $i = 0; @@ -642,7 +668,22 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer switch (true) { case ctype_digit($scalar): + if (preg_match('/^0[0-7]+$/', $scalar)) { + trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0.'); + + return octdec($scalar); + } + + $cast = (int) $scalar; + + return ($scalar === (string) $cast) ? $cast : $scalar; case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): + if (preg_match('/^-0[0-7]+$/', $scalar)) { + trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0.'); + + return -octdec(substr($scalar, 1)); + } + $cast = (int) $scalar; return ($scalar === (string) $cast) ? $cast : $scalar; diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php index 2b080dee..4b642e3a 100644 --- a/vendor/symfony/yaml/Parser.php +++ b/vendor/symfony/yaml/Parser.php @@ -27,17 +27,17 @@ class Parser public const BLOCK_SCALAR_HEADER_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?'; public const REFERENCE_PATTERN = '#^&(?P[^ ]++) *+(?P.*)#u'; - private ?string $filename = null; - private int $offset = 0; - private int $numberOfParsedLines = 0; - private ?int $totalNumberOfLines = null; - private array $lines = []; - private int $currentLineNb = -1; - private string $currentLine = ''; - private array $refs = []; - private array $skippedLineNumbers = []; - private array $locallySkippedLineNumbers = []; - private array $refsBeingParsed = []; + private $filename; + private $offset = 0; + private $numberOfParsedLines = 0; + private $totalNumberOfLines; + private $lines = []; + private $currentLineNb = -1; + private $currentLine = ''; + private $refs = []; + private $skippedLineNumbers = []; + private $locallySkippedLineNumbers = []; + private $refsBeingParsed = []; /** * Parses a YAML file into a PHP value. @@ -45,9 +45,11 @@ class Parser * @param string $filename The path to the YAML file to be parsed * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior * + * @return mixed + * * @throws ParseException If the file could not be read or the YAML is not valid */ - public function parseFile(string $filename, int $flags = 0): mixed + public function parseFile(string $filename, int $flags = 0) { if (!is_file($filename)) { throw new ParseException(sprintf('File "%s" does not exist.', $filename)); @@ -72,9 +74,11 @@ public function parseFile(string $filename, int $flags = 0): mixed * @param string $value A YAML string * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior * + * @return mixed + * * @throws ParseException If the YAML is not valid */ - public function parse(string $value, int $flags = 0): mixed + public function parse(string $value, int $flags = 0) { if (false === preg_match('//u', $value)) { throw new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename); @@ -82,9 +86,19 @@ public function parse(string $value, int $flags = 0): mixed $this->refs = []; + $mbEncoding = null; + + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + } + try { $data = $this->doParse($value, $flags); } finally { + if (null !== $mbEncoding) { + mb_internal_encoding($mbEncoding); + } $this->lines = []; $this->currentLine = ''; $this->numberOfParsedLines = 0; @@ -541,6 +555,9 @@ public function getRealCurrentLineNb(): int return $realCurrentLineNumber; } + /** + * Returns the current line indentation. + */ private function getCurrentLineIndentation(): int { if (' ' !== ($this->currentLine[0] ?? '')) { @@ -695,9 +712,11 @@ private function moveToPreviousLine(): bool * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior * @param string $context The parser context (either sequence or mapping) * + * @return mixed + * * @throws ParseException When reference does not exist */ - private function parseValue(string $value, int $flags, string $context): mixed + private function parseValue(string $value, int $flags, string $context) { if (0 === strpos($value, '*')) { if (false !== $pos = strpos($value, '#')) { @@ -940,16 +959,25 @@ private function isNextLineIndented(): bool return $ret; } + /** + * Returns true if the current line is blank or if it is a comment line. + */ private function isCurrentLineEmpty(): bool { return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); } + /** + * Returns true if the current line is blank. + */ private function isCurrentLineBlank(): bool { return '' === $this->currentLine || '' === trim($this->currentLine, ' '); } + /** + * Returns true if the current line is a comment line. + */ private function isCurrentLineComment(): bool { //checking explicitly the first char of the trim is faster than loops or strpos @@ -963,6 +991,11 @@ private function isCurrentLineLastLineInDocument(): bool return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); } + /** + * Cleanups a YAML string to be parsed. + * + * @param string $value The input YAML string + */ private function cleanup(string $value): string { $value = str_replace(["\r\n", "\r"], "\n", $value); @@ -994,6 +1027,9 @@ private function cleanup(string $value): string return $value; } + /** + * Returns true if the next line starts unindented collection. + */ private function isNextLineUnIndentedCollection(): bool { $currentIndentation = $this->getCurrentLineIndentation(); @@ -1020,6 +1056,9 @@ private function isNextLineUnIndentedCollection(): bool return $ret; } + /** + * Returns true if the string is un-indented collection item. + */ private function isStringUnIndentedCollectionItem(): bool { return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- '); diff --git a/vendor/symfony/yaml/Tag/TaggedValue.php b/vendor/symfony/yaml/Tag/TaggedValue.php index c7946c27..4ea34061 100644 --- a/vendor/symfony/yaml/Tag/TaggedValue.php +++ b/vendor/symfony/yaml/Tag/TaggedValue.php @@ -17,10 +17,10 @@ */ final class TaggedValue { - private string $tag; - private mixed $value; + private $tag; + private $value; - public function __construct(string $tag, mixed $value) + public function __construct(string $tag, $value) { $this->tag = $tag; $this->value = $value; diff --git a/vendor/symfony/yaml/Yaml.php b/vendor/symfony/yaml/Yaml.php index 49784216..ea130452 100644 --- a/vendor/symfony/yaml/Yaml.php +++ b/vendor/symfony/yaml/Yaml.php @@ -46,9 +46,11 @@ class Yaml * @param string $filename The path to the YAML file to be parsed * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior * + * @return mixed + * * @throws ParseException If the file could not be read or the YAML is not valid */ - public static function parseFile(string $filename, int $flags = 0): mixed + public static function parseFile(string $filename, int $flags = 0) { $yaml = new Parser(); @@ -67,9 +69,11 @@ public static function parseFile(string $filename, int $flags = 0): mixed * @param string $input A string containing YAML * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior * + * @return mixed + * * @throws ParseException If the YAML is not valid */ - public static function parse(string $input, int $flags = 0): mixed + public static function parse(string $input, int $flags = 0) { $yaml = new Parser(); @@ -87,7 +91,7 @@ public static function parse(string $input, int $flags = 0): mixed * @param int $indent The amount of spaces to use for indentation of nested nodes * @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string */ - public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string + public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string { $yaml = new Dumper($indent); diff --git a/vendor/symfony/yaml/composer.json b/vendor/symfony/yaml/composer.json index 356b9ac7..7fa6e2cc 100644 --- a/vendor/symfony/yaml/composer.json +++ b/vendor/symfony/yaml/composer.json @@ -16,14 +16,15 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.3|^6.0" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<5.3" }, "suggest": { "symfony/console": "For validating YAML files using the lint command"