rector fixes

This commit is contained in:
Dennis Eichhorn 2023-09-24 14:56:45 +00:00
parent 2f351e6d01
commit 5b7af365ba
4 changed files with 6 additions and 8 deletions

View File

@ -196,7 +196,7 @@ final class ApiController extends Controller
if (($val['status'] = !TaskStatus::isValidValue((int) $request->getData('status'))) if (($val['status'] = !TaskStatus::isValidValue((int) $request->getData('status')))
|| ($val['due'] = !((bool) \strtotime((string) $request->getData('due')))) || ($val['due'] = !((bool) \strtotime((string) $request->getData('due'))))
|| ($val['ticket'] = !(\is_numeric($request->getData('ticket')))) || ($val['ticket'] = !(\is_numeric($request->getData('ticket'))))
|| ($val['forward'] = !(\is_numeric(!$request->hasData('forward') ? $request->header->account : $request->getData('forward')))) || ($val['forward'] = !(\is_numeric($request->hasData('forward') ? $request->getData('forward') : $request->header->account)))
) { ) {
return $val; return $val;
} }

View File

@ -49,9 +49,7 @@ final class BackendController extends Controller
*/ */
public function viewSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface public function viewSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{ {
$view = new View($this->app->l11nManager, $request, $response); return new View($this->app->l11nManager, $request, $response);
return $view;
} }
/** /**

View File

@ -101,7 +101,7 @@ echo $this->data['nav']->render(); ?>
<?php endif; ?> <?php endif; ?>
<?php $tags = $task->getTags(); foreach ($tags as $tag) : ?> <?php $tags = $task->getTags(); foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span> <span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= empty($tag->icon) ? '' : '<i class="' . $this->printHtml($tag->icon) . '"></i>'; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>
@ -369,7 +369,7 @@ echo $this->data['nav']->render(); ?>
<div class="form-group"> <div class="form-group">
<label for="iDue"><?= $this->getHtml('Due'); ?></label> <label for="iDue"><?= $this->getHtml('Due'); ?></label>
<input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml( <input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml(
!empty($elements) ? \end($elements)->taskElement->due->format('Y-m-d\TH:i:s') : $task->due->format('Y-m-d\TH:i:s') empty($elements) ? $task->due->format('Y-m-d\TH:i:s') : \end($elements)->taskElement->due->format('Y-m-d\TH:i:s')
); ?>"> ); ?>">
</div> </div>
</div> </div>

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);
}); });