Skip to content

Commit e606a03

Browse files
committed
#193: Remove extra/unused props and import
1 parent 1b78d49 commit e606a03

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

src/Controllers/BaseCommand.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class BaseCommand extends Command
3030
use GeneratorTrait;
3131

3232
// dirs
33-
public $rootDir = '';
3433
public $appDir = '';
3534
public $modulesDir = '';
3635
public $httpDir = '';
@@ -42,7 +41,6 @@ class BaseCommand extends Command
4241
public $version;
4342
public $objectName = '';
4443
public $defaultController = 'Default';
45-
public $uriNamedParams;
4644
public $force;
4745
public $customTypes = [
4846
CustomsInterface::CUSTOM_TYPES_ID,
@@ -54,10 +52,8 @@ class BaseCommand extends Command
5452
public $types = [];
5553
public $currentTypes = [];
5654
public $historyTypes = [];
57-
public $mergedTypes = [];
5855
public $diffTypes = [];
5956
public $objectProps = [];
60-
public $generatedFiles = [];
6157
public $relationships = [];
6258
private $files = [];
6359

src/Controllers/GeneratorTrait.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ trait GeneratorTrait
2727

2828
// all generated entities/resources
2929
private $forms;
30-
private $mappers;
3130
private $routes;
32-
private $migrations;
33-
private $controllers;
34-
private $tests;
3531

3632
// gen dir found in history
3733
private $genDir;
@@ -64,8 +60,8 @@ private function generateResources(): void
6460
$this->error($e->getTraceAsString());
6561
}
6662

67-
$this->tests = new Tests($this);
68-
$this->tests->createEntity($this->formatFuncTestsPath(), DefaultInterface::FUNCTIONAL_POSTFIX);
63+
$tests = new Tests($this);
64+
$tests->createEntity($this->formatFuncTestsPath(), DefaultInterface::FUNCTIONAL_POSTFIX);
6965
}
7066

7167
$this->createMigrations();
@@ -95,17 +91,17 @@ private function mergeResources(): void
9591
*/
9692
private function solveControllers(): void
9793
{
98-
$this->controllers = new Controllers($this);
94+
$controllers = new Controllers($this);
9995
$controllerPath = $this->formatControllersPath();
10096

10197
if (empty($this->options[ConsoleInterface::OPTION_REGENERATE]) === false
102-
&& file_exists($this->controllers->getEntityFile($controllerPath,
98+
&& file_exists($controllers->getEntityFile($controllerPath,
10399
DefaultInterface::CONTROLLER_POSTFIX)) === true) {
104100

105-
$this->controllers->recreateEntity($controllerPath, DefaultInterface::CONTROLLER_POSTFIX);
101+
$controllers->recreateEntity($controllerPath, DefaultInterface::CONTROLLER_POSTFIX);
106102
} else {
107-
$this->controllers->createDefault();
108-
$this->controllers->createEntity($controllerPath, DefaultInterface::CONTROLLER_POSTFIX);
103+
$controllers->createDefault();
104+
$controllers->createEntity($controllerPath, DefaultInterface::CONTROLLER_POSTFIX);
109105
}
110106
}
111107

@@ -129,15 +125,15 @@ private function solveFormRequest(): void
129125
private function solveEntities(): void
130126
{
131127
// create entities/models
132-
$this->mappers = new Entities($this);
133-
$this->mappers->createPivot();
128+
$mappers = new Entities($this);
129+
$mappers->createPivot();
134130
$entitiesPath = $this->formatEntitiesPath();
135131

136132
if (empty($this->options[ConsoleInterface::OPTION_MERGE]) === false
137133
&& file_exists($this->forms->getEntityFile($entitiesPath)) === true) {
138-
$this->mappers->recreateEntity($entitiesPath);
134+
$mappers->recreateEntity($entitiesPath);
139135
} else {
140-
$this->mappers->createEntity($entitiesPath);
136+
$mappers->createEntity($entitiesPath);
141137
}
142138
}
143139

@@ -155,9 +151,9 @@ private function outputEntity(): void
155151
private function createMigrations(): void
156152
{
157153
if (empty($this->options[ConsoleInterface::OPTION_MIGRATIONS]) === false) {
158-
$this->migrations = new Migrations($this);
159-
$this->migrations->create();
160-
$this->migrations->createPivot();
154+
$migrations = new Migrations($this);
155+
$migrations->create();
156+
$migrations->createPivot();
161157
}
162158
}
163159
}

src/Controllers/HistoryTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use SoliDry\Types\ErrorsInterface;
1010
use SoliDry\Types\ApiInterface;
1111
use SoliDry\Types\PhpInterface;
12-
use Symfony\Component\Yaml\Yaml;
1312

1413
/**
1514
* Trait HistoryTrait

0 commit comments

Comments
 (0)