Skip to content

Commit d4ac84b

Browse files
authored
Merge pull request #116 from codeigniter4/develop
Prep for Release v1.1.2
2 parents dcd1c28 + 92f977d commit d4ac84b

20 files changed

+69
-100
lines changed

.github/workflows/phpcsfixer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Set up PHP
2828
uses: shivammathur/setup-php@v2
@@ -31,7 +31,7 @@ jobs:
3131
extensions: json, tokenizer
3232
coverage: none
3333
env:
34-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535

3636
- name: Get composer cache directory
3737
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434

3535
- name: Setup PHP
3636
uses: shivammathur/setup-php@v2
@@ -40,7 +40,7 @@ jobs:
4040
extensions: intl, json, mbstring, xml
4141
coverage: none
4242
env:
43-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444

4545
- name: Get composer cache directory
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

.github/workflows/psalm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030

3131
- name: Setup PHP
3232
uses: shivammathur/setup-php@v2
@@ -36,7 +36,7 @@ jobs:
3636
extensions: intl, json, mbstring, xml
3737
coverage: none
3838
env:
39-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040

4141
- name: Get composer cache directory
4242
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

.github/workflows/rector.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434

3535
- name: Set up PHP
3636
uses: shivammathur/setup-php@v2
@@ -40,7 +40,7 @@ jobs:
4040
extensions: intl, json, mbstring, xml
4141
coverage: none
4242
env:
43-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444

4545
- name: Get composer cache directory
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
@@ -61,6 +61,4 @@ jobs:
6161
fi
6262
6363
- name: Analyze for refactoring
64-
run: |
65-
composer global require --dev rector/rector:^0.15.1
66-
rector process --dry-run --no-progress-bar
64+
run: vendor/bin/rector process --dry-run --no-progress-bar

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ Development toolkit for CodeIgniter libraries and projects
44

55
## Installation
66

7-
* Install via Composer: `> composer require --dev codeigniter4/devkit`
7+
Install via Composer:
8+
9+
```console
10+
composer config minimum-stability dev
11+
composer config prefer-stable true
12+
composer require --dev codeigniter4/devkit
13+
```
814

915
## Included Dependencies
1016

@@ -137,8 +143,11 @@ predefined rulesets. Rector can be highly opinionated based on its configuration
137143
so be sure to read the documentation and figure out the best fit for you. This workflow performs
138144
a "dry run" to check for any changes that Rector would have made and fail if there are matches.
139145

140-
> Note: Rector updates rules all the time so you may want to lock your repo to the latest known working version of Rector to prevent unexpected failures
141-
> E.g. in **Template/.github/workflows/rector.yml** supply the specific minor patch: `composer global require --dev rector/rector:0.12.16`
146+
> **Note**
147+
> Rector updates rules all the time, so you may want to lock your repo to
148+
> the latest known working version of Rector to prevent unexpected failures.
149+
> Using pinned version in `composer.json` and update it with dependabot is the
150+
> best practice.
142151
143152
#### Unused
144153

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
"fakerphp/faker": "^1.9",
2828
"mikey179/vfsstream": "^1.6",
2929
"nexusphp/cs-config": "^3.6",
30-
"nexusphp/tachycardia": "^1.0",
30+
"nexusphp/tachycardia": "^1.3",
3131
"phpstan/extension-installer": "^1.1",
3232
"phpstan/phpstan": "^1.0",
3333
"phpstan/phpstan-deprecation-rules": "^1.0",
3434
"phpstan/phpstan-phpunit": "^1.0",
3535
"phpunit/phpunit": "^9.3",
3636
"roave/security-advisories": "dev-latest",
37-
"vimeo/psalm": "^5.0"
37+
"vimeo/psalm": "^5.0",
38+
"rector/rector": "^0.18.3"
3839
},
3940
"require-dev": {
4041
"codeigniter4/framework": "^4.1",
41-
"icanhazstring/composer-unused": "^0.8.2",
42-
"rector/rector": "0.15.1"
42+
"icanhazstring/composer-unused": "^0.8.2"
4343
},
4444
"minimum-stability": "dev",
4545
"prefer-stable": true,
@@ -50,6 +50,7 @@
5050
},
5151
"scripts": {
5252
"analyze": [
53+
"Composer\\Config::disableProcessTimeout",
5354
"phpstan analyze",
5455
"psalm",
5556
"rector process --dry-run"

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
autoloader="psalm_autoload.php"
99
cacheDirectory="build/psalm/"
10+
findUnusedBaselineEntry="true"
11+
findUnusedCode="false"
1012
>
1113
<projectFiles>
1214
<directory name="src/" />

rector.php

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
46
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
57
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
6-
use Rector\CodeQuality\Rector\For_\ForToForeachRector;
78
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
8-
use Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector;
99
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
1010
use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector;
1111
use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector;
@@ -21,18 +21,17 @@
2121
use Rector\Config\RectorConfig;
2222
use Rector\Core\ValueObject\PhpVersion;
2323
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
24-
use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector;
2524
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
2625
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
2726
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
2827
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
2928
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
30-
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
3129
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
3230
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
31+
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector;
32+
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
3333
use Rector\PHPUnit\Set\PHPUnitSetList;
3434
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
35-
use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector;
3635
use Rector\Set\ValueObject\LevelSetList;
3736
use Rector\Set\ValueObject\SetList;
3837
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
@@ -41,7 +40,7 @@
4140
$rectorConfig->sets([
4241
SetList::DEAD_CODE,
4342
LevelSetList::UP_TO_PHP_74,
44-
PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD,
43+
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
4544
PHPUnitSetList::PHPUNIT_100,
4645
]);
4746

@@ -78,25 +77,14 @@
7877

7978
JsonThrowOnErrorRector::class,
8079
StringifyStrNeedlesRector::class,
80+
YieldDataProviderRector::class,
8181

8282
// Note: requires php 8
8383
RemoveUnusedPromotedPropertyRector::class,
84-
85-
// Ignore tests that might make calls without a result
86-
RemoveEmptyMethodCallRector::class => [
87-
__DIR__ . '/tests',
88-
],
89-
90-
// Ignore files that should not be namespaced to their folder
91-
NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [
92-
__DIR__ . '/src/Helpers',
93-
],
84+
AnnotationWithValueToAttributeRector::class,
9485

9586
// May load view files directly when detecting classes
9687
StringClassNameToClassConstantRector::class,
97-
98-
// May be uninitialized on purpose
99-
AddDefaultValueForUndefinedVariableRector::class,
10088
]);
10189

10290
// auto import fully qualified class names
@@ -105,7 +93,6 @@
10593
$rectorConfig->rule(SimplifyUselessVariableRector::class);
10694
$rectorConfig->rule(RemoveAlwaysElseRector::class);
10795
$rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class);
108-
$rectorConfig->rule(ForToForeachRector::class);
10996
$rectorConfig->rule(ChangeNestedForeachIfsToEarlyContinueRector::class);
11097
$rectorConfig->rule(ChangeIfElseValueAssignToEarlyReturnRector::class);
11198
$rectorConfig->rule(SimplifyStrposLowerRector::class);
@@ -118,12 +105,10 @@
118105
$rectorConfig->rule(UnusedForeachValueToArrayKeysRector::class);
119106
$rectorConfig->rule(ChangeArrayPushToArrayAssignRector::class);
120107
$rectorConfig->rule(UnnecessaryTernaryExpressionRector::class);
121-
$rectorConfig->rule(AddPregQuoteDelimiterRector::class);
122108
$rectorConfig->rule(SimplifyRegexPatternRector::class);
123109
$rectorConfig->rule(FuncGetArgsToVariadicParamRector::class);
124110
$rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class);
125111
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
126-
$rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class);
127112
$rectorConfig
128113
->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
129114
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030

3131
- name: Set up PHP
3232
uses: shivammathur/setup-php@v2
@@ -36,7 +36,7 @@ jobs:
3636
extensions: intl, json, mbstring, xml
3737
coverage: none
3838
env:
39-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040

4141
- name: Get composer cache directory
4242
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ on:
99
- 'composer.*'
1010
- 'phpunit*'
1111
- '.github/workflows/infection.yml'
12-
push:
13-
branches:
14-
- develop
15-
paths:
16-
- '**.php'
17-
- 'composer.*'
18-
- 'phpunit*'
19-
- '.github/workflows/infection.yml'
2012

2113
jobs:
2214
main:
@@ -26,7 +18,7 @@ jobs:
2618

2719
steps:
2820
- name: Checkout
29-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
3022

3123
- name: Set up PHP
3224
uses: shivammathur/setup-php@v2
@@ -36,7 +28,7 @@ jobs:
3628
extensions: intl, json, mbstring, gd, xml, sqlite3
3729
coverage: xdebug
3830
env:
39-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4032

4133
- name: Set up problem matchers for PHPUnit
4234
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
@@ -62,10 +54,7 @@ jobs:
6254
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
6355
fi
6456
65-
- name: Test with PHPUnit
66-
run: vendor/bin/phpunit --teamcity
67-
68-
- name: Mutate with Infection
57+
- name: Run Infection for added files only
6958
run: |
7059
git fetch --depth=1 origin $GITHUB_BASE_REF
71-
infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations
60+
infection --threads=max --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --ignore-msi-with-no-mutations --only-covered --logger-github

src/Template/.github/workflows/phpcpd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Set up PHP
2828
uses: shivammathur/setup-php@v2
@@ -31,7 +31,7 @@ jobs:
3131
extensions: json, tokenizer
3232
coverage: none
3333
env:
34-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535

3636
- name: Get composer cache directory
3737
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
php-versions: ['7.4', '8.0', '8.1']
29+
php-versions: ['7.4', '8.0', '8.1', '8.2']
3030

3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434

3535
- name: Setup PHP
3636
uses: shivammathur/setup-php@v2
@@ -40,7 +40,7 @@ jobs:
4040
extensions: intl, json, mbstring, xml
4141
coverage: none
4242
env:
43-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444

4545
- name: Get composer cache directory
4646
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2626
strategy:
2727
matrix:
28-
php-versions: ['7.4', '8.0', '8.1']
28+
php-versions: ['7.4', '8.0', '8.1', '8.2']
2929

3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333

3434
- name: Set up PHP
3535
uses: shivammathur/setup-php@v2
@@ -39,7 +39,7 @@ jobs:
3939
extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3
4040
coverage: xdebug
4141
env:
42-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343

4444
- name: Get composer cache directory
4545
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
@@ -65,7 +65,7 @@ jobs:
6565
TERM: xterm-256color
6666
TACHYCARDIA_MONITOR_GA: enabled
6767

68-
- if: matrix.php-versions == '8.0'
68+
- if: matrix.php-versions == '8.1'
6969
name: Run Coveralls
7070
continue-on-error: true
7171
run: |

0 commit comments

Comments
 (0)