@param Size $size

@return Size
545818
public function divide(Size $size): Size
    {
        if (0 === $size->get('b')) {
            throw new \OutOfBoundsException('Could not divide by zero.');
        }

        $this->bit = \ceil($this->bit / $size->get('b'));

        return $this;
    }
1149850
public function setSize($size)
    {
        if (strpos($size, 'col-') === false) {
            $size = 'col-'.$size.'-';
        }

        $this->size = $size;

        return $this;
    }
1372646
public function iniHumanFriendlySize($size){

        switch( substr($size,-1) ) {
            case 'G':
                $size = $size * 1024;
            case 'M':
                $size = $size * 1024;
            case 'K':
                $size = $size * 1024;
        }//switch

        return $this->humanFileSize($size);

    }
89461
public function size($size)
    {
        if (!$this->isValidSize($size)) {
            throw new AudioPlayerException('Invalid Size');
        }
        $this->size = $size;

        // Progress Bar & Time Code can not be used with Tiny/Invisible
        // Any other size (Small, Medium, Large) MUST have a Progress Bar
        if ($size == static::SIZE_TINY || $size == static::SIZE_INVISIBLE) {
            $this->progressBar(false)->timeCode(false);
        } else {
            $this->progressBar();
        }

        return $this;
    }
69697
public static function fileSize($size)
    {
        $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];

        for ($i = 0; $size > 1024; $i++) {
            $size /= 1024;
        }

        return __('Size unit ' . $units[$i], round($size, 2));
    }
1049489
protected function readableSize($size, $format = null)
	{
		// adapted from code at http://aidanlister.com/repos/v/function.size_readable.php
		$sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');

		if(is_null($format))
		{
			$format = '%01.2f %s';
		}

		$lastsizestring = end($sizes);

		foreach ($sizes as $sizestring)
		{
			if ($size < 1024)
			{
				break;
			}

			if ($sizestring != $lastsizestring)
			{
				$size /= 1024;
			}
		}

		// Bytes aren't normally fractional
		if($sizestring == $sizes[0])
		{
			$format = '%01d %s';
		}

		return sprintf($format, $size, $sizestring);
	}
258224
protected function packSize($size)
    {
        return ($size <= 127)
            ? $this->pack(self::BINN_UINT8, $size)
            : $this->getInt32Binsize($size);
    }
821438
private function migrateSize(?string $size): ?string
    {
        if ($size === null) {
            return null;
        }


        $columns = array_map(
            function (array $column) {
                if ($column['width'] === 'auto') {
                    $column['width'] = 'equal';
                }

                return $column;
            },
            StringUtil::deserialize($size, true)
        );

        return serialize($columns);
    }
469268
public function fileSize($size) {
        if (!$size) {
            return '0 ' . $this->_sizes[0];
        }
        return round($size/pow(1024, ($i = floor(log($size, 1024)))), $i > 1 ? 2 : 0) .
            ' ' . $this->_sizes[$i];
    }
1350614
final static public function sizeTextToBytes (int $size=0, string $unit="") : int
	{
		$units = ['B' => 0, 'KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4, 'PB' => 5, 'EB' => 6, 'ZB' => 7, 'YB' => 8 ];
		return $size * pow(1024, $units[strtoupper($unit)]);
	}
1373668
public function setSize($size)
	{
		$this->size = $size;
		$this->pixelRatio = round($size / 5);

		return $this;
	}
92656
public static function get_image_height($size)
    {
        // Get the size meta array.
        $size = static::get_image_size($size);

        if ($size === false) {
            return false;
        }

        if (isset($size['height'])) {
            return (int) $size['height'];
        }

        return false;
    }
1365576
public static function size ($size, $unit = '')
		{
			if (is_numeric($size) and $size >= 0)
			{
				if (( !$unit && $size >= 1 << 30 ) || $unit == 'GB')
					return round($size / ( 1 << 30 )) . ' GB';
				if (( !$unit && $size >= 1 << 20 ) || $unit == 'MB')
					return round($size / ( 1 << 20 )) . ' MB';
				if (( !$unit && $size >= 1 << 10 ) || $unit == 'KB')
					return round($size / ( 1 << 10 )) . ' KB';

				return round($size) . ' B';
			}

			return null;
		}
764814
public function removeSize($size)
    {
        $size = is_array($size) ? new Size($size[0], $size[1]) : $size;
        $key = "$size";

        if (isset($this->sizes[$key])) {
            unset($this->sizes[$key]);
        }

        if (isset($this->sizeUrls[$key])) {
            unset($this->sizeUrls[$key]);
        }

        return $this;
    }
61779
public function setSize($size) {
		foreach ( $this->elements as $element ) {
			$element->setSize($size);
		}
		if (is_int($size)) {
			return $this->addToPropertyUnique("class", CssRef::sizes("btn-group")[$size], CssRef::sizes("btn-group"));
		}
		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("btn-group"));
	}
240587
public function generate($size)
    {
        if ($size == 0) {
            return static::emptyValue($size);
        }
        $file = fopen(static::$file, 'rb');
        if (!$file) {
            return static::emptyValue($size);
        }
        if (function_exists('stream_set_read_buffer')) {
            stream_set_read_buffer($file, 0);
        }
        $result = fread($file, $size);
        fclose($file);

        return $result;
    }
697459
public static function formatFileSize($size) {
        if ( $size/1024 < 1 ) {
            return $size ." B";
        } else if ( $size/1024 > 1 && $size/(1024*1024) < 1 ) {
            return number_format($size/1024, 2, '.', '') .'KB';
        } else if ( $size/(1024*1024) > 1 && $size/(1024*1024*1024)< 1 ) {
            return number_format($size/(1024*1024), 2, '.', '') ." MB";
        } else {
            return number_format($size/(1024*1024*1024), 2, '.', '')." GB";
        }
    }