From 9407b37a400d755bade2448886af42a3d6a93319 Mon Sep 17 00:00:00 2001 From: Alari <31406326+kasutajaimin@users.noreply.github.com> Date: Wed, 30 Apr 2025 18:01:33 +0300 Subject: [PATCH 1/5] php 8.4 compatibility --- src/Command.php | 10 +++++----- src/Connection.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Command.php b/src/Command.php index 1e21ffa..477a5c7 100644 --- a/src/Command.php +++ b/src/Command.php @@ -63,7 +63,7 @@ class Command extends Component * @param \yii\caching\Dependency|null $dependency the cache dependency associated with the cached query result. * @return $this the command object itself */ - public function cache(int $duration = null, \yii\caching\Dependency $dependency = null): Command + public function cache(?int $duration = null, ?\yii\caching\Dependency $dependency = null): Command { $this->queryCacheDuration = $duration === null ? $this->db->queryCacheDuration : $duration; $this->queryCacheDependency = $dependency; @@ -100,7 +100,7 @@ public function getRawUrl(): string * An empty array is returned if the query results in nothing. * @throws \yii\base\InvalidConfigException */ - public function queryAll(int $fetchMode = null): array + public function queryAll(?int $fetchMode = null): array { return $this->queryInternal(); } @@ -113,7 +113,7 @@ public function queryAll(int $fetchMode = null): array * results in nothing. * @throws \yii\base\InvalidConfigException */ - public function queryOne(int $fetchMode = null) + public function queryOne(?int $fetchMode = null) { $class = $this->modelClass; @@ -170,7 +170,7 @@ public function insert(string $model, array $columns) * * @return mixed */ - public function update(string $model, array $data = [], string $id = null) + public function update(string $model, array $data = [], ?string $id = null) { $method = $this->db->updateMethod; $this->pathInfo = $model; @@ -190,7 +190,7 @@ public function update(string $model, array $data = [], string $id = null) * @return array|false * @throws Exception */ - public function delete(string $model, string $id = null) + public function delete(string $model, ?string $id = null) { $this->pathInfo = $model; if ($id) { diff --git a/src/Connection.php b/src/Connection.php index e30af6b..bd93ad2 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -165,7 +165,7 @@ class Connection extends Component * @see queryCache * @see noCache() */ - public function cache(callable $callable, int $duration = null, \yii\caching\Dependency $dependency = null) + public function cache(callable $callable, ?int $duration = null, ?\yii\caching\Dependency $dependency = null) { $this->_queryCacheInfo[] = [$duration === null ? $this->queryCacheDuration : $duration, $dependency]; try { @@ -231,7 +231,7 @@ public function noCache(callable $callable) * @throws InvalidConfigException * @internal */ - public function getQueryCacheInfo(int $duration = null, \yii\caching\Dependency $dependency = null): ?array + public function getQueryCacheInfo(?int $duration = null, ?\yii\caching\Dependency $dependency = null): ?array { if (!$this->enableQueryCache) { return null; From 3389da8787ab0d1d6e57358393687eeacb5a2bc6 Mon Sep 17 00:00:00 2001 From: Alari <31406326+kasutajaimin@users.noreply.github.com> Date: Wed, 30 Apr 2025 18:07:20 +0300 Subject: [PATCH 2/5] test matrix update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c30615..0f10370 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['7.3', '7.4', '8.0', '8.1'] + php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout From dd8c5b0f59f38823d4fe81907243d61772e83e32 Mon Sep 17 00:00:00 2001 From: Alari <31406326+kasutajaimin@users.noreply.github.com> Date: Wed, 30 Apr 2025 18:32:15 +0300 Subject: [PATCH 3/5] manual workflow trigger --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f10370..f6d45ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: build -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] env: DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader" From a25b00dfb45a29b91d3e9d1570f5a235d77b6846 Mon Sep 17 00:00:00 2001 From: Alari <31406326+kasutajaimin@users.noreply.github.com> Date: Wed, 30 Apr 2025 18:37:07 +0300 Subject: [PATCH 4/5] cache action update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6d45ca..0af1ddd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} From f8a1f3b0ef2178147a474256c208edc0c02df7d8 Mon Sep 17 00:00:00 2001 From: Alari <31406326+kasutajaimin@users.noreply.github.com> Date: Wed, 30 Apr 2025 19:04:59 +0300 Subject: [PATCH 5/5] deprecated command update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0af1ddd..2356cc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: ini-values: date.timezone='UTC' - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v4 with: