for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* security SubnetUser entity
* A basic user to allow login, query and find object based on anonymous authentication.
*/
namespace Graviton\SecurityBundle\Entities;
* Class SubnetUser
*
* @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @link http://swisscom.ch
class SubnetUser
{
const DEFAULT_ID = 10;
const ROLE_SUBNET = 'ROLE_GRAVITON_SUBNET_USER';
* @var int
private $id;
* @var string
private $username;
* Constructor of the class.
* @param string $username Name of the user
public function __construct($username)
$this->username = $username;
$this->setId(self::DEFAULT_ID);
}
* Returns the username used to authenticate the user.
* @return string The username
public function getUsername()
return $this->username;
* @param int $id id
* @return void
public function setId($id)
$this->id = $id;
* @return int
public function getId()
return $this->id;
* @return array
string[]
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function getRoles()
return [self::ROLE_SUBNET];
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.