original_string: public function setUsername(string $username): void
  	{
  		if (Strings::match($username, '/[^A-Za-z0-9_]/')) {
  			throw new InvalidArgumentException('Username contains invalid characters');
  		}
  
  		/* @var $repository UsersRepository */
  		$repository = $this->getRepository();
  		$user = $repository->getByUsername($username);
  		if ($user !== null && $user !== $this) {
  			throw new UniqueConstraintViolationException("Username '$username' exists");
  		}
  		$this->username = $username;
  	}
code: public function setUsername(string $username): void
  	{
  		if (Strings::match($username, '/[^A-Za-z0-9_]/')) {
  			throw new InvalidArgumentException('Username contains invalid characters');
  		}
  
  		/* @var $repository UsersRepository */
  		$repository = $this->getRepository();
  		$user = $repository->getByUsername($username);
  		if ($user !== null && $user !== $this) {
  			throw new UniqueConstraintViolationException("Username '$username' exists");
  		}
  		$this->username = $username;
  	}
code_tokens: public function setUsername ( string $ username ) : void { if ( Strings :: match ( $ username , '/[^A-Za-z0-9_]/' ) ) { throw new InvalidArgumentException ( 'Username contains invalid characters' ) ; } /* @var $repository UsersRepository */ $ repository = $ this -> getRepository ( ) ; $ user = $ repository -> getByUsername ( $ username ) ; if ( $ user !== null && $ user !== $ this ) { throw new UniqueConstraintViolationException ( "Username '$username' exists" ) ; } $ this -> username = $ username ; }
docstring: Ulozi uzivatelske jmeno
  @param string $username
  @throws UniqueConstraintViolationException
  @throws InvalidArgumentException
docstring_tokens: Ulozi uzivatelske jmeno