Skip to content

Commit

Permalink
Fix StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienheyd committed Dec 1, 2021
1 parent 1140d25 commit 4e925e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Commands/Crud/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use function Illuminate\Events\queueable;

class Command extends BaseCommand
{
Expand All @@ -30,11 +29,11 @@ protected function checkRelations($package, $relations)

foreach ($relations as $type => $rels) {
foreach ($rels as $rel) {
if(Namespaces::get($rel['method'])) {
if (Namespaces::get($rel['method'])) {
continue;
}

if (!class_exists("\\".$this->getNamespace($package)."\\Models\\".$rel['model'])) {
if (! class_exists('\\'.$this->getNamespace($package).'\\Models\\'.$rel['model'])) {
question:
$msg = sprintf('Input the namespace for the model <comment>%s</comment>', $rel['model']);
$ns = $this->ask($msg, 'App\Models');
Expand Down
5 changes: 3 additions & 2 deletions src/Commands/Crud/Namespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static function register($name, $namespace)
{
self::$namespaces = Cache::get('namespaces', self::$namespaces);

if(! isset(self::$namespaces[$name])) {
if (! isset(self::$namespaces[$name])) {
self::$namespaces[$name] = $namespace;
Cache::put('namespaces', self::$namespaces, 3600);
}
Expand All @@ -21,6 +21,7 @@ public static function register($name, $namespace)
public static function get($name = null)
{
$namespaces = Cache::get('namespaces', self::$namespaces);

return isset($name) ? ($namespaces[$name] ?? false) : $namespaces;
}
}
}
3 changes: 2 additions & 1 deletion src/Commands/CrudPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function handle()
foreach ($tables as $k => $table) {
if (! in_array($table, $inDb)) {
$this->error("Table \"$table\" is not in the current database, maybe you have to run \"php artisan migrate\"");

return;
}

Expand Down Expand Up @@ -135,7 +136,7 @@ private function checkModel($model)
{
$ns = Namespaces::get($model);

if($ns) {
if ($ns) {
return $ns;
}

Expand Down

0 comments on commit 4e925e0

Please sign in to comment.