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
+1 -1
View File
@@ -32,7 +32,7 @@ abstract class FileLoader extends AbstractLoader
*
* @throws MappingException If the file does not exist or is not readable
*/
public function __construct($file)
public function __construct(string $file)
{
if (!is_file($file)) {
throw new MappingException(sprintf('The mapping file "%s" does not exist', $file));
+1 -1
View File
@@ -36,7 +36,7 @@ class LoaderChain implements LoaderInterface
{
foreach ($loaders as $loader) {
if (!$loader instanceof LoaderInterface) {
throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface', get_class($loader)));
throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface', \get_class($loader)));
}
}
@@ -28,7 +28,7 @@ class StaticMethodLoader implements LoaderInterface
*
* @param string $methodName The name of the static method to call
*/
public function __construct($methodName = 'loadValidatorMetadata')
public function __construct(string $methodName = 'loadValidatorMetadata')
{
$this->methodName = $methodName;
}
+14 -14
View File
@@ -75,17 +75,17 @@ class XmlFileLoader extends FileLoader
$constraints = array();
foreach ($nodes as $node) {
if (count($node) > 0) {
if (count($node->value) > 0) {
if (\count($node) > 0) {
if (\count($node->value) > 0) {
$options = $this->parseValues($node->value);
} elseif (count($node->constraint) > 0) {
} elseif (\count($node->constraint) > 0) {
$options = $this->parseConstraints($node->constraint);
} elseif (count($node->option) > 0) {
} elseif (\count($node->option) > 0) {
$options = $this->parseOptions($node->option);
} else {
$options = array();
}
} elseif (strlen((string) $node) > 0) {
} elseif (\strlen((string) $node) > 0) {
$options = XmlUtils::phpize(trim($node));
} else {
$options = null;
@@ -109,10 +109,10 @@ class XmlFileLoader extends FileLoader
$values = array();
foreach ($nodes as $node) {
if (count($node) > 0) {
if (count($node->value) > 0) {
if (\count($node) > 0) {
if (\count($node->value) > 0) {
$value = $this->parseValues($node->value);
} elseif (count($node->constraint) > 0) {
} elseif (\count($node->constraint) > 0) {
$value = $this->parseConstraints($node->constraint);
} else {
$value = array();
@@ -143,17 +143,17 @@ class XmlFileLoader extends FileLoader
$options = array();
foreach ($nodes as $node) {
if (count($node) > 0) {
if (count($node->value) > 0) {
if (\count($node) > 0) {
if (\count($node->value) > 0) {
$value = $this->parseValues($node->value);
} elseif (count($node->constraint) > 0) {
} elseif (\count($node->constraint) > 0) {
$value = $this->parseConstraints($node->constraint);
} else {
$value = array();
}
} else {
$value = XmlUtils::phpize($node);
if (is_string($value)) {
if (\is_string($value)) {
$value = trim($value);
}
}
@@ -203,12 +203,12 @@ class XmlFileLoader extends FileLoader
private function loadClassMetadataFromXml(ClassMetadata $metadata, \SimpleXMLElement $classDescription)
{
if (count($classDescription->{'group-sequence-provider'}) > 0) {
if (\count($classDescription->{'group-sequence-provider'}) > 0) {
$metadata->setGroupSequenceProvider(true);
}
foreach ($classDescription->{'group-sequence'} as $groupSequence) {
if (count($groupSequence->value) > 0) {
if (\count($groupSequence->value) > 0) {
$metadata->setGroupSequence($this->parseValues($groupSequence[0]->value));
}
}
+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) {