Skip to content

Commit

Permalink
Add CRUD generator
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Aug 31, 2023
1 parent b08de00 commit 57a0adb
Show file tree
Hide file tree
Showing 6 changed files with 418 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
'class' => Generators\ActiveRecord\Generator::class,
'parameters' => [],
],
[
'class' => Generators\CRUD\Generator::class,
'parameters' => [],
],
],
'parameters' => [
'templates' => [],
Expand Down
159 changes: 159 additions & 0 deletions src/Generator/CRUD/Command.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Yii\Gii\Generator\CRUD;

use Yiisoft\Strings\Inflector;
use Yiisoft\Strings\StringHelper;
use Yiisoft\Validator\Rule\Each;
use Yiisoft\Validator\Rule\Regex;
use Yiisoft\Validator\Rule\Required;
use Yiisoft\Yii\Gii\Generator\AbstractGeneratorCommand;
use Yiisoft\Yii\Gii\Validator\ClassExistsRule;
use Yiisoft\Yii\Gii\Validator\NewClassRule;
use Yiisoft\Yii\Gii\Validator\TemplateRule;

final class Command extends AbstractGeneratorCommand
{
#[Each([
new Regex(
pattern: '/^[a-z][a-z0-9]*$/',
message: 'Only a-z, 0-9, dashes (-), spaces and commas are allowed.'
),
])]
private readonly array $actions;

public function __construct(

Check warning on line 27 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L27

Added line #L27 was not covered by tests
#[Required]
#[Regex(
pattern: '/^(?:[a-z][a-z0-9]*)(?:\\\\[a-z][a-z0-9]*)*$/i',
message: 'Invalid namespace'
)]

Check warning on line 32 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L30-L32

Added lines #L30 - L32 were not covered by tests
private readonly string $controllerNamespace = 'App\\Controller',
#[Required]
#[ClassExistsRule]
private readonly string $model = 'App\\Model\\User',
#[Required]
#[Regex(
pattern: '/^[A-Z][a-zA-Z0-9]*Controller$/',
message: 'Only word characters are allowed, and the class name must start with a capital letter and end with "Controller".'
)]

Check warning on line 41 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L39-L41

Added lines #L39 - L41 were not covered by tests
#[NewClassRule]
private readonly string $controllerClass = 'IndexController',
/**
* @var string the controller path
*/
private readonly string $controllerPath = '@src/Controller',
/**
* @var string the controller's views path
*/
private readonly string $viewsPath = '@views/',
#[Regex(
pattern: '/^[a-z\\\\]*$/i',
message: 'Only word characters and backslashes are allowed.',
skipOnEmpty: true,
)]

Check warning on line 56 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L53-L56

Added lines #L53 - L56 were not covered by tests
private readonly string $baseClass = '',
array $actions = ['index'],

Check warning on line 58 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L58

Added line #L58 was not covered by tests
#[Required(message: 'A code template must be selected.')]
#[TemplateRule]
protected string $template = 'default',
) {
parent::__construct($template);
sort($actions);
$this->actions = $actions;

Check warning on line 65 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L63-L65

Added lines #L63 - L65 were not covered by tests
}

/**
* @return string the controller ID
*/
public function getControllerID(): string

Check warning on line 71 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L71

Added line #L71 was not covered by tests
{
$name = StringHelper::baseName($this->controllerClass);
return (new Inflector())->pascalCaseToId(substr($name, 0, -10));

Check warning on line 74 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L73-L74

Added lines #L73 - L74 were not covered by tests
}

public function getControllerClass(): string

Check warning on line 77 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L77

Added line #L77 was not covered by tests
{
return $this->controllerClass;

Check warning on line 79 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L79

Added line #L79 was not covered by tests
}

public function getActions(): array

Check warning on line 82 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L82

Added line #L82 was not covered by tests
{
return $this->actions;

Check warning on line 84 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L84

Added line #L84 was not covered by tests
}

public function getViewsPath(): string

Check warning on line 87 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L87

Added line #L87 was not covered by tests
{
return $this->viewsPath;

Check warning on line 89 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L89

Added line #L89 was not covered by tests
}

public function getModel(): string

Check warning on line 92 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L92

Added line #L92 was not covered by tests
{
return $this->model;

Check warning on line 94 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L94

Added line #L94 was not covered by tests
}

public function getControllerNamespace(): string

Check warning on line 97 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L97

Added line #L97 was not covered by tests
{
return $this->controllerNamespace;

Check warning on line 99 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L99

Added line #L99 was not covered by tests
}

public function getBaseClass(): string

Check warning on line 102 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L102

Added line #L102 was not covered by tests
{
return $this->baseClass;

Check warning on line 104 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L104

Added line #L104 was not covered by tests
}

public function getDirectory(): string

Check warning on line 107 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L107

Added line #L107 was not covered by tests
{
return $this->controllerPath;

Check warning on line 109 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L109

Added line #L109 was not covered by tests
}

public static function getAttributeLabels(): array

Check warning on line 112 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L112

Added line #L112 was not covered by tests
{
return [
'controllerNamespace' => 'Controller Namespace',
'controllerClass' => 'Controller Class',
'baseClass' => 'Base Class',
'model' => 'Active record class',
'controllerPath' => 'Controller Path',
'actions' => 'Action IDs',
'viewsPath' => 'Views Path',
'template' => 'Action IDs',
];

Check warning on line 123 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L114-L123

Added lines #L114 - L123 were not covered by tests
}

public static function getHints(): array

Check warning on line 126 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L126

Added line #L126 was not covered by tests
{
return [
'controllerClass' => 'This is the name of the controller class to be generated. You should

Check warning on line 129 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L128-L129

Added lines #L128 - L129 were not covered by tests
provide a fully qualified namespaced class (e.g. <code>App\Controller\PostController</code>),
and class name should be in CamelCase ending with the word <code>Controller</code>. Make sure the class
is using the same namespace as specified by your application\'s controllerNamespace property.',
'actions' => 'Provide one or multiple action IDs to generate empty action method(s) in the controller. Separate multiple action IDs with commas or spaces.

Check warning on line 133 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L132-L133

Added lines #L132 - L133 were not covered by tests
Action IDs should be in lower case. For example:
<ul>
<li><code>index</code> generates <code>index()</code></li>
<li><code>create-order</code> generates <code>createOrder()</code></li>
</ul>',
'viewsPath' => 'Specify the directory for storing the view scripts for the controller. You may use path alias here, e.g.,

Check warning on line 139 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L138-L139

Added lines #L138 - L139 were not covered by tests
<code>/var/www/app/controllers/views/order</code>, <code>@app/views/order</code>. If not set, it will default
to <code>@app/views/ControllerID</code>',
'baseClass' => 'This is the class that the new controller class will extend from. Please make sure the class exists and can be autoloaded.',
];

Check warning on line 143 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L141-L143

Added lines #L141 - L143 were not covered by tests
}

public static function getAttributes(): array

Check warning on line 146 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L146

Added line #L146 was not covered by tests
{
return [
'controllerNamespace',
'controllerClass',
'baseClass',
'model',
'viewsPath',
'actions',
'template',
'controllerPath',
];

Check warning on line 157 in src/Generator/CRUD/Command.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Command.php#L148-L157

Added lines #L148 - L157 were not covered by tests
}
}
131 changes: 131 additions & 0 deletions src/Generator/CRUD/Generator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Yii\Gii\Generator\CRUD;

use InvalidArgumentException;
use Yiisoft\ActiveRecord\ActiveRecordFactory;
use Yiisoft\Aliases\Aliases;
use Yiisoft\Validator\ValidatorInterface;
use Yiisoft\Yii\Gii\Component\CodeFile\CodeFile;
use Yiisoft\Yii\Gii\Generator\AbstractGenerator;
use Yiisoft\Yii\Gii\GeneratorCommandInterface;
use Yiisoft\Yii\Gii\ParametersProvider;

/**
* This generator will generate a controller and one or a few action view files.
*/
final class Generator extends AbstractGenerator
{
public function __construct(

Check warning on line 21 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L21

Added line #L21 was not covered by tests
Aliases $aliases,
ValidatorInterface $validator,
ParametersProvider $parametersProvider,
private ActiveRecordFactory $activeRecordFactory,
) {
parent::__construct($aliases, $validator, $parametersProvider);

Check warning on line 27 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L27

Added line #L27 was not covered by tests
}

public static function getId(): string

Check warning on line 30 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L30

Added line #L30 was not covered by tests
{
return 'crud';

Check warning on line 32 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L32

Added line #L32 was not covered by tests
}

public static function getName(): string

Check warning on line 35 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L35

Added line #L35 was not covered by tests
{
return 'CRUD';

Check warning on line 37 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L37

Added line #L37 was not covered by tests
}

public static function getDescription(): string

Check warning on line 40 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L40

Added line #L40 was not covered by tests
{
return 'This generator helps you to quickly generate a new controller class with
one or several controller actions and their corresponding views.';

Check warning on line 43 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L42-L43

Added lines #L42 - L43 were not covered by tests
}

public function getRequiredTemplates(): array

Check warning on line 46 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L46

Added line #L46 was not covered by tests
{
return [
'controller.php',
'view.php',
];

Check warning on line 51 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L48-L51

Added lines #L48 - L51 were not covered by tests
}

public function doGenerate(GeneratorCommandInterface $command): array

Check warning on line 54 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L54

Added line #L54 was not covered by tests
{
if (!$command instanceof Command) {
throw new InvalidArgumentException();

Check warning on line 57 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L56-L57

Added lines #L56 - L57 were not covered by tests
}

$files = [];

Check warning on line 60 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L60

Added line #L60 was not covered by tests

$rootPath = $this->aliases->get('@root');

Check warning on line 62 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L62

Added line #L62 was not covered by tests

$codeFile = (new CodeFile(
$this->getControllerFile($command),
$this->render($command, 'controller.php')
))->withBasePath($rootPath);
$files[$codeFile->getId()] = $codeFile;

Check warning on line 68 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L64-L68

Added lines #L64 - L68 were not covered by tests

//$actions = $command->getActions();
$actions = ['index'];
$model = $this->activeRecordFactory->createAR($command->getModel());
foreach ($actions as $action) {
$codeFile = (new CodeFile(
$this->getViewFile($command, $action),
$this->render($command, $action.'.php', ['action' => $action, 'model' => $model])
))->withBasePath($rootPath);
$files[$codeFile->getId()] = $codeFile;

Check warning on line 78 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L71-L78

Added lines #L71 - L78 were not covered by tests
}

return $files;

Check warning on line 81 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L81

Added line #L81 was not covered by tests
}

/**
* @return string the controller class file path
*/
private function getControllerFile(Command $command): string

Check warning on line 87 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L87

Added line #L87 was not covered by tests
{
$directory = empty($command->getDirectory()) ? '@src/Controller/' : $command->getDirectory();

Check warning on line 89 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L89

Added line #L89 was not covered by tests

return $this->aliases->get(
str_replace(
['\\', '//'],
'/',
sprintf(
'%s/%s.php',
$directory,
$command->getControllerClass(),
),
),
);

Check warning on line 101 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L91-L101

Added lines #L91 - L101 were not covered by tests
}

/**
* @param string $action the action ID
*
* @return string the action view file path
*/
public function getViewFile(Command $command, string $action): string

Check warning on line 109 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L109

Added line #L109 was not covered by tests
{
$directory = empty($command->getViewsPath()) ? '@views/' : $command->getViewsPath();

Check warning on line 111 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L111

Added line #L111 was not covered by tests

return $this->aliases->get(
str_replace(
['\\', '//'],
'/',
sprintf(
'%s/%s/%s.php',
$directory,
$command->getControllerID(),
$action,
),
),
);

Check warning on line 124 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L113-L124

Added lines #L113 - L124 were not covered by tests
}

public static function getCommandClass(): string

Check warning on line 127 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L127

Added line #L127 was not covered by tests
{
return Command::class;

Check warning on line 129 in src/Generator/CRUD/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/Generator.php#L129

Added line #L129 was not covered by tests
}
}
41 changes: 41 additions & 0 deletions src/Generator/CRUD/default/controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
/**
* This is the template for generating a controller class file.
*/

use Yiisoft\Strings\StringHelper;

/* @var $command Yiisoft\Yii\Gii\Generator\CRUD\Command */

$classDefinitionParts = [];
$classDefinitionParts[] = StringHelper::baseName($command->getControllerClass());

Check failure on line 12 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:12:50: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check failure on line 12 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:12:50: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)
if (!empty($command->getBaseClass())) {
$classDefinitionParts[] = 'extends \\' . trim($command->getBaseClass(), '\\');

Check failure on line 14 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:14:51: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check failure on line 14 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:14:51: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check warning on line 14 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L11-L14

Added lines #L11 - L14 were not covered by tests
}
$classDefinition = implode(' ', $classDefinitionParts) . PHP_EOL;

Check warning on line 16 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L16

Added line #L16 was not covered by tests


echo "<?php\n";

Check warning on line 19 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L19

Added line #L19 was not covered by tests
?>

declare(strict_types=1);

Check warning on line 22 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L22

Added line #L22 was not covered by tests

namespace <?= $command->getControllerNamespace() ?>;

Check failure on line 24 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:24:15: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check failure on line 24 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:24:15: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check warning on line 24 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L24

Added line #L24 was not covered by tests

use Yiisoft\Yii\View\ViewRenderer;

final class <?= $classDefinition; ?>
{
public function __construct(private ViewRenderer $viewRenderer)
{
$this->viewRenderer = $viewRenderer->withController($this);
}
<?php foreach ($command->getActions() as $action) : ?>

Check failure on line 34 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:34:16: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check failure on line 34 in src/Generator/CRUD/default/controller.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedGlobalVariable

src/Generator/CRUD/default/controller.php:34:16: UndefinedGlobalVariable: Cannot find referenced variable $command in global scope (see https://psalm.dev/127)

Check warning on line 34 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L28-L34

Added lines #L28 - L34 were not covered by tests

public function <?= $action ?>()

Check warning on line 36 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L36

Added line #L36 was not covered by tests
{
return $this->viewRenderer->render('<?= $action ?>');

Check warning on line 38 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L38

Added line #L38 was not covered by tests
}
<?php endforeach; ?>
}

Check warning on line 41 in src/Generator/CRUD/default/controller.php

View check run for this annotation

Codecov / codecov/patch

src/Generator/CRUD/default/controller.php#L41

Added line #L41 was not covered by tests
Loading

0 comments on commit 57a0adb

Please sign in to comment.