Skip to content

feat(dev): Add php-forge/coding-standard to development dependencies for code quality checks.#5

Merged
terabytesoftw merged 5 commits into
mainfrom
feature_2
Jan 25, 2026
Merged

feat(dev): Add php-forge/coding-standard to development dependencies for code quality checks.#5
terabytesoftw merged 5 commits into
mainfrom
feature_2

Conversation

@terabytesoftw

@terabytesoftw terabytesoftw commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

Summary by CodeRabbit

  • New Features

    • Added a Development Guide covering maintenance and a command to sync project configuration.
  • Documentation

    • Restructured and expanded the Testing Guide into tool-centric sections.
    • Updated README to link the new Development Guide.
  • Chores

    • Updated development tooling and scripts; integrated a unified coding-standard.
    • Simplified configuration for code-quality and refactoring tools.

✏️ Tip: You can customize this high-level summary in your review settings.

@terabytesoftw terabytesoftw added the enhancement New feature or request label Jan 24, 2026
@coderabbitai

coderabbitai Bot commented Jan 24, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Consolidates tooling by switching to external coding-standard configs, simplifying in-repo ECS/Rector setups, updating composer dev dependencies and scripts (adds sync-metadata), adds [*.xml.dist] to .editorconfig, and expands developer/testing documentation and changelog.

Changes

Cohort / File(s) Summary
Tooling & Config Files
ecs.php, rector.php, .editorconfig, composer.json
Replaces in-file ECS/Rector configuration with external imports; adds [*.xml.dist] section to .editorconfig; adds php-forge/coding-standard to require-dev, removes several dev deps, updates static phpstan memory limit, and adds sync-metadata composer script.
Documentation & Guides
README.md, CHANGELOG.md, docs/testing.md, docs/development.md
Updates README with emoji-prefixed links and new Development Guide entry; adds changelog entry for coding-standard; rewrites testing docs into tool-centric sections; adds docs/development.md documenting the sync-metadata workflow and related maintenance notes.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant Composer as Composer (script)
  participant Remote as Remote Template (HTTP)
  participant FS as Local Filesystem

  Dev->>Composer: run `composer run sync-metadata`
  Composer->>Remote: curl fetch template archive/files
  Remote-->>Composer: return config files (.editorconfig, .gitattributes, .gitignore, phpstan.neon)
  Composer->>FS: write/overwrite files to repo
  FS-->>Dev: files updated (sync complete)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇🧺 I fetched the rules from far away,
Templates hopped in, tidy as day,
ECS and Rector now softly aligned,
Syncing metadata—clean code we find,
A little rabbit cheers tooling refined.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main objective: adding php-forge/coding-standard to development dependencies for code quality checks, which aligns with the primary changes in composer.json and the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@composer.json`:
- Around line 42-47: The composer.json "sync-metadata" script currently fetches
only four files but the docs/development.md claim six; update the
"sync-metadata" script (the "sync-metadata" array in composer.json) to include
the missing curl commands to fetch infection.json5 and phpunit.xml.dist (or
alternatively update docs/development.md to reflect the four-file behavior) so
the script and documentation are consistent—locate the "sync-metadata" entry and
add curl -fsSL -o infection.json5 <url> and curl -fsSL -o phpunit.xml.dist <url>
(or edit the docs to remove the two files).

In `@docs/development.md`:
- Around line 18-25: The file table in docs lists five files but the composer
script named "sync-metadata" only fetches four; update the table in
development.md to match the actual files synced by the "sync-metadata" script
(remove `infection.json5` and `phpunit.xml.dist` and keep `.editorconfig`,
`.gitattributes`, `.gitignore`, and `phpstan.neon`) so documentation aligns with
the composer.json script behavior and ensure the table header/format remains
intact.

In `@docs/testing.md`:
- Around line 12-58: Add a "tests" entry to the composer.json "scripts" section
so the documented composer run tests -- --filter ... invocation works;
specifically add a "tests" script key that runs PHPUnit (e.g. using
"vendor/bin/phpunit" or an equivalent project-specific test runner) and supports
forwarding args, update composer.json's scripts to include "tests" so references
in docs/testing.md are accurate.

In `@ecs.php`:
- Around line 5-12: The file fails at the require of
vendor/php-forge/coding-standard/config/ecs.php because that package/config is
missing; replace or remove the external dependency by either installing/renaming
the correct package so the path exists, or refactor to use ECS native
configuration: instantiate or obtain an ECSConfigBuilder (the $ecsConfigBuilder
variable) via ECSConfig::configure() (or equivalent) and call withPaths(...) on
it, or point the require to an existing local config file; ensure the unique
symbols ($ecsConfigBuilder, withPaths) are preserved and return the configured
builder.
🧹 Nitpick comments (2)
composer.json (1)

42-47: Consider using a template from the same organization.

The script fetches configuration files from yii2-extensions/template, but this package belongs to ui-awesome. Using a template from a different organization may lead to configuration drift or unexpected changes when the external template is updated.

rector.php (1)

5-8: Avoid hard-coded vendor path for imported Rector config.

Using __DIR__ . '/vendor/...' breaks if vendor-dir is customized or the package layout changes. Consider resolving the install path via Composer’s runtime API and failing fast with a clear error.

♻️ Suggested adjustment
 use Rector\Config\RectorConfig;
+use Composer\InstalledVersions;

 return static function (RectorConfig $rectorConfig): void {
-    $rectorConfig->import(__DIR__ . '/vendor/php-forge/coding-standard/config/rector.php');
+    $codingStandardPath = InstalledVersions::getInstallPath('php-forge/coding-standard');
+    if ($codingStandardPath === null) {
+        throw new RuntimeException('php-forge/coding-standard is not installed. Run composer install --dev.');
+    }
+    $rectorConfig->import($codingStandardPath . '/config/rector.php');

Comment thread composer.json
Comment thread docs/development.md Outdated
Comment thread docs/testing.md
Comment thread ecs.php
@terabytesoftw

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jan 25, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant