<commit_before><?php

namespace Ivory\GoogleMapBundle\Model\Base;

/**
 * Size which describes a google map size
 * 
 * @see http://code.google.com/apis/maps/documentation/javascript/reference.html#Size
 * @author GeLo <<EMAIL>>
 */
class Size 
{
    /**
     * @var double Width size
     */
    protected $width = 1;
    
    /**
     * @var double Height size
     */
    protected $height = 1;
    
    /**
     * @var string Width unit size
     */
    protected $widthUnit = null;
    
    /**
     * @var string Height unit size
     */
    protected $heightUnit = null;
    
    /**
     * Create a size
     *
     * @param double $width
     * @param double $height
     * @param string $widthUnit
     * @param string $heightUnit 
     */
    public function __construct($width = 1, $height = 1, $widthUnit = null, $heightUnit = null)
    {
        $this->setWidth($width);
        $this->setHeight($height);
        
        $this->setWidthUnit($widthUnit);
        $this->setHeightUnit($heightUnit);
    }
    
    /**
     * Checks if the size has units
     *
     * @return boolean TRUE if the size has units else FALSE
     */
    public function hasUnits()
    {
        return !is_null($this->widthUnit) && !is_null($this->heightUnit);
    }
    
    /**
     * Gets the width size
     *
     * @return double
     */
    public function getWidth()
    {
        return $this->width;
    }
    
    /**
     * Sets the width size
     *
     * @param double $width 
     */
    public function setWidth($width)
    {
        if(is_numeric($width))
            $this->width = $width;
        else
            throw new \InvalidArgumentException('The width of a size must be a numeric value.');
    }
    
    /**
     * Gets the height size
     *
     * @return double
     */
    public function getHeight()
    {
        return $this->height;
    }
    
    /**
     * Sets the height size
     *
     * @param double $height 
     */
    public function setHeight($height)
    {
        if(is_numeric($height))
            $this->height = $height;
        else
            throw new \InvalidArgumentException('The height of a size must be a numeric value.');
    }
    
    /**
     * Gets the width unit size
     *
     * @return string
     */
    public function getWidthUnit()
    {
        return $this->widthUnit;
    }
    
    /**
     * Set sthe width unit size
     *
     * @param string $widthUnit 
     */
    public function setWidthUnit($widthUnit)
    {
        if(is_string($widthUnit))
            $this->widthUnit = $widthUnit;
        else
            throw new \InvalidArgumentException('The width unit of a size must be a string value.');
    }
    
    /**
     * Gets the height unit size
     *
     * @return string 
     */
    public function getHeightUnit()
    {
        return $this->heightUnit;
    }
    
    /**
     * Set sthe height unit size
     *
     * @param string $heightUnit 
     */
    public function setHeightUnit($heightUnit)
    {
        if(is_string($heightUnit))
            $this->heightUnit = $heightUnit;
        else
            throw new \InvalidArgumentException('The height unit of a size must be a string value.');
    }<commit_msg>Fix mistake in size width & height unit setter<commit_after><?php

namespace Ivory\GoogleMapBundle\Model\Base;

/**
 * Size which describes a google map size
 * 
 * @see http://code.google.com/apis/maps/documentation/javascript/reference.html#Size
 * @author GeLo <<EMAIL>>
 */
class Size 
{
    /**
     * @var double Width size
     */
    protected $width = 1;
    
    /**
     * @var double Height size
     */
    protected $height = 1;
    
    /**
     * @var string Width unit size
     */
    protected $widthUnit = null;
    
    /**
     * @var string Height unit size
     */
    protected $heightUnit = null;
    
    /**
     * Create a size
     *
     * @param double $width
     * @param double $height
     * @param string $widthUnit
     * @param string $heightUnit 
     */
    public function __construct($width = 1, $height = 1, $widthUnit = null, $heightUnit = null)
    {
        $this->setWidth($width);
        $this->setHeight($height);
        
        $this->setWidthUnit($widthUnit);
        $this->setHeightUnit($heightUnit);
    }
    
    /**
     * Checks if the size has units
     *
     * @return boolean TRUE if the size has units else FALSE
     */
    public function hasUnits()
    {
        return !is_null($this->widthUnit) && !is_null($this->heightUnit);
    }
    
    /**
     * Gets the width size
     *
     * @return double
     */
    public function getWidth()
    {
        return $this->width;
    }
    
    /**
     * Sets the width size
     *
     * @param double $width 
     */
    public function setWidth($width)
    {
        if(is_numeric($width))
            $this->width = $width;
        else
            throw new \InvalidArgumentException('The width of a size must be a numeric value.');
    }
    
    /**
     * Gets the height size
     *
     * @return double
     */
    public function getHeight()
    {
        return $this->height;
    }
    
    /**
     * Sets the height size
     *
     * @param double $height 
     */
    public function setHeight($height)
    {
        if(is_numeric($height))
            $this->height = $height;
        else
            throw new \InvalidArgumentException('The height of a size must be a numeric value.');
    }
    
    /**
     * Gets the width unit size
     *
     * @return string
     */
    public function getWidthUnit()
    {
        return $this->widthUnit;
    }
    
    /**
     * Set sthe width unit size
     *
     * @param string $widthUnit 
     */
    public function setWidthUnit($widthUnit)
    {
        if(($widthUnit === null) || is_string($widthUnit))
            $this->widthUnit = $widthUnit;
        else
            throw new \InvalidArgumentException('The width unit of a size must be a string value.');
    }
    
    /**
     * Gets the height unit size
     *
     * @return string 
     */
    public function getHeightUnit()
    {
        return $this->heightUnit;
    }
    
    /**
     * Set sthe height unit size
     *
     * @param string $heightUnit 
     */
    public function setHeightUnit($heightUnit)
    {
        if(($heightUnit === null) || is_string($heightUnit))
            $this->heightUnit = $heightUnit;
        else
            throw new \InvalidArgumentException('The height unit of a size must be a string value.');
    }
{'fraction_non_alphanumeric': 0.11521939245167229, 'fraction_numerical': 0.00122737035900583, 'mean_word_length': 1.7219206680584551, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1025905', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1868, 'n_words': 515}