original_string: public function setSender(ContactInterface $sender = null)
      {
          if ($sender !== null && !($sender instanceof Contact)) {
              throw new InvalidArgumentException(
                  sprintf(
                      '%s expects an instance of %s.',
                      __FUNCTION__, Contact::class
                  )
              );
          }
          $this->sender = $sender;
  
          return $this;
      }
code: public function setSender(ContactInterface $sender = null)
      {
          if ($sender !== null && !($sender instanceof Contact)) {
              throw new InvalidArgumentException(
                  sprintf(
                      '%s expects an instance of %s.',
                      __FUNCTION__, Contact::class
                  )
              );
          }
          $this->sender = $sender;
  
          return $this;
      }
code_tokens: public function setSender ( ContactInterface $ sender = null ) { if ( $ sender !== null && ! ( $ sender instanceof Contact ) ) { throw new InvalidArgumentException ( sprintf ( '%s expects an instance of %s.' , __FUNCTION__ , Contact :: class ) ) ; } $ this -> sender = $ sender ; return $ this ; }
docstring: Sets the sender.
  Optional OR Required. Optional where From is one person. Required where From is multiple people.
  
  @param Contact|null $sender
  
  @throws InvalidArgumentException
  @return static
docstring_tokens: Sets the sender . Optional OR Required . Optional where From is one person . Required where From is multiple people .