fix code quality, typage, php-csfixer
Some checks failed
Cadoles/hydra-sql/pipeline/pr-develop There was a failure building this commit
Cadoles/hydra-sql/pipeline/head This commit is unstable

This commit is contained in:
2024-09-24 11:47:52 +02:00
parent 27f957124b
commit f36a675d22
11 changed files with 40 additions and 37 deletions

View File

@ -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().';';
}
}