public function max($max)
    {
        if (isset($this->min) && $this->min > $max) {
            throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min));
        }
        $this->max = $max;

        return $this;
    }
public function max($max)
    {
        if (isset($this->min) && $this->min > $max) {
            throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min));
        }
        $this->max = $max;

        return $this;
    }
public function max ( $ max ) { if ( isset ( $ this -> min ) && $ this -> min > $ max ) { throw new \ InvalidArgumentException ( sprintf ( 'You cannot define a max(%s) as you already have a min(%s)' , $ max , $ this -> min ) ) ; } $ this -> max = $ max ; return $ this ; }
Ensures that the value is smaller than the given reference.

@param mixed $max

@return $this

@throws \InvalidArgumentException when the constraint is inconsistent
Ensures that the value is smaller than the given reference .