Skip to content

Commit

Permalink
fix deprecations (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexz707 authored Jan 15, 2025
1 parent e180dee commit 78e2f80
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/Lib/CacheResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function save(
mixed $data,
string $key,
array $tags = [],
DateInterval|int $lifetime = null,
DateInterval|int|null $lifetime = null,
int $priority = 0,
bool $force = false
): void {
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/CacheResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function save(
mixed $data,
string $key,
array $tags = [],
DateInterval|int $lifetime = null,
DateInterval|int|null $lifetime = null,
int $priority = 0,
bool $force = false
): void;
Expand Down
10 changes: 5 additions & 5 deletions src/Lib/ConfigResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ public function locateConfigFile(string $name): string
return Config::locateConfigFile($name);
}

public function getSystemConfiguration(string $offset = null): ?array
public function getSystemConfiguration(?string $offset = null): ?array
{
return Config::getSystemConfiguration($offset);
}

public function getWebsiteConfigRuntimeCacheKey(string $language = null): string
public function getWebsiteConfigRuntimeCacheKey(?string $language = null): string
{
return Config::getWebsiteConfigRuntimeCacheKey($language);
}

public function getWebsiteConfig(string $language = null): array
public function getWebsiteConfig(?string $language = null): array
{
return Config::getWebsiteConfig($language);
}

public function getWebsiteConfigValue(
string $key = null,
?string $key = null,
mixed $default = null,
string $language = null
?string $language = null
): mixed {
return Config::getWebsiteConfigValue($key, $default, $language);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Lib/ConfigResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ interface ConfigResolverInterface
{
public function locateConfigFile(string $name): string;

public function getSystemConfiguration(string $offset = null): ?array;
public function getSystemConfiguration(?string $offset = null): ?array;

public function getWebsiteConfigRuntimeCacheKey(string $language = null): string;
public function getWebsiteConfigRuntimeCacheKey(?string $language = null): string;

public function getWebsiteConfig(string $language = null): array;
public function getWebsiteConfig(?string $language = null): array;

public function getWebsiteConfigValue(
string $key = null,
?string $key = null,
mixed $default = null,
string $language = null
?string $language = null
): mixed;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/DocumentResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class DocumentResolver implements DocumentResolverInterface
/**
* @throws Exception
*/
public function getInstance(string $adapter = null): ?Adapter
public function getInstance(?string $adapter = null): ?Adapter
{
Document::getInstance($adapter);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/DocumentResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface DocumentResolverInterface
/**
* @throws Exception
*/
public function getInstance(string $adapter = null): ?Adapter;
public function getInstance(?string $adapter = null): ?Adapter;

public function isAvailable(): bool;

Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Helper/MailResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function formatDebugReceivers(array $receivers): string
/**
* @throws Exception
*/
public function setAbsolutePaths(string $string, ?Document $document = null, string $hostUrl = null): string
public function setAbsolutePaths(string $string, ?Document $document = null, ?string $hostUrl = null): string
{
return MailHelper::setAbsolutePaths($string, $document, $hostUrl);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Helper/MailResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function formatDebugReceivers(array $receivers): string;
/**
* @throws Exception
*/
public function setAbsolutePaths(string $string, ?Document $document = null, string $hostUrl = null): string;
public function setAbsolutePaths(string $string, ?Document $document = null, ?string $hostUrl = null): string;

/**
* @throws Exception
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/ToolResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getDefaultLanguage(): ?string
/**
* @throws Exception
*/
public function getMail(array|string $recipients = null, string $subject = null): Mail
public function getMail(array|string|null $recipients = null, ?string $subject = null): Mail
{
return Tool::getMail($recipients, $subject);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/ToolResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ public function getDefaultLanguage(): ?string;
/**
* @throws Exception
*/
public function getMail(array|string $recipients = null, string $subject = null): Mail;
public function getMail(array|string|null $recipients = null, ?string $subject = null): Mail;
}
2 changes: 1 addition & 1 deletion src/Lib/Tools/Authentication/AuthenticationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
final class AuthenticationResolver implements AuthenticationResolverInterface
{
public function authenticateSession(Request $request = null): ?User
public function authenticateSession(?Request $request = null): ?User
{
return Authentication::authenticateSession($request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
interface AuthenticationResolverInterface
{
public function authenticateSession(Request $request = null): ?User;
public function authenticateSession(?Request $request = null): ?User;

public function generateTokenByUser(User $user): string;

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Asset/AssetServiceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function createFolderByPath(string $path, array $options = []): Folder
return Service::createFolderByPath($path, $options);
}

public function pathExists(string $path, string $type = null): bool
public function pathExists(string $path, ?string $type = null): bool
{
return Service::pathExists($path, $type);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Asset/AssetServiceResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ public function rewriteIds(Asset $asset, array $rewriteConfig): Asset;

public function createFolderByPath(string $path, array $options = []): Folder;

public function pathExists(string $path, string $type = null): bool;
public function pathExists(string $path, ?string $type = null): bool;
}
4 changes: 2 additions & 2 deletions src/Models/DataObject/DataObjectServiceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function createFolderByPath(string $path, array $options = []): Folder
return Service::createFolderByPath($path, $options);
}

public function pathExists(string $path, string $type = null): bool
public function pathExists(string $path, ?string $type = null): bool
{
return Service::pathExists($path, $type);
}
Expand All @@ -68,7 +68,7 @@ public function getCustomLayoutDefinitionForGridColumnConfig(ClassDefinition $cl

public function enrichLayoutDefinition(
ClassDefinition\Data|ClassDefinition\Layout|null &$layout,
Concrete $object = null,
?Concrete $object = null,
array $context = []
): void {
Service::enrichLayoutDefinition($layout, $object, $context);
Expand Down
4 changes: 2 additions & 2 deletions src/Models/DataObject/DataObjectServiceResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public function rewriteIds(AbstractObject $object, array $rewriteConfig, array $

public function createFolderByPath(string $path, array $options = []): Folder;

public function pathExists(string $path, string $type = null): bool;
public function pathExists(string $path, ?string $type = null): bool;

public function getCustomLayoutDefinitionForGridColumnConfig(ClassDefinition $class, int $objectId): array;

public function enrichLayoutDefinition(
ClassDefinition\Data|ClassDefinition\Layout|null &$layout,
Concrete $object = null,
?Concrete $object = null,
array $context = []
): void;

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Document/DocumentServiceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function createFolderByPath(string $path, array $options = []): Folder
return Service::createFolderByPath($path, $options);
}

public function pathExists(string $path, string $type = null): bool
public function pathExists(string $path, ?string $type = null): bool
{
return Service::pathExists($path, $type);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Document/DocumentServiceResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ public function rewriteIds(

public function createFolderByPath(string $path, array $options = []): Folder;

public function pathExists(string $path, string $type = null): bool;
public function pathExists(string $path, ?string $type = null): bool;
}
2 changes: 1 addition & 1 deletion src/Models/Element/ServiceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function findForbiddenPaths(string $type, User $user): array
return Service::findForbiddenPaths($type, $user);
}

public function isPublished(ElementInterface $element = null): bool
public function isPublished(?ElementInterface $element = null): bool
{
return Service::isPublished($element);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Element/ServiceResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getElementType(ElementInterface $element): ?string;

public function findForbiddenPaths(string $type, User $user): array;

public function isPublished(ElementInterface $element = null): bool;
public function isPublished(?ElementInterface $element = null): bool;

public function getValidKey(string $key, string $type): string;

Expand Down

0 comments on commit 78e2f80

Please sign in to comment.