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
Some checks reported warnings
Cadoles/hydra-sql/pipeline/pr-develop This commit is unstable
This commit is contained in:
@ -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() . ';';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user