Skip to content

Assert Type is Numeric fails on Int32 limitation #9570

Closed
@stefantalen

Description

@stefantalen

Hi,

I have an entity called Telephone with an validation constraint on the number:

use Doctrine\ORM\Mapping as ORM;

use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class Telephone extends ContactMethod
{
    /**
     * @ORM\Column(type="integer", nullable=true)
     * @Assert\Type(type="numeric")
     */
    protected $countrycode;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Assert\Type(type="numeric")
     */
    protected $number;
}

However when I try to set the value of $number to 2821760000 it is marked as "invalid".

Locally I'm not experiencing this problem (Mac OS X 10.9) but on our dedicated server with Windows Server 2003 x86, PHP 5.4.5 and Symfony 2.2.10 the validation fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions