Set the current image type

@param string 		$type		The new image type
@param string 		$overwrite	Should the image keep this type?
@return string
518953
protected function set_type( $type, $overwrite = true )
	{
		if ( !is_null( $type ) )
		{
			if ( !in_array( $type, static::$available_image_types ) )
			{
				throw new CCException( "CCImage - Invalid image type '".$type."'." );
			}

			// don't allow jpg, set to jpeg
			if ( $type === 'jpg' )
			{
				$type = 'jpeg';
			}

			if ( $overwrite )
			{
				$this->type = $type;
			}
		}

		return $type;
	}
1025383
public function setType($type): self
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex()->getName());
            $type = $type->getName();
        }

        $this->_type = (string) $type;

        return $this;
    }
614152
public function setType($type) {

        $this->checkInArray($type, GDAXConstants::$orderTypeValues);
        $this->type = $type;
        return $this;

    }
926360
public function setType($type)
    {
        $this->type = $type;

        switch ($type) {
            case 'text':
            case 'string':
                $this->operatorOpts = ['equals', 'notequals', 'contains'];
                break;
            case 'integer':
                $this->operatorOpts = ['equals', 'notequals', 'greaterthan', 'lessthan'];
                break;
            case 'boolean':
                $this->operatorOpts = ['equals'];
                break;
        }

        return $this;
    }
829207
public function set( $key, $value = null, $overwrite = true )
    {
        //	Passed in an array or object
        if ( null === $value )
        {
            if ( $key instanceof \Traversable )
            {
                foreach ( $key as $_key => $_value )
                {
                    $this->set( $_key, $_value, $overwrite );
                }

                return $this;
            }
            else if ( $key instanceof Interfaces\SeedLike )
            {
                $value = $key;
                $key = $value->getId();
            }
        }

        $_exists = Utility\Option::contains( $this->_bag, $key );

        if ( false === $overwrite && $_exists && ( null !== ( $_oldValue = Utility\Option::get( $this->_bag, $key ) ) ) )
        {
            throw new Exceptions\BagException( 'The property "' . $key . '" is read-only.' );
        }

        if ( false !== $this->_fixedSize && !$_exists )
        {
            throw new Exceptions\BagException( 'This class does not have a property named "' . $key . '"' );
        }

        Utility\Option::set( $this->_bag, $key, $value );

        return $this;
    }
1009926
public function setType($type)
    {
        if (strlen($type) == 0) {
            throw new \InvalidArgumentException(sprintf('MIME type should not be empty'));
        }

        if (!preg_match('@^[^/]+/[^/]+$@', $type)) {
            throw new \InvalidArgumentException(sprintf('Invalid MIME type: %s', $type));
        }

        $this->type = $type;

        return $this;
    }
473363
public function setType($type)
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex());
            $type = $type->getName();
        }

        return $this->setParam('_type', $type);
    }
1367718
public function copy(string $destination, $overwrite = false) : bool
    {
        $copied = false;

        if ($this->isFile()) {
            $exists = file_exists($destination);
            if (!$exists || ($exists && $overwrite)) {
                $copied = copy($this->realPath, $destination);
            }
        }

        return $copied;
    }
362826
public function updateResource(Resource $resource, $overwrite = false)
    {
        $url = self::makeUrl(null, $resource->uri);
        $body = $resource->toJSON();

        $url .= '?' . Util::query_suffix(array("overwrite" => $overwrite));
        // Isolate the class name, lowercase it, and provide it as a filetype in the headers
        $type = explode('\\', get_class($resource));
        $file_type = 'application/repository.' . lcfirst(end($type)) . '+json';
        $data = $this->service->prepAndSend($url, array(201, 200), 'PUT', $body, true, $file_type, 'application/json');
        return $resource::createFromJSON(json_decode($data, true), get_class($resource));
    }
448951
public function set($name, $content, $metaType="name", $overwrite = true)
    {
        if($content) {
            // strip html tags and encode html entities
            $content = htmlspecialchars(strip_tags($content));
            if($overwrite) {
                // limit length on description tag
                if ($name == 'description' || $name == "og:description") {
                    $content = str_limit($content, 300);
                }
                // allowed duplicates meta tags
                if (in_array($name, $this->allowedDuplicateMeta)) {
                    $this->metaList[$name][] = [
                      'type' => $metaType,
                      'content' => $content
                    ];
                } else {
                    $this->metaList[$name] = [
                      'type' => $metaType,
                      'content' => $content
                    ];
                }
            }
        }

        return $this;
    }
244265
public function setType($type)
    {
        if ($this->formHelper->getFieldType($type)) {
            $this->type = $type;
        }

        return $this;
    }
213089
public function addFileType($type): self
    {
        $type = '.' . trim($type, '. ');

        if (!isset($this->watchedTypes[$type])) {
            $this->watchedTypes[$type] = true;
        }

        return $this;
    }
733807
public function create($type, $override, $persisted)
    {
        $base = $this->factory->blueprint();
        $variation = $this->getVariation($type);

        $blueprint = array_merge($base, $variation, $override);

        return new Blueprint($this->name, $type, $blueprint, $this->isFixture($type), $persisted);
    }
1216735
public function type($type)
    {
        $types = is_array($type) ? $type : func_get_args();

        $this->types = array_merge($this->types, $types);

        return $this;
    }
853906
private static function imageTypeToExtension($type)
    {
        $type = (int)$type;

        switch ($type) {
            case 2:
                $format = 'JPEG';
                break;

            case 4:
                $format = 'PNG';
                break;

            default:
                $format = 'UNSUPPORTED';
        }
        return $format;
    }
96762
public function options($options, bool $overwrite = false)
    {
        if ($overwrite) {
            $this->options = $options;
        } else {
            $this->options = array_replace_recursive($this->options, $options);
        }

        return $this;
    }
663285
public function setUrlType($type)
    {
        if (!in_array($type, [self::URL_APPEND, self::URL_CLEAN])) {
            throw new \Exception("Unsupported Url type.");
        }

        $this->urlType = $type;
        return $this;
    }