Fixing style errors.

This commit is contained in:
stickler-ci 2022-08-18 16:12:40 +00:00
parent 17c5f30689
commit f0dd152f11
2 changed files with 4 additions and 5 deletions

View File

@ -436,13 +436,13 @@ class Boms extends DolibarrApi
//Check the rowid is a line of current bom object //Check the rowid is a line of current bom object
$lineIdIsFromObject = false; $lineIdIsFromObject = false;
foreach ($this->bom->lines as $bl) { foreach ($this->bom->lines as $bl) {
if ($bl->id == $lineid){ if ($bl->id == $lineid) {
$lineIdIsFromObject = true; $lineIdIsFromObject = true;
break; break;
} }
} }
if (!$lineIdIsFromObject) { if (!$lineIdIsFromObject) {
throw new RestException(500,'Line to delete (rowid: '.$lineid.') is not a line of BOM (id: '.$this->bom->id.')'); throw new RestException(500, 'Line to delete (rowid: '.$lineid.') is not a line of BOM (id: '.$this->bom->id.')');
} }
$updateRes = $this->bom->deleteline(DolibarrApiAccess::$user, $lineid); $updateRes = $this->bom->deleteline(DolibarrApiAccess::$user, $lineid);

View File

@ -668,8 +668,8 @@ class BOM extends CommonObject
$this->line->context = $this->context; $this->line->context = $this->context;
// Rank to use // Rank to use
$rankToUse = (int)$position; $rankToUse = (int) $position;
if($rankToUse != $line->oldcopy->position) { // check if position have a new value if ($rankToUse != $line->oldcopy->position) { // check if position have a new value
foreach ($this->lines as $bl) { foreach ($this->lines as $bl) {
if ($bl->position >= $rankToUse AND $bl->position < ($line->oldcopy->position + 1)) { // move rank up if ($bl->position >= $rankToUse AND $bl->position < ($line->oldcopy->position + 1)) { // move rank up
$bl->position++; $bl->position++;
@ -1386,7 +1386,6 @@ class BOM extends CommonObject
} }
} }
} }
} }