chore: code cleanup
This commit is contained in:
@@ -56,4 +56,4 @@ class Address
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,11 @@ namespace App\BusProNet\Model;
|
||||
class BaseDataResponse
|
||||
{
|
||||
public function __construct(private readonly array $items)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
public function getItems(): array
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\BusProNet\Model;
|
||||
|
||||
use Symfony\Component\Serializer\Annotation\SerializedName;
|
||||
|
||||
class Communication
|
||||
{
|
||||
private ?string $phone = null;
|
||||
@@ -45,4 +43,4 @@ class Communication
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,4 +56,4 @@ class Country
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +43,4 @@ class CrmAttribute
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,4 @@ class CrmAttributeGroup
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ class CrmAttributesResponse
|
||||
return $this->attributeGroups;
|
||||
}
|
||||
|
||||
public function setAttributeGroups(?array $attributeGroups): static{
|
||||
public function setAttributeGroups(?array $attributeGroups): static
|
||||
{
|
||||
$this->attributeGroups = $attributeGroups;
|
||||
|
||||
return $this;
|
||||
@@ -102,4 +103,4 @@ class CrmAttributesResponse
|
||||
|
||||
return $crmSelections;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class NotificationResponse
|
||||
private ?int $code;
|
||||
private ?string $message;
|
||||
|
||||
public function __construct(int $code = null, string $message = null)
|
||||
public function __construct(?int $code = null, ?string $message = null)
|
||||
{
|
||||
$this->code = $code;
|
||||
$this->message = $message;
|
||||
@@ -33,9 +33,9 @@ class NotificationResponse
|
||||
// These weird and contradictory looking assertions are required because
|
||||
// of the stupid API implementation that doesn't distinguish between error
|
||||
// and success responses.
|
||||
$responseIsError = 100 <= $this->getCode() || $this->getMessage() === 'Daten konnten nicht gesendet werden.';
|
||||
$responseIsError = 100 <= $this->getCode() || 'Daten konnten nicht gesendet werden.' === $this->getMessage();
|
||||
$responseIsSuccess = 650 === $this->getCode() && false === stripos($this->getMessage(), 'fehler');
|
||||
|
||||
return false === $responseIsError && true === $responseIsSuccess;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,4 @@ class Pickup
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,4 @@ class ProfileResponse
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user