feat!: add Vite::create() and replace high-arity render-option and manifest-chunk construction with fluent immutable APIs. - #9
Conversation
…manifest-chunk construction with fluent immutable APIs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used🪛 PHPMD (2.15.0)src/Vite.php[error] 24-138: The class Vite has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13. (undefined) (CouplingBetweenObjects) tests/ConfigurationTest.php[warning] 24-195: The class ConfigurationTest has 12 public methods. Consider refactoring ConfigurationTest to keep number of public methods under 10. (undefined) (TooManyPublicMethods) [error] 43-47: Avoid using static access to class '\PHPForge\Vite\Vite' in method 'testCreateReturnsConfiguredViteFacade'. (undefined) (StaticAccess) src/Manifest/ManifestLoader.php[warning] 320-379: The method parse() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (undefined) (CyclomaticComplexity) src/Html/HtmlRenderer.php[error] 57-57: Avoid using static access to class 'PHPForge\Vite\Html\HtmlRenderOptions' in method 'render'. (undefined) (StaticAccess) src/Resolver/ManifestAssetResolver.php[error] 23-222: The class ManifestAssetResolver has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. (undefined) (CouplingBetweenObjects) [warning] 52-131: The method resolve() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (undefined) (CyclomaticComplexity) [warning] 52-131: The method resolve() has an NPath complexity of 210. The configured NPath complexity threshold is 200. (undefined) (NPathComplexity) tests/ManifestChunkTest.php[error] 22-22: Avoid using static access to class '\PHPForge\Vite\Manifest\ManifestChunk' in method 'testConstructorAndFactoryApplyOptionalDefaults'. (undefined) (StaticAccess) [warning] 150-253: The method testWithMethodsReturnConfiguredCopyWithoutMutatingOriginal() has 104 lines of code. Current threshold is set to 100. Avoid really long methods. (undefined) (ExcessiveMethodLength) [error] 152-152: Avoid using static access to class '\PHPForge\Vite\Manifest\ManifestChunk' in method 'testWithMethodsReturnConfiguredCopyWithoutMutatingOriginal'. (undefined) (StaticAccess) src/Html/HtmlRenderOptions.php[warning] 29-29: Avoid excessively long variable names like $inlineModuleAttributes. Keep variable name length under 20. (undefined) (LongVariable) [warning] 34-34: Avoid excessively long variable names like $modulePreloadAttributes. Keep variable name length under 20. (undefined) (LongVariable) [warning] 39-39: Avoid excessively long variable names like $moduleScriptAttributes. Keep variable name length under 20. (undefined) (LongVariable) [error] 176-176: Avoid using static access to class '\Closure' in method 'withAttributeProvider'. (undefined) (StaticAccess) src/Manifest/ManifestChunk.php[error] 211-211: The method withDynamicEntry has a boolean flag argument $isDynamicEntry, which is a certain sign of a Single Responsibility Principle violation. (undefined) (BooleanArgumentFlag) [error] 241-241: The method withEntry has a boolean flag argument $isEntry, which is a certain sign of a Single Responsibility Principle violation. (undefined) (BooleanArgumentFlag) tests/HtmlRendererTest.php[warning] 21-433: The class HtmlRendererTest has 13 public methods. Consider refactoring HtmlRendererTest to keep number of public methods under 10. (undefined) (TooManyPublicMethods) [error] 25-25: Avoid using static access to class '\PHPForge\Vite\Html\HtmlRenderOptions' in method 'testFactoryCreatesDefaultOptions'. (undefined) (StaticAccess) [warning] 173-294: The method testOptionsModifiersReturnNewConfiguredInstances() has 122 lines of code. Current threshold is set to 100. Avoid really long methods. (undefined) (ExcessiveMethodLength) [error] 175-175: Avoid using static access to class '\PHPForge\Vite\Html\HtmlRenderOptions' in method 'testOptionsModifiersReturnNewConfiguredInstances'. (undefined) (StaticAccess) [warning] 181-181: Avoid excessively long variable names like $withAttributeProvider. Keep variable name length under 20. (undefined) (LongVariable) [warning] 182-182: Avoid excessively long variable names like $withInlineModuleAttributes. Keep variable name length under 20. (undefined) (LongVariable) [warning] 183-183: Avoid excessively long variable names like $withModulePreloadAttributes. Keep variable name length under 20. (undefined) (LongVariable) [warning] 184-184: Avoid excessively long variable names like $withModuleScriptAttributes. Keep variable name length under 20. (undefined) (LongVariable) [warning] 187-187: Avoid excessively long variable names like $withStylesheetAttributes. Keep variable name length under 20. (undefined) (LongVariable) tests/ManifestLoaderTest.php[warning] 36-349: The class ManifestLoaderTest has 11 public methods. Consider refactoring ManifestLoaderTest to keep number of public methods under 10. (undefined) (TooManyPublicMethods) 🔇 Additional comments (18)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe release updates version references to 0.2, adds ChangesRendering and facade APIs
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 70.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 67 functions across 11 files. (7 skipped: 7 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 208 239 +31
===========================================
Files 19 19
Lines 516 606 +90
===========================================
+ Hits 516 606 +90 ☔ View full report in Codecov by Harness. |
Pull Request