@param string $firstname

@throws \InvalidArgumentException
@return Applicant
770428
public function setFirstname($firstname)
    {
        if (!is_string($firstname) && !is_null($firstname)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->firstname = $firstname;

        return $this;
    }
1304436
public static function instance($authorId, $firstName, $lastName)
    {
        $author = new self();

        $author->authorId  = $authorId;
        $author->firstName = $firstName;
        $author->lastName  = $lastName;

        return $author;
    }
945446
protected function resolve($name): EmailVerificationBrokerContract
    {
        $config = $this->getConfig($name);

        if (is_null($config)) {
            throw new InvalidArgumentException("Email verification broker [{$name}] is not defined.");
        }

        return new EmailVerificationBroker(
            $this->app['auth']->createUserProvider($config['provider']),
            $this->app['config']['app.key'],
            $config['expire']
        );
    }
449817
private function addStandardApplicant(
        $firstName,
        callable $callback = null
    )
    {
        $applicant = new Applicant();
        $eligibility = new Eligibility();
        $nationality = new Nationality();
        $registration = new Registration();

        $nationality->setName('British');

        $eligibility->setPresentNationality($nationality);
        $eligibility->setSubjectToImmigrationControls(true);
        $eligibility->setSubjectToImmigrationControlsDetails('I require a Visa');
        $eligibility->setResidencyOrEmploymentRestrictions(false);
        $eligibility->setPermissionToCheckBackground(true);

        $registration->setHeardAboutUs('I have heard');
        $registration->setDisabledDetails('I am disabled');
        $registration->setDisabledAdjustmentDetails('I would like an adjustment');

        $applicant->setEnabled(true);
        $applicant->setEmail(strtolower($firstName).'@test.com');
        $applicant->setPlainPassword('P@ssword1');
        $applicant->setUsername(md5($firstName));
        $applicant->setFirstname($firstName);
        $applicant->setLastname('Persona');

        $applicant->setAddress(
            (new Address())
                ->setLine1('123 Some Street')
                ->setTown('Some Town')
                ->setCounty('Some County')
                ->setPostcode('AB12 3CD')
                ->setCountry('GB')
        );

        $applicant->setPhoneNumber(
            (new PhoneNumber())
                ->setNumber('123456789')
        );

        $applicant->setEligibility($eligibility);
        $applicant->setRegistration($registration);

        if ($callback != null) {
            $callback($applicant);
        }

        $this->manager->persist($applicant);

        return $applicant;
    }
375788
public function setName($name)
    {
        if (strlen($name) == 0) {
            throw new \InvalidArgumentException(sprintf('TextInput name should not be empty'));
        }

        $this->name = $name;

        return $this;
    }
751602
public function setName(string $name) : Application
    {
        $service = $this->getService();
        $service->setName($name);
        $this->name = $service->getName();
        return $this;
    }
914432
public function setUserName($userName)
    {
        $user = posix_getpwnam($userName);
        if (! isset($user['uid'])) {
            throw new InvalidArgumentException(sprintf('"%s" is not a valid user name', $userName));
        }

        $this->setUserId($user['uid']);
    }
787802
public function getMember($name)
    {
        $members = $this->getMembers();

        if (!isset($members[$name])) {
            throw new \InvalidArgumentException('Unknown member ' . $name);
        }

        return $members[$name];
    }
78147
public function setFirstname($firstname)
	{
		if ( $firstname == $this->getFirstname() ) { return; }

		$this->_values['firstname'] = (string) $firstname;
		$this->setModified();
	}
1034384
public function getUser($username)
    {
        try {
            $response = $this->client->adminGetUser([
                'Username' => $username,
                'UserPoolId' => $this->userPoolId,
            ]);
            return $response;
        } catch (Exception $e) {
            throw CognitoResponseException::createFromCognitoException($e);
        }
    }
864534
public function setUsername($username)
        {
            if ($this->validateUsername($username) === false) {
                throw new Exception("Username \"$username\" is not a valid HTTP username");
            }

            $oldUsername     = $this->_username;
            $this->_username = $username;

            return $oldUsername;
        }
844531
public function setName($name)
    {
        if ((strlen($name) > 50)) {
            throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 50.');
        }
        if ((strlen($name) < 1)) {
            throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be bigger than or equal to 1.');
        }

        $this->container['name'] = $name;

        return $this;
    }
480688
public function validateApplication($application)
    {
        if (!is_string($application)
            || strlen($application) > 256
            || strlen($application) < 1
        ) {
            throw new InvalidArgumentException(
                'Application name must be a non empty string of at most 256 ' .
                'characters',
                400
            );
        }

        return $this;
    }
1240107
public function setName($name)
    {
        $xName = explode(' ', $name);
        $firstName = $xName[ 0 ];

        array_shift($xName);

        $lastName = implode(' ', $xName);

        $this->setObject('first_name', $firstName);
        $this->setObject('last_name', $lastName);

        return $this;
    }
1241071
private function createCustomer(
        $email,
        $firstName = null,
        $lastName = null,
        \DateTimeInterface $createdAt = null,
        $phoneNumber = null
    ) {
        /** @var CustomerInterface $customer */
        $customer = $this->customerFactory->createNew();

        $customer->setFirstName($firstName);
        $customer->setLastName($lastName);
        $customer->setEmail($email);
        $customer->setPhoneNumber($phoneNumber);
        if (null !== $createdAt) {
            $customer->setCreatedAt($createdAt);
        }

        $this->sharedStorage->set('customer', $customer);

        return $customer;
    }
336495
public function setName($name)
    {
        if ($this->isNameValid($name) !== true) {
            throw new InvalidArgumentException('The name is not valid.');
        }

        $this->name = $name;

        return $this;
    }
947720
public static function fromQName( $name )
	{
		if ( $name instanceof QName )
		{
			$name = "{$name->prefix}:{$name->localName}";
		}
		if ( ! is_string( $name ) )
		{
			throw new \InvalidArgumentException( "$name must be string or a QName instanxe" );
		}

		$types = SchemaTypes::getInstance();
		$attribute = $types->getElement( $name );

		if ( ! $attribute )
		{
			return null;
		}

		$result = new DOMSchemaAttribute();
		error_log( __CLASS__ . " need to populate the DOMSchemaAttribute instance" );
		return $result;
	}