From 9f9cd607919099d7ab9473e183fc3e007e857dff Mon Sep 17 00:00:00 2001 From: Nikolay Novikov Date: Thu, 28 Nov 2024 19:27:08 +0300 Subject: [PATCH] php 8.4 support --- .gitattributes | 8 ++++++++ .gitignore | 4 ++++ src/Exceptions/ExternalException.php | 2 +- src/Service.php | 22 +++++++++++----------- src/Traits/PostgresTrait.php | 4 ++-- 5 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitignore diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..532ca5b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +/tests export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.php-cs-fixer.php export-ignore +phpcs.xml export-ignore +phpstan.neon export-ignore +phpunit.xml export-ignore +psalm.xml export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3988cec --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.phpunit.cache/ +vendor/ +composer.lock +.php-cs-fixer.cache diff --git a/src/Exceptions/ExternalException.php b/src/Exceptions/ExternalException.php index 94ab150..1b0d701 100644 --- a/src/Exceptions/ExternalException.php +++ b/src/Exceptions/ExternalException.php @@ -16,7 +16,7 @@ class ExternalException extends Exception * @param array|null $dump * @return void */ - public function __construct(string $action, array $dump = null) + public function __construct(string $action, ?array $dump = null) { parent::__construct("Unexpected behaviour for action {$action}."); diff --git a/src/Service.php b/src/Service.php index c71947a..dffee2e 100644 --- a/src/Service.php +++ b/src/Service.php @@ -31,11 +31,11 @@ class Service * Setters * * @param \AnourValar\LaravelAtom\Registry $registry - * @param array $config - * @param callable $lockHook + * @param array|null $config + * @param callable|null $lockHook * @return void */ - public function __construct(Registry $registry, array $config = null, callable $lockHook = null) + public function __construct(Registry $registry, ?array $config = null, ?callable $lockHook = null) { $this->registry = $registry; @@ -113,10 +113,10 @@ public function lock(): void * Action after transaction commit * * @param callable $closure - * @param string $connection + * @param string|null $connection * @return int|null */ - public function onCommit(callable $closure, string $connection = null): ?int + public function onCommit(callable $closure, ?string $connection = null): ?int { if (is_null($connection)) { $connection = \DB::getDefaultConnection(); @@ -134,10 +134,10 @@ public function onCommit(callable $closure, string $connection = null): ?int * Action after transaction rollBack * * @param callable $closure - * @param string $connection + * @param string|null $connection * @return int|null */ - public function onRollBack(callable $closure, string $connection = null): ?int + public function onRollBack(callable $closure, ?string $connection = null): ?int { if (is_null($connection)) { $connection = \DB::getDefaultConnection(); @@ -154,10 +154,10 @@ public function onRollBack(callable $closure, string $connection = null): ?int * Remove "onCommit" task * * @param int $key - * @param string $connection + * @param string|null $connection * @return void */ - public function removeOnCommit(int $key, string $connection = null): void + public function removeOnCommit(int $key, ?string $connection = null): void { if (is_null($connection)) { $connection = \DB::getDefaultConnection(); @@ -170,10 +170,10 @@ public function removeOnCommit(int $key, string $connection = null): void * Remove "onRollBack" task * * @param int $key - * @param string $connection + * @param string|null $connection * @return void */ - public function removeOnRollBack(int $key, string $connection = null): void + public function removeOnRollBack(int $key, ?string $connection = null): void { if (is_null($connection)) { $connection = \DB::getDefaultConnection(); diff --git a/src/Traits/PostgresTrait.php b/src/Traits/PostgresTrait.php index 2c2b087..0c22eb4 100644 --- a/src/Traits/PostgresTrait.php +++ b/src/Traits/PostgresTrait.php @@ -88,10 +88,10 @@ protected function conditionalIndexNotNull(string $tableName, string $column) * * @param string $tableName * @param string $columnName - * @param string $locale + * @param string|null $locale * @return void */ - protected function addRumFullText(string $tableName, string $columnName = 'search_fulltext', string $locale = null): void + protected function addRumFullText(string $tableName, string $columnName = 'search_fulltext', ?string $locale = null): void { if (! $locale) { $locale = config('app.fulltext_locale', config('app.fallback_locale'));