fix code quality, typage, php-csfixer
This commit is contained in:
@ -14,10 +14,10 @@ class SQLLoginRequest
|
||||
public const TABLE_NAME = 'table_name';
|
||||
public const SUBJECT_REWRITE_EXPRESSION = 'subject_rewrite_expression';
|
||||
|
||||
protected array $config;
|
||||
protected string $dsn;
|
||||
protected string $user;
|
||||
protected string $password;
|
||||
private array $config;
|
||||
private string $dsn;
|
||||
private string $user;
|
||||
private string $password;
|
||||
|
||||
public function __construct(string $dsn, string $user, string $password, array $config = [])
|
||||
{
|
||||
@ -72,7 +72,7 @@ class SQLLoginRequest
|
||||
return $this->config[self::SUBJECT_REWRITE_EXPRESSION];
|
||||
}
|
||||
|
||||
public function getRequestScope()
|
||||
public function getRequestScope(): string
|
||||
{
|
||||
$scope = '';
|
||||
if (!$this->config[self::DATA_TO_FETCH]) {
|
||||
@ -80,12 +80,12 @@ class SQLLoginRequest
|
||||
}
|
||||
|
||||
foreach ($this->config[self::DATA_TO_FETCH] as $data) {
|
||||
$scope .= $data . ',';
|
||||
$scope .= $data.',';
|
||||
}
|
||||
// On enlève la dernière virgule
|
||||
$scope = substr($scope, 0, -1);
|
||||
|
||||
return 'SELECT ' . $scope . ' FROM ' . $this->getTableName() . ' WHERE ' . $this->getLoginColumnName() . ' = :' . $this->getLoginColumnName() . ';';
|
||||
return 'SELECT '.$scope.' FROM '.$this->getTableName().' WHERE '.$this->getLoginColumnName().' = :'.$this->getLoginColumnName().';';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,9 +96,9 @@ class SQLLoginRequest
|
||||
{
|
||||
$fields = $this->getPasswordColumnName();
|
||||
if (!empty($this->getSaltColumnName())) {
|
||||
$fields .= ', ' . $this->getSaltColumnName();
|
||||
$fields .= ', '.$this->getSaltColumnName();
|
||||
}
|
||||
|
||||
return 'SELECT ' . $fields . ' FROM ' . $this->getTableName() . ' WHERE ' . $this->getLoginColumnName() . ' = :' . $this->getLoginColumnName() . ';';
|
||||
return 'SELECT '.$fields.' FROM '.$this->getTableName().' WHERE '.$this->getLoginColumnName().' = :'.$this->getLoginColumnName().';';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user