From 9a7dbb8bbdcf84b58583c44e3655e7e9f2a5dbeb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 23 May 2019 18:21:32 +0200 Subject: [PATCH] #2783 --- src/app/Console/Commands/MagicCubistCommand.php | 13 +++++++++---- src/app/Magic/Controllers/CubistMagicController.php | 6 +----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/Console/Commands/MagicCubistCommand.php b/src/app/Console/Commands/MagicCubistCommand.php index d7afaf9..d63b842 100644 --- a/src/app/Console/Commands/MagicCubistCommand.php +++ b/src/app/Console/Commands/MagicCubistCommand.php @@ -53,11 +53,16 @@ class MagicCubistCommand extends Command $this->line('Testing ' . $item); /** @var $item \SplFileInfo */ if ($item->isFile() && $item->getExtension() == 'php') { - $class = PHP::instanciateClassInFile($item); - if ($class instanceof CubistMagicModelAbstract) { - $this->line('Generate code of ' . get_class($class)); - $class->generateCode(); + try { + $class = PHP::instanciateClassInFile($item); + if ($class instanceof CubistMagicModelAbstract) { + $this->line('Generate code of ' . get_class($class)); + $class->generateCode(); + } + } catch (\Exception $e) { + } + } } } diff --git a/src/app/Magic/Controllers/CubistMagicController.php b/src/app/Magic/Controllers/CubistMagicController.php index 4e0d69c..3241d58 100644 --- a/src/app/Magic/Controllers/CubistMagicController.php +++ b/src/app/Magic/Controllers/CubistMagicController.php @@ -3,9 +3,8 @@ namespace Cubist\Backpack\app\Magic\Controllers; - use Backpack\CRUD\app\Http\Controllers\CrudController; -use Cubist\Backpack\app\Http\Controllers\CubistCrud; +use Cubist\Backpack\app\Magic\CubistCrud; use Cubist\Backpack\app\Magic\Requests\CubistMagicStoreRequest; use Cubist\Backpack\app\Magic\Requests\CubistMagicUpdateRequest; @@ -27,9 +26,6 @@ class CubistMagicController extends CrudController if (!$this->_plural) { $this->_plural = $this->_singular . 's'; } - if(!$this->_modelNamespace){ - - } /* |-------------------------------------------------------------------------- -- 2.39.5