Fixed some inspection issues.

This commit is contained in:
Jan Böhmer 2022-08-14 19:32:53 +02:00
parent eef26f7ae6
commit 639829f5c5
97 changed files with 305 additions and 185 deletions

View file

@ -22,13 +22,14 @@ namespace App\Repository\Parts;
use App\Entity\Parts\MeasurementUnit;
use App\Repository\AbstractPartsContainingRepository;
use InvalidArgumentException;
class MeasurementUnitRepository extends AbstractPartsContainingRepository
{
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
{
if (!$element instanceof MeasurementUnit) {
throw new \InvalidArgumentException('$element must be an MeasurementUnit!');
throw new InvalidArgumentException('$element must be an MeasurementUnit!');
}
return $this->getPartsByField($element, $order_by, 'partUnit');
@ -37,7 +38,7 @@ class MeasurementUnitRepository extends AbstractPartsContainingRepository
public function getPartsCount(object $element): int
{
if (!$element instanceof MeasurementUnit) {
throw new \InvalidArgumentException('$element must be an MeasurementUnit!');
throw new InvalidArgumentException('$element must be an MeasurementUnit!');
}
return $this->getPartsCountByField($element, 'partUnit');