Skip to content
Code-Schnipsel Gruppen Projekte
Commit b7d4519e erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor(phpstan): php8.4 null deprecated

Übergeordneter 48eef914
No related branches found
No related tags found
2 Merge Requests!146fix: update `getCustomerFiles` method signature in `AbstractOrder`,!145Update 'next-3.x' with latest changes from 'main'
Pipeline #15524 fehlgeschlagen mit Phase
in 2 Minuten und 28 Sekunden
Dieser Diff ist reduziert.
......@@ -609,7 +609,7 @@ public function recalculate($Basket = null): void
*
* @param QUI\Interfaces\Users\User|null $PermissionUser - optional, permission user, default = session user
*/
abstract public function clear(QUI\Interfaces\Users\User $PermissionUser = null);
abstract public function clear(null | QUI\Interfaces\Users\User $PermissionUser = null);
/**
* Refresh the order data
......@@ -623,14 +623,14 @@ abstract public function refresh();
* @param QUI\Interfaces\Users\User|null $PermissionUser - optional, permission user, default = session user
* @throws QUI\Exception
*/
abstract public function update(QUI\Interfaces\Users\User $PermissionUser = null);
abstract public function update(null | QUI\Interfaces\Users\User $PermissionUser = null);
/**
* Delete the order
*
* @param QUI\Interfaces\Users\User|null $PermissionUser - optional, permission user, default = session user
*/
abstract public function delete(QUI\Interfaces\Users\User $PermissionUser = null);
abstract public function delete(null | QUI\Interfaces\Users\User $PermissionUser = null);
/**
* Is the order posted / submitted
......
......@@ -90,7 +90,7 @@ public function refresh(): void
* @throws QUI\Exception
* @throws QUI\ERP\Accounting\Invoice\Exception
*/
public function getInvoice(): QUI\ERP\Accounting\Invoice\Invoice|QUI\ERP\Accounting\Invoice\InvoiceTemporary
public function getInvoice(): QUI\ERP\Accounting\Invoice\Invoice | QUI\ERP\Accounting\Invoice\InvoiceTemporary
{
if (!Settings::getInstance()->isInvoiceInstalled()) {
throw new QUI\Exception([
......@@ -140,8 +140,8 @@ public function getView(): OrderView
* @throws QUI\Exception
*/
public function createInvoice(
QUI\Interfaces\Users\User $PermissionUser = null
): QUI\ERP\Accounting\Invoice\Invoice|QUI\ERP\Accounting\Invoice\InvoiceTemporary {
null | QUI\Interfaces\Users\User $PermissionUser = null
): QUI\ERP\Accounting\Invoice\Invoice | QUI\ERP\Accounting\Invoice\InvoiceTemporary {
if (Settings::getInstance()->forceCreateInvoice() === false && $this->isPosted()) {
return $this->getInvoice();
}
......@@ -504,7 +504,7 @@ public function hasInvoice(): bool
* @throws QUI\Exception
* @deprecated use createInvoice
*/
public function post(): Invoice|InvoiceTemporary
public function post(): Invoice | InvoiceTemporary
{
return $this->createInvoice(QUI::getUsers()->getSystemUser());
}
......@@ -996,8 +996,8 @@ public function delete($PermissionUser = null): void
* @throws Exception
*/
public function copy(
QUI\Interfaces\Users\User $PermissionUser = null,
bool|string $globalProcessId = false
null | QUI\Interfaces\Users\User $PermissionUser = null,
bool | string $globalProcessId = false
): Order {
$NewOrder = Factory::getInstance()->create();
......
......@@ -27,7 +27,7 @@
*/
class OrderInProcess extends AbstractOrder implements OrderInterface, ErpEntityInterface, ErpTransactionsInterface
{
protected null|string|int $orderId = null;
protected null | string | int $orderId = null;
/**
* Order constructor.
......@@ -97,7 +97,7 @@ public function refresh(): void
$this->setDataBaseData($data);
}
public function getOrderId(): null|int|string
public function getOrderId(): null | int | string
{
return $this->orderId;
}
......@@ -130,7 +130,7 @@ public function getPrefixedId(): string
* @throws Exception
* @throws QUI\Permissions\Exception
*/
public function save(QUI\Interfaces\Users\User $PermissionUser = null): void
public function save(null | QUI\Interfaces\Users\User $PermissionUser = null): void
{
$this->update($PermissionUser);
}
......@@ -141,7 +141,7 @@ public function save(QUI\Interfaces\Users\User $PermissionUser = null): void
* @throws QUI\Permissions\Exception
* @throws Exception
*/
public function update(QUI\Interfaces\Users\User $PermissionUser = null): void
public function update(null | QUI\Interfaces\Users\User $PermissionUser = null): void
{
if ($this->hasPermissions($PermissionUser) === false) {
throw new QUI\Permissions\Exception(
......@@ -349,7 +349,7 @@ public function calculatePayments(): void
* @throws QUI\Permissions\Exception
* @throws QUI\Database\Exception
*/
public function delete(QUI\Interfaces\Users\User $PermissionUser = null): void
public function delete(null | QUI\Interfaces\Users\User $PermissionUser = null): void
{
if ($this->hasPermissions($PermissionUser) === false) {
throw new QUI\Permissions\Exception(
......@@ -394,7 +394,7 @@ public function isPosted(): bool
* @throws Exception
* @throws Exception
*/
public function createOrder(QUI\Interfaces\Users\User $PermissionUser = null): Order
public function createOrder(null | QUI\Interfaces\Users\User $PermissionUser = null): Order
{
QUI\ERP\Debug::getInstance()->log('OrderInProcess:: Create Order');
......@@ -571,7 +571,7 @@ public function createOrder(QUI\Interfaces\Users\User $PermissionUser = null): O
* @param null|QUI\Interfaces\Users\User $PermissionUser
* @return bool
*/
protected function hasPermissions(QUI\Interfaces\Users\User $PermissionUser = null): bool
protected function hasPermissions(null | QUI\Interfaces\Users\User $PermissionUser = null): bool
{
if ($PermissionUser === null) {
$PermissionUser = QUI::getUserBySession();
......@@ -691,7 +691,7 @@ protected function getDataForSaving(): array
* @throws Exception
* @throws QUI\ExceptionStack
*/
public function clear($PermissionUser = null): void
public function clear(null | QUI\Interfaces\Users\User $PermissionUser = null): void
{
if ($PermissionUser === null) {
$PermissionUser = QUI::getUserBySession();
......@@ -761,7 +761,7 @@ public function hasInvoice(): bool
* @throws Exception
* @throws QUI\ERP\Accounting\Invoice\Exception
*/
public function getInvoice(): QUI\ERP\Accounting\Invoice\Invoice|QUI\ERP\Accounting\Invoice\InvoiceTemporary
public function getInvoice(): QUI\ERP\Accounting\Invoice\Invoice | QUI\ERP\Accounting\Invoice\InvoiceTemporary
{
if ($this->orderId) {
$Order = Handler::getInstance()->get($this->getOrderId());
......
......@@ -177,7 +177,7 @@ public function getCreateDate(): string
/**
* @return bool|QUI\ERP\Shipping\ShippingStatus\Status
*/
public function getShippingStatus(): bool|QUI\ERP\Shipping\ShippingStatus\Status
public function getShippingStatus(): bool | QUI\ERP\Shipping\ShippingStatus\Status
{
return $this->Order->getShippingStatus();
}
......@@ -210,7 +210,7 @@ public function getData(): array
* @param null|QUI\Locale $Locale
* @return string|bool
*/
public function getDate(QUI\Locale $Locale = null): string|bool
public function getDate(null | QUI\Locale $Locale = null): string | bool
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......@@ -306,7 +306,7 @@ public function getInvoiceAddress(): Address
* @throws QUI\Exception
* @throws QUI\ERP\Accounting\Invoice\Exception
*/
public function getInvoice(): QUI\ERP\Accounting\Invoice\Invoice|QUI\ERP\Accounting\Invoice\InvoiceTemporary
public function getInvoice(): QUI\ERP\Accounting\Invoice\Invoice | QUI\ERP\Accounting\Invoice\InvoiceTemporary
{
return $this->Order->getInvoice();
}
......
......@@ -57,7 +57,7 @@ public static function getEntityType(): string
* @param Locale|null $Locale $Locale (optional) - If ommitted use \QUI::getLocale()
* @return string
*/
public static function getEntityTypeTitle(Locale $Locale = null): string
public static function getEntityTypeTitle(null | Locale $Locale = null): string
{
if (empty($Locale)) {
$Locale = QUI::getLocale();
......@@ -74,7 +74,7 @@ public static function getEntityTypeTitle(Locale $Locale = null): string
*
* @throws QUI\Exception
*/
public static function getEntity(int|string $entityId): OrderInProcess|Order
public static function getEntity(int | string $entityId): OrderInProcess | Order
{
try {
$Order = QUI\ERP\Order\Handler::getInstance()->get($entityId);
......@@ -93,7 +93,7 @@ public static function getEntity(int|string $entityId): OrderInProcess|Order
*
* @throws QUI\Exception
*/
public static function getDownloadFileName(int|string $entityId): string
public static function getDownloadFileName(int | string $entityId): string
{
return self::getEntity($entityId)->getPrefixedNumber();
}
......@@ -106,7 +106,7 @@ public static function getDownloadFileName(int|string $entityId): string
*
* @throws QUI\Exception
*/
public static function getLocale(int|string $entityId): Locale
public static function getLocale(int | string $entityId): Locale
{
$Order = self::getEntity($entityId);
$Customer = $Order->getCustomer();
......@@ -121,7 +121,7 @@ public static function getLocale(int|string $entityId): Locale
* @return array
* @throws QUI\Exception
*/
public static function getTemplateData(int|string $entityId): array
public static function getTemplateData(int | string $entityId): array
{
$Order = self::getEntity($entityId);
$OrderView = $Order->getView();
......@@ -202,7 +202,7 @@ public static function getTemplateData(int|string $entityId): array
* @param User $User
* @return bool
*/
public static function hasDownloadPermission(int|string $entityId, User $User): bool
public static function hasDownloadPermission(int | string $entityId, User $User): bool
{
if (!QUI::getUsers()->isAuth($User) || QUI::getUsers()->isNobodyUser($User)) {
return false;
......@@ -227,7 +227,7 @@ public static function hasDownloadPermission(int|string $entityId, User $User):
*
* @throws QUI\Exception
*/
public static function getEmailAddress(int|string $entityId): bool|string
public static function getEmailAddress(int | string $entityId): bool | string
{
$Customer = self::getEntity($entityId)->getCustomer();
......@@ -246,7 +246,7 @@ public static function getEmailAddress(int|string $entityId): bool|string
*
* @throws QUI\Exception
*/
public static function getMailSubject(int|string $entityId): string
public static function getMailSubject(int | string $entityId): string
{
$Order = self::getEntity($entityId);
$Customer = $Order->getCustomer();
......@@ -266,7 +266,7 @@ public static function getMailSubject(int|string $entityId): string
*
* @throws QUI\Exception
*/
public static function getMailBody(int|string $entityId): string
public static function getMailBody(int | string $entityId): string
{
$Order = self::getEntity($entityId);
$Customer = $Order->getCustomer();
......@@ -418,7 +418,7 @@ public static function getCustomerVariables(QUI\ERP\User $Customer): array
* @param $date
* @return false|string
*/
public static function dateFormat($date): bool|string
public static function dateFormat($date): bool | string
{
// date
$localeCode = QUI::getLocale()->getLocalesByLang(
......@@ -446,7 +446,7 @@ public static function dateFormat($date): bool|string
* @param Order $Order
* @return string|false - Raw <img> "src" attribute with base64 image data or false if code can or must not be generated.
*/
protected static function getEpcQrCodeImageImgSrc(Order $Order): bool|string
protected static function getEpcQrCodeImageImgSrc(Order $Order): bool | string
{
try {
// Check currency (must be EUR)
......@@ -474,7 +474,9 @@ protected static function getEpcQrCodeImageImgSrc(Order $Order): bool|string
// Prefer bank account set in SEPA module if available
if (class_exists('QUI\ERP\Payments\SEPA\Provider') && QUI::getPackageManager()->isInstalled('quiqqer/payment-sepa')) {
if (class_exists('QUI\ERP\Payments\SEPA\Provider') && QUI::getPackageManager()->isInstalled(
'quiqqer/payment-sepa'
)) {
$creditorBankAccount = QUI\ERP\Payments\SEPA\Provider::getCreditorBankAccount();
} else {
$creditorBankAccount = BankAccounts::getCompanyBankAccount();
......
......@@ -44,7 +44,7 @@ class Search extends Singleton
/**
* @var array|bool
*/
protected array|bool $limit = [0, 20];
protected array | bool $limit = [0, 20];
/**
* @var string
......@@ -78,7 +78,7 @@ class Search extends Singleton
* @param string $filter
* @param array|string|null $value
*/
public function setFilter(string $filter, array|string|null $value): void
public function setFilter(string $filter, array | string | null $value): void
{
if ($value === null) {
return;
......@@ -157,7 +157,7 @@ public function clearFilter(): void
* @param int|string $from
* @param int|string $to
*/
public function limit(int|string $from, int|string $to): void
public function limit(int | string $from, int | string $to): void
{
$this->limit = [(int)$from, (int)$to];
}
......
......@@ -77,7 +77,7 @@ public static function parseProduct(Product $Product, $Locale = null): array
return $product;
}
public static function parseArticle(QUI\ERP\Accounting\Article $Article, QUI\Locale $Locale = null): array
public static function parseArticle(QUI\ERP\Accounting\Article $Article, null | QUI\Locale $Locale = null): array
{
try {
$Product = Products::getProduct($Article->getId());
......@@ -104,7 +104,7 @@ public static function parseArticle(QUI\ERP\Accounting\Article $Article, QUI\Loc
return $item;
}
public static function parseOrder(QUI\ERP\Order\OrderInterface $Order, QUI\Locale $Locale = null): array
public static function parseOrder(QUI\ERP\Order\OrderInterface $Order, null | QUI\Locale $Locale = null): array
{
$calculations = $Order->getArticles()->getCalculations();
$tax = 0;
......
......@@ -278,7 +278,7 @@ public static function isPaymentChangeable(
public static function importProductsToBasketList(
QUI\ERP\Products\Product\ProductList $List,
array $products = [],
QUI\ERP\Order\AbstractOrder|QUI\ERP\Order\Basket\Basket $Order = null
null | QUI\ERP\Order\AbstractOrder | QUI\ERP\Order\Basket\Basket $Order = null
): QUI\ERP\Products\Product\ProductList {
if (!is_array($products)) {
$products = [];
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren