Skip to content

docs: add guide for writing custom rules#635

Open
fain182 wants to merge 1 commit into
mainfrom
docs/custom-rules-626
Open

docs: add guide for writing custom rules#635
fain182 wants to merge 1 commit into
mainfrom
docs/custom-rules-626

Conversation

@fain182

@fain182 fain182 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

What

Adds docs/custom-rules.md, documenting how to extend PHPArkitect by writing your own Expression — a first-class path, not a workaround.

It covers:

  • the Expression interface (describe() / evaluate(), plus the optional appliesTo())
  • the ClassDescription accessors available to query a class, with their real return types
  • an annotated walkthrough of the built-in IsFinal as a minimal template
  • a from-scratch example (HaveAtMostDependencies, a coupling budget) showing a constructor argument and querying dependencies
  • how to use a custom expression in a config (and as a selector in that())
  • how to test it

The two code examples were executed against the real Arkitect classes to confirm they compile and behave as documented.

The README links to the new page so the extension path is discoverable.

Refs #626

Document how to write a custom Expression: the interface, the
ClassDescription accessors available to query a class, an annotated
walkthrough of the built-in IsFinal, a from-scratch example with a
constructor argument, how to use it in a config, and how to test it.

Link it from the README so the extension path is discoverable.

Refs #626

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.25%. Comparing base (ea0897d) to head (869c37f).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #635   +/-   ##
=========================================
  Coverage     98.25%   98.25%           
  Complexity      700      700           
=========================================
  Files            87       87           
  Lines          2000     2000           
=========================================
  Hits           1965     1965           
  Misses           35       35           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant