Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/shipping
1 Ergebnis
Änderungen anzeigen
......@@ -44,7 +44,7 @@ public function __construct()
* @throws QUI\ERP\Shipping\Exception
* @throws QUI\Exception
*/
public function createChild(array $data = []): QUI\CRUD\Child
public function createChild(array $data = []): ShippingEntry
{
if (!isset($data['active']) || !is_integer($data['active'])) {
$data['active'] = 0;
......@@ -64,17 +64,17 @@ public function createChild(array $data = []): QUI\CRUD\Child
QUI::getEvents()->fireEvent('shippingCreateBegin', [$data['shipping_type']]);
/* @var $NewChild ShippingEntry */
/* @var ShippingEntry $NewChild */
$NewChild = parent::createChild($data);
$this->createShippingLocale(
'shipping.' . $NewChild->getId() . '.title',
$NewChild->getShippingType()->getTitle()
$NewChild->getShippingType()->getTitle() // @phpstan-ignore-line
);
$this->createShippingLocale(
'shipping.' . $NewChild->getId() . '.workingTitle',
$NewChild->getShippingType()->getTitle() . ' - ' . $NewChild->getId()
$NewChild->getShippingType()->getTitle() . ' - ' . $NewChild->getId() // @phpstan-ignore-line
);
// description
......@@ -88,6 +88,7 @@ public function createChild(array $data = []): QUI\CRUD\Child
QUI::getEvents()->fireEvent('shippingCreateEnd', [$NewChild]);
// @phpstan-ignore-next-line
return $NewChild;
}
......@@ -130,15 +131,16 @@ public function getChildAttributes(): array
/**
* @param int $id
*
* @return QUI\ERP\Shipping\Types\ShippingEntry
* @return ShippingEntry
*
* @throws QUI\Exception
*/
public function getChild($id): QUI\CRUD\Child
public function getChild($id): ShippingEntry
{
/* @var QUI\ERP\Shipping\Types\ShippingEntry $Shipping */
/* @var ShippingEntry $Shipping */
$Shipping = parent::getChild($id);
// @phpstan-ignore-next-line
return $Shipping;
}
......
......@@ -8,6 +8,8 @@
use QUI;
use QUI\CRUD\Factory;
use QUI\ERP\ErpEntityInterface;
use QUI\ERP\Products\Utils\PriceFactor;
use QUI\ERP\Shipping\Api;
use QUI\ERP\Shipping\Debug;
use QUI\ERP\Shipping\Rules\Factory as RuleFactory;
......@@ -42,7 +44,7 @@ class ShippingEntry extends QUI\CRUD\Child implements Api\ShippingInterface
/**
* @var null|QUI\ERP\Address|QUI\Users\Address
*/
protected QUI\Users\Address|QUI\ERP\Address|null $Address = null;
protected QUI\Users\Address | QUI\ERP\Address | null $Address = null;
/**
* Shipping constructor.
......@@ -258,7 +260,7 @@ public function getPriceDisplay(): string
*
* @return float|int
*/
public function getPrice(): float|int
public function getPrice(): float | int
{
$rules = $this->getShippingRules();
$price = 0;
......@@ -399,7 +401,7 @@ public function deactivate(): void
* @param null|Locale $Locale
* @return string
*/
public function getTitle(QUI\Locale $Locale = null): string
public function getTitle(null | QUI\Locale $Locale = null): string
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......@@ -414,10 +416,10 @@ public function getTitle(QUI\Locale $Locale = null): string
/**
* Return the shipping description
*
* @param null $Locale
* @param Locale|null $Locale
* @return string
*/
public function getDescription($Locale = null): string
public function getDescription(null | QUI\Locale $Locale = null): string
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......@@ -432,10 +434,10 @@ public function getDescription($Locale = null): string
/**
* Return the shipping working title
*
* @param null $Locale
* @param Locale|null $Locale
* @return array|string
*/
public function getWorkingTitle($Locale = null): array|string
public function getWorkingTitle(null | QUI\Locale $Locale = null): array | string
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......@@ -607,7 +609,6 @@ public function addShippingRule(ShippingRule $Rule): void
*/
public function addShippingRuleId(int $shippingRuleId): void
{
/* @var $Rule ShippingRule */
$Rule = RuleFactory::getInstance()->getChild($shippingRuleId);
$this->addShippingRule($Rule);
}
......@@ -790,14 +791,14 @@ public function setOrder(QUI\ERP\ErpEntityInterface $ErpEntity): void
}
/**
* @param null $Locale
* @param QUI\ERP\ErpEntityInterface|null $ErpEntity
* @param Locale|null $Locale
* @param ErpEntityInterface|null $ErpEntity
*
* @return QUI\ERP\Products\Utils\PriceFactor
* @return PriceFactor
*/
public function toPriceFactor(
$Locale = null,
QUI\ERP\ErpEntityInterface $ErpEntity = null
null | QUI\Locale $Locale = null,
null | QUI\ERP\ErpEntityInterface $ErpEntity = null
): QUI\ERP\Products\Utils\PriceFactor {
if ($ErpEntity === null) {
$ErpEntity = $this->ErpEntity;
......@@ -863,7 +864,7 @@ public function setAddress($Address): void
/**
* Return the address
*/
public function getAddress(): QUI\ERP\Address|QUI\Users\Address|null
public function getAddress(): QUI\ERP\Address | QUI\Users\Address | null
{
return $this->Address;
}
......