Repository: symfony/symfony
File: src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php (PHP)

Code before:
     *
     * @return class-string[]
     */
    public function getMappedClasses(): array
    {
        if (!isset($this->classes)) {
            $this->loadClassesFromXml();
        }

        return array_keys($this->classes);
    }

    /**
     * Parses a collection of "constraint" XML nodes.
     *
     * @param \SimpleXMLElement $nodes The XML nodes
     *
     * @return Constraint[]
     */
    protected function parseConstraints(\SimpleXMLElement $nodes): array
    {
        $constraints = [];

        foreach ($nodes as $node) {
            if (\count($node) > 0) {
                if (\count($node->value) > 0) {
                    trigger_deprecation('symfony/validator', '7.4', 'Using the "value" XML element to configure an option for the "%s" is deprecated. Use the "option" element instead.', (string) $node['name']);

                    $options = [
                        'value' => $this->parseValues($node->value),
                    ];
                } elseif (\count($node->constraint) > 0) {
                    $options = $this->parseConstraints($node->constraint);
                } elseif (\count($node->option) > 0) {
                    $options = $this->parseOptions($node->option);
                } else {
                    $options = [];
                }
            } elseif ('' !== (string) $node) {
                $options = XmlUtils::phpize(trim($node));
            } else {
                $options = null;
            }

            if (isset($options['groups']) && !\is_array($options['groups'])) {
                $options['groups'] = (array) $options['groups'];
            }

            $constraints[] = $this->newConstraint((string) $node['name'], $options, true);
        }


Review comment (suggestion):
The XSD should also be updated to remove `<value>` as an allowed child of `<constraint>`

Code after:
     *
     * @return class-string[]
     */
    public function getMappedClasses(): array
    {
        if (!isset($this->classes)) {
            $this->loadClassesFromXml();
        }

        return array_keys($this->classes);
    }

    /**
     * Parses a collection of "constraint" XML nodes.
     *
     * @param \SimpleXMLElement $nodes The XML nodes
     *
     * @return Constraint[]
     */
    protected function parseConstraints(\SimpleXMLElement $nodes): array
    {
        $constraints = [];

        foreach ($nodes as $node) {
            if (\count($node) > 0) {
                if (\count($node->constraint) > 0) {
                    $options = $this->parseConstraints($node->constraint);
                } elseif (\count($node->option) > 0) {
                    $options = $this->parseOptions($node->option);
                } else {
                    $options = [];
                }
            } elseif ('' !== (string) $node) {
                $options = XmlUtils::phpize(trim($node));
            } else {
                $options = null;
            }

            if (isset($options['groups']) && !\is_array($options['groups'])) {
                $options['groups'] = (array) $options['groups'];
            }

            $constraints[] = $this->newConstraint((string) $node['name'], $options, true);
        }

        return $constraints;
    }

    /**
     * Parses a collection of "value" XML nodes.
     *