Skip to content

Commit

Permalink
clean up the class generator
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed May 31, 2023
1 parent dbcc0a5 commit 0acb507
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions app/Generators/ClassBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
abstract class ClassBase
{
protected string $generatorName = 'Outbound';

protected string $plural = 's';

protected BaseRepository $generatorRepository;
Expand Down Expand Up @@ -51,6 +52,4 @@ protected function makeClass()
$destination = $basePath.$name;
$this->generatorRepository->putFile($destination, $transformed);
}


}
3 changes: 1 addition & 2 deletions app/Generators/Outbound/GeneratorRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

use App\Generators\BaseRepository;
use Facades\App\Generators\Outbound\ControllerOutboundGenerator;
use Facades\App\Generators\Outbound\OutboundClassGenerator;
use Facades\App\Generators\Outbound\RoutesOutbound;
use Facades\App\Generators\Outbound\VueOutbound;
use Facades\App\Generators\Outbound\OutboundClassGenerator;

//use Facades\App\Generators\Outbound\EnumOutbound;
//use Facades\App\Generators\Outbound\LarachainConfigOutbound;


class GeneratorRepository extends BaseRepository
{
public function run(): self
Expand Down
5 changes: 1 addition & 4 deletions app/Generators/Outbound/OutboundClassGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace App\Generators\Outbound;

use App\Generators\ClassBase;
use App\Generators\BaseRepository;
use Facades\App\Generators\TokenReplacer;
use App\Generators\ClassBase;

class OutboundClassGenerator extends ClassBase
{
Expand All @@ -17,6 +16,4 @@ public function handle(BaseRepository $generatorRepository): void
$this->makeClass();
$this->makeTest();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ public function handle(BaseRepository $generatorRepository): void
$this->makeClass();
$this->makeTest();
}

}
1 change: 1 addition & 0 deletions app/Generators/Source/ControllerSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class ControllerSource extends Base
{
protected string $generatorName = 'Source';

protected string $plural = 'es';

public function handle(BaseRepository $generatorRepository): void
Expand Down
4 changes: 1 addition & 3 deletions app/Generators/Source/SourceClassTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use App\Generators\BaseRepository;
use App\Generators\ClassBase;
use Facades\App\Generators\TokenReplacer;

class SourceClassTransformer extends ClassBase
{
protected string $generatorName = 'Source';

protected string $plural = 'es';

public function handle(BaseRepository $generatorRepository): void
Expand All @@ -18,6 +18,4 @@ public function handle(BaseRepository $generatorRepository): void
$this->makeClass();
$this->makeTest();
}


}
2 changes: 0 additions & 2 deletions app/Generators/Transformer/TransformerClassGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ public function handle(BaseRepository $generatorRepository): void
$this->makeClass();
$this->makeTest();
}


}

0 comments on commit 0acb507

Please sign in to comment.