feat: lots more improvements
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -175,8 +175,6 @@ class Provider implements ProviderServiceMutateInterface, ProviderServiceDiscove
|
||||
?string $secret = null
|
||||
): ResourceServiceLocationInterface|null {
|
||||
$discovery = new Discovery();
|
||||
|
||||
// TODO: Make SSL verification configurable based on tenant/user settings
|
||||
$verifySSL = true;
|
||||
|
||||
return $discovery->discover($identity, $location, $secret, $verifySSL);
|
||||
|
||||
@@ -175,7 +175,7 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
||||
], fn($v) => $v !== null);
|
||||
}
|
||||
|
||||
public function jsonDeserialize(array|string $data): static {
|
||||
public function jsonDeserialize(array|string $data, bool $delta = false): static {
|
||||
if (is_string($data)) {
|
||||
$data = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
@@ -193,13 +193,11 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
||||
$this->setIdentity($this->freshIdentity(null, $data[self::JSON_PROPERTY_IDENTITY]));
|
||||
}
|
||||
if (isset($data[self::JSON_PROPERTY_PRIMARY_ADDRESS]) && is_string($data[self::JSON_PROPERTY_PRIMARY_ADDRESS])) {
|
||||
if (is_array($data[self::JSON_PROPERTY_PRIMARY_ADDRESS]) && isset($data[self::JSON_PROPERTY_PRIMARY_ADDRESS]['address'])) {
|
||||
$this->setPrimaryAddress(new Address($data[self::JSON_PROPERTY_PRIMARY_ADDRESS]));
|
||||
}
|
||||
$this->setPrimaryAddress(new Address($data[self::JSON_PROPERTY_PRIMARY_ADDRESS]));
|
||||
}
|
||||
if (isset($data[self::JSON_PROPERTY_SECONDARY_ADDRESSES]) && is_array($data[self::JSON_PROPERTY_SECONDARY_ADDRESSES])) {
|
||||
$this->setSecondaryAddresses(array_map(
|
||||
fn($addr) => new Address($addr['address']),
|
||||
fn($addr) => new Address(is_array($addr) ? ($addr['address'] ?? $addr) : $addr),
|
||||
$data[self::JSON_PROPERTY_SECONDARY_ADDRESSES]
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user