bug fixes and template adjustments

This commit is contained in:
Dennis Eichhorn 2021-07-31 17:20:48 +02:00
parent 264e93ef28
commit f5028e3dbf
7 changed files with 18 additions and 17 deletions

View File

@ -279,7 +279,7 @@ final class ApiController extends Controller
$status = !\is_dir($pdfDir) ? \mkdir($pdfDir, 0755, true) : true;
if ($status === false) {
$response->set($request->uri->__toString(), new FormValidation($status));
$response->set($request->uri->__toString(), new FormValidation(['status' => $status]));
$response->header->status = RequestStatusCode::R_400;
return;

View File

@ -293,6 +293,7 @@ final class BackendController extends Controller
$view->addData('currentCustomerRegion', $currentCustomerRegion);
$annualCustomerRegion = [];
for ($i = 1; $i < 11; ++$i) {
$annualCustomerRegion[] = [
'year' => 2020 - 10 + $i,
@ -355,6 +356,7 @@ final class BackendController extends Controller
$view->addData('currentCustomerRegion', $currentCustomerRegion);
$annualCustomerRegion = [];
for ($i = 1; $i < 11; ++$i) {
$annualCustomerRegion[] = [
'year' => 2020 - 10 + $i,
@ -378,7 +380,9 @@ final class BackendController extends Controller
];
}
\uasort($currentCustomersRep, function($a, $b) { return $b['customers'] <=> $a['customers']; });
\uasort($currentCustomersRep, function($a, $b) {
return $b['customers'] <=> $a['customers'];
});
$view->addData('currentCustomersRep', $currentCustomersRep);
@ -405,7 +409,9 @@ final class BackendController extends Controller
];
}
\uasort($currentCustomersCountry, function($a, $b) { return $b['customers'] <=> $a['customers']; });
\uasort($currentCustomersCountry, function($a, $b) {
return $b['customers'] <=> $a['customers'];
});
$view->addData('currentCustomersCountry', $currentCustomersCountry);
@ -501,6 +507,7 @@ final class BackendController extends Controller
$view->addData('currentCustomerRegion', $currentCustomerRegion);
$annualCustomerRegion = [];
for ($i = 1; $i < 11; ++$i) {
$annualCustomerRegion[] = [
'year' => 2020 - 10 + $i,
@ -524,7 +531,9 @@ final class BackendController extends Controller
];
}
\uasort($currentCustomersRep, function($a, $b) { return $b['customers'] <=> $a['customers']; });
\uasort($currentCustomersRep, function($a, $b) {
return $b['customers'] <=> $a['customers'];
});
$view->addData('currentCustomersRep', $currentCustomersRep);

View File

@ -55,9 +55,7 @@ class Bill implements \JsonSerializable
* @var int|BillType
* @since 1.0.0
*/
public int |
BillType $type = 0;
public int|BillType $type = 0;
/**
* Bill status.

View File

@ -91,9 +91,7 @@ class BillElement implements \JsonSerializable
*/
public int $promotion = 0;
public int |
Bill $bill = 0;
public int|Bill $bill = 0;
/**
* Constructor.

View File

@ -43,9 +43,7 @@ class BillType
*
* @var string|BillTypeL11n
*/
protected string |
BillTypeL11n $l11n;
protected string|BillTypeL11n $l11n;
/**
* Constructor.

View File

@ -41,9 +41,7 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
* @var int
* @since 1.0.0
*/
protected int |
BillType $type = 0;
protected int|BillType $type = 0;
/**
* Language.

View File

@ -10,7 +10,7 @@
"require-dev": {
"phpunit/phpunit": ">=9.4",
"friendsofphp/php-cs-fixer": ">=3.0",
"squizlabs/php_codesniffer": ">=3.5",
"squizlabs/php_codesniffer": ">=3.6",
"phpmd/phpmd": ">=2.9",
"phpstan/phpstan": ">=0.12.58",
"phan/phan": ">=3.2.6"