Skip to content

Commit 7d507a0

Browse files
some fixes
1 parent 640918b commit 7d507a0

File tree

10 files changed

+12
-19
lines changed

10 files changed

+12
-19
lines changed

src/Console/Commands/GenerateEnvExample.php renamed to src/Console/Commands/LaravelProjectAssist/GenerateEnvExample.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<?php
22

3-
namespace HichemtabTech\LaravelProjectAssist\Console\Commands;
3+
namespace App\Console\Commands\LaravelProjectAssist;
44

55
use Illuminate\Console\Command;
6-
use Illuminate\Support\Facades\File;
7-
use Illuminate\Support\Str;
8-
use function App\Console\Commands\app_path;
9-
use function App\Console\Commands\class_basename;
10-
use function App\Console\Commands\lang_path;
116

127
class GenerateEnvExample extends Command
138
{

src/Console/Commands/MakeDataClass.php renamed to src/Console/Commands/LaravelProjectAssist/MakeDataClass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php /** @noinspection ALL */
22

3-
namespace App\Console\Commands;
3+
namespace App\Console\Commands\LaravelProjectAssist;
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Facades\File;
@@ -87,7 +87,7 @@ protected function collectFields(): array
8787

8888
protected function generateDataClass(string $className, string $subdirectory, array $fields, bool $serialize, array $hidden): void
8989
{
90-
$template = File::get(app_path('Console/Commands/stubs/dataClass.stub'));
90+
$template = File::get(app_path('Console/Commands/LaravelProjectAssist/stubs/dataClass.stub'));
9191
$constructor = $this->generateConstructorBuilder($fields);
9292
$uses = [];
9393
if ($serialize) {
@@ -195,7 +195,7 @@ protected function generateConstructorBuilder(array $fields): array
195195

196196
protected function generateDataClassBuilder(string $className, string $subdirectory, array $fields): void
197197
{
198-
$template = File::get(app_path('Console/Commands/stubs/dataClassBuilder.stub'));
198+
$template = File::get(app_path('Console/Commands/LaravelProjectAssist/stubs/dataClassBuilder.stub'));
199199
$replacements = [
200200
'{{class}}' => $className,
201201
'{{builderFields}}' => $this->generateBuilderFields($fields),

src/Console/Commands/MakeLangFile.php renamed to src/Console/Commands/LaravelProjectAssist/MakeLangFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace App\Console\Commands;
3+
namespace App\Console\Commands\LaravelProjectAssist;
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Facades\File;
@@ -48,7 +48,7 @@ public function handle(): void
4848
$replacements = [
4949
'{{CONTENT}}' => $contents[$dir],
5050
];
51-
$template = File::get(app_path('Console/Commands/stubs/lang.stub'));
51+
$template = File::get(app_path('Console/Commands/LaravelProjectAssist/stubs/lang.stub'));
5252
$generatedClass = str_replace(array_keys($replacements), array_values($replacements), $template);
5353

5454
$classPath = lang_path($dir.'/'.$subdirectory.'/'.$scriptName . '.php');

src/Console/Commands/MakeRepository.php renamed to src/Console/Commands/LaravelProjectAssist/MakeRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace App\Console\Commands;
3+
namespace App\Console\Commands\LaravelProjectAssist;
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Facades\File;
7-
use Str;
7+
use Illuminate\Support\Str;
88
use Symfony\Component\Console\Command\Command as CommandAlias;
99

1010
class MakeRepository extends Command
@@ -35,7 +35,7 @@ public function handle(): int
3535
$repositoryClassName = str_replace("RepositoryRepository", "Repository", $repositoryClassName);
3636
$repositorySubdirectory = rtrim(dirname($name), '/\\');
3737

38-
$repositoryStub = File::get(app_path('Console/Commands/stubs/repository.stub'));
38+
$repositoryStub = File::get(app_path('Console/Commands/LaravelProjectAssist/stubs/repository.stub'));
3939

4040

4141

src/Console/Commands/MakeTrait.php renamed to src/Console/Commands/LaravelProjectAssist/MakeTrait.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
namespace App\Console\Commands;
3+
namespace App\Console\Commands\LaravelProjectAssist;
44

55
use Illuminate\Console\Command;
6-
use Illuminate\Contracts\Filesystem\FileNotFoundException;
7-
use Illuminate\Filesystem\Filesystem;
86
use Illuminate\Support\Facades\File;
9-
use Str;
7+
use Illuminate\Support\Str;
108
use Symfony\Component\Console\Command\Command as CommandAlias;
119

1210
/**
@@ -40,7 +38,7 @@ public function handle(): int
4038
$traitName = str_replace("TraitTrait", "Trait", $traitName);
4139
$traitSubdirectory = rtrim(dirname($name), '/\\');
4240

43-
$traitStub = File::get(app_path('Console/Commands/stubs/trait.stub'));
41+
$traitStub = File::get(app_path('Console/Commands/LaravelProjectAssist/stubs/trait.stub'));
4442

4543
$traitStub = str_replace('{{className}}', $traitName, $traitStub);
4644
$traitStub = str_replace('\{{subdirectory}}', ($traitSubdirectory != "." ? "\\".$traitSubdirectory : ""), $traitStub);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)