Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/invoice' into feature/in…
Browse files Browse the repository at this point in the history
…voice
  • Loading branch information
SimonJnsson committed Dec 7, 2023
2 parents a2f1301 + 8ce472f commit 87bb9c6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/Abstracts/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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
38 changes: 19 additions & 19 deletions src/Resources/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,25 @@ public static function create(
Currency|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 {
return static::createRequest(array_filter(compact(
'name',
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
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 87bb9c6

Please sign in to comment.