Skip to content

Prep for Release #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0488f29
Fix logic issue
MGatner Aug 27, 2022
31c1341
Update Rector for PHPUnit level set list
MGatner Aug 27, 2022
0a5ea5d
Merge pull request #41 from codeigniter4/rector-phpunit
MGatner Aug 27, 2022
1cdd278
Merge pull request #42 from codeigniter4/chdir
MGatner Aug 27, 2022
0382c0b
chore: update composer scripts
kenjis Sep 1, 2022
600a725
chore: move @inspect before @analyze
kenjis Sep 1, 2022
7dc4aa4
Merge pull request #43 from kenjis/update-composer-scripts
kenjis Sep 1, 2022
2313447
Indicate library as suitable for require-dev
MGatner Sep 7, 2022
86ceb0b
Merge pull request #45 from codeigniter4/pkg-dev
MGatner Sep 8, 2022
84c94c5
docs: add CONTRIBUTING.md
kenjis Sep 9, 2022
6bd9d04
Merge pull request #46 from kenjis/add-CONTRIBUTING.md
kenjis Sep 9, 2022
77ec239
Update versions
paulbalandan Sep 24, 2022
0a8ab8f
Update rector/rector requirement from 0.14.0 to 0.14.5
dependabot[bot] Sep 30, 2022
e82eba7
Use environment variables instead of `set-output`
paulbalandan Oct 15, 2022
83d7027
Update `set-output` usage in `src/Template/.github/`
paulbalandan Oct 15, 2022
3a6c8ee
Merge pull request #47 from paulbalandan/cs-update
MGatner Oct 16, 2022
510a8a8
Merge pull request #50 from codeigniter4/dependabot/composer/rector/r…
MGatner Oct 16, 2022
b7af44c
Merge pull request #51 from paulbalandan/set-output
paulbalandan Oct 16, 2022
de5d1a7
Update rector/rector requirement from 0.14.5 to 0.14.6
dependabot[bot] Oct 17, 2022
b87b92b
Merge pull request #52 from codeigniter4/dependabot/composer/rector/r…
samsonasik Oct 17, 2022
5564a88
chore(deps-dev): update rector/rector requirement from 0.14.6 to 0.14.7
dependabot[bot] Nov 8, 2022
e5ac7ec
Merge pull request #53 from codeigniter4/dependabot/composer/rector/r…
samsonasik Nov 8, 2022
178edbd
chore(deps-dev): update rector/rector requirement from 0.14.7 to 0.14.8
dependabot[bot] Nov 15, 2022
2e51075
Merge pull request #54 from codeigniter4/dependabot/composer/rector/r…
samsonasik Nov 15, 2022
803b59c
fix: restore current directory
kenjis Nov 17, 2022
354457d
Merge pull request #55 from kenjis/fix-psalm_autoload
MGatner Nov 18, 2022
e20f8ac
chore: update psalm to ^5.0
kenjis Dec 3, 2022
da5290e
Merge pull request #57 from kenjis/update-psalm-5.0
kenjis Dec 4, 2022
e271c31
chore(deps-dev): update rector/rector requirement from 0.14.8 to 0.15.0
dependabot[bot] Dec 5, 2022
8253b86
update deprecated TypedPropertyRector to TypedPropertyFromAssignsRector
samsonasik Dec 5, 2022
2ed9e26
set INLINE_PUBLIC to true as previous config
samsonasik Dec 5, 2022
cf4df09
Fix config rector in template
samsonasik Dec 5, 2022
1358f64
Fix rector config deprecated TypedPropertyRector
samsonasik Dec 5, 2022
47d1968
Merge pull request #58 from codeigniter4/dependabot/composer/rector/r…
samsonasik Dec 5, 2022
29d90f7
chore: add rector.php to php-cs-fixer
kenjis Dec 15, 2022
0bf0998
Update rector version
kenjis Dec 15, 2022
786ef69
Update rector.php
kenjis Dec 15, 2022
6122097
Merge pull request #59 from kenjis/update-rector-0.15.1
samsonasik Dec 15, 2022
ac9359a
[Rector] Update comment usage for TypedPropertyFromAssignsRector
samsonasik Dec 16, 2022
f5ea3a2
Merge pull request #61 from codeigniter4/update-comment-usage-typed-p…
samsonasik Dec 16, 2022
51a46eb
Update php-cs-fixer.dist.php
kenjis Dec 18, 2022
c4726ff
Merge pull request #62 from kenjis/update-php-cs-fixer.dist.php
kenjis Dec 20, 2022
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
5 changes: 2 additions & 3 deletions .github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand All @@ -63,5 +62,5 @@ jobs:

- name: Analyze for refactoring
run: |
composer global require --dev rector/rector:^0.13.8
composer global require --dev rector/rector:^0.15.1
rector process --dry-run --no-progress-bar
5 changes: 4 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
__DIR__ . '/src/',
])
->exclude('build')
->append([__FILE__]);
->append([
__FILE__,
__DIR__ . '/rector.php',
]);

$overrides = [];

Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing to CodeIgniter4

CodeIgniter is a community driven project and accepts contributions of
code and documentation from the community.

If you'd like to contribute, please read [Contributing to CodeIgniter](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/README.md)
in the [main repository](https://github.com/codeigniter4/CodeIgniter4).

If you are going to contribute to this repository, please report bugs or send PRs
to this repository instead of the main repository.
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"devkit",
"toolkit",
"development",
"tools"
"tools",
"static analysis"
],
"authors": [
{
Expand All @@ -22,23 +23,23 @@
"homepage": "https://github.com/codeigniter4/devkit",
"require": {
"php": "^7.4 || ^8.0",
"codeigniter/coding-standard": "^1.1",
"codeigniter/coding-standard": "^1.5",
"fakerphp/faker": "^1.9",
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.1",
"nexusphp/cs-config": "^3.6",
"nexusphp/tachycardia": "^1.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.3",
"roave/security-advisories": "dev-latest",
"vimeo/psalm": "^4.22"
"vimeo/psalm": "^5.0"
},
"require-dev": {
"codeigniter4/framework": "^4.1",
"icanhazstring/composer-unused": "^0.8.2",
"rector/rector": "0.14.0"
"rector/rector": "0.15.1"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -63,10 +64,11 @@
"@test"
],
"cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff",
"cs-fix": "php-cs-fixer fix --ansi --verbose --diff --using-cache=yes",
"cs-fix": "php-cs-fixer fix --ansi --verbose --diff",
"style": "@cs-fix",
"deduplicate": "phpcpd app/ src/",
"inspect": "deptrac analyze --cache-file=build/deptrac.cache",
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit"
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
"test": "phpunit"
}
}
2 changes: 2 additions & 0 deletions psalm_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
require_once $filePath;
}
}

chdir(__DIR__);
33 changes: 26 additions & 7 deletions rector.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Rector\Config\RectorConfig;
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
use Rector\CodeQuality\Rector\For_\ForToForeachRector;
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
Expand All @@ -18,6 +18,7 @@
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector;
Expand All @@ -29,15 +30,23 @@
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::DEAD_CODE, LevelSetList::UP_TO_PHP_74, PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, PHPUnitSetList::PHPUNIT_80]);
$rectorConfig->sets([
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_74,
PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD,
PHPUnitSetList::PHPUNIT_100,
]);

$rectorConfig->parallel();

// The paths to refactor (can also be supplied with CLI arguments)
$rectorConfig->paths([
__DIR__ . '/src/',
Expand Down Expand Up @@ -78,7 +87,7 @@
__DIR__ . '/tests',
],

// Ignore files that should not be namespaced
// Ignore files that should not be namespaced to their folder
NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [
__DIR__ . '/src/Helpers',
],
Expand All @@ -89,6 +98,10 @@
// May be uninitialized on purpose
AddDefaultValueForUndefinedVariableRector::class,
]);

// auto import fully qualified class names
$rectorConfig->importNames();

$rectorConfig->rule(SimplifyUselessVariableRector::class);
$rectorConfig->rule(RemoveAlwaysElseRector::class);
$rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class);
Expand All @@ -112,8 +125,14 @@
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
$rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class);
$rectorConfig
->ruleWithConfiguration(TypedPropertyRector::class, [
// Set to false if you use in libraries, or it does create breaking changes.
TypedPropertyRector::INLINE_PUBLIC => true,
->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
/**
* 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
* Set to true for projects that allow BC break
*/
TypedPropertyFromAssignsRector::INLINE_PUBLIC => true,
]);
$rectorConfig->rule(StringClassNameToClassConstantRector::class);
$rectorConfig->rule(PrivatizeFinalClassPropertyRector::class);
$rectorConfig->rule(CompleteDynamicPropertiesRector::class);
};
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/infection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ jobs:
uses: mheap/phpunit-matcher-action@v1

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
7 changes: 3 additions & 4 deletions src/Template/.github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand All @@ -63,5 +62,5 @@ jobs:

- name: Analyze for refactoring
run: |
composer global require --dev rector/rector:^0.14
composer global require --dev rector/rector:^0.15.1
rector process --dry-run --no-progress-bar
5 changes: 2 additions & 3 deletions src/Template/.github/workflows/unused.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
15 changes: 12 additions & 3 deletions src/Template/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
__DIR__ . '/app/',
__DIR__ . '/tests/',
])
->exclude('build')
->append([__FILE__]);
->exclude([
'build',
'Views',
])
->append([
__FILE__,
__DIR__ . '/rector.php',
]);

$overrides = [];
$overrides = [
// 'declare_strict_types' => true,
// 'void_return' => true,
];

$options = [
'finder' => $finder,
Expand Down
Loading