Use imports instead of FQNs

This commit is contained in:
Jan Böhmer 2023-06-11 14:55:06 +02:00
parent f63b6d7207
commit 5629215ce4
179 changed files with 792 additions and 597 deletions

View file

@ -2,6 +2,7 @@
namespace App\Services\Parts;
use App\Entity\Parts\Storelocation;
use App\Entity\LogSystem\PartStockChangedLogEntry;
use App\Entity\Parts\PartLot;
use App\Services\LogSystem\EventCommentHelper;
@ -24,7 +25,7 @@ final class PartLotWithdrawAddHelper
}
//So far all other restrictions are defined at the storelocation level
if(!$partLot->getStorageLocation() instanceof \App\Entity\Parts\Storelocation) {
if(!$partLot->getStorageLocation() instanceof Storelocation) {
return true;
}
//We can not add parts if the storage location of the lot is marked as full

View file

@ -20,6 +20,7 @@
namespace App\Services\Parts;
use Symfony\Bundle\SecurityBundle\Security;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer;
@ -33,11 +34,10 @@ use InvalidArgumentException;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
final class PartsTableActionHandler
{
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly \Symfony\Bundle\SecurityBundle\Security $security, private readonly UrlGeneratorInterface $urlGenerator)
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly Security $security, private readonly UrlGeneratorInterface $urlGenerator)
{
}

View file

@ -150,13 +150,13 @@ class PricedetailHelper
$pricedetail = $orderdetail->findPriceForQty($amount);
//When we don't have information about this amount, ignore it
if (!$pricedetail instanceof \App\Entity\PriceInformations\Pricedetail) {
if (!$pricedetail instanceof Pricedetail) {
continue;
}
$converted = $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency);
//Ignore price information that can not be converted to base currency.
if ($converted instanceof \Brick\Math\BigDecimal) {
if ($converted instanceof BigDecimal) {
$avg = $avg->plus($converted);
++$count;
}
@ -189,9 +189,9 @@ class PricedetailHelper
$val_base = $value;
//Convert value to base currency
if ($originCurrency instanceof \App\Entity\PriceInformations\Currency) {
if ($originCurrency instanceof Currency) {
//Without an exchange rate we can not calculate the exchange rate
if (!$originCurrency->getExchangeRate() instanceof \Brick\Math\BigDecimal || $originCurrency->getExchangeRate()->isZero()) {
if (!$originCurrency->getExchangeRate() instanceof BigDecimal || $originCurrency->getExchangeRate()->isZero()) {
return null;
}
@ -200,9 +200,9 @@ class PricedetailHelper
$val_target = $val_base;
//Convert value in base currency to target currency
if ($targetCurrency instanceof \App\Entity\PriceInformations\Currency) {
if ($targetCurrency instanceof Currency) {
//Without an exchange rate we can not calculate the exchange rate
if (!$targetCurrency->getExchangeRate() instanceof \Brick\Math\BigDecimal) {
if (!$targetCurrency->getExchangeRate() instanceof BigDecimal) {
return null;
}