auto fixes

This commit is contained in:
Dennis Eichhorn 2023-05-28 03:10:16 +00:00
parent 696f5c371d
commit 2ebd697c6b
7 changed files with 31 additions and 31 deletions

View File

@ -97,9 +97,9 @@ final class Installer extends InstallerAbstract
continue;
}
$taskAttrType[$attribute['name']] = !\is_array($responseData['response'])
? $responseData['response']->toArray()
: $responseData['response'];
$taskAttrType[$attribute['name']] = \is_array($responseData['response'])
? $responseData['response']
: $responseData['response']->toArray();
$isFirst = true;
foreach ($attribute['l11n'] as $language => $l11n) {
@ -169,9 +169,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();
$taskAttrValue[$attribute['name']][] = $attrValue;

View File

@ -429,7 +429,7 @@ final class ApiController extends Controller
if (($val['status'] = !TaskStatus::isValidValue((int) $request->getData('status')))
|| ($val['due'] = !((bool) \strtotime((string) $request->getData('due'))))
|| ($val['task'] = !(\is_numeric($request->getData('task'))))
|| ($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;
}

View File

@ -31,7 +31,7 @@ use phpOMS\Uri\UriFactory;
<?php
$c = 0;
foreach ($this->tasks as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('task/single?{?}&id=' . $task->id));
$url = UriFactory::build(empty($task->redirect) ? 'task/single?{?}&id=' . $task->id : ($task->redirect));
$color = 'darkred';
if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; }

View File

@ -32,9 +32,9 @@ $tasksList = $this->getData('tasks') ?? [];
<?php
$c = 0;
foreach ($tasksList as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect)
? $task->redirect
: ('task/single?{?}&id=' . $task->id)
$url = UriFactory::build(empty($task->redirect)
? 'task/single?{?}&id=' . $task->id
: ($task->redirect)
);
?>
<tr data-href="<?= $url; ?>">

View File

@ -53,9 +53,9 @@ echo $this->getData('nav')->render(); ?>
<?php
$c = 0;
foreach ($open as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect)
? '{/app}/' . $task->redirect
: ('task/single?{?}&id=' . $task->id),
$url = UriFactory::build(empty($task->redirect)
? 'task/single?{?}&id=' . $task->id
: ('{/app}/' . $task->redirect),
['$id' => $task->id]
);
?>
@ -79,7 +79,7 @@ echo $this->getData('nav')->render(); ?>
<td data-label="<?= $this->getHtml('Tag'); ?>">
<?php $tags = $task->getTags(); foreach ($tags as $tag) : ?>
<a href="<?= $url; ?>">
<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>
</a>
<?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>">
@ -112,9 +112,9 @@ echo $this->getData('nav')->render(); ?>
<?php
$c = 0;
foreach ($open as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect)
? '{/app}/' . $task->redirect
: ('task/single?{?}&id=' . $task->id),
$url = UriFactory::build(empty($task->redirect)
? 'task/single?{?}&id=' . $task->id
: ('{/app}/' . $task->redirect),
['$id' => $task->id]
);
?>
@ -138,7 +138,7 @@ echo $this->getData('nav')->render(); ?>
<td data-label="<?= $this->getHtml('Tag'); ?>">
<?php $tags = $task->getTags(); foreach ($tags as $tag) : ?>
<a href="<?= $url; ?>">
<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>
</a>
<?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>">
@ -176,9 +176,9 @@ echo $this->getData('nav')->render(); ?>
}
++$c;
$url = UriFactory::build(!empty($task->redirect)
? '{/app}/' . $task->redirect
: ('task/single?{?}&id=' . $task->id),
$url = UriFactory::build(empty($task->redirect)
? 'task/single?{?}&id=' . $task->id
: ('{/app}/' . $task->redirect),
['$id' => $task->id]
);
?>
@ -202,7 +202,7 @@ echo $this->getData('nav')->render(); ?>
<td data-label="<?= $this->getHtml('Tag'); ?>">
<?php $tags = $task->getTags(); foreach ($tags as $tag) : ?>
<a href="<?= $url; ?>">
<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>
</a>
<?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>">
@ -242,9 +242,9 @@ echo $this->getData('nav')->render(); ?>
<?php
$c = 0;
foreach ($open as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect)
? '{/app}/' . $task->redirect
: ('task/single?{?}&id=' . $task->id),
$url = UriFactory::build(empty($task->redirect)
? 'task/single?{?}&id=' . $task->id
: ('{/app}/' . $task->redirect),
['$id' => $task->id]
);
?>
@ -268,7 +268,7 @@ echo $this->getData('nav')->render(); ?>
<td data-label="<?= $this->getHtml('Tag'); ?>">
<?php $tags = $task->getTags(); foreach ($tags as $tag) : ?>
<a href="<?= $url; ?>">
<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>
</a>
<?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>">

View File

@ -76,7 +76,7 @@ echo $this->getData('nav')->render(); ?>
data-tpl-text-path="/0/response/description"
data-value=""><?= $task->description; ?></article>
<?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 if (!empty($taskMedia)) : ?>
<div>
@ -380,7 +380,7 @@ echo $this->getData('nav')->render(); ?>
<div class="form-group">
<label for="iDue"><?= $this->getHtml('Due'); ?></label>
<input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml(
!empty($elements) ? \end($elements)->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)->due->format('Y-m-d\TH:i:s')
); ?>">
</div>
</div>

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