• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valkyrjaio / sindri-php / 24907639395 / 1
100%
26.x: 100%

Build:
DEFAULT BRANCH: 26.x
Ran 24 Apr 2026 07:20PM UTC
Files 73
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Apr 2026 07:20PM UTC coverage: 100.0%. Remained the same
24907639395.1

push

github

web-flow
[Refactor] Reduce complexity of AST route/config readers (#26)

## Description

Refactors the AST reader layer to eliminate repeated inline patterns
across `CliRouteAttributeReader`, `HttpRouteAttributeReader`, and
`ConfigReader` by introducing shared helpers on `AstReader` and a new
`RouteAttributeReader` abstract base.

---

## Types of Changes

- [x] Improvement _(non-breaking change which improves code)_
- [ ] Bug fix _(non-breaking change which fixes an issue)_
- [ ] New feature _(non-breaking change which adds functionality)_
- [ ] Deprecation _(breaking change which removes functionality)_
- [ ] Breaking change _(fix or feature that would cause existing
functionality to change)_
- [ ] Documentation improvement

---

## Changes

### New Files

- **`Sindri\Ast\Abstract\RouteAttributeReader`** — abstract base with
`getRouteHandlerAttributeClass()` (abstract) and `updateHandler()`
(shared between CLI and HTTP)

### `AstReader`

- **`parseClassFile()`** — extracts the parse → unwrap → useMap →
findClass → currentClass preamble used by every reader
- **`extractStringArg()`** — collapses `getAttrArg` + `extractExprValue`
+ `is_string` guard into one call
- **`extractBoolArg()`** — same for booleans
- **`extractClassListArg()`** — collapses `getAttrArg` + `instanceof
Array_` + `extractClassListFromArrayExpr`
- **`extractStringListArg()`** — same for plain strings
- **`extractStringListFromArrayExpr()`** — moved here from
`CliRouteAttributeReader`

### `CliRouteAttributeReader`

- Extends `RouteAttributeReader`, implements
`getRouteHandlerAttributeClass()`
- **`buildRouteData`** — 4 inline `if ($expr instanceof Array_)` blocks
→ 4 `extractClassListArg()` calls
- **`buildRouteExpr`** — 8 if-blocks → 2 if-blocks + delegates to new
`buildRouteMiddlewareArgs()`
- **`updateMiddleware`** — `is_a` classification loop → delegates to new
`classifyMiddleware()`
- **`buildArgumentData` / `buildOptionData`** — `extractExprValue` +
`is_string` ternaries → `extractSt... (continued)

1490 of 1490 relevant lines covered (100.0%)

15.76 hits per line

Source Files on job 24907639395.1
  • Tree
  • List 73
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 24907639395
  • 0ed59d63 on github
  • Prev Job for on 26.x (#24904361143.1)
  • Next Job for on 26.x (#24911376532.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc