rector fixes

This commit is contained in:
Dennis Eichhorn 2023-09-24 14:56:44 +00:00
parent b411168594
commit af04b82068
5 changed files with 20 additions and 22 deletions

View File

@ -141,9 +141,9 @@ final class Installer extends InstallerAbstract
continue; continue;
} }
$billAttrType[$attribute['name']] = !\is_array($responseData['response']) $billAttrType[$attribute['name']] = \is_array($responseData['response'])
? $responseData['response']->toArray() ? $responseData['response']
: $responseData['response']; : $responseData['response']->toArray();
$isFirst = true; $isFirst = true;
foreach ($attribute['l11n'] as $language => $l11n) { foreach ($attribute['l11n'] as $language => $l11n) {
@ -212,9 +212,9 @@ final class Installer extends InstallerAbstract
continue; continue;
} }
$attrValue = !\is_array($responseData['response']) $attrValue = \is_array($responseData['response'])
? $responseData['response']->toArray() ? $responseData['response']
: $responseData['response']; : $responseData['response']->toArray();
$billAttrValue[$attribute['name']][] = $attrValue; $billAttrValue[$attribute['name']][] = $attrValue;
@ -298,9 +298,9 @@ final class Installer extends InstallerAbstract
continue; continue;
} }
$result = !\is_array($responseData['response']) $result = \is_array($responseData['response'])
? $responseData['response']->toArray() ? $responseData['response']
: $responseData['response']; : $responseData['response']->toArray();
$results[] = $result; $results[] = $result;
} }
@ -350,9 +350,9 @@ final class Installer extends InstallerAbstract
continue; continue;
} }
$billType = !\is_array($responseData['response']) $billType = \is_array($responseData['response'])
? $responseData['response']->toArray() ? $responseData['response']
: $responseData['response']; : $responseData['response']->toArray();
$billTypes[] = $billType; $billTypes[] = $billType;

View File

@ -321,14 +321,12 @@ final class ApiBillController extends Controller
$taxCode = $this->app->moduleManager->get('Billing', 'ApiTax') $taxCode = $this->app->moduleManager->get('Billing', 'ApiTax')
->getTaxCodeFromClientItem($client, $item, $request->header->l11n->country); ->getTaxCodeFromClientItem($client, $item, $request->header->l11n->country);
$element = BillElement::fromItem( return BillElement::fromItem(
$item, $item,
$taxCode, $taxCode,
$request->getDataInt('quantity') ?? 1, $request->getDataInt('quantity') ?? 1,
$bill->id $bill->id
); );
return $element;
} }
/** /**

View File

@ -42,7 +42,7 @@ $archive = $bill->getFileByTypeName('original');
$logs = $this->data['logs'] ?? []; $logs = $this->data['logs'] ?? [];
$editable = $bill->id === 0 || \in_array($bill->getStatus(), [BillStatus::DRAFT, BillStatus::UNPARSED]); $editable = $bill->id === 0 || \in_array($bill->getStatus(), [BillStatus::DRAFT, BillStatus::UNPARSED]);
$disabled = !$editable ? ' disabled' : ''; $disabled = $editable ? '' : ' disabled';
echo $this->data['nav']->render(); ?> echo $this->data['nav']->render(); ?>

View File

@ -171,11 +171,11 @@ echo $this->data['nav']->render(); ?>
?>"><?= $value->billAddress; ?></a> ?>"><?= $value->billAddress; ?></a>
<td><a href="<?= $url; ?>"><?= $value->billZip; ?></a> <td><a href="<?= $url; ?>"><?= $value->billZip; ?></a>
<td><a href="<?= $url; ?>"><?= $value->billCity; ?></a> <td><a href="<?= $url; ?>"><?= $value->billCity; ?></a>
<td><a href="<?= $url; ?>"><?= !empty($value->billCountry) <td><a href="<?= $url; ?>"><?= empty($value->billCountry)
? ISO3166NameEnum::getByName( ? ''
: ISO3166NameEnum::getByName(
ISO3166TwoEnum::getName($value->billCountry) ISO3166TwoEnum::getName($value->billCountry)
) ); ?></a>
: ''; ?></a>
<td><a href="<?= $url; ?>"><?= $value->grossCosts->getAmount(); ?></a> <td><a href="<?= $url; ?>"><?= $value->grossCosts->getAmount(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->billDate?->format('Y-m-d'); ?></a> <td><a href="<?= $url; ?>"><?= $value->billDate?->format('Y-m-d'); ?></a>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -381,7 +381,7 @@ function phpServe() : void
// Execute the command and store the process ID // Execute the command and store the process ID
$output = []; $output = [];
echo \sprintf('Starting server...') . \PHP_EOL; echo 'Starting server...' . \PHP_EOL;
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL; echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
echo \sprintf(' %s', $command); echo \sprintf(' %s', $command);
\exec($command, $output); \exec($command, $output);
@ -406,7 +406,7 @@ function phpServe() : void
// Kill the web server when the process ends // Kill the web server when the process ends
\register_shutdown_function(function() use ($killCommand, $pid) : void { \register_shutdown_function(function() use ($killCommand, $pid) : void {
echo \PHP_EOL . \sprintf('Stopping server...') . \PHP_EOL; echo \PHP_EOL . 'Stopping server...' . \PHP_EOL;
echo \sprintf(' %s - Killing process with ID %d', \date('r'), $pid) . \PHP_EOL; echo \sprintf(' %s - Killing process with ID %d', \date('r'), $pid) . \PHP_EOL;
\exec($killCommand . $pid); \exec($killCommand . $pid);
}); });