From cd2c4274ad07e4eee720e4ddb4c213d059b58ea8 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:39:30 -0300 Subject: [PATCH 1/5] feat(dev): Add `php-forge/coding-standard` to development dependencies for code quality checks. (#229) --- CHANGELOG.md | 1 + composer.json | 9 +- composer.lock | 162 +++++++++++++++++--------- docs/development.md | 2 - ecs.php | 89 ++------------ rector.php | 18 +-- src/usecase/Controller.php | 4 +- src/usecase/hello/HelloController.php | 4 +- 8 files changed, 124 insertions(+), 165 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f57d3f2..f166c92c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Bug #217: Add copyright and license information to various files for compliance (@terabytesoftw) - Bug #220: Update `php-forge/foxy` version and add missing composer assets in `package.json` (@terabytesoftw) - Bug #223: Remove outdated composer asset dependencies from `package.json` (@terabytesoftw) +- Enh #229: Add `php-forge/coding-standard` to development dependencies for code quality checks (@terabytesoftw) ## 0.1.2 October 8, 2025 diff --git a/composer.json b/composer.json index bd1f6440..9df2c16c 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "license": "BSD-3-Clause", "require": { "php": ">=8.1", - "php-forge/foxy": "^0.2@dev", + "php-forge/foxy": "^0.2", "ui-awesome/html-svg": "^0.3", "vlucas/phpdotenv": "^5.6", "yiisoft/yii2": "^2.0.54|^22", @@ -28,12 +28,11 @@ "codeception/module-yii2": "^1.1", "codeception/verify": "^3.0", "maglnet/composer-require-checker": "^4.6", + "php-forge/coding-standard": "^0.1", "phpstan/extension-installer": "^1.4", "phpstan/phpstan-strict-rules": "^2.0.3", - "rector/rector": "^2.0", "symfony/browser-kit": "^6.3", "symfony/process": "^6.3", - "symplify/easy-coding-standard": "^13.0", "yii2-extensions/phpstan": "^0.3.0", "yiisoft/yii2-debug": "^2.1.27|^22", "yiisoft/yii2-gii": "^2.2.7|^22" @@ -71,11 +70,9 @@ "curl -fsSL -o .editorconfig https://raw.githubusercontent.com/yii2-extensions/template/main/.editorconfig", "curl -fsSL -o .gitattributes https://raw.githubusercontent.com/yii2-extensions/template/main/.gitattributes", "curl -fsSL -o .gitignore https://raw.githubusercontent.com/yii2-extensions/template/main/.gitignore", - "curl -fsSL -o ecs.php https://raw.githubusercontent.com/yii2-extensions/template/main/ecs.php", "curl -fsSL -o infection.json5 https://raw.githubusercontent.com/yii2-extensions/template/main/infection.json5", "curl -fsSL -o phpstan.neon https://raw.githubusercontent.com/yii2-extensions/template/main/phpstan.neon", - "curl -fsSL -o phpunit.xml.dist https://raw.githubusercontent.com/yii2-extensions/template/main/phpunit.xml.dist", - "curl -fsSL -o rector.php https://raw.githubusercontent.com/yii2-extensions/template/main/rector.php" + "curl -fsSL -o phpunit.xml.dist https://raw.githubusercontent.com/yii2-extensions/template/main/phpunit.xml.dist" ], "tests": "./vendor/bin/codecept run --env php-builtin" } diff --git a/composer.lock b/composer.lock index 5aa91ed9..bcaf7cf1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "85c97604493a7ee7a5543584e0f51f04", + "content-hash": "15f1f55e055cec6430d8990101742c91", "packages": [ { "name": "cebe/markdown", @@ -220,12 +220,12 @@ "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "4fa255cafa099309f2511fd8933710c1e9631112" + "reference": "285ea67245692ec23529f47a2264cd2c95bad3d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/4fa255cafa099309f2511fd8933710c1e9631112", - "reference": "4fa255cafa099309f2511fd8933710c1e9631112", + "url": "https://api.github.com/repos/composer/composer/zipball/285ea67245692ec23529f47a2264cd2c95bad3d3", + "reference": "285ea67245692ec23529f47a2264cd2c95bad3d3", "shasum": "" }, "require": { @@ -326,7 +326,7 @@ "type": "github" } ], - "time": "2026-01-22T10:17:40+00:00" + "time": "2026-01-22T13:08:50+00:00" }, { "name": "composer/metadata-minifier", @@ -1012,16 +1012,16 @@ }, { "name": "php-forge/foxy", - "version": "dev-main", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/php-forge/foxy.git", - "reference": "583be98644ccb18ca10f0cffa8c0c804f2bc0650" + "reference": "78d5922c2c57a8fd7f8a9d992731c0620d1be03b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-forge/foxy/zipball/583be98644ccb18ca10f0cffa8c0c804f2bc0650", - "reference": "583be98644ccb18ca10f0cffa8c0c804f2bc0650", + "url": "https://api.github.com/repos/php-forge/foxy/zipball/78d5922c2c57a8fd7f8a9d992731c0620d1be03b", + "reference": "78d5922c2c57a8fd7f8a9d992731c0620d1be03b", "shasum": "" }, "require": { @@ -1035,18 +1035,22 @@ }, "require-dev": { "maglnet/composer-require-checker": "^4.7", - "php-forge/support": "^0.1", + "php-forge/coding-standard": "^0.1", + "php-forge/support": "^0.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-strict-rules": "^2.0.3", "phpunit/phpunit": "^10.5", - "symplify/easy-coding-standard": "^12.5", - "vimeo/psalm": "^5.26.1|^6.4.1", "xepozz/internal-mocker": "^1.4" }, - "default-branch": true, + "suggest": { + "infection/infection": "Mutation testing" + }, "type": "composer-plugin", "extra": { "class": "Foxy\\Foxy", "branch-alias": { - "dev-main": "0.2.x-dev" + "dev-main": "0.3.x-dev" } }, "autoload": { @@ -1056,7 +1060,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "description": "Fast, reliable, and secure Bun/NPM/Yarn/pnpm bridge for Composer", "homepage": "https://github.com/fxpio/foxy", @@ -1073,7 +1077,7 @@ ], "support": { "issues": "https://github.com/php-forge/foxy/issues", - "source": "https://github.com/php-forge/foxy/tree/main" + "source": "https://github.com/php-forge/foxy/tree/0.2.0" }, "funding": [ { @@ -1081,7 +1085,7 @@ "type": "github" } ], - "time": "2026-01-22T11:05:42+00:00" + "time": "2026-01-24T22:09:11+00:00" }, { "name": "phpoption/phpoption", @@ -2976,16 +2980,16 @@ }, { "name": "ui-awesome/html-mixin", - "version": "0.3.1", + "version": "0.3.2", "source": { "type": "git", "url": "https://github.com/ui-awesome/html-mixin.git", - "reference": "71342118e77ec88e2ef6d550051051e6fe91325e" + "reference": "0d43b4909e80a8d8fd92997508f0273bf9149639" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ui-awesome/html-mixin/zipball/71342118e77ec88e2ef6d550051051e6fe91325e", - "reference": "71342118e77ec88e2ef6d550051051e6fe91325e", + "url": "https://api.github.com/repos/ui-awesome/html-mixin/zipball/0d43b4909e80a8d8fd92997508f0273bf9149639", + "reference": "0d43b4909e80a8d8fd92997508f0273bf9149639", "shasum": "" }, "require": { @@ -2996,12 +3000,11 @@ "require-dev": { "infection/infection": "^0.27|^0.32", "maglnet/composer-require-checker": "^4.1", + "php-forge/coding-standard": "^0.1", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2.1", "phpstan/phpstan-strict-rules": "^2.0.3", - "phpunit/phpunit": "^10.5", - "rector/rector": "^2.2", - "symplify/easy-coding-standard": "^13.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { @@ -3018,31 +3021,32 @@ "license": [ "BSD-3-Clause" ], - "description": "UI Awesome HTML Mixin for PHP.", + "description": "UI Awesome HTML Mixin Library for PHP.", "keywords": [ "html", + "library", "mixin", "php", "ui-awesome" ], "support": { "issues": "https://github.com/ui-awesome/html-mixin/issues", - "source": "https://github.com/ui-awesome/html-mixin/tree/0.3.1" + "source": "https://github.com/ui-awesome/html-mixin/tree/0.3.2" }, - "time": "2026-01-20T07:55:06+00:00" + "time": "2026-01-24T22:07:39+00:00" }, { "name": "ui-awesome/html-svg", - "version": "0.3.0", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/ui-awesome/html-svg.git", - "reference": "f80e83c7adadd7837778e8a184b5b35636e74ff4" + "reference": "305ea6ea3229ca8b1282396b222bf058b4790dc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ui-awesome/html-svg/zipball/f80e83c7adadd7837778e8a184b5b35636e74ff4", - "reference": "f80e83c7adadd7837778e8a184b5b35636e74ff4", + "url": "https://api.github.com/repos/ui-awesome/html-svg/zipball/305ea6ea3229ca8b1282396b222bf058b4790dc1", + "reference": "305ea6ea3229ca8b1282396b222bf058b4790dc1", "shasum": "" }, "require": { @@ -3059,13 +3063,12 @@ "require-dev": { "infection/infection": "^0.27|^0.32", "maglnet/composer-require-checker": "^4.1", + "php-forge/coding-standard": "^0.1", "php-forge/support": "^0.3", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2.1", "phpstan/phpstan-strict-rules": "^2.0.3", - "phpunit/phpunit": "^10.5", - "rector/rector": "^2.2", - "symplify/easy-coding-standard": "^13.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { @@ -3082,7 +3085,7 @@ "license": [ "BSD-3-Clause" ], - "description": "UI Awesome HTML SVG library for PHP.", + "description": "UI Awesome HTML SVG Library for PHP.", "keywords": [ "html", "library", @@ -3092,7 +3095,7 @@ ], "support": { "issues": "https://github.com/ui-awesome/html-svg/issues", - "source": "https://github.com/ui-awesome/html-svg/tree/0.3.0" + "source": "https://github.com/ui-awesome/html-svg/tree/0.3.1" }, "funding": [ { @@ -3100,7 +3103,7 @@ "type": "github" } ], - "time": "2026-01-20T11:05:17+00:00" + "time": "2026-01-24T22:17:17+00:00" }, { "name": "vlucas/phpdotenv", @@ -4937,6 +4940,52 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-forge/coding-standard", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-forge/coding-standard.git", + "reference": "94ec5394846284124483ad971725e0b5709c1079" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-forge/coding-standard/zipball/94ec5394846284124483ad971725e0b5709c1079", + "reference": "94ec5394846284124483ad971725e0b5709c1079", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "rector/rector": "^2.1", + "symplify/easy-coding-standard": "^13.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "PHPForge\\CodingStandard\\": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Coding standards for PHP projects.", + "keywords": [ + "coding-standard", + "php", + "yii2" + ], + "support": { + "issues": "https://github.com/php-forge/coding-standard/issues", + "source": "https://github.com/php-forge/coding-standard/tree/0.1.0" + }, + "time": "2026-01-24T17:29:00+00:00" + }, { "name": "phpspec/php-diff", "version": "v1.1.3", @@ -5032,8 +5081,8 @@ "version": "2.1.x-dev", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16cf288c4594ba9dca7feddcde330331717835d7", - "reference": "16cf288c4594ba9dca7feddcde330331717835d7", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1a29c005258c0c991358d8ef6ca7b6acc78bdb10", + "reference": "1a29c005258c0c991358d8ef6ca7b6acc78bdb10", "shasum": "" }, "require": { @@ -5079,7 +5128,7 @@ "type": "github" } ], - "time": "2026-01-22T07:50:05+00:00" + "time": "2026-01-24T22:10:34+00:00" }, { "name": "phpstan/phpstan-strict-rules", @@ -5518,12 +5567,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5240ea866cd10c15135b8a9b3b8703b447d2ed07" + "reference": "79dee3d2685b80518e94b9ea741b3f822b213a5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5240ea866cd10c15135b8a9b3b8703b447d2ed07", - "reference": "5240ea866cd10c15135b8a9b3b8703b447d2ed07", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79dee3d2685b80518e94b9ea741b3f822b213a5e", + "reference": "79dee3d2685b80518e94b9ea741b3f822b213a5e", "shasum": "" }, "require": { @@ -5543,7 +5592,7 @@ "phpunit/php-text-template": "^5.0.0", "phpunit/php-timer": "^8.0.0", "sebastian/cli-parser": "^4.2.0", - "sebastian/comparator": "^7.1.3", + "sebastian/comparator": "^7.1.4", "sebastian/diff": "^7.0.0", "sebastian/environment": "^8.0.3", "sebastian/exporter": "^7.0.2", @@ -5591,7 +5640,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.7" }, "funding": [ { @@ -5615,7 +5664,7 @@ "type": "tidelift" } ], - "time": "2026-01-22T04:43:43+00:00" + "time": "2026-01-24T16:12:53+00:00" }, { "name": "psr/event-dispatcher", @@ -5838,12 +5887,12 @@ "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "6bd1bfd66c5d84774e5bb7a8ceda4289aac93169" + "reference": "ae78336dec4dc3623d3c84f590585f1eec923d28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/6bd1bfd66c5d84774e5bb7a8ceda4289aac93169", - "reference": "6bd1bfd66c5d84774e5bb7a8ceda4289aac93169", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/ae78336dec4dc3623d3c84f590585f1eec923d28", + "reference": "ae78336dec4dc3623d3c84f590585f1eec923d28", "shasum": "" }, "require": { @@ -5910,7 +5959,7 @@ "issues": "https://github.com/bobthecow/psysh/issues", "source": "https://github.com/bobthecow/psysh/tree/main" }, - "time": "2026-01-07T23:02:52+00:00" + "time": "2026-01-23T15:00:11+00:00" }, { "name": "ralouphie/getallheaders", @@ -6091,12 +6140,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "029d0f03dc37cb6e8ba1cffd3150ddc74ade37b6" + "reference": "740247c4b621becf9e52da7eb6ae64c3f7c32dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/029d0f03dc37cb6e8ba1cffd3150ddc74ade37b6", - "reference": "029d0f03dc37cb6e8ba1cffd3150ddc74ade37b6", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/740247c4b621becf9e52da7eb6ae64c3f7c32dad", + "reference": "740247c4b621becf9e52da7eb6ae64c3f7c32dad", "shasum": "" }, "require": { @@ -6175,7 +6224,7 @@ "type": "tidelift" } ], - "time": "2025-12-31T13:44:11+00:00" + "time": "2026-01-24T09:33:40+00:00" }, { "name": "sebastian/complexity", @@ -7447,6 +7496,7 @@ "symfony/uid": "^7.4|^8.0", "twig/twig": "^3.12" }, + "default-branch": true, "bin": [ "Resources/bin/var-dump-server" ], @@ -8010,9 +8060,7 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "php-forge/foxy": 20 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docs/development.md b/docs/development.md index dfb83e9d..8682e215 100644 --- a/docs/development.md +++ b/docs/development.md @@ -20,11 +20,9 @@ This command updates the following configuration files: | `.editorconfig` | Editor settings and code style configuration | | `.gitattributes` | Git attributes and file handling rules | | `.gitignore` | Git ignore patterns and exclusions | -| `ecs.php` | Easy Coding Standard configuration | | `infection.json5` | Infection mutation testing configuration | | `phpstan.neon` | PHPStan static analysis configuration | | `phpunit.xml.dist` | PHPUnit test configuration | -| `rector.php` | Rector refactoring configuration | ### When to Run diff --git a/ecs.php b/ecs.php index 726b0dd2..300b0b5e 100644 --- a/ecs.php +++ b/ecs.php @@ -2,85 +2,12 @@ declare(strict_types=1); -use PhpCsFixer\Fixer\ClassNotation\{ClassDefinitionFixer, OrderedClassElementsFixer, OrderedTraitsFixer}; -use PhpCsFixer\Fixer\Import\{NoUnusedImportsFixer, OrderedImportsFixer}; -use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer; -use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer; -use PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer; -use Symplify\EasyCodingStandard\Config\ECSConfig; +/** @var \Symplify\EasyCodingStandard\Configuration\ECSConfigBuilder $ecsConfigBuilder */ +$ecsConfigBuilder = require __DIR__ . '/vendor/php-forge/coding-standard/config/ecs.php'; -return ECSConfig::configure() - ->withConfiguredRule( - ClassDefinitionFixer::class, - [ - 'space_before_parenthesis' => true, - ], - ) - ->withConfiguredRule( - OrderedClassElementsFixer::class, - [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'case', - 'property_public', - 'property_protected', - 'property_private', - 'construct', - 'destruct', - 'magic', - 'method_protected_abstract', - 'method_public', - 'method_protected', - 'method_private', - ], - 'sort_algorithm' => 'alpha', - ], - ) - ->withConfiguredRule( - OrderedImportsFixer::class, - [ - 'imports_order' => [ - 'class', - 'function', - 'const', - ], - 'sort_algorithm' => 'alpha', - ], - ) - ->withConfiguredRule( - PhpdocTypesOrderFixer::class, - [ - 'sort_algorithm' => 'none', - 'null_adjustment' => 'always_last', - ], - ) - ->withFileExtensions(['php']) - ->withPaths( - [ - __DIR__ . '/src', - __DIR__ . '/tests', - ], - ) - ->withPhpCsFixerSets(perCS30: true) - ->withPreparedSets( - cleanCode: true, - comments: true, - docblocks: true, - namespaces: true, - strict: true, - ) - ->withRules( - [ - NoUnusedImportsFixer::class, - OrderedTraitsFixer::class, - SingleQuoteFixer::class, - ] - ) - ->withSkip( - [ - NullableTypeDeclarationFixer::class, - ] - ); +return $ecsConfigBuilder->withPaths( + [ + __DIR__ . '/src', + __DIR__ . '/tests', + ], +); diff --git a/rector.php b/rector.php index 4a7a938c..6fce6678 100644 --- a/rector.php +++ b/rector.php @@ -2,10 +2,10 @@ declare(strict_types=1); -return static function (Rector\Config\RectorConfig $rectorConfig): void { - $rectorConfig->parallel(); +use Rector\Config\RectorConfig; - $rectorConfig->importNames(); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->import(__DIR__ . '/vendor/php-forge/coding-standard/config/rector.php'); $rectorConfig->paths( [ @@ -13,16 +13,4 @@ __DIR__ . '/tests', ], ); - - $rectorConfig->sets( - [ - Rector\Set\ValueObject\SetList::PHP_81, - Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_81, - Rector\Set\ValueObject\SetList::TYPE_DECLARATION, - ], - ); - - $rectorConfig->rule( - Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector::class - ); }; diff --git a/src/usecase/Controller.php b/src/usecase/Controller.php index c11e1548..ba529474 100644 --- a/src/usecase/Controller.php +++ b/src/usecase/Controller.php @@ -5,12 +5,12 @@ namespace app\usecase; use yii\filters\VerbFilter; -use yii\web\ErrorAction; +use yii\web\{Application, ErrorAction}; /** * Base web controller for application use cases. * - * @extends \yii\web\Controller<\yii\web\Application> + * @extends \yii\web\Controller * * @copyright Copyright (C) 2025 Terabytesoftw. * @license https://opensource.org/license/bsd-3-clause BSD 3-Clause License. diff --git a/src/usecase/hello/HelloController.php b/src/usecase/hello/HelloController.php index a87d5e7c..d155cd87 100644 --- a/src/usecase/hello/HelloController.php +++ b/src/usecase/hello/HelloController.php @@ -4,12 +4,12 @@ namespace app\usecase\hello; -use yii\console\{Controller, ExitCode}; +use yii\console\{Application, Controller, ExitCode}; /** * Hello console controller. * - * @extends \yii\console\Controller<\yii\console\Application> + * @extends Controller * * @copyright Copyright (C) 2025 Terabytesoftw. * @license https://opensource.org/license/bsd-3-clause BSD 3-Clause License. From 32e59734b7f099360209212bcda9c5a4157bf17c Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Sat, 24 Jan 2026 23:38:06 -0300 Subject: [PATCH 2/5] fix(docs): Add section for automated refactoring using `Rector` in testing documentation. (#230) --- CHANGELOG.md | 1 + docs/testing.md | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f166c92c..067216d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Bug #220: Update `php-forge/foxy` version and add missing composer assets in `package.json` (@terabytesoftw) - Bug #223: Remove outdated composer asset dependencies from `package.json` (@terabytesoftw) - Enh #229: Add `php-forge/coding-standard` to development dependencies for code quality checks (@terabytesoftw) +- Bug #230: Add section for automated refactoring using `Rector` in testing documentation (@terabytesoftw) ## 0.1.2 October 8, 2025 diff --git a/docs/testing.md b/docs/testing.md index 35bb95fe..1cd39934 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -8,6 +8,15 @@ Tool references: - [Composer Require Checker](https://github.com/maglnet/ComposerRequireChecker) for dependency definition checks. - [Easy Coding Standard (ECS)](https://github.com/easy-coding-standard/easy-coding-standard) for coding standards. - [PHPStan](https://phpstan.org/) for static analysis. +- [Rector](https://github.com/rectorphp/rector) for automated refactoring. + +## Automated refactoring (Rector) + +Run Rector to apply automated code refactoring. + +```bash +composer run rector +``` ## Coding standards (ECS) From f49cce5d0cebd1c41e672a9ab675ceb725836d65 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Fri, 20 Feb 2026 20:56:43 -0300 Subject: [PATCH 3/5] feat(linters): Add `.codespellrc` configuration to skip specific files and directories for spell checking. (#236) --- .github/linters/.codespellrc | 2 ++ CHANGELOG.md | 1 + 2 files changed, 3 insertions(+) create mode 100644 .github/linters/.codespellrc diff --git a/.github/linters/.codespellrc b/.github/linters/.codespellrc new file mode 100644 index 00000000..1375eee6 --- /dev/null +++ b/.github/linters/.codespellrc @@ -0,0 +1,2 @@ +[codespell] +skip = */tests/*,tests/**,*/composer.lock,*/composer.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 067216d9..e0056c4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Bug #223: Remove outdated composer asset dependencies from `package.json` (@terabytesoftw) - Enh #229: Add `php-forge/coding-standard` to development dependencies for code quality checks (@terabytesoftw) - Bug #230: Add section for automated refactoring using `Rector` in testing documentation (@terabytesoftw) +- Enh #236: Add `.codespellrc` configuration to skip specific files and directories for spell checking (@terabytesoftw) ## 0.1.2 October 8, 2025 From 5a2cbd53644e81e8828b0bae946446b7dc15c26f Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Fri, 20 Feb 2026 21:22:08 -0300 Subject: [PATCH 4/5] fix(dependencies): Update PHP requirement to `8.2` in `composer.json` and adjust PHP versions in `build.yml`. (#237) --- .github/workflows/build.yml | 1 + CHANGELOG.md | 1 + README.md | 4 ++-- composer.json | 2 +- docs/installation.md | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f270c8b..d24e90b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,3 +25,4 @@ jobs: codeception-command: vendor/bin/codecept run --env php-builtin --coverage-xml coverage-file: runtime/output/coverage.xml extensions: gd, intl, pcov + php-version: '["8.2","8.3","8.4","8.5"]' diff --git a/CHANGELOG.md b/CHANGELOG.md index e0056c4e..9bd778cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Enh #229: Add `php-forge/coding-standard` to development dependencies for code quality checks (@terabytesoftw) - Bug #230: Add section for automated refactoring using `Rector` in testing documentation (@terabytesoftw) - Enh #236: Add `.codespellrc` configuration to skip specific files and directories for spell checking (@terabytesoftw) +- Enh #237: Update PHP requirement to `8.2` in `composer.json` and adjust PHP versions in `build.yml` (@terabytesoftw) ## 0.1.2 October 8, 2025 diff --git a/README.md b/README.md index 571cc5df..90d5bb44 100644 --- a/README.md +++ b/README.md @@ -155,8 +155,8 @@ final class SiteController extends Controller ## Package information -[![PHP](https://img.shields.io/badge/%3E%3D8.1-777BB4.svg?style=for-the-badge&logo=php&logoColor=white)](https://www.php.net/releases/8.1/en.php) -[![Yii 2.0.x](https://img.shields.io/badge/2.0.53-0073AA.svg?style=for-the-badge&logo=yii&logoColor=white)](https://github.com/yiisoft/yii2/tree/2.0.53) +[![PHP](https://img.shields.io/badge/%3E%3D8.2-777BB4.svg?style=for-the-badge&logo=php&logoColor=white)](https://www.php.net/releases/8.2/en.php) +[![Yii 2.0.x](https://img.shields.io/badge/2.0.54-0073AA.svg?style=for-the-badge&logo=yii&logoColor=white)](https://github.com/yiisoft/yii2/tree/2.0.54) [![Yii 22.0.x](https://img.shields.io/badge/22.0.x-0073AA.svg?style=for-the-badge&logo=yii&logoColor=white)](https://github.com/yiisoft/yii2/tree/22.0) [![Latest Stable Version](https://img.shields.io/packagist/v/yii2-extensions/app-basic.svg?style=for-the-badge&logo=packagist&logoColor=white&label=Stable)](https://packagist.org/packages/yii2-extensions/app-basic) [![Total Downloads](https://img.shields.io/packagist/dt/yii2-extensions/app-basic.svg?style=for-the-badge&logo=composer&logoColor=white&label=Downloads)](https://packagist.org/packages/yii2-extensions/app-basic) diff --git a/composer.json b/composer.json index 9df2c16c..46b0bde6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "minimum-stability": "dev", "license": "BSD-3-Clause", "require": { - "php": ">=8.1", + "php": ">=8.2", "php-forge/foxy": "^0.2", "ui-awesome/html-svg": "^0.3", "vlucas/phpdotenv": "^5.6", diff --git a/docs/installation.md b/docs/installation.md index 0b061d17..3e41420b 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,10 +2,10 @@ ## System requirements -- [`PHP`](https://www.php.net/downloads) 8.1 or higher. +- [`PHP`](https://www.php.net/downloads) 8.2 or higher. - [`Composer`](https://getcomposer.org/download/) for dependency management. - [`npm`](https://nodejs.org/en/download/) for frontend dependency management. -- [`Yii2`](https://github.com/yiisoft/yii2) 2.0.53+ or 22.x. +- [`Yii2`](https://github.com/yiisoft/yii2) 2.0.54+ or 22.x. ### Optional requirements From cb9d59434bdd8825ea7be4bc45689594bc94beda Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Fri, 20 Feb 2026 21:28:55 -0300 Subject: [PATCH 5/5] fix(readme): Remove Codecov badge from `README.md`. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 45d88c5b..989964d7 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,6 @@ final class SiteController extends Controller ## Quality code -[![Codecov](https://img.shields.io/codecov/c/github/yii2-extensions/app-basic.svg?branch=main&style=for-the-badge&logo=codecov&logoColor=white&label=Coverage)](https://codecov.io/github/yii2-extensions/app-basic) [![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml?query=branch%3Afranken-php) [![Super-Linter](https://img.shields.io/github/actions/workflow/status/yii2-extensions/app-basic/linter.yml?style=for-the-badge&label=Super-Linter&logo=github)](https://github.com/yii2-extensions/app-basic/actions/workflows/linter.yml?query=branch%3Afranken-php) [![StyleCI](https://img.shields.io/badge/StyleCI-Passed-44CC11.svg?style=for-the-badge&logo=styleci&logoColor=white)](https://github.styleci.io/repos/165419144?branch=franken-php)