Skip to content

T46 mvc make controller - #59

Merged
niden merged 3 commits into
masterfrom
T46-mvc-make-controller
Oct 13, 2026
Merged

niden merged 3 commits into
masterfrom
T46-mvc-make-controller

Conversation

@niden

@niden niden commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Hello!

In raising this pull request, I confirm the following:

  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • composer test, composer cs and composer analyze all pass
  • I have created a PR for the documentation about this change, if user facing

  • Added make:controller for MVC projects: writes a controller that extends CrestControllerBase, a base class in src/Controllers/Base/ that crest owns. Crest writes the base again when its stub changes, and writes the controller only once: a second run keeps the controller and updates the base. The name must give a class that the dispatcher finds from a URL.
  • Added the controller default path (src/Controllers) for MVC projects, and the MVC stubs controller, controller-base and fragment-guidance-controller.
  • Added Crest\Generator\ArtifactWriter::renderOwned(), renderOnce() and MARKER, and Crest\Generator\Outcome: the write rules for a generated base class and for a class that the developer owns.

Thanks

niden added 3 commits October 13, 2026 16:40
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
@niden
niden requested a review from Jeckerson October 13, 2026 21:43
@niden niden self-assigned this Oct 13, 2026
@niden niden added the enhancement New feature or request label Oct 13, 2026
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code Metrics Report

master (96342e0) #59 (94550bf) +/-
Coverage 99.5% 99.6% +0.0%
Details
  |           | master (96342e0) | #59 (94550bf) |  +/-  |
  |-----------|------------------|---------------|-------|
+ | Coverage  |            99.5% |         99.6% | +0.0% |
  |   Files   |               63 |            65 |    +2 |
  |   Lines   |             1667 |          1753 |   +86 |
+ |   Covered |             1660 |          1746 |   +86 |

Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
src/Command/Make/ControllerCommand.php 100.0% +100.0% 100.0% added
src/Command/Make/NamedArtifactCommand.php 100.0% 0.0% 100.0% modified
src/Commands.php 100.0% 0.0% 100.0% modified
src/Generator/ArtifactWriter.php 100.0% 0.0% 100.0% modified
src/Generator/Outcome.php 0.0% 0.0% - added
src/Project/Config.php 100.0% 0.0% 100.0% modified

Reported by octocov

@niden
niden merged commit dd811be into master Oct 13, 2026
24 checks passed
@niden
niden deleted the T46-mvc-make-controller branch October 13, 2026 21:53
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