Skip to content

Commit 4eb59a5

Browse files
authored
Update the PHP CS Fixer configuration (#414)
1 parent 158e8d1 commit 4eb59a5

File tree

11 files changed

+31
-7
lines changed

11 files changed

+31
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
2525
with:
2626
repository: ${{ github.event.pull_request.head.repo.full_name }}
27-
php: '8.5'
27+
php: '8.1'
2828
required-packages: >-
2929
['db']

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ composer.phar
3636

3737
# PHP CS Fixer
3838
/.php-cs-fixer.cache
39+
/.php-cs-fixer.php

.php-cs-fixer.dist.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,23 @@
1212
]);
1313

1414
return (new Config())
15+
->setRiskyAllowed(true)
1516
->setParallelConfig(ParallelConfigFactory::detect())
1617
->setRules([
1718
'@PER-CS3.0' => true,
1819
'no_unused_imports' => true,
1920
'ordered_class_elements' => true,
2021
'class_attributes_separation' => ['elements' => ['method' => 'one']],
22+
'declare_strict_types' => true,
23+
'native_function_invocation' => true,
24+
'native_constant_invocation' => true,
25+
'fully_qualified_strict_types' => [
26+
'import_symbols' => true
27+
],
28+
'global_namespace_import' => [
29+
'import_classes' => true,
30+
'import_constants' => true,
31+
'import_functions' => true,
32+
],
2133
])
2234
->setFinder($finder);

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 2.0.1 under development
44

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

78
## 2.0.0 December 05, 2025
89

src/Builder/InBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
use Yiisoft\Db\Exception\InvalidConfigException;
1111
use Yiisoft\Db\Exception\NotSupportedException;
1212
use Yiisoft\Db\Expression\ExpressionInterface;
13+
use Yiisoft\Db\QueryBuilder\Condition\In;
1314

1415
use function implode;
1516
use function is_array;
1617
use function str_contains;
1718

1819
/**
19-
* Build an object of {@see \Yiisoft\Db\QueryBuilder\Condition\In} into SQL expressions for SQLite Server.
20+
* Build an object of {@see In} into SQL expressions for SQLite Server.
2021
*/
2122
final class InBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\InBuilder
2223
{

src/Builder/LikeBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
use Yiisoft\Db\Exception\NotSupportedException;
88
use Yiisoft\Db\Expression\ExpressionInterface;
9+
use Yiisoft\Db\QueryBuilder\Condition\LikeCondition;
910

1011
/**
11-
* Build an object of {@see \Yiisoft\Db\QueryBuilder\Condition\LikeCondition} into SQL expressions for SQLite Server.
12+
* Build an object of {@see LikeCondition} into SQL expressions for SQLite Server.
1213
*/
1314
final class LikeBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\LikeBuilder
1415
{

src/Command.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use function preg_match_all;
1717
use function strpos;
1818

19+
use const PREG_SET_ORDER;
20+
1921
/**
2022
* Implements a database command that can be executed with a PDO (PHP Data Object) database connection for SQLite
2123
* Server.

src/Driver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use PDO;
88
use Yiisoft\Db\Driver\Pdo\AbstractPdoDriver;
99

10+
use const PHP_VERSION_ID;
11+
1012
/**
1113
* Implements the SQLite Server driver based on the PDO (PHP Data Objects) extension.
1214
*

src/Schema.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
use function in_array;
2626
use function strncasecmp;
2727

28+
use const PREG_SET_ORDER;
29+
2830
/**
2931
* Implements the SQLite Server specific schema, supporting SQLite 3.3.0 or higher.
3032
*

src/Transaction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Yiisoft\Db\Exception\Exception;
1010
use Yiisoft\Db\Exception\InvalidConfigException;
1111
use Yiisoft\Db\Exception\NotSupportedException;
12+
use Yiisoft\Db\Transaction\TransactionInterface;
1213

1314
/**
1415
* Implements the SQLite Server specific transaction.
@@ -20,8 +21,8 @@ final class Transaction extends AbstractPdoTransaction
2021
*
2122
* @param string $level The transaction isolation level to use for this transaction.
2223
*
23-
* @see \Yiisoft\Db\Transaction\TransactionInterface::READ_UNCOMMITTED
24-
* @see \Yiisoft\Db\Transaction\TransactionInterface::SERIALIZABLE
24+
* @see TransactionInterface::READ_UNCOMMITTED
25+
* @see TransactionInterface::SERIALIZABLE
2526
*
2627
* @throws Exception
2728
* @throws InvalidConfigException

0 commit comments

Comments
 (0)