Skip to content

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

Merged
terabytesoftw merged 3 commits into
mainfrom
feature_9
Jan 24, 2026
Merged

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

Conversation

@terabytesoftw
Copy link
Copy Markdown
Contributor

@terabytesoftw terabytesoftw commented Jan 24, 2026

Pull Request

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

Summary by CodeRabbit

  • Documentation

    • Updated project description to "UI Awesome HTML Attribute Library for PHP"
    • Refined keywords for discoverability
    • Normalized PHPDoc type annotations across attribute classes for clearer docs and IDE/static-analysis hints
  • Chores

    • Added a coding-standards tool to development dependencies
    • Simplified and consolidated development/configuration setup for a leaner workflow

✏️ 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
Copy link
Copy Markdown

coderabbitai Bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

This PR updates developer tooling configs (composer, ECS, Rector), adds a changelog entry, and revises many trait docblocks to import UnitEnum and remove leading backslashes in @method union types; no runtime API signatures were changed.

Changes

Cohort / File(s) Summary
Changelog & Metadata
CHANGELOG.md, composer.json, docs/development.md
Added v0.5.2 changelog entry; updated package description/keywords; replaced prior ECS/Rector tooling entries with php-forge/coding-standard in dev deps; removed docs references to ecs.php and rector.php.
Tooling Configs
ecs.php, rector.php
Simplified/externally-sourced configurations: ECS and Rector moved from detailed inline setups to importing external config builders; retained path specifications but removed inline sets/rules and parallel setup.
Element Traits
src/Element/*
src/Element/HasAlt.php, src/Element/HasDecoding.php, src/Element/HasHeight.php, src/Element/HasHref.php, src/Element/HasReferrerpolicy.php, src/Element/HasSrc.php, src/Element/HasWidth.php
Added use UnitEnum; where needed and updated @method docblock parameter types from `string
Global Attribute Traits
src/Global/*
src/Global/CanBeAutofocus.php, src/Global/CanBeHidden.php, src/Global/HasAccesskey.php, src/Global/HasContentEditable.php, src/Global/HasDir.php, src/Global/HasDraggable.php, src/Global/HasId.php, src/Global/HasLang.php, src/Global/HasMicroData.php, src/Global/HasRole.php, src/Global/HasSpellcheck.php, src/Global/HasStyle.php, src/Global/HasTabindex.php, src/Global/HasTitle.php, src/Global/HasTranslate.php
Added use UnitEnum; in select files and normalized @method docblock types to `string
Root-Level Traits
src/HasCrossorigin.php, src/HasFetchpriority.php, src/HasRel.php
Normalized @method docblock types from `string

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Configs trimmed, the docblocks sing,
I hopped through files to fix each thing.
UnitEnum tucked in nice and neat,
Backslashes gone—what a treat!
A little hop for code, a cheerful beat. 🥕

🚥 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 accurately describes the main change: adding php-forge/coding-standard to development dependencies for code quality checks, which is reflected throughout the changeset.
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.

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/Element/HasReferrerpolicy.php`:
- Line 25: The PHPDoc `@method` annotation for addAttribute mistakenly wraps the
union type in parentheses (`(string|UnitEnum) $key`); update the annotation to
use the correct union syntax without parentheses—change the parameter type to
`string|UnitEnum $key` in the `@method` line for addAttribute so
phpDocumentor/PSR-5 tooling parses it correctly.
♻️ Duplicate comments (4)
src/HasCrossorigin.php (1)

25-25: Consistent with PR-wide docblock update.

Same parenthesized union type pattern as other files. Verification requested in HasReferrerpolicy.php review comment applies here.

src/Global/HasStyle.php (1)

24-24: Consistent with PR-wide docblock update.

Same parenthesized union type pattern. Verification requested in HasReferrerpolicy.php applies here.

src/HasFetchpriority.php (1)

26-26: Consistent with PR-wide docblock update.

Same parenthesized union type pattern. Verification requested in HasReferrerpolicy.php applies here.

src/Element/HasHeight.php (1)

23-23: Consistent with PR-wide docblock update.

Same parenthesized union type pattern. Verification requested in HasReferrerpolicy.php applies here.

🧹 Nitpick comments (2)
src/Global/HasTabindex.php (1)

11-11: Potentially unused import.

The UnitEnum import is added but the tabIndex() method signature (line 55) only accepts int|string|null, not UnitEnum. The import appears to exist solely for the @method docblock annotation documenting the addAttribute method from a different trait.

While this is valid PHP and documents the dependency correctly, static analysis tools may flag it as unused depending on configuration.

src/Element/HasHref.php (1)

23-23: Unnecessary parentheses in PHPDoc union type.

The parentheses around string|UnitEnum are redundant. While parentheses are valid in PHPDoc for disambiguation (e.g., (Foo|Bar)[] to denote an array of unions), they're unnecessary here since there are no complex type modifiers. Removing them would align with typical PHPDoc style.

📝 Suggested fix
- * `@method` static addAttribute((string|UnitEnum) $key, mixed $value) Adds an attribute and returns a new instance.
+ * `@method` static addAttribute(string|UnitEnum $key, mixed $value) Adds an attribute and returns a new instance.

Comment thread src/Element/HasReferrerpolicy.php Outdated
@terabytesoftw
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 24, 2026

✅ 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.

@terabytesoftw
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 24, 2026

✅ 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