protected function validateSize($width, $height)
    {
        if ($this->maximumHeight && $height > $this->maximumHeight) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_height_max'],
                $height,
                $this->maximumHeight
            ));
            return false;
        }

        if ($this->maximumWidth && $width > $this->maximumWidth) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_width_max'],
                $width,
                $this->maximumWidth
            ));
            return false;
        }

        if ($this->minimumHeight && $height < $this->minimumHeight) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_height_min'],
                $height,
                $this->minimumHeight
            ));
            return false;
        }

        if ($this->minimumWidth && $width < $this->minimumWidth) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_width_min'],
                $width,
                $this->minimumWidth
            ));
            return false;
        }

        return true;
    }
protected function validateSize($width, $height)
    {
        if ($this->maximumHeight && $height > $this->maximumHeight) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_height_max'],
                $height,
                $this->maximumHeight
            ));
            return false;
        }

        if ($this->maximumWidth && $width > $this->maximumWidth) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_width_max'],
                $width,
                $this->maximumWidth
            ));
            return false;
        }

        if ($this->minimumHeight && $height < $this->minimumHeight) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_height_min'],
                $height,
                $this->minimumHeight
            ));
            return false;
        }

        if ($this->minimumWidth && $width < $this->minimumWidth) {
            $this->setErrorMessage(sprintf(
                $this->messages['size_width_min'],
                $width,
                $this->minimumWidth
            ));
            return false;
        }

        return true;
    }
protected function validateSize ( $ width , $ height ) { if ( $ this -> maximumHeight && $ height > $ this -> maximumHeight ) { $ this -> setErrorMessage ( sprintf ( $ this -> messages [ 'size_height_max' ] , $ height , $ this -> maximumHeight ) ) ; return false ; } if ( $ this -> maximumWidth && $ width > $ this -> maximumWidth ) { $ this -> setErrorMessage ( sprintf ( $ this -> messages [ 'size_width_max' ] , $ width , $ this -> maximumWidth ) ) ; return false ; } if ( $ this -> minimumHeight && $ height < $ this -> minimumHeight ) { $ this -> setErrorMessage ( sprintf ( $ this -> messages [ 'size_height_min' ] , $ height , $ this -> minimumHeight ) ) ; return false ; } if ( $ this -> minimumWidth && $ width < $ this -> minimumWidth ) { $ this -> setErrorMessage ( sprintf ( $ this -> messages [ 'size_width_min' ] , $ width , $ this -> minimumWidth ) ) ; return false ; } return true ; }
Validate the size. If the size is invalid, we will also push an error message with setErrorMessage.
@param int $width
@param int $height
@return bool
Validate the size . If the size is invalid we will also push an error message with setErrorMessage .