Fixed code style.

This commit is contained in:
Jan Böhmer 2020-08-21 21:36:22 +02:00
parent 2853e471c4
commit d0b1024d80
212 changed files with 495 additions and 1005 deletions

View file

@ -234,7 +234,7 @@ class ORMAdapter extends AbstractAdapter
$qb->resetDQLPart('orderBy');
$gb = $qb->getDQLPart('groupBy');
if (empty($gb) || ! $this->hasGroupByPart($identifier, $gb)) {
if (empty($gb) || !$this->hasGroupByPart($identifier, $gb)) {
$qb->select($qb->expr()->count($identifier));
return (int) $qb->getQuery()->getSingleScalarResult();

View file

@ -81,12 +81,11 @@ final class AttachmentDataTable implements DataTableTypeInterface
'label' => '',
'render' => function ($value, Attachment $context) {
if ($context->isPicture()
&& ! $context->isExternal()
&& !$context->isExternal()
&& $this->attachmentHelper->isFileExisting($context)) {
$title = htmlspecialchars($context->getName());
if ($context->getFilename()) {
$title .= ' (' . htmlspecialchars($context->getFilename()) . ')';
$title .= ' ('.htmlspecialchars($context->getFilename()).')';
}
return sprintf(

View file

@ -66,8 +66,6 @@ class EntityColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
*
* @param mixed $value The single value of the column
*
* @return mixed
*/
public function normalize($value)
{

View file

@ -59,7 +59,7 @@ class LocaleDateTimeColumn extends AbstractColumn
{
if (null === $value) {
return $this->options['nullValue'];
} elseif (! $value instanceof DateTimeInterface) {
} elseif (!$value instanceof DateTimeInterface) {
$value = new DateTime((string) $value);
}

View file

@ -104,7 +104,7 @@ class LogEntryTargetColumn extends AbstractColumn
$tmp = '';
//The element is existing
if ($target instanceof NamedElementInterface && ! empty($target->getName())) {
if ($target instanceof NamedElementInterface && !empty($target->getName())) {
try {
$tmp = sprintf(
'<a href="%s">%s</a>',

View file

@ -58,8 +58,6 @@ class MarkdownColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
*
* @param mixed $value The single value of the column
*
* @return mixed
*/
public function normalize($value)
{

View file

@ -68,8 +68,6 @@ class PartAttachmentsColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
*
* @param mixed $value The single value of the column
*
* @return mixed
*/
public function normalize($value)
{
@ -78,7 +76,7 @@ class PartAttachmentsColumn extends AbstractColumn
public function render($value, $context)
{
if (! $context instanceof Part) {
if (!$context instanceof Part) {
throw new RuntimeException('$context must be a Part object!');
}
$tmp = '';

View file

@ -65,7 +65,7 @@ class RevertLogColumn extends AbstractColumn
return '';
}
$disabled = ! $this->security->isGranted('revert_element', $context->getTargetClass());
$disabled = !$this->security->isGranted('revert_element', $context->getTargetClass());
$tmp = '<div class="btn-group btn-group-sm">';
$tmp .= sprintf(

View file

@ -58,8 +58,6 @@ class TagsColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
*
* @param mixed $value The single value of the column
*
* @return mixed
*/
public function normalize($value)
{

View file

@ -103,7 +103,7 @@ class LogDataTable implements DataTableTypeInterface
$optionsResolver->setAllowedTypes('mode', 'string');
$optionsResolver->setNormalizer('filter_elements', function (Options $options, $value) {
if (! is_array($value)) {
if (!is_array($value)) {
return [$value];
}
@ -254,8 +254,8 @@ class LogDataTable implements DataTableTypeInterface
},
'disabled' => function ($value, AbstractLogEntry $context) {
return
! $this->security->isGranted('@tools.timetravel')
|| ! $this->security->isGranted('show_history', $context->getTargetClass());
!$this->security->isGranted('@tools.timetravel')
|| !$this->security->isGranted('show_history', $context->getTargetClass());
},
]);
@ -293,7 +293,7 @@ class LogDataTable implements DataTableTypeInterface
]);
}
if (! empty($options['filter_elements'])) {
if (!empty($options['filter_elements'])) {
foreach ($options['filter_elements'] as $element) {
/** @var AbstractDBElement $element */

View file

@ -49,7 +49,6 @@ use App\DataTables\Column\LocaleDateTimeColumn;
use App\DataTables\Column\MarkdownColumn;
use App\DataTables\Column\PartAttachmentsColumn;
use App\DataTables\Column\TagsColumn;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer;
@ -163,7 +162,7 @@ final class PartsDataTable implements DataTableTypeInterface
$title = htmlspecialchars($preview_attachment->getName());
if ($preview_attachment->getFilename()) {
$title .= ' (' . htmlspecialchars($preview_attachment->getFilename()) . ')';
$title .= ' ('.htmlspecialchars($preview_attachment->getFilename()).')';
}
return sprintf(
@ -396,8 +395,8 @@ final class PartsDataTable implements DataTableTypeInterface
$builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%');
}
if (! empty($options['search'])) {
if (! $options['search_options']['regex']) {
if (!empty($options['search'])) {
if (!$options['search_options']['regex']) {
//Dont show results, if no things are selected
$builder->andWhere('0=1');
$defined = false;