Skip to content

Commit f06b00b

Browse files
committed
Reorganize models
1 parent 0a40e6a commit f06b00b

16 files changed

+26
-30
lines changed

src/Generators/ControllerGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
namespace Blueprint\Generators;
44

5-
use Blueprint\Column;
65
use Blueprint\Contracts\Generator;
7-
use Blueprint\Controller;
6+
use Blueprint\Models\Controller;
87
use Illuminate\Support\Str;
98

109
class ControllerGenerator implements Generator
@@ -23,7 +22,7 @@ public function output(array $tree): array
2322

2423
$stub = $this->files->get(STUBS_PATH . '/controller/class.stub');
2524

26-
/** @var \Blueprint\Controller $controller */
25+
/** @var \Blueprint\Models\Controller $controller */
2726
foreach ($tree['controllers'] as $controller) {
2827
$path = $this->getPath($controller);
2928
$this->files->put(

src/Generators/FactoryGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Blueprint\Generators;
44

55
use Blueprint\Contracts\Generator;
6-
use Blueprint\Model;
6+
use Blueprint\Models\Model;
77

88
class FactoryGenerator implements Generator
99
{
@@ -23,7 +23,7 @@ public function output(array $tree): array
2323

2424
$stub = $this->files->get(STUBS_PATH . '/factory.stub');
2525

26-
/** @var \Blueprint\Model $model */
26+
/** @var \Blueprint\Models\Model $model */
2727
foreach ($tree['models'] as $model) {
2828
$path = $this->getPath($model);
2929
$this->files->put(
@@ -55,7 +55,7 @@ protected function buildDefinition(Model $model)
5555
{
5656
$definition = '';
5757

58-
/** @var \Blueprint\Column $column */
58+
/** @var \Blueprint\Models\Column $column */
5959
foreach ($model->columns() as $column) {
6060
if ($column->name() === 'id') {
6161
continue;

src/Generators/MigrationGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Blueprint\Generators;
44

55
use Blueprint\Contracts\Generator;
6-
use Blueprint\Model;
6+
use Blueprint\Models\Model;
77
use Illuminate\Support\Str;
88

99
class MigrationGenerator implements Generator
@@ -24,7 +24,7 @@ public function output(array $tree): array
2424

2525
$stub = $this->files->get(STUBS_PATH . '/migration.stub');
2626

27-
/** @var \Blueprint\Model $model */
27+
/** @var \Blueprint\Models\Model $model */
2828
foreach ($tree['models'] as $model) {
2929
$path = $this->getPath($model);
3030
$this->files->put(
@@ -51,7 +51,7 @@ protected function buildDefinition(Model $model)
5151
{
5252
$definition = '';
5353

54-
/** @var \Blueprint\Column $column */
54+
/** @var \Blueprint\Models\Column $column */
5555
foreach ($model->columns() as $column) {
5656
$dataType = $column->dataType();
5757
if ($column->name() === 'id') {

src/Generators/ModelGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Blueprint\Generators;
44

5-
use Blueprint\Column;
65
use Blueprint\Contracts\Generator;
7-
use Blueprint\Model;
6+
use Blueprint\Models\Column;
7+
use Blueprint\Models\Model;
88

99
class ModelGenerator implements Generator
1010
{
@@ -22,7 +22,7 @@ public function output(array $tree): array
2222

2323
$stub = $this->files->get(STUBS_PATH . '/model/class.stub');
2424

25-
/** @var \Blueprint\Model $model */
25+
/** @var \Blueprint\Models\Model $model */
2626
foreach ($tree['models'] as $model) {
2727
$path = $this->getPath($model);
2828
$this->files->put(

src/Generators/Statements/EventGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function output(array $tree): array
2323

2424
$stub = $this->files->get(STUBS_PATH . '/event.stub');
2525

26-
/** @var \Blueprint\Controller $controller */
26+
/** @var \Blueprint\Models\Controller $controller */
2727
foreach ($tree['controllers'] as $controller) {
2828
foreach ($controller->methods() as $method => $statements) {
2929
foreach ($statements as $statement) {

src/Generators/Statements/FormRequestGenerator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
namespace Blueprint\Generators\Statements;
44

5-
use Blueprint\Column;
65
use Blueprint\Contracts\Generator;
7-
use Blueprint\Model;
6+
use Blueprint\Models\Model;
87
use Blueprint\Models\Statements\ValidateStatement;
98
use Blueprint\Translators\Rules;
109
use Illuminate\Support\Str;
@@ -33,7 +32,7 @@ public function output(array $tree): array
3332

3433
$this->registerModels($tree['models']);
3534

36-
/** @var \Blueprint\Controller $controller */
35+
/** @var \Blueprint\Models\Controller $controller */
3736
foreach ($tree['controllers'] as $controller) {
3837
foreach ($controller->methods() as $method => $statements) {
3938
foreach ($statements as $statement) {
@@ -124,7 +123,7 @@ private function splitField($field)
124123

125124
private function validationRules(string $qualifier, string $column)
126125
{
127-
/** @var Model $model */
126+
/** @var \Blueprint\Models\Model $model */
128127
$model = $this->modelForContext($qualifier);
129128

130129
if (!is_null($model) && $model->hasColumn($column)) {

src/Generators/Statements/JobGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function output(array $tree): array
2323

2424
$stub = $this->files->get(STUBS_PATH . '/job.stub');
2525

26-
/** @var \Blueprint\Controller $controller */
26+
/** @var \Blueprint\Models\Controller $controller */
2727
foreach ($tree['controllers'] as $controller) {
2828
foreach ($controller->methods() as $method => $statements) {
2929
foreach ($statements as $statement) {

src/Generators/Statements/MailGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function output(array $tree): array
2323

2424
$stub = $this->files->get(STUBS_PATH . '/mail.stub');
2525

26-
/** @var \Blueprint\Controller $controller */
26+
/** @var \Blueprint\Models\Controller $controller */
2727
foreach ($tree['controllers'] as $controller) {
2828
foreach ($controller->methods() as $method => $statements) {
2929
foreach ($statements as $statement) {

src/Generators/Statements/ViewGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function output(array $tree): array
2323

2424
$stub = $this->files->get(STUBS_PATH . '/view.stub');
2525

26-
/** @var \Blueprint\Controller $controller */
26+
/** @var \Blueprint\Models\Controller $controller */
2727
foreach ($tree['controllers'] as $controller) {
2828
foreach ($controller->methods() as $method => $statements) {
2929
foreach ($statements as $statement) {

src/Lexers/ControllerLexer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Blueprint\Lexers;
44

55
use Blueprint\Contracts\Lexer;
6-
use Blueprint\Controller;
7-
use Blueprint\Models\Statements\QueryStatement;
8-
use Blueprint\Models\Statements\RenderStatement;
6+
use Blueprint\Models\Controller;
97

108
class ControllerLexer implements Lexer
119
{

0 commit comments

Comments
 (0)