Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+8 -16
View File
@@ -83,16 +83,16 @@ class YamlFileLoader extends FileLoader
$values = array();
foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && is_array($childNodes) && 1 === count($childNodes)) {
if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) {
$options = current($childNodes);
if (is_array($options)) {
if (\is_array($options)) {
$options = $this->parseNodes($options);
}
$values[] = $this->newConstraint(key($childNodes), $options);
} else {
if (is_array($childNodes)) {
if (\is_array($childNodes)) {
$childNodes = $this->parseNodes($childNodes);
}
@@ -115,18 +115,10 @@ class YamlFileLoader extends FileLoader
*/
private function parseFile($path)
{
$prevErrorHandler = set_error_handler(function ($level, $message, $script, $line) use ($path, &$prevErrorHandler) {
$message = E_USER_DEPRECATED === $level ? preg_replace('/ on line \d+/', ' in "'.$path.'"$0', $message) : $message;
return $prevErrorHandler ? $prevErrorHandler($level, $message, $script, $line) : false;
});
try {
$classes = $this->yamlParser->parse(file_get_contents($path), Yaml::PARSE_KEYS_AS_STRINGS);
$classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
} catch (ParseException $e) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
} finally {
restore_error_handler();
}
// empty file
@@ -135,7 +127,7 @@ class YamlFileLoader extends FileLoader
}
// not an array
if (!is_array($classes)) {
if (!\is_array($classes)) {
throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $this->file));
}
@@ -171,13 +163,13 @@ class YamlFileLoader extends FileLoader
$metadata->setGroupSequence($classDescription['group_sequence']);
}
if (isset($classDescription['constraints']) && is_array($classDescription['constraints'])) {
if (isset($classDescription['constraints']) && \is_array($classDescription['constraints'])) {
foreach ($this->parseNodes($classDescription['constraints']) as $constraint) {
$metadata->addConstraint($constraint);
}
}
if (isset($classDescription['properties']) && is_array($classDescription['properties'])) {
if (isset($classDescription['properties']) && \is_array($classDescription['properties'])) {
foreach ($classDescription['properties'] as $property => $constraints) {
if (null !== $constraints) {
foreach ($this->parseNodes($constraints) as $constraint) {
@@ -187,7 +179,7 @@ class YamlFileLoader extends FileLoader
}
}
if (isset($classDescription['getters']) && is_array($classDescription['getters'])) {
if (isset($classDescription['getters']) && \is_array($classDescription['getters'])) {
foreach ($classDescription['getters'] as $getter => $constraints) {
if (null !== $constraints) {
foreach ($this->parseNodes($constraints) as $constraint) {