Skip to content

Commit 880dfb2

Browse files
authored
Merge pull request #122 from codeigniter4/develop
Prep for Release v1.2.0
2 parents d4ac84b + ef62bca commit 880dfb2

File tree

17 files changed

+73
-24
lines changed

17 files changed

+73
-24
lines changed

.github/workflows/phpcsfixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
3838

3939
- name: Cache composer dependencies
40-
uses: actions/cache@v3
40+
uses: actions/cache@v4
4141
with:
4242
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4343
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4747

4848
- name: Cache composer dependencies
49-
uses: actions/cache@v3
49+
uses: actions/cache@v4
5050
with:
5151
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
5252
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
@@ -56,7 +56,7 @@ jobs:
5656
run: mkdir -p build/phpstan
5757

5858
- name: Cache PHPStan results
59-
uses: actions/cache@v3
59+
uses: actions/cache@v4
6060
with:
6161
path: build/phpstan
6262
key: ${{ runner.os }}-phpstan-${{ github.sha }}

.github/workflows/psalm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4343

4444
- name: Cache composer dependencies
45-
uses: actions/cache@v3
45+
uses: actions/cache@v4
4646
with:
4747
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4848
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
@@ -52,7 +52,7 @@ jobs:
5252
run: mkdir -p build/psalm
5353

5454
- name: Cache Psalm results
55-
uses: actions/cache@v3
55+
uses: actions/cache@v4
5656
with:
5757
path: build/psalm
5858
key: ${{ runner.os }}-psalm-${{ github.sha }}

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4747

4848
- name: Cache composer dependencies
49-
uses: actions/cache@v3
49+
uses: actions/cache@v4
5050
with:
5151
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
5252
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"phpunit/phpunit": "^9.3",
3636
"roave/security-advisories": "dev-latest",
3737
"vimeo/psalm": "^5.0",
38-
"rector/rector": "^0.18.3"
38+
"rector/rector": "^0.19.0"
3939
},
4040
"require-dev": {
4141
"codeigniter4/framework": "^4.1",

rector.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
66
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
7+
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
78
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
89
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
910
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
@@ -14,12 +15,12 @@
1415
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
1516
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
1617
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
18+
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
1719
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
1820
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
1921
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
2022
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
2123
use Rector\Config\RectorConfig;
22-
use Rector\Core\ValueObject\PhpVersion;
2324
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
2425
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
2526
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
@@ -34,7 +35,10 @@
3435
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
3536
use Rector\Set\ValueObject\LevelSetList;
3637
use Rector\Set\ValueObject\SetList;
38+
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
39+
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
3740
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
41+
use Rector\ValueObject\PhpVersion;
3842

3943
return static function (RectorConfig $rectorConfig): void {
4044
$rectorConfig->sets([
@@ -109,10 +113,16 @@
109113
$rectorConfig->rule(FuncGetArgsToVariadicParamRector::class);
110114
$rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class);
111115
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
116+
$rectorConfig->rule(SimplifyEmptyCheckOnEmptyArrayRector::class);
117+
$rectorConfig->rule(TernaryEmptyArrayArrayDimFetchToCoalesceRector::class);
118+
$rectorConfig->rule(EmptyOnNullableObjectToInstanceOfRector::class);
119+
$rectorConfig->rule(DisallowedEmptyRuleFixerRector::class);
112120
$rectorConfig
113121
->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
114122
/**
115-
* The INLINE_PUBLIC value is default to false to avoid BC break, if you use for libraries and want to preserve BC break, you don't need to configure it, as it included in LevelSetList::UP_TO_PHP_74
123+
* The INLINE_PUBLIC value is default to false to avoid BC break,
124+
* if you use for libraries and want to preserve BC break, you don't
125+
* need to configure it, as it included in LevelSetList::UP_TO_PHP_74
116126
* Set to true for projects that allow BC break
117127
*/
118128
TypedPropertyFromAssignsRector::INLINE_PUBLIC => true,

src/Template/.github/workflows/deptrac.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4343

4444
- name: Cache composer dependencies
45-
uses: actions/cache@v3
45+
uses: actions/cache@v4
4646
with:
4747
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4848
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
@@ -52,7 +52,7 @@ jobs:
5252
run: mkdir -p build/
5353

5454
- name: Cache Deptrac results
55-
uses: actions/cache@v3
55+
uses: actions/cache@v4
5656
with:
5757
path: build
5858
key: ${{ runner.os }}-deptrac-${{ github.sha }}

src/Template/.github/workflows/infection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4141

4242
- name: Cache composer dependencies
43-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4444
with:
4545
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4646
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

src/Template/.github/workflows/phpcsfixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
3838

3939
- name: Cache composer dependencies
40-
uses: actions/cache@v3
40+
uses: actions/cache@v4
4141
with:
4242
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4343
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

src/Template/.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4747

4848
- name: Cache composer dependencies
49-
uses: actions/cache@v3
49+
uses: actions/cache@v4
5050
with:
5151
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
5252
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
@@ -56,7 +56,7 @@ jobs:
5656
run: mkdir -p build/phpstan
5757

5858
- name: Cache PHPStan results
59-
uses: actions/cache@v3
59+
uses: actions/cache@v4
6060
with:
6161
path: build/phpstan
6262
key: ${{ runner.os }}-phpstan-${{ github.sha }}

src/Template/.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4646

4747
- name: Cache composer dependencies
48-
uses: actions/cache@v3
48+
uses: actions/cache@v4
4949
with:
5050
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
5151
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

src/Template/.github/workflows/psalm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4343

4444
- name: Cache composer dependencies
45-
uses: actions/cache@v3
45+
uses: actions/cache@v4
4646
with:
4747
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4848
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
@@ -52,7 +52,7 @@ jobs:
5252
run: mkdir -p build/psalm
5353

5454
- name: Cache Psalm results
55-
uses: actions/cache@v3
55+
uses: actions/cache@v4
5656
with:
5757
path: build/psalm
5858
key: ${{ runner.os }}-psalm-${{ github.sha }}

src/Template/.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4747

4848
- name: Cache composer dependencies
49-
uses: actions/cache@v3
49+
uses: actions/cache@v4
5050
with:
5151
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
5252
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

src/Template/.github/workflows/unused.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4141

4242
- name: Cache composer dependencies
43-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4444
with:
4545
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4646
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}

src/Template/rector.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
66
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
7+
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
78
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
89
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
910
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
@@ -14,12 +15,12 @@
1415
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
1516
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
1617
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
18+
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
1719
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
1820
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
1921
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
2022
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
2123
use Rector\Config\RectorConfig;
22-
use Rector\Core\ValueObject\PhpVersion;
2324
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
2425
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
2526
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
@@ -34,7 +35,10 @@
3435
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
3536
use Rector\Set\ValueObject\LevelSetList;
3637
use Rector\Set\ValueObject\SetList;
38+
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
39+
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
3740
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
41+
use Rector\ValueObject\PhpVersion;
3842

3943
return static function (RectorConfig $rectorConfig): void {
4044
$rectorConfig->sets([
@@ -110,10 +114,16 @@
110114
$rectorConfig->rule(FuncGetArgsToVariadicParamRector::class);
111115
$rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class);
112116
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
117+
$rectorConfig->rule(SimplifyEmptyCheckOnEmptyArrayRector::class);
118+
$rectorConfig->rule(TernaryEmptyArrayArrayDimFetchToCoalesceRector::class);
119+
$rectorConfig->rule(EmptyOnNullableObjectToInstanceOfRector::class);
120+
$rectorConfig->rule(DisallowedEmptyRuleFixerRector::class);
113121
$rectorConfig
114122
->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
115123
/**
116-
* The INLINE_PUBLIC value is default to false to avoid BC break, if you use for libraries and want to preserve BC break, you don't need to configure it, as it included in LevelSetList::UP_TO_PHP_74
124+
* The INLINE_PUBLIC value is default to false to avoid BC break,
125+
* if you use for libraries and want to preserve BC break, you don't
126+
* need to configure it, as it included in LevelSetList::UP_TO_PHP_74
117127
* Set to true for projects that allow BC break
118128
*/
119129
TypedPropertyFromAssignsRector::INLINE_PUBLIC => true,

src/docker/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
- PostgreSQL 13
66
- SQL Server 2019
7-
- MySQL 5.7
7+
- MySQL 8.0
8+
- Oracle Database 21c XE
89
- MailHog
910

1011
## Usage
@@ -67,6 +68,25 @@ database.default.DBDriver = MySQLi
6768
database.default.port = 3306
6869
```
6970

71+
### Oracle
72+
73+
#### .env
74+
75+
```
76+
NLS_LANG = 'AMERICAN_AMERICA.UTF8'
77+
NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
78+
NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
79+
NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
80+
database.default.DSN = localhost:1521/XEPDB1
81+
database.default.hostname =
82+
database.default.database =
83+
database.default.username = ORACLE
84+
database.default.password = ORACLE
85+
database.default.DBDriver = OCI8
86+
database.default.charset = AL32UTF8
87+
database.default.port = 1521
88+
```
89+
7090
### MailHog
7191

7292
#### .env

src/docker/docker-compose.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
MSSQL_PID: Developer
2121

2222
mysql:
23-
image: mysql:5.7
23+
image: mysql:8.0
2424
ports:
2525
- "3306:3306"
2626
environment:
@@ -29,6 +29,15 @@ services:
2929
MYSQL_USER: mysql
3030
MYSQL_PASSWORD: mysql
3131

32+
oracle:
33+
image: gvenzl/oracle-xe:21
34+
ports:
35+
- "1521:1521"
36+
environment:
37+
ORACLE_RANDOM_PASSWORD: true
38+
APP_USER: ORACLE
39+
APP_USER_PASSWORD: ORACLE
40+
3241
mailhog:
3342
image: mailhog/mailhog
3443
ports:

0 commit comments

Comments
 (0)