Set the src attribute.

@param string $src A URI.
@throws \InvalidArgumentException If $src is not a valid URI.
519707
public function setSrc($src)
    {
        if (Format::isUri($src) === true) {
            $this->src = $src;
        } else {
            $msg = "The 'src' argument must be a valid URI, '" . $src . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
292414
public function setPhoto($src, $href = null)
    {
        if (isset($href)) {
            $this->photo = new Link(new Image($src), $href);
        } else {
            $this->photo = new Image($src);
        }

        return $this;
    }
907342
private function setEye($eye)
    {
        if (!is_string($eye) || strlen($eye) !== 1) {
            throw new \InvalidArgumentException(
                'Eye must be a one character string'
            );
        }

        $this->eye = $eye;
    }
973494
public function set($target)
    {
        if (! is_string($target) || empty($target)) {
            throw new InvalidArgumentException(
                'Invalid target provided. Must be an non-empty string.'
            );
        }
        $this->target = $target;
    }
863549
public function set_label($code, $value)
    {
        if (!array_key_exists($code, $this->labels)) {
            throw new InvalidArgumentException(sprintf('Code %s is not defined', $code));
        }

        $this->labels[$code] = $value;

        return $this;
    }
1109710
public function setChan($chan)
    {
        if (!\Erebot\Utils::stringifiable($chan)) {
            throw new \Erebot\InvalidValueException('Not a channel');
        }

        $this->chan = $chan;
    }
123608
protected static function setURI($uri){
        if(!is_string($uri)){
            throw new InvalidArgumentException(
                '$uri must be a string or null'
            );
        }
        self::$uri = filter_var($uri, FILTER_SANITIZE_URL);
    }
170774
protected function attr($src = null, array $attr = array())
    {
        if (null !== $src) {
            $attr['src'] = $src;
        }
        $attr['type'] = 'text/javascript';
        return $this->escaper->attr($attr);
    }
545985
protected function setPostcode(string $postcode): void
    {
        if (! preg_match(self::POSTCODE_FORMAT, $postcode)) {
            throw new InvalidArgumentException('Postcode must match the expected format: ' . self::POSTCODE_FORMAT);
        }

        $this->postcode = $postcode;
    }
919720
private function build_src( $src ) {
		if ( ! preg_match( '/^(https?:)?\/\//u', $src ) ) {
			// O.K. This is a library in WPametu!
			$src = trailingslashit( $this->get_root_uri() ) . ltrim( $src, '/' );
		}

		return $src;
	}
97759
public function setOption($option)
    {
        if (!isset(static::$availableOptions[$option])) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid option specified: "%s". Expected one of (%s)',
                $option,
                implode(', ', array_keys(static::$availableOptions))
            ));
        }
        if (!in_array(static::$availableOptions[$option], $this->options, true)) {
            $this->options[] = static::$availableOptions[$option];
        }
    }
888638
public function setAttribute($key, $value) {
    if (($key == static::$table_type_field) || (!$this->isInAllAttributes($key))) {
      throw new InvalidAttributeException("The attribute {$key} is non available.");
    }

    return parent::setAttribute($key, $value);
  }
759626
public function setAttribute($name, $value)
    {
        if (is_numeric($value)) {
            $value = (string) $value;
        }

        if (!is_string($value) && $value !== null) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 2 to be string or null, %s given', __METHOD__, (is_object($value) ? get_class($value) : gettype($value))));
        }

        $this->node->setAttribute($name, $value);

        return $this;
    }
393820
public function setAttribute($name, $value)
    {
        if (isset($this->{$name})) {
            $this->{$name} = $value;
        } else {
            throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".');
        }
    }
824238
public function setDefaultPath($path = null)
    {
        if ((null !== $path) && (false === is_dir($path))) {
            throw new InvalidArgumentException(sprintf(
                'The path "%s" is not a directory path or does not exist.',
                $path
            ));
        }

        $this->path = $path;
    }
959964
public function setTypeAttribute($type)
    {
        if (!$type instanceof ContentType) {
            $type = ContentType::getByName($type);
        }
        if (!$type) {
            throw new InvalidArgumentException('Unknown content type');
        }
        $this->type()->associate($type);
    }
253475
public function source($src)
    {
        $this->source = $this->getImageInfo($src);

        $type              = $this->source['type'];
        $createFrom        = 'ImageCreateFrom' . $type;
        $this->sourceImage = $createFrom($src);

        return $this;
    }