Callback.php in Zircon Profile 8
File
vendor/symfony/validator/Constraints/Callback.php
View source
<?php
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
class Callback extends Constraint {
public $callback;
public $methods;
public function __construct($options = null) {
if (is_array($options) && 1 === count($options) && isset($options['value'])) {
$options = $options['value'];
}
if (is_array($options) && isset($options['methods'])) {
@trigger_error('The "methods" option of the ' . __CLASS__ . ' class is deprecated since version 2.4 and will be removed in 3.0. Use the "callback" option instead.', E_USER_DEPRECATED);
}
if (is_array($options) && !isset($options['callback']) && !isset($options['methods']) && !isset($options['groups'])) {
if (is_callable($options) || !$options) {
$options = array(
'callback' => $options,
);
}
else {
$options = array(
'methods' => $options,
);
}
}
parent::__construct($options);
}
public function getDefaultOption() {
return 'callback';
}
public function getTargets() {
return array(
self::CLASS_CONSTRAINT,
self::PROPERTY_CONSTRAINT,
);
}
}
Classes
Name |
Description |
Callback |
@Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"}) |