Fixing style errors.

This commit is contained in:
stickler-ci 2020-08-29 10:40:30 +00:00
parent 7fe83b24ba
commit 96b3474185

View File

@ -94,17 +94,17 @@ class Members extends DolibarrApi
*/ */
function getByThirdparty($thirdparty) function getByThirdparty($thirdparty)
{ {
if(! DolibarrApiAccess::$user->rights->adherent->lire) { if (! DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401); throw new RestException(401);
} }
$member = new Adherent($this->db); $member = new Adherent($this->db);
$result = $member->fetch('', '', $thirdparty); $result = $member->fetch('', '', $thirdparty);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'member not found'); throw new RestException(404, 'member not found');
} }
if( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { if ( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -127,23 +127,23 @@ class Members extends DolibarrApi
*/ */
function getByThirdpartyEmail($email) function getByThirdpartyEmail($email)
{ {
if(! DolibarrApiAccess::$user->rights->adherent->lire) { if (! DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401); throw new RestException(401);
} }
$thirdparty = new Societe($this->db); $thirdparty = new Societe($this->db);
$result = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email); $result = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'thirdparty not found'); throw new RestException(404, 'thirdparty not found');
} }
$member = new Adherent($this->db); $member = new Adherent($this->db);
$result = $member->fetch('', '', $thirdparty->id); $result = $member->fetch('', '', $thirdparty->id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'member not found'); throw new RestException(404, 'member not found');
} }
if( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { if ( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -166,23 +166,23 @@ class Members extends DolibarrApi
*/ */
function getByThirdpartyBarcode($barcode) function getByThirdpartyBarcode($barcode)
{ {
if(! DolibarrApiAccess::$user->rights->adherent->lire) { if (! DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401); throw new RestException(401);
} }
$thirdparty = new Societe($this->db); $thirdparty = new Societe($this->db);
$result = $thirdparty->fetch('', '', '', $barcode); $result = $thirdparty->fetch('', '', '', $barcode);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'thirdparty not found'); throw new RestException(404, 'thirdparty not found');
} }
$member = new Adherent($this->db); $member = new Adherent($this->db);
$result = $member->fetch('', '', $thirdparty->id); $result = $member->fetch('', '', $thirdparty->id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'member not found'); throw new RestException(404, 'member not found');
} }
if( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { if ( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }