Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand All @@ -26,9 +26,9 @@ 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@v1
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
10 changes: 5 additions & 5 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down