Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 15, 2021
1 parent fd3b2e5 commit adf957b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace IdeHelper\Annotator\ClassAnnotatorTask;

use Throwable;

/**
* Classes that use ModelAwareTrait should automatically have used tables - via loadModel() call - annotated.
*/
Expand Down Expand Up @@ -29,7 +31,7 @@ public function shouldRun(string $path, string $content): bool {
if (method_exists($object, 'loadModel')) {
return true;
}
} catch (\Throwable $exception) {
} catch (Throwable $exception) {
// Do nothing
}

Expand Down
3 changes: 2 additions & 1 deletion src/Annotator/ComponentAnnotator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use IdeHelper\Annotator\Traits\ComponentTrait;
use IdeHelper\Utility\App;
use RuntimeException;
use Throwable;

class ComponentAnnotator extends AbstractAnnotator {

Expand Down Expand Up @@ -81,7 +82,7 @@ protected function getComponentAnnotations(string $className) {
$controller = new Controller();
try {
$object = new $className(new ComponentRegistry($controller));
} catch (\Throwable $e) {
} catch (Throwable $e) {
if ($this->getConfig(static::CONFIG_VERBOSE)) {
$this->_io->warn(' Skipping component annotations: ' . $e->getMessage());
}
Expand Down
3 changes: 2 additions & 1 deletion src/Generator/Task/DatabaseTableTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use IdeHelper\Generator\Directive\ExpectedArguments;
use IdeHelper\Generator\Directive\RegisterArgumentsSet;
use IdeHelper\ValueObject\StringName;
use Throwable;

/**
* This task is useful when using Migrations plugin and creating Migration files.
Expand Down Expand Up @@ -68,7 +69,7 @@ protected function collectTables(): array {
$db = $this->getConnection();
try {
$tables = (new TableScanner($db))->listAll();
} catch (\Exception $exception) {
} catch (Throwable $exception) {
$tables = [];
}
static::$tables = $tables;
Expand Down
4 changes: 2 additions & 2 deletions src/Generator/Task/DatabaseTypeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use Cake\Database\Type;
use Cake\Database\TypeFactory;
use Exception;
use IdeHelper\Generator\Directive\ExpectedArguments;
use IdeHelper\Generator\Directive\Override;
use IdeHelper\ValueObject\ClassName;
use IdeHelper\ValueObject\StringName;
use Throwable;

/**
* For Database TypeFactory calls around column types.
Expand Down Expand Up @@ -56,7 +56,7 @@ protected function getTypes(): array {

try {
$allTypes = Type::buildAll();
} catch (Exception $exception) {
} catch (Throwable $exception) {
return $types;
}

Expand Down
7 changes: 4 additions & 3 deletions src/Generator/Task/EntityTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use IdeHelper\Generator\Directive\ExpectedArguments;
use IdeHelper\Generator\Directive\RegisterArgumentsSet;
use IdeHelper\ValueObject\StringName;
use Throwable;

class EntityTask extends ModelTask {

Expand Down Expand Up @@ -66,7 +67,7 @@ protected function getEntityFields(): array {
$tableObject = new $className();
$fields = $tableObject->getSchema()->columns();

} catch (\Exception $exception) {
} catch (Throwable $exception) {
// Do nothing
}

Expand All @@ -75,7 +76,7 @@ protected function getEntityFields(): array {
$fieldsFromRelations = $this->addFromRelations($tableObject);
$fields = array_merge($fields, $fieldsFromRelations);
$fields = array_unique($fields);
} catch (\Exception $exception) {
} catch (Throwable $exception) {
// Do nothing
}
}
Expand All @@ -88,7 +89,7 @@ protected function getEntityFields(): array {
$virtualFields = $entityObject->getVirtual();
$fields = array_merge($fields, $virtualFields, $visibleFields);
$fields = array_unique($fields);
} catch (\Exception $exception) {
} catch (Throwable $exception) {
// Do nothing
}

Expand Down
3 changes: 2 additions & 1 deletion src/Utility/ControllerActionParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use ReflectionClass;
use ReflectionMethod;
use RuntimeException;
use Throwable;

class ControllerActionParser {

Expand All @@ -26,7 +27,7 @@ public function parse(string $path): array {
try {
$class = new ReflectionClass(AppController::class);
$methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
} catch (\Throwable $exception) {
} catch (Throwable $exception) {
return [];
}

Expand Down

0 comments on commit adf957b

Please sign in to comment.