Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Drupal\Core\Validation\Plugin\Validation\Constraint; use Drupal\Core\Str..

Decoded Output download

<?php

namespace Drupal\Core\Validation\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraints\Choice;

/**
 * Checks for the value being allowed.
 *
 * @see \Drupal\Core\TypedData\OptionsProviderInterface
 */
#[Constraint(
  id: 'AllowedValues',
  label: new TranslatableMarkup('Allowed values', [], ['context' => 'Validation'])
)]
class AllowedValuesConstraint extends Choice {

  /**
   * {@inheritdoc}
   */
  public function __construct(...$args) {
    $this->strict = TRUE;
    $this->minMessage = 'You must select at least %limit choice.|You must select at least %limit choices.';
    $this->maxMessage = 'You must select at most %limit choice.|You must select at most %limit choices.';
    parent::__construct(...$args);
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Drupal\Core\Validation\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraints\Choice;

/**
 * Checks for the value being allowed.
 *
 * @see \Drupal\Core\TypedData\OptionsProviderInterface
 */
#[Constraint(
  id: 'AllowedValues',
  label: new TranslatableMarkup('Allowed values', [], ['context' => 'Validation'])
)]
class AllowedValuesConstraint extends Choice {

  /**
   * {@inheritdoc}
   */
  public function __construct(...$args) {
    $this->strict = TRUE;
    $this->minMessage = 'You must select at least %limit choice.|You must select at least %limit choices.';
    $this->maxMessage = 'You must select at most %limit choice.|You must select at most %limit choices.';
    parent::__construct(...$args);
  }

}

Function Calls

None

Variables

None

Stats

MD5 b453d44ec3e6a2df66376c25856aaa8f
Eval Count 0
Decode Time 95 ms