Skip to content

T55 make module mvc - #74

Merged
niden merged 5 commits into
masterfrom
T55-make-module-mvc
Nov 3, 2026
Merged

niden merged 5 commits into
masterfrom
T55-make-module-mvc

Conversation

@niden

@niden niden commented Nov 3, 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:module for MVC projects: it writes Module.php (a class that implements Phalcon\Mvc\ModuleDefinitionInterface) and the folders Controllers, Models and views in the module path (src/Modules), and prints how to register the module and its routes. An existing Module.php stops the command; --force replaces only that file. Added the module default path, the MVC stubs module, fragment-guidance-module and fragment-guidance-controller-module, Crest\Generator\ModuleLocation and Crest\Generator\ArtifactWriter::directory().
  • Added --module=<name> to make:controller and make:model: they write into the module, with its namespace. The relations of a model in a module name models in the same module.
  • Changed init: for an MVC project, it also asks for the module folder, so a script that sends answers to init needs one more line. new writes the module path into the crest.php of an MVC project.

Thanks

niden added 5 commits November 1, 2026 08:53
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
@niden
niden requested a review from Jeckerson November 3, 2026 07:40
@niden niden self-assigned this Nov 3, 2026
@niden niden added the enhancement New feature or request label Nov 3, 2026
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Code Metrics Report

master (6730d20) #74 (2b1c3a5) +/-
Coverage 99.7% 99.7% +0.0%
Test Execution Time 10s 8s -2s
Details
  |                     | master (6730d20) | #74 (2b1c3a5) |  +/-  |
  |---------------------|------------------|---------------|-------|
+ | Coverage            |            99.7% |         99.7% | +0.0% |
  |   Files             |               86 |            88 |    +2 |
  |   Lines             |             3098 |          3186 |   +88 |
+ |   Covered           |             3091 |          3179 |   +88 |
+ | Test Execution Time |              10s |            8s |   -2s |

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% 0.0% 100.0% modified
src/Command/Make/ModelCommand.php 100.0% 0.0% 100.0% modified
src/Command/Make/ModuleCommand.php 100.0% +100.0% 100.0% added
src/Command/Make/NamedArtifactCommand.php 100.0% 0.0% 100.0% modified
src/Command/ProjectCommand.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/ModuleLocation.php 100.0% +100.0% 100.0% added
src/Generator/Placement.php 100.0% 0.0% 100.0% modified
src/Project/Config.php 100.0% 0.0% 100.0% modified

Reported by octocov

@niden
niden merged commit c2d4aeb into master Nov 3, 2026
40 checks passed
@niden
niden deleted the T55-make-module-mvc branch November 3, 2026 08:28
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