@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * Generate default class name (for case if not passed as argument) from table name |
| 56 | 56 | * |
| 57 | 57 | * @param $tableName |
| 58 | - * @return mixed |
|
| 58 | + * @return string |
|
| 59 | 59 | */ |
| 60 | 60 | abstract public function generateClassNameFromTable($tableName); |
| 61 | 61 | |
@@ -66,6 +66,9 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | abstract protected function buildClass(): string; |
| 68 | 68 | |
| 69 | + /** |
|
| 70 | + * @param string $name |
|
| 71 | + */ |
|
| 69 | 72 | public function getPathFromClassName($name) { |
| 70 | 73 | $path = str_replace('\\', '/', $name).".php"; |
| 71 | 74 | |
@@ -1,13 +1,12 @@ |
||
| 1 | 1 | <?php namespace Savannabits\JetstreamInertiaGenerator\Generators; |
| 2 | 2 | |
| 3 | +use Illuminate\Console\Command; |
|
| 4 | +use Illuminate\Filesystem\Filesystem; |
|
| 5 | +use Illuminate\Support\Str; |
|
| 6 | +use Savannabits\JetstreamInertiaGenerator\Generators\Traits\Columns; |
|
| 3 | 7 | use Savannabits\JetstreamInertiaGenerator\Generators\Traits\Helpers; |
| 4 | 8 | use Savannabits\JetstreamInertiaGenerator\Generators\Traits\Names; |
| 5 | -use Savannabits\JetstreamInertiaGenerator\Generators\Traits\Columns; |
|
| 6 | -use Illuminate\Console\Command; |
|
| 7 | -use Illuminate\Support\Facades\Schema; |
|
| 8 | 9 | use Symfony\Component\Console\Input\InputArgument; |
| 9 | -use Illuminate\Support\Str; |
|
| 10 | -use Illuminate\Filesystem\Filesystem; |
|
| 11 | 10 | use Symfony\Component\Console\Input\InputInterface; |
| 12 | 11 | use Symfony\Component\Console\Output\OutputInterface; |
| 13 | 12 | |
@@ -1,9 +1,6 @@ |
||
| 1 | 1 | <?php namespace Savannabits\JetstreamInertiaGenerator\Generators\Traits; |
| 2 | 2 | |
| 3 | -use Doctrine\DBAL\DriverManager; |
|
| 4 | 3 | use Doctrine\DBAL\Schema\ForeignKeyConstraint; |
| 5 | -use Illuminate\Database\Capsule\Manager; |
|
| 6 | -use Illuminate\Database\DatabaseManager; |
|
| 7 | 4 | use Illuminate\Support\Collection; |
| 8 | 5 | use Illuminate\Support\Facades\Schema; |
| 9 | 6 | use Illuminate\Support\Str; |
@@ -5,6 +5,9 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | trait Helpers { |
| 7 | 7 | |
| 8 | + /** |
|
| 9 | + * @param string $key |
|
| 10 | + */ |
|
| 8 | 11 | public function option($key = null) { |
| 9 | 12 | return ($key === null || $this->hasOption($key)) ? parent::option($key) : null; |
| 10 | 13 | } |
@@ -27,7 +30,7 @@ discard block |
||
| 27 | 30 | /** |
| 28 | 31 | * Determine if the file already exists. |
| 29 | 32 | * |
| 30 | - * @param $path |
|
| 33 | + * @param string $path |
|
| 31 | 34 | * @return bool |
| 32 | 35 | */ |
| 33 | 36 | protected function alreadyExists($path): bool |
@@ -40,7 +43,7 @@ discard block |
||
| 40 | 43 | * Check if provided relation has a table |
| 41 | 44 | * |
| 42 | 45 | * @param $relationTable |
| 43 | - * @return mixed |
|
| 46 | + * @return boolean |
|
| 44 | 47 | */ |
| 45 | 48 | public function checkRelationTable($relationTable) |
| 46 | 49 | { |