mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 19:58:53 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
eef26f7ae6
commit
639829f5c5
97 changed files with 305 additions and 185 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue