for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace JBen87\ParsleyBundle\Constraint\Constraints;
use JBen87\ParsleyBundle\Constraint\Constraint;
use Symfony\Component\OptionsResolver\OptionsResolver;
class Max extends Constraint
{
/**
* @var int
*/
private $max;
* @param array $options
public function __construct(array $options = [])
parent::__construct($options);
$this->max = $options['max'];
}
* @inheritdoc
protected function getAttribute(): string
return 'data-parsley-max';
protected function getValue(): string
return (string) $this->max;
protected function configureOptions(OptionsResolver $resolver): void
$resolver
->setRequired(['max'])
->setAllowedTypes('max', ['int'])
;