Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

Yaml.php

Same filename in this branch
  1. 11.1.x vendor/symfony/yaml/Yaml.php
  2. 11.1.x core/lib/Drupal/Core/Serialization/Yaml.php
  3. 11.1.x core/lib/Drupal/Component/Serialization/Yaml.php

Namespace

Symfony\Component\Validator\Constraints

File

vendor/symfony/validator/Constraints/Yaml.php

View source
<?php


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\Validator\Attribute\HasNamedArguments;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Exception\LogicException;
use Symfony\Component\Yaml\Parser;

/**
 * @author Kev <https://github.com/symfonyaml>
 */
class Yaml extends Constraint {
    public const INVALID_YAML_ERROR = '63313a31-837c-42bb-99eb-542c76aacc48';
    protected const ERROR_NAMES = [
        self::INVALID_YAML_ERROR => 'INVALID_YAML_ERROR',
    ];
    
    /**
     * @param int-mask-of<\Symfony\Component\Yaml\Yaml::PARSE_*> $flags
     * @param string[]|null                                      $groups
     */
    public function __construct(string $message = 'This value is not valid YAML.', int $flags = 0, ?array $groups = null, mixed $payload = null) {
        if (!class_exists(Parser::class)) {
            throw new LogicException('The Yaml component is required to use the Yaml constraint. Try running "composer require symfony/yaml".');
        }
        parent::__construct(null, $groups, $payload);
    }

}

Classes

Title Deprecated Summary
Yaml @author Kev <https://github.com/symfonyaml>
RSS feed
Powered by Drupal