Skip to content

chore: use StructArmed on QA - #2302

Closed
samsonasik wants to merge 1 commit into
tempestphp:3.xfrom
samsonasik:use-structarmed-on-qa
Closed

samsonasik wants to merge 1 commit into
tempestphp:3.xfrom
samsonasik:use-structarmed-on-qa

Conversation

@samsonasik

@samsonasik samsonasik commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Hi, this PR add StructArmed to QA

https://github.com/boundwize/structarmed

It is a configurable PHP architecture guards with built in presets (psr4, mvc, and so on).

It already used by PHP frameworks:

Project Configuration
CakePHP https://github.com/cakephp/cakephp/blob/5.x/structarmed.php
CodeIgniter 4 https://github.com/codeigniter4/CodeIgniter4/blob/develop/structarmed.php
Spiral Framework https://github.com/spiral/framework/blob/master/structarmed.php
Mezzio Framework https://github.com/mezzio/mezzio/blob/3.29.x/structarmed.php

This PR apply StructArmed with register:

  • PSR4, CodeQuality preset. The CodeQuality preset apply MustBeStaticAnonymousFunctionRule to make use of static in anonymous function when possible, applied wtih:
vendor/bin/structarmed analyze --fix
  • I also enable ruleset so it show more ability of layering setup to define which layers each layer is allowed to depend on.

Current skip tests paths and and packages/auth/src/Installer for easier to review and gradual updates next.

  • Register to Github workflow.

@samsonasik
samsonasik force-pushed the use-structarmed-on-qa branch from a8f25c9 to 3bd8709 Compare September 18, 2026 09:51
@samsonasik samsonasik changed the title Use StructArmed on QA chore: Use StructArmed on QA Sep 18, 2026
@samsonasik samsonasik changed the title chore: Use StructArmed on QA chore: use StructArmed on QA Sep 18, 2026
@github-actions

Copy link
Copy Markdown

Benchmark Results

Comparison of use-structarmed-on-qa against 3.x (0f478fb487e12a5891738a15a1663fa44c47295b).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
ViewRenderBench(benchPlainHtml) - 22.036mb +0.00% 524.541μs +5.46% ±1.70% -39.82%

Generated by phpbench against commit 3bd8709

@samsonasik

Copy link
Copy Markdown
Contributor Author

Ready for review/merge 👍

@aidan-casey

Copy link
Copy Markdown
Member

Hey @samsonasik, thanks for the PR! I am going to close this for the time being, as it doesn't fit with our current architecture testing toolset (PHPStan + PHPat). Going forward, I would recommend making an issue for large refactors like this one to ensure it fits with the vision of the project.

Thanks again for your work here!

@tempestphp tempestphp locked as resolved and limited conversation to collaborators Sep 18, 2026
@samsonasik
samsonasik deleted the use-structarmed-on-qa branch September 18, 2026 14:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants