Sets the subject of the e-mail.

@param string $subject the subject of the e-mail, must not be empty

@return void

@throws \InvalidArgumentException
337320
public function setSubject($subject)
    {
        if ($subject === '') {
            throw new \InvalidArgumentException('$subject must not be empty.', 1331488802);
        }

        if ((strpos($subject, CR) !== false) || (strpos($subject, LF) !== false)) {
            throw new \InvalidArgumentException(
                '$subject must not contain any line breaks or carriage returns.',
                1331488817
            );
        }

        $this->setAsString('subject', $subject);
    }
19237
public function setEmail($email)
    {
        if (!is_bool($email)) {
            throw new \InvalidArgumentException('The attribute email on the class Attribute has to be boolean (' . gettype($email) . ('object' === gettype($email) ? ' ' . get_class($email) : '') . ' given).');
        }

        $this->email = $email;

        return $this;
    }
516754
public function setSentVia($sentVia)
    {
        if (is_string($sentVia) && in_array($sentVia, self::$sentVias)) {
            $this->sentVia = $sentVia;
        } else {
            throw new InvalidArgumentException;
        }
    }
493552
public function setObject($object)
    {
        if ( ! is_object($object))
        {
            throw new InvalidArgumentException(
                'Expected an object, but got '.gettype($object)
            );
        }

        $this->object = new ReflectionClass($object);
    }
97187
public function setType($type)
    {
      if(!is_string($type) || strlen(trim($type)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid type, must be a non empty string');

      $this->type = $type;
    }
1275085
public function receiveAnEmailWithSubject($subject)
    {
        $message = $this->fetchLastMessage();
        $this->assertEquals($subject, $message->subject);
    }
433504
public function setBody($body)
    {
        if ($body !== false && (empty($body) || !is_array($body) || (count($body) % 2) !== 0)) {
            throw new InvalidResponseException($this->command, $body);
        }
        parent::setBody($body);
    }
311853
public function setTarget($target)
    {
        if (!$target instanceof ModelInterface) {
            throw new Exception\InvalidArgumentException(sprintf(
                '"%s" works only with ModelInterface targets',
                __CLASS__
            ));
        }
        return parent::setTarget($target);
    }
15919
public function update(SubjectInterface $subject)
   {
       try {
           foreach ($this->observer as $value) {
               $value->update($subject);
           }
       } catch (Throwable $e) {
           throw new ViewException(
               "Can't update " . static::class . " " . $e->getMessage()
           );
       }
   }
131123
public function setField(string $field) : void
    {
        $field = trim($field);
        if (empty($field)) {
            throw new InvalidArgumentException("Field is empty");
        }

        $this->field = $field;
    }
270947
public function setResponse($response)
    {
        $allowedValues = $this->getResponseAllowableValues();
        if (!in_array($response, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'response', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['response'] = $response;

        return $this;
    }
656617
public function setSubject($subject)
    {
        $node = $this->getSubject(false);
        if(!$node){
            $node = $this->createElement('subject');
            $this->doc->appendChild($node);
        }
        $node->nodeValue = htmlspecialchars($subject);
    }
192483
public function subject($subject) {

		if(false === is_string($subject)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($subject)), E_USER_ERROR);
		}

		$this -> subject = $subject;

		return $this;
	}
1000317
public function setEmailAddress($emailAddress)
    {
        if ($emailAddress != null)
        {
            if (filter_var(trim($emailAddress), FILTER_VALIDATE_EMAIL) === false)
            {
                throw new InvalidArgumentException($emailAddress . " is not a valid email address.");
            }
        }

        $this->emailAddress = $emailAddress;
    }
389761
public function setSubject($value)
    {
        if (trim($value) == null)
        {
            throw new InvalidArgumentException("Subject cannot be empty.");
        }
        $this->subject = trim($value);
    }
811733
public function stickSubject(Subject $subject)
    {
        $this->om->startFlushSuite();
        $subject->setIsSticked(true);
        $this->om->persist($subject);
        $this->dispatch(new StickSubjectEvent($subject));
        $this->om->endFlushSuite();
    }
637407
public function setSubject($subject)
    {
        $this->_subject = $this->encodeUtf8(
            $this->filterOther((string) $subject)
        );
        return $this;
    }