Skip to content

Commit

Permalink
add phpdoc and clean phpstan baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Nov 6, 2024
1 parent e68b6fb commit 7a5eabb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
15 changes: 0 additions & 15 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1315,11 +1315,6 @@ parameters:
count: 2
path: ../../htdocs/admin/limits.php

-
message: "#^Parameter \\#2 \\$pu of function calcul_price_total expects float, string given\\.$#"
count: 3
path: ../../htdocs/admin/limits.php

-
message: "#^Variable \\$aCurrencies in empty\\(\\) always exists and is not falsy\\.$#"
count: 2
Expand Down Expand Up @@ -19530,11 +19525,6 @@ parameters:
count: 1
path: ../../htdocs/imports/import.php

-
message: "#^Variable \\$relativepath might not be defined\\.$#"
count: 1
path: ../../htdocs/imports/import.php

-
message: "#^If condition is always true\\.$#"
count: 1
Expand Down Expand Up @@ -27755,11 +27745,6 @@ parameters:
count: 1
path: ../../htdocs/societe/price.php

-
message: "#^Variable \\$arrayofmassactions might not be defined\\.$#"
count: 1
path: ../../htdocs/societe/project.php

-
message: "#^Variable \\$parameters might not be defined\\.$#"
count: 1
Expand Down
10 changes: 5 additions & 5 deletions htdocs/admin/limits.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
$localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc);

$s = 10 / 3;
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
$tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
print ' x <span class="opacitymedium">'.$langs->trans("Quantity").":</span> ".$qty;
print ' - <span class="opacitymedium">'.$langs->trans("VAT").':</span> '.$vat.'%';
Expand All @@ -314,13 +314,13 @@
}

if (getDolGlobalString('MAIN_ADD_MORE_EXAMPLE_IN_ACCURANCY_SETUP')) {
$qty = '1.234';
$qty = 1.234;
$vattxt = $vat.($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');

$localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc);

$s = 10 / 3;
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
$tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
print ' x <span class="opacitymedium">'.$langs->trans("Quantity").":</span> ".$qty;
print ' - <span class="opacitymedium">'.$langs->trans("VAT").':</span> '.$vat.'%';
Expand All @@ -340,7 +340,7 @@
$s = 10 / 3;
$qty = 1;
$vat = 10;
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
$tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
print ' x <span class="opacitymedium">'.$langs->trans("Quantity").":</span> ".$qty;
print ' - <span class="opacitymedium">'.$langs->trans("VAT").":</span> ".$vat.'%';
Expand All @@ -349,7 +349,7 @@
$s = 10 / 3;
$qty = 2;
$vat = 10;
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
$tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
print ' x <span class="opacitymedium">'.$langs->trans("Quantity").":</span> ".$qty;
print ' - <span class="opacitymedium">'.$langs->trans("VAT").":</span> ".$vat.'%';
Expand Down
5 changes: 3 additions & 2 deletions htdocs/imports/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,16 @@
$confirm = GETPOST('confirm', 'alpha');
$step = (GETPOST('step') ? GETPOST('step') : 1);
$import_name = GETPOST('import_name');
$hexa = GETPOST('hexa');
$hexa = GETPOST('hexa');
$importmodelid = GETPOSTINT('importmodelid');
$excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 2);
$endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : '');
$endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : '');
$updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array());
$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml', 3) : '');
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
$charset = GETPOST('charset', 'aZ09');
$separator_used = str_replace('\t', "\t", $separator);
$relativepath = '';

$objimport = new Import($db);
$objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport));
Expand Down

0 comments on commit 7a5eabb

Please sign in to comment.