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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
php: '8.5'
php: '8.1'
required-packages: >-
['db']
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ composer.phar

# PHP CS Fixer
/.php-cs-fixer.cache
/.php-cs-fixer.php
12 changes: 12 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@
]);

return (new Config())
->setRiskyAllowed(true)
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@PER-CS3.0' => true,
'no_unused_imports' => true,
'ordered_class_elements' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'declare_strict_types' => true,
'native_function_invocation' => true,
'native_constant_invocation' => true,
'fully_qualified_strict_types' => [
'import_symbols' => true
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
])
->setFinder($finder);
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 2.0.1 under development

- Bug #413: Fix "GROUP BY" builder ignoring parameters (@vjik)
- Enh #414: Explicitly import classes and constants in "use" section (@mspirkov)

## 2.0.0 December 05, 2025

Expand Down
3 changes: 2 additions & 1 deletion src/Builder/InBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
use Yiisoft\Db\Exception\InvalidConfigException;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Expression\ExpressionInterface;
use Yiisoft\Db\QueryBuilder\Condition\In;

use function implode;
use function is_array;
use function str_contains;

/**
* Build an object of {@see \Yiisoft\Db\QueryBuilder\Condition\In} into SQL expressions for SQLite Server.
* Build an object of {@see In} into SQL expressions for SQLite Server.
*/
final class InBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\InBuilder
{
Expand Down
3 changes: 2 additions & 1 deletion src/Builder/LikeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Expression\ExpressionInterface;
use Yiisoft\Db\QueryBuilder\Condition\LikeCondition;

/**
* Build an object of {@see \Yiisoft\Db\QueryBuilder\Condition\LikeCondition} into SQL expressions for SQLite Server.
* Build an object of {@see LikeCondition} into SQL expressions for SQLite Server.
*/
final class LikeBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\LikeBuilder
{
Expand Down
2 changes: 2 additions & 0 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use function preg_match_all;
use function strpos;

use const PREG_SET_ORDER;

/**
* Implements a database command that can be executed with a PDO (PHP Data Object) database connection for SQLite
* Server.
Expand Down
2 changes: 2 additions & 0 deletions src/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use PDO;
use Yiisoft\Db\Driver\Pdo\AbstractPdoDriver;

use const PHP_VERSION_ID;

/**
* Implements the SQLite Server driver based on the PDO (PHP Data Objects) extension.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
use function in_array;
use function strncasecmp;

use const PREG_SET_ORDER;

/**
* Implements the SQLite Server specific schema, supporting SQLite 3.3.0 or higher.
*
Expand Down
5 changes: 3 additions & 2 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Yiisoft\Db\Exception\Exception;
use Yiisoft\Db\Exception\InvalidConfigException;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Transaction\TransactionInterface;

/**
* Implements the SQLite Server specific transaction.
Expand All @@ -20,8 +21,8 @@ final class Transaction extends AbstractPdoTransaction
*
* @param string $level The transaction isolation level to use for this transaction.
*
* @see \Yiisoft\Db\Transaction\TransactionInterface::READ_UNCOMMITTED
* @see \Yiisoft\Db\Transaction\TransactionInterface::SERIALIZABLE
* @see TransactionInterface::READ_UNCOMMITTED
* @see TransactionInterface::SERIALIZABLE
*
* @throws Exception
* @throws InvalidConfigException
Expand Down
5 changes: 3 additions & 2 deletions tests/Provider/QueryBuilderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Yiisoft\Db\QueryBuilder\Condition\In;
use Yiisoft\Db\Sqlite\Column\ColumnBuilder;
use Yiisoft\Db\Tests\Support\TraversableObject;
use Yiisoft\Db\Connection\ConnectionInterface;

use function array_replace;
use function array_splice;
Expand Down Expand Up @@ -168,7 +169,7 @@ public static function insertReturningPks(): array
],
'carry passed params (query)' => [
'customer',
static fn(\Yiisoft\Db\Connection\ConnectionInterface $db) => (new Query($db))
static fn(ConnectionInterface $db) => (new Query($db))
->select(['email', 'name', 'address', 'is_active', 'related_id'])
->from('customer')
->where(
Expand Down Expand Up @@ -460,7 +461,7 @@ public static function multiOperandFunctionBuilder(): iterable
];
yield 'ArrayMerge with 4 operands' => [
ArrayMerge::class,
static fn(\Yiisoft\Db\Connection\ConnectionInterface $db) => [
static fn(ConnectionInterface $db) => [
[1, 2, 3],
new ArrayValue([5, 6, 7]),
$stringParam,
Expand Down
Loading