.+))?$#u', rtrim($this->currentLine), $values)
- && (!str_contains($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"]))
+ && (false === strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"]))
) {
if ($context && 'sequence' == $context) {
throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename);
@@ -306,7 +306,7 @@ private function doParse(string $value, int $flags)
$subTag = null;
if ($mergeNode) {
// Merge keys
- } elseif (!isset($values['value']) || '' === $values['value'] || str_starts_with($values['value'], '#') || (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()) {
@@ -453,7 +453,7 @@ private function doParse(string $value, int $flags)
throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
- if (str_contains($line, ': ')) {
+ if (false !== strpos($line, ': ')) {
@trigger_error('Support for mapping keys in multi-line blocks is deprecated since Symfony 4.3 and will throw a ParseException in 5.0.', \E_USER_DEPRECATED);
}
@@ -463,7 +463,7 @@ private function doParse(string $value, int $flags)
$value .= ' ';
}
- if ('' !== trim($line) && str_ends_with($line, '\\')) {
+ if ('' !== trim($line) && '\\' === substr($line, -1)) {
$value .= ltrim(substr($line, 0, -1));
} elseif ('' !== trim($line)) {
$value .= trim($line);
@@ -472,7 +472,7 @@ private function doParse(string $value, int $flags)
if ('' === trim($line)) {
$previousLineWasNewline = true;
$previousLineWasTerminatedWithBackslash = false;
- } elseif (str_ends_with($line, '\\')) {
+ } elseif ('\\' === substr($line, -1)) {
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = true;
} else {
@@ -716,7 +716,7 @@ private function moveToPreviousLine(): bool
*/
private function parseValue(string $value, int $flags, string $context)
{
- if (str_starts_with($value, '*')) {
+ if (0 === strpos($value, '*')) {
if (false !== $pos = strpos($value, '#')) {
$value = substr($value, 1, $pos - 2);
} else {
@@ -803,7 +803,7 @@ private function parseValue(string $value, int $flags, string $context)
$parsedValue = Inline::parse($value, $flags, $this->refs);
- if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && str_contains($parsedValue, ': ')) {
+ if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) {
throw new ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename);
}
@@ -1073,7 +1073,7 @@ private function isNextLineUnIndentedCollection(): bool
*/
private function isStringUnIndentedCollectionItem(): bool
{
- return '-' === rtrim($this->currentLine) || str_starts_with($this->currentLine, '- ');
+ return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- ');
}
/**
diff --git a/src/Symfony/Component/Yaml/composer.json b/src/Symfony/Component/Yaml/composer.json
index cb4c1f264dbef..10120348a67fc 100644
--- a/src/Symfony/Component/Yaml/composer.json
+++ b/src/Symfony/Component/Yaml/composer.json
@@ -17,8 +17,7 @@
],
"require": {
"php": ">=7.1.3",
- "symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-php80": "^1.16"
+ "symfony/polyfill-ctype": "~1.8"
},
"require-dev": {
"symfony/console": "^3.4|^4.0|^5.0"
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy