for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Rafał Muszyński <[email protected]>
* @copyright 2013 Sourcefabric o.p.s.
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/
namespace Newscoop\PaywallBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
class ContainsDecimalValidator extends ConstraintValidator
{
* Add violations to the validator's context property.
*
* @param string $value
* @param Symfony\Component\Validator\Constraint $constraint
public function validate($value, Constraint $constraint)
if (!is_numeric($value)) {
$this->context->addViolation($constraint->message);
}