Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonJnsson committed Dec 13, 2023
2 parents 1ba3be9 + 09d8ca6 commit 6a99cb7
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/Abstracts/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class Resource
{
public string $self;

public function __construct(array|string|int|float $properties = null)
public function __construct(array|string|int|float|null $properties = null)
{
if (is_array($properties)) {
$this->populate($properties);
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/EconomicQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function getEndpoint(): string
return $this->endpoint;
}

public function where(int|string|Closure $propertyName, string $operatorOrValue = null, mixed $value = null): static
public function where(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static
{
if (! isset($this->filter)) {
$this->filter = new EconomicQueryFilterBuilder(EconomicQueryFilterBuilder::FILTER_RELATION_AND);
Expand All @@ -53,7 +53,7 @@ public function where(int|string|Closure $propertyName, string $operatorOrValue
return $this;
}

public function orWhere(int|string|Closure $propertyName, string $operatorOrValue = null, mixed $value = null): static
public function orWhere(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static
{
if (! isset($this->filter)) {
$this->filter = new EconomicQueryFilterBuilder(EconomicQueryFilterBuilder::FILTER_RELATION_OR);
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/EconomicQueryFilterBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function whereNested(Closure $closure)
return $this;
}

public function where(int|string|Closure $propertyName, string $operatorOrValue = null, mixed $value = null): static
public function where(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static
{
if ($propertyName instanceof Closure) {
return $this->whereNested($propertyName);
Expand All @@ -91,7 +91,7 @@ public function where(int|string|Closure $propertyName, string $operatorOrValue
return $this;
}

public function orWhere(int|string|Closure $propertyName, string $operatorOrValue = null, mixed $value = null): static
public function orWhere(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static
{
$instance = new static(static::FILTER_RELATION_OR);

Expand Down
2 changes: 1 addition & 1 deletion src/DTOs/Attention.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Attention extends Resource
public ?int $customerContactNumber = null;

public static function new(
int $customerContactNumber = null,
?int $customerContactNumber = null,
): static {
return new static([
'customerContactNumber' => $customerContactNumber,
Expand Down
14 changes: 7 additions & 7 deletions src/DTOs/Recipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class Recipient extends Resource
public static function new(
string $name,
VatZone $vatZone,
string $address = null,
string $zip = null,
string $city = null,
string $country = null,
string $ean = null,
string $publicEntryNumber = null,
Attention $attention = null,
?string $address = null,
?string $zip = null,
?string $city = null,
?string $country = null,
?string $ean = null,
?string $publicEntryNumber = null,
?Attention $attention = null,
): static {
return new static([
'name' => $name,
Expand Down
38 changes: 19 additions & 19 deletions src/Resources/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,25 @@ public static function create(
string $currency,
VatZone|int $vatZone,
PaymentTerm|int $paymentTerms,
string $email = null,
string $address = null,
string $zip = null,
string $city = null,
string $country = null,
string $corporateIdentificationNumber = null,
string $pNumber = null,
string $vatNumber = null,
string $ean = null,
string $publicEntryNumber = null,
string $website = null,
string $mobilePhone = null,
string $telephoneAndFaxNumber = null,
bool $barred = null,
bool $eInvoicingDisabledByDefault = null,
float $creditLimit = null,
int $customerNumber = null,
Layout|int $layout = null,
Employee|int $salesPerson = null,
?string $email = null,
?string $address = null,
?string $zip = null,
?string $city = null,
?string $country = null,
?string $corporateIdentificationNumber = null,
?string $pNumber = null,
?string $vatNumber = null,
?string $ean = null,
?string $publicEntryNumber = null,
?string $website = null,
?string $mobilePhone = null,
?string $telephoneAndFaxNumber = null,
?bool $barred = null,
?bool $eInvoicingDisabledByDefault = null,
?float $creditLimit = null,
?int $customerNumber = null,
Layout|int|null $layout = null,
Employee|int|null $salesPerson = null,
): static {
$creationParameters = static::resolveArguments(static::getMethodArgs(__METHOD__, func_get_args()));

Expand Down
10 changes: 5 additions & 5 deletions src/Resources/Customer/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public static function fromCustomer(Customer|int $customer)
public static function create(
Customer $customer,
string $name,
string $email = null,
string $phone = null,
string $notes = null,
string $eInvoiceId = null,
array $emailNotifications = null
?string $email = null,
?string $phone = null,
?string $notes = null,
?string $eInvoiceId = null,
?array $emailNotifications = null
) {
return static::createRequest(array_filter(compact(
'customer',
Expand Down
12 changes: 6 additions & 6 deletions src/Resources/Invoice/ProductLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public static function new(
Product|int $product,
float $quantity,
float $unitNetPrice,
string $description = null,
float $discountPercentage = null,
float $marginInBaseCurrency = null,
float $marginPercentage = null,
int $sortKey = null,
float $unitCostPrice = null,
?string $description = null,
?float $discountPercentage = null,
?float $marginInBaseCurrency = null,
?float $marginPercentage = null,
?int $sortKey = null,
?float $unitCostPrice = null,
): static {
return new static([
'product' => $product,
Expand Down
16 changes: 8 additions & 8 deletions src/Resources/PaymentTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ class PaymentTerm extends Resource

public static function new(
int $paymentTermsNumber,
string $name = null,
string $description = null,
int $daysOfCredit = null,
PaymentTermsType $paymentTermsType = null,
Account $contraAccountForPrepaidAmount = null,
float $percentageForPrepaidAmount = null,
float $percentageForRemainderAmount = null,
Customer $creditCardCompany = null,
?string $name = null,
?string $description = null,
?int $daysOfCredit = null,
?PaymentTermsType $paymentTermsType = null,
?Account $contraAccountForPrepaidAmount = null,
?float $percentageForPrepaidAmount = null,
?float $percentageForRemainderAmount = null,
?Customer $creditCardCompany = null,
): static {
return new static([
'paymentTermsNumber' => $paymentTermsNumber,
Expand Down
22 changes: 11 additions & 11 deletions src/Resources/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ public static function create(DateTime $fromDate, DateTime $toDate): static

public static function new(
string $productNumber,
string $name = null,
string $barCode = null,
bool $barred = null,
float $costPrice = null,
EconomicCollection $entries = null,
DateTime|string $fromDate = null,
EconomicCollection $periods = null,
DateTime|string $toDate = null,
EconomicCollection $totals = null,
EconomicCollection $vouchers = null,
string $year = null,
?string $name = null,
?string $barCode = null,
?bool $barred = null,
?float $costPrice = null,
?EconomicCollection $entries = null,
DateTime|string|null $fromDate = null,
?EconomicCollection $periods = null,
DateTime|string|null $toDate = null,
?EconomicCollection $totals = null,
?EconomicCollection $vouchers = null,
?string $year = null,
): static {
return new static([
'productNumber' => $productNumber,
Expand Down
2 changes: 1 addition & 1 deletion src/Services/EconomicLoggerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class EconomicLoggerService
{
protected static array $loggers = [];

public static function registerLogger(LoggerInterface $logger, string|array $logLevels = null): void
public static function registerLogger(LoggerInterface $logger, string|array|null $logLevels = null): void
{
if ($logLevels === null) {
static::$loggers['all'][] = $logger;
Expand Down

0 comments on commit 6a99cb7

Please sign in to comment.