for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AppBundle\Security;
class UserCredentials
{
const TYPE_ID = 'id';
const TYPE_NAME = 'name';
/** @var string */
private $password;
private $type;
private $username;
/**
* UserCredentials constructor.
*
* @param string $username
* @param string $password
* @param string $type
*/
public function __construct($username, $password, $type = self::TYPE_NAME)
$this->password = $password;
$this->type = $type;
$this->username = $username;
}
public function getUsernameCompound()
return sprintf('%s:%s', $this->type, $this->username);
public function getUsername()
return $this->username;
public function getPassword()
return $this->password;