Skip to content

Commit

Permalink
Merge pull request #4 from maurobonfietti/0.6.0
Browse files Browse the repository at this point in the history
Version 0.6.0 - Minor changes.
  • Loading branch information
maurobonfietti committed Mar 2, 2020
2 parents e9c5703 + c2abafe commit 7874b2c
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Following the previous example, the command generate 5 (five) new endpoints like
- Update User: `PUT /user/{id}`
- Delete User: `DELETE /user/{id}`

So, the script generate a real example with all files and directories: Controller, Services, Repository, etc, etc, that allow to manage the new resource using a RESTful API.
So, the script generate a real example with all files and directories: Controller, Services, Repository, etc, etc, that allow you to manage the new resource using as RESTful API.

Furthermore, the script make a file with PHPUnit tests, for each new endpoint generated.


Expand Down
8 changes: 4 additions & 4 deletions src/Command/CrudGeneratorCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Command;

use Symfony\Component\Console\Command\Command;
Expand All @@ -9,7 +11,7 @@

class CrudGeneratorCommand extends Command
{
const COMMAND_VERSION = '0.5.0';
const COMMAND_VERSION = '0.6.0';

public function __construct($app)
{
Expand All @@ -31,12 +33,10 @@ protected function configure()

protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Starting!');
$db = $this->container->get('db');
$entity = $input->getArgument('entity');
$output->writeln('Generate Endpoints For New Entity: ' . $entity);
$output->writeln('OK - Generated endpoints for entity: ' . $entity);
$generator = new CrudGeneratorService();
$generator->generateCrud($db, $entity);
$output->writeln('Finish ;-)');
}
}
2 changes: 2 additions & 0 deletions src/Command/CrudGeneratorService.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Command;

use Symfony\Component\Console\Command\Command;
Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/Objectbase/Base.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Controller\Objectbase;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/Objectbase/Create.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Controller\Objectbase;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/Objectbase/Delete.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Controller\Objectbase;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/Objectbase/GetAll.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Controller\Objectbase;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/Objectbase/GetOne.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Controller\Objectbase;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/Objectbase/Update.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Controller\Objectbase;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/ObjectbaseException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Exception;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/ObjectbaseRepository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Repository;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/ObjectbaseService.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Service;

Expand Down
4 changes: 3 additions & 1 deletion src/Command/TemplateBase/ObjectbaseTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Tests\integration;

Expand Down

0 comments on commit 7874b2c

Please sign in to comment.