Skip to content

Commit

Permalink
Revert "Merge branch 'fix/controller-gen' of https://github.com/innof…
Browse files Browse the repository at this point in the history
…lash/apiato-core into pr/194"

This reverts commit 7b83409, reversing
changes made to 76f03b9.
  • Loading branch information
Mohammad-Alavi committed Dec 8, 2024
1 parent 7b83409 commit 673a5e5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Generator/Commands/ContainerApiGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ContainerApiGenerator extends GeneratorCommand implements ComponentsGenera
/**
* The name of the stub file.
*/
protected string $stubName = 'composer.stub';
protected string $stubName = '';

public function getUserInputs(): array|null
{
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Commands/ContainerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ContainerGenerator extends GeneratorCommand implements ComponentsGenerator
/**
* The name of the stub file.
*/
protected string $stubName = 'composer.stub';
protected string $stubName = '';

public function getUserInputs(): array|null
{
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Commands/ContainerWebGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ContainerWebGenerator extends GeneratorCommand implements ComponentsGenera
/**
* The name of the stub file.
*/
protected string $stubName = 'composer.stub';
protected string $stubName = '';

public function getUserInputs(): array|null
{
Expand Down
1 change: 1 addition & 0 deletions src/Generator/Commands/ControllerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ControllerGenerator extends GeneratorCommand implements ComponentsGenerato

public function getUserInputs(): array|null
{
// Name of the model (singular and plural)
$model = $this->checkParameterOrAsk('model', 'Model for the controller.', $this->containerName);
$models = Pluralizer::plural($model);

Expand Down
9 changes: 0 additions & 9 deletions src/Generator/Stubs/controllers/api/crud.stub
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ use Prettus\Repository\Exceptions\RepositoryException;

class {{class-name}} extends {{base-controller}}
{
public function __construct(
private readonly Create{{model}}Action $create{{model}}Action,
private readonly Update{{model}}Action $update{{model}}Action,
private readonly Find{{model}}ByIdAction $find{{model}}ByIdAction,
private readonly List{{models}}Action $list{{models}}Action,
private readonly Delete{{model}}Action $delete{{model}}Action,
) {
}

/**
* @throws InvalidTransformerException
* @throws CreateResourceFailedException
Expand Down

0 comments on commit 673a5e5

Please sign in to comment.