mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02:00
Fixed some inspection issues
This commit is contained in:
parent
33475dca66
commit
42e604245c
85 changed files with 272 additions and 291 deletions
|
@ -221,7 +221,7 @@ final class AttachmentDataTable implements DataTableTypeInterface
|
|||
//We do the most stuff here in the filter class
|
||||
if (isset($options['filter'])) {
|
||||
if(!$options['filter'] instanceof AttachmentFilter) {
|
||||
throw new \Exception('filter must be an instance of AttachmentFilter!');
|
||||
throw new \RuntimeException('filter must be an instance of AttachmentFilter!');
|
||||
}
|
||||
|
||||
$filter = $options['filter'];
|
||||
|
|
|
@ -35,9 +35,9 @@ 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
|
||||
* @return string
|
||||
*/
|
||||
public function normalize($value): mixed
|
||||
public function normalize($value): string
|
||||
{
|
||||
return $this->markdown->markForRendering($value, true);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ use App\Entity\Parts\PartLot;
|
|||
use App\Entity\ProjectSystem\Project;
|
||||
use App\Services\EntityURLGenerator;
|
||||
use App\Services\Formatters\AmountFormatter;
|
||||
use Doctrine\ORM\AbstractQuery;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Omines\DataTablesBundle\Adapter\Doctrine\ORM\SearchCriteriaProvider;
|
||||
|
@ -235,7 +236,7 @@ final class PartsDataTable implements DataTableTypeInterface
|
|||
'filter_query' => $this->getFilterQuery(...),
|
||||
'detail_query' => $this->getDetailQuery(...),
|
||||
'entity' => Part::class,
|
||||
'hydrate' => Query::HYDRATE_OBJECT,
|
||||
'hydrate' => AbstractQuery::HYDRATE_OBJECT,
|
||||
//Use the simple total query, as we just want to get the total number of parts without any conditions
|
||||
//For this the normal query would be pretty slow
|
||||
'simple_total_query' => true,
|
||||
|
@ -270,7 +271,7 @@ final class PartsDataTable implements DataTableTypeInterface
|
|||
|
||||
private function getDetailQuery(QueryBuilder $builder, array $filter_results): void
|
||||
{
|
||||
$ids = array_map(fn($row) => $row['id'], $filter_results);
|
||||
$ids = array_map(static fn($row) => $row['id'], $filter_results);
|
||||
|
||||
/*
|
||||
* In this query we take the IDs which were filtered, paginated and sorted in the filter query, and fetch the
|
||||
|
|
|
@ -97,7 +97,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
|
|||
}
|
||||
|
||||
//@phpstan-ignore-next-line
|
||||
throw new \Exception('This should never happen!');
|
||||
throw new \RuntimeException('This should never happen!');
|
||||
},
|
||||
])
|
||||
->add('ipn', TextColumn::class, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue