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

View File

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

View File

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

View File

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

View File

@ -381,7 +381,7 @@ function phpServe() : void
// Execute the command and store the process ID
$output = [];
echo \sprintf('Starting server...') . \PHP_EOL;
echo 'Starting server...' . \PHP_EOL;
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
echo \sprintf(' %s', $command);
\exec($command, $output);
@ -406,7 +406,7 @@ function phpServe() : void
// Kill the web server when the process ends
\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;
\exec($killCommand . $pid);
});