public function __construct(EntityRepository $repository, $username, $password) { $this->repository = $repository; $this->username = (string) $username; $this->password = (string) $password; }