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\Entity\Plugin\Validation\Constraint; use Symfony\Component\V..

Decoded Output download

<?php

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

use Symfony\Component\Validator\Constraint;

/**
 * Checks if a value is a valid entity type.
 *
 * @Constraint(
 *   id = "EntityType",
 *   label = @Translation("Entity type", context = "Validation"),
 *   type = { "entity", "entity_reference" }
 * )
 */
class EntityTypeConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'The entity must be of type %type.';

  /**
   * The entity type option.
   *
   * @var string
   */
  public $type;

  /**
   * {@inheritdoc}
   */
  public function getDefaultOption() {
    return 'type';
  }

  /**
   * {@inheritdoc}
   */
  public function getRequiredOptions() {
    return ['type'];
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

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

use Symfony\Component\Validator\Constraint;

/**
 * Checks if a value is a valid entity type.
 *
 * @Constraint(
 *   id = "EntityType",
 *   label = @Translation("Entity type", context = "Validation"),
 *   type = { "entity", "entity_reference" }
 * )
 */
class EntityTypeConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'The entity must be of type %type.';

  /**
   * The entity type option.
   *
   * @var string
   */
  public $type;

  /**
   * {@inheritdoc}
   */
  public function getDefaultOption() {
    return 'type';
  }

  /**
   * {@inheritdoc}
   */
  public function getRequiredOptions() {
    return ['type'];
  }

}

Function Calls

None

Variables

None

Stats

MD5 baf1e5d2a462fc4982154ec820cf4d9d
Eval Count 0
Decode Time 75 ms