feat (gestion exceptions) #19: traitement retour: typage, un seul message pour erreur login ou mdp
Some checks reported warnings
Cadoles/hydra-sql/pipeline/pr-develop This commit is unstable

This commit is contained in:
2024-04-29 10:44:38 +02:00
parent 3e45119684
commit 0791727694
6 changed files with 23 additions and 32 deletions

View File

@ -69,16 +69,17 @@ class SQLLoginRequest
public function getRequestScope()
{
$scope = '';
if ($this->config[self::DATA_TO_FETCH]) {
foreach ($this->config[self::DATA_TO_FETCH] as $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().';';
if (!$this->config[self::DATA_TO_FETCH]) {
throw new NullDataToFetchException();
}
throw new NullDataToFetchException();
foreach ($this->config[self::DATA_TO_FETCH] as $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() . ';';
}
/**
@ -89,9 +90,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() . ';';
}
}