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
2 changes: 1 addition & 1 deletion .github/workflows/mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'tests/**'
- 'phpunit.xml.dist'
- 'infection.json.dist'
- 'tools/infection/composer.json'
- 'composer.json'
- '.github/workflows/mutation.yml'
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/rector-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ concurrency:
cancel-in-progress: true

jobs:
rector:
rector-cs:
permissions:
contents: write # Required to commit formatting fixes back to the PR
uses: yiisoft/actions/.github/workflows/rector-cs.yml@master
with:
php: '8.1'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ composer.phar
# PhpUnit
/phpunit.phar
/phpunit.xml
/.phpunit.cache

# PHP CS Fixer
/.php-cs-fixer.cache
12 changes: 6 additions & 6 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
use Yiisoft\CodeStyle\ConfigBuilder;

$finder = (new Finder())->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

return (new Config())
return ConfigBuilder::build()
->setCacheFile(__DIR__ . '/runtime/.php-cs-fixer.cache')
->setRiskyAllowed(true)
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@PER-CS3.0' => true,
'no_unused_imports' => true,
'ordered_class_elements' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'@Yiisoft/Core' => true,
'@Yiisoft/Core:risky' => true,
])
->setFinder($finder);
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1.0.1 under development

- no changes in this release.
- Enh #146: Explicitly import `SORT_ASC` constant in `QueryDataReader` (@vjik)

## 1.0.0 December 13, 2025

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ vendor/bin/roave-infection-static-analysis-plugin \
--only-covered" ## Run mutation tests using Infection
mutation: run

composer-require-checker: CMD="vendor/bin/composer-require-checker" ## Check dependencies using Composer Require Checker
composer-require-checker: run
composer-dependency-analyser: CMD="vendor/bin/composer-dependency-analyser" ## Check dependencies using Composer Dependency Analyser
composer-dependency-analyser: run

rector: CMD="vendor/bin/rector" ## Check code style using Rector
rector: run
Expand Down
21 changes: 14 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
},
"require-dev": {
"ext-pdo": "*",
"friendsofphp/php-cs-fixer": "^3.92.0",
"phpunit/phpunit": "^10.5.60",
"rector/rector": "^2.2.14",
"roave/infection-static-analysis-plugin": "^1.35",
"bamarni/composer-bin-plugin": "^1.9.1",
"friendsofphp/php-cs-fixer": "^3.95.27",
"phpunit/phpunit": "^10.5.66",
"rector/rector": "^2.7.0",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.24",
"vimeo/psalm": "^5.26.1 || ^6.9.1",
"vimeo/psalm": "^6.20.0",
"vlucas/phpdotenv": "^5.6.2",
"yiisoft/code-style": "^1.1",
"yiisoft/db-mssql": "^2.0",
"yiisoft/db-mysql": "^2.0",
"yiisoft/db-oracle": "^2.0",
Expand All @@ -62,11 +63,17 @@
},
"files": ["tests/bootstrap.php"]
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"target-directory": "tools",
"forward-command": true
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"infection/extension-installer": true,
"composer/package-versions-deprecated": true
"bamarni/composer-bin-plugin": true
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ COPY --from=composer /composer /usr/bin/composer
# Code

COPY . /code
RUN rm -f /code/composer.lock
RUN rm -f /code/composer.lock /code/tools/*/composer.lock
WORKDIR /code

# PHP packages
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
cacheDirectory="runtime/.phpunit.cache"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
Expand Down
14 changes: 3 additions & 11 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Yiisoft\CodeStyle\Rector\SetList;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withPhpSets(php81: true)
->withRules([
InlineConstructorDefaultToPropertyRector::class,
])
->withSkip([
ClosureToArrowFunctionRector::class,
ReadOnlyPropertyRector::class,
NullToStrictStringFuncCallArgRector::class,
->withSets([
SetList::YII_CORE,
]);
2 changes: 2 additions & 0 deletions runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions src/QueryDataReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
use function is_string;
use function sprintf;

use const SORT_ASC;

/**
* @template TKey as array-key
* @template TValue as array|object
Expand Down
4 changes: 1 addition & 3 deletions tests/Base/DataTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ abstract protected function getConnectionId(): string;
protected function getConnection(): PdoConnectionInterface
{
$connectionId = $this->getConnectionId();
if (!isset(self::$connection[$connectionId])) {
self::$connection[$connectionId] = $this->makeConnection();
}
self::$connection[$connectionId] ??= $this->makeConnection();

return self::$connection[$connectionId];
}
Expand Down
2 changes: 2 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*/vendor
/*/composer.lock
10 changes: 10 additions & 0 deletions tools/infection/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"require-dev": {
"roave/infection-static-analysis-plugin": "^1.35"
},
"config": {
"allow-plugins": {
"infection/extension-installer": true
}
}
}
Loading