From c83797231d03e802d0274b97fc90d1c042471acd Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Sat, 1 Nov 2014 12:00:45 +1100 Subject: [PATCH] Subsequent expressions are on a new line (see developer guide > PSR exceptions) --- modules/backend/behaviors/FormController.php | 9 ++- modules/backend/classes/Controller.php | 21 ++++--- modules/backend/controllers/Auth.php | 9 ++- modules/backend/formwidgets/FileUpload.php | 6 +- modules/backend/widgets/Lists.php | 52 +++++++++++------ modules/backend/widgets/Search.php | 6 +- .../widgets/lists/assets/js/october.list.js | 3 +- modules/cms/classes/CmsCompoundObject.php | 12 ++-- modules/cms/classes/CmsException.php | 3 +- modules/cms/classes/CmsObject.php | 3 +- modules/cms/classes/CmsObjectQuery.php | 3 +- modules/cms/classes/ComponentHelpers.php | 3 +- modules/cms/classes/Controller.php | 57 ++++++++++++------- modules/cms/classes/FileHelper.php | 8 ++- modules/cms/classes/Router.php | 3 +- modules/cms/classes/SectionParser.php | 12 ++-- modules/cms/controllers/Index.php | 6 +- modules/cms/formwidgets/Components.php | 4 +- modules/cms/twig/DebugExtension.php | 33 +++++++---- modules/cms/twig/FlashNode.php | 3 +- modules/cms/twig/FlashTokenParser.php | 3 +- modules/cms/twig/PlaceholderNode.php | 6 +- modules/cms/twig/PlaceholderTokenParser.php | 3 +- modules/cms/widgets/AssetList.php | 15 +++-- modules/cms/widgets/TemplateList.php | 9 ++- modules/system/assets/js/framework.js | 3 +- modules/system/classes/CombineAssets.php | 24 +++++--- modules/system/classes/Controller.php | 3 +- modules/system/classes/ErrorHandler.php | 9 ++- modules/system/classes/ExceptionBase.php | 27 ++++++--- modules/system/classes/MarkupManager.php | 6 +- modules/system/classes/PluginManager.php | 9 ++- modules/system/classes/SettingsManager.php | 3 +- modules/system/classes/UpdateManager.php | 6 +- modules/system/classes/VersionManager.php | 12 ++-- modules/system/console/CacheClear.php | 5 +- modules/system/console/OctoberUpdate.php | 3 +- modules/system/console/OctoberUtil.php | 3 +- modules/system/controllers/MailTemplates.php | 3 +- modules/system/controllers/Settings.php | 3 +- modules/system/controllers/Updates.php | 24 +++++--- .../system/controllers/updates/_execute.htm | 11 ++-- modules/system/models/File.php | 6 +- modules/system/models/MailSettings.php | 4 +- modules/system/models/MailTemplate.php | 3 +- modules/system/models/PluginVersion.php | 6 +- modules/system/models/RequestLog.php | 3 +- modules/system/reportwidgets/Status.php | 3 +- modules/system/traits/AssetMaker.php | 3 +- modules/system/traits/ConfigMaker.php | 9 ++- modules/system/twig/Loader.php | 3 +- 51 files changed, 320 insertions(+), 166 deletions(-) diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php index c4de44f9c..20797c00a 100644 --- a/modules/backend/behaviors/FormController.php +++ b/modules/backend/behaviors/FormController.php @@ -141,7 +141,8 @@ class FormController extends ControllerBehavior $model = $this->controller->formCreateModelObject(); $this->initForm($model); $this->controller->vars['formModel'] = $model; - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->controller->handleError($ex); } } @@ -196,7 +197,8 @@ class FormController extends ControllerBehavior $this->initForm($model); $this->controller->vars['formModel'] = $model; - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->controller->handleError($ex); } } @@ -274,7 +276,8 @@ class FormController extends ControllerBehavior $this->initForm($model); $this->controller->vars['formModel'] = $model; - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->controller->handleError($ex); } } diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index b47b940ee..63e20a41a 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -346,7 +346,8 @@ class Controller extends Extendable // )); // } // } - } else { + } + else { $partialList = []; } @@ -385,7 +386,8 @@ class Controller extends Extendable /* * No redirect is used, look for any flash messages */ - } elseif (Flash::check()) { + } + elseif (Flash::check()) { $responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages'); } @@ -397,7 +399,8 @@ class Controller extends Extendable } return Response::make()->setContent($responseContents); - } catch (ValidationException $ex) { + } + catch (ValidationException $ex) { /* * Handle validation error gracefully */ @@ -406,14 +409,17 @@ class Controller extends Extendable $responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages'); $responseContents['X_OCTOBER_ERROR_FIELDS'] = $ex->getFields(); return Response::make($responseContents, 406); - } catch (MassAssignmentException $ex) { + } + catch (MassAssignmentException $ex) { return Response::make( Lang::get('backend::lang.model.mass_assignment_failed', ['attribute' => $ex->getMessage()]), 500 ); - } catch (ApplicationException $ex) { + } + catch (ApplicationException $ex) { return Response::make($ex->getMessage(), 500); - } catch (Exception $ex) { + } + catch (Exception $ex) { return Response::make( sprintf('"%s" on line %s of %s', $ex->getMessage(), $ex->getLine(), $ex->getFile()), 500 @@ -454,7 +460,8 @@ class Controller extends Extendable $result = call_user_func_array([$widget, $handlerName], $this->params); return ($result) ?: true; } - } else { + } + else { /* * Process page specific handler (index_onSomething) */ diff --git a/modules/backend/controllers/Auth.php b/modules/backend/controllers/Auth.php index 9e7edab67..a7c91e9a9 100644 --- a/modules/backend/controllers/Auth.php +++ b/modules/backend/controllers/Auth.php @@ -52,7 +52,8 @@ class Auth extends Controller } else { $this->bodyClass .= ' preload'; } - } catch (Exception $ex) { + } + catch (Exception $ex) { Flash::error($ex->getMessage()); } } @@ -103,7 +104,8 @@ class Auth extends Controller if (post('postback')) { return $this->restore_onSubmit(); } - } catch (Exception $ex) { + } + catch (Exception $ex) { Flash::error($ex->getMessage()); } } @@ -156,7 +158,8 @@ class Auth extends Controller if (!$userId || !$code) { throw new ApplicationException(trans('backend::lang.account.reset_error')); } - } catch (Exception $ex) { + } + catch (Exception $ex) { Flash::error($ex->getMessage()); } diff --git a/modules/backend/formwidgets/FileUpload.php b/modules/backend/formwidgets/FileUpload.php index a4fb5b2dc..7c3c7a9c6 100644 --- a/modules/backend/formwidgets/FileUpload.php +++ b/modules/backend/formwidgets/FileUpload.php @@ -176,7 +176,8 @@ class FileUpload extends FormWidgetBase } throw new SystemException('Unable to find file, it may no longer exist'); - } catch (Exception $ex) { + } + catch (Exception $ex) { return json_encode(['error' => $ex->getMessage()]); } } @@ -243,7 +244,8 @@ class FileUpload extends FormWidgetBase $file->thumb = $file->getThumb($this->imageWidth, $this->imageHeight, ['mode' => 'crop']); $result = $file; - } catch (Exception $ex) { + } + catch (Exception $ex) { $result = json_encode(['error' => $ex->getMessage()]); } diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index 35cbb8a38..809c615f1 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -209,7 +209,8 @@ class Lists extends WidgetBase $this->vars['pageLast'] = $this->records->getLastPage(); $this->vars['pageFrom'] = $this->records->getFrom(); $this->vars['pageTo'] = $this->records->getTo(); - } else { + } + else { $this->vars['recordTotal'] = $this->records->count(); $this->vars['pageCurrent'] = 1; } @@ -305,10 +306,11 @@ class Lists extends WidgetBase : $table . '.' . $column->valueFrom; $relationSearchable[$column->relation][] = $columnName; + } /* * Primary */ - } else { + else { $columnName = isset($column->sqlSelect) ? DbDongle::raw($this->parseTableName($column->sqlSelect, $primaryTable)) : $primaryTable . '.' . $column->columnName; @@ -391,10 +393,11 @@ class Lists extends WidgetBase $joinSql = $countQuery->select($joinSql)->toSql(); $selects[] = Db::raw("(".$joinSql.") as ".$alias); + } /* * Primary column */ - } else { + else { $sqlSelect = $this->parseTableName($column->sqlSelect, $primaryTable); $selects[] = DbDongle::raw($sqlSelect . ' as '. $alias); } @@ -449,7 +452,8 @@ class Lists extends WidgetBase { if ($this->showTree) { $records = $this->model->getAllRoot(); - } else { + } + else { $model = $this->prepareModel(); $records = ($this->showPagination) ? $model->paginate($this->recordsPerPage) @@ -544,10 +548,11 @@ class Lists extends WidgetBase $definitions[$columnName]->invisible = false; $columns[$columnName] = $definitions[$columnName]; } + } /* * Use default column list */ - } else { + else { foreach ($definitions as $columnName => $column) { if ($column->invisible) { continue; @@ -617,9 +622,11 @@ class Lists extends WidgetBase { if (is_string($config)) { $label = $config; - } elseif (isset($config['label'])) { + } + elseif (isset($config['label'])) { $label = $config['label']; - } else { + } + else { $label = studly_case($name); } @@ -683,11 +690,14 @@ class Lists extends WidgetBase if ($column->valueFrom) { if (!array_key_exists($columnName, $record->getRelations())) { $value = null; - } elseif ($this->isColumnRelated($column, true)) { + } + elseif ($this->isColumnRelated($column, true)) { $value = implode(', ', $record->{$columnName}->lists($column->valueFrom)); - } elseif ($this->isColumnRelated($column)) { + } + elseif ($this->isColumnRelated($column)) { $value = $record->{$columnName}->{$column->valueFrom}; - } else { + } + else { $value = $record->{$column->valueFrom}; } /* @@ -695,10 +705,12 @@ class Lists extends WidgetBase * so prevent the Model from attempting to load the relation * if the value is NULL. */ - } else { + } + else { if ($record->hasRelation($columnName) && array_key_exists($columnName, $record->attributes)) { $value = $record->attributes[$columnName]; - } else { + } + else { $value = $record->{$columnName}; } } @@ -881,7 +893,8 @@ class Lists extends WidgetBase { if (empty($term)) { $this->showTree = $this->getConfig('showTree', $this->showTree); - } else { + } + else { $this->showTree = false; } @@ -926,7 +939,8 @@ class Lists extends WidgetBase if ($column != $sortOptions['column'] || $sortOptions['direction'] == 'asc') { $this->sortDirection = $sortOptions['direction'] = 'desc'; - } else { + } + else { $this->sortDirection = $sortOptions['direction'] = 'asc'; } @@ -962,15 +976,16 @@ class Lists extends WidgetBase if ($this->showSorting && ($sortOptions = $this->getSession('sort'))) { $this->sortColumn = $sortOptions['column']; $this->sortDirection = $sortOptions['direction']; - + } /* * Supplied default */ - } else { + else { if (is_string($this->defaultSort)) { $this->sortColumn = $this->defaultSort; $this->sortDirection = 'desc'; - } elseif (is_array($this->defaultSort) && isset($this->defaultSort['column'])) { + } + elseif (is_array($this->defaultSort) && isset($this->defaultSort['column'])) { $this->sortColumn = $this->defaultSort['column']; $this->sortDirection = (isset($this->defaultSort['direction'])) ? $this->defaultSort['direction'] : @@ -997,7 +1012,8 @@ class Lists extends WidgetBase { if ($column === null) { return (count($this->getSortableColumns()) > 0); - } else { + } + else { return array_key_exists($column, $this->getSortableColumns()); } } diff --git a/modules/backend/widgets/Search.php b/modules/backend/widgets/Search.php index 039a0ed71..59c332812 100644 --- a/modules/backend/widgets/Search.php +++ b/modules/backend/widgets/Search.php @@ -84,7 +84,8 @@ class Search extends WidgetBase if ($this->customPartial) { return $this->controller->makePartial($this->customPartial); - } else { + } + else { return $this->makePartial('search'); } } @@ -134,7 +135,8 @@ class Search extends WidgetBase { if (strlen($term)) { $this->putSession('term', $term); - } else { + } + else { $this->resetSession(); } diff --git a/modules/backend/widgets/lists/assets/js/october.list.js b/modules/backend/widgets/lists/assets/js/october.list.js index 07053c6a3..0c6245c7f 100644 --- a/modules/backend/widgets/lists/assets/js/october.list.js +++ b/modules/backend/widgets/lists/assets/js/october.list.js @@ -51,7 +51,8 @@ if (checked) { $el.closest('tr').addClass('active') - } else { + } + else { $('.list-checkbox input[type="checkbox"]', head).prop('checked', false) $el.closest('tr').removeClass('active') } diff --git a/modules/cms/classes/CmsCompoundObject.php b/modules/cms/classes/CmsCompoundObject.php index a086ce4a4..deb9f8673 100644 --- a/modules/cms/classes/CmsCompoundObject.php +++ b/modules/cms/classes/CmsCompoundObject.php @@ -202,7 +202,8 @@ class CmsCompoundObject extends CmsObject foreach ($values as &$value) { if (!is_array($value)) { $value = trim($value); - } else { + } + else { $trim($value); } } @@ -229,7 +230,8 @@ class CmsCompoundObject extends CmsObject $code = preg_replace('/\?>$/', '', $code); $content[] = 'code.PHP_EOL.'?>'; - } else { + } + else { $content[] = $this->code; } } @@ -322,7 +324,8 @@ class CmsCompoundObject extends CmsObject if (self::$objectComponentPropertyMap !== null) { $objectComponentMap = self::$objectComponentPropertyMap; - } else { + } + else { $cached = Cache::get($key, false); $unserialized = $cached ? @unserialize($cached) : false; $objectComponentMap = $unserialized ? $unserialized : []; @@ -343,7 +346,8 @@ class CmsCompoundObject extends CmsObject if (!isset($this->settings['components'])) { $objectComponentMap[$objectCode] = []; - } else { + } + else { foreach ($this->settings['components'] as $componentName => $componentSettings) { $nameParts = explode(' ', $componentName); if (count($nameParts > 1)) { diff --git a/modules/cms/classes/CmsException.php b/modules/cms/classes/CmsException.php index b8f5d5d50..ef236fbc6 100644 --- a/modules/cms/classes/CmsException.php +++ b/modules/cms/classes/CmsException.php @@ -165,7 +165,8 @@ class CmsException extends ApplicationException /* * Errors occurring the PHP code base class (Cms\Classes\CodeBase) */ - } else { + } + else { $trace = $exception->getTrace(); if (isset($trace[1]['class'])) { $class = $trace[1]['class']; diff --git a/modules/cms/classes/CmsObject.php b/modules/cms/classes/CmsObject.php index 85a13214c..c0d6822c7 100644 --- a/modules/cms/classes/CmsObject.php +++ b/modules/cms/classes/CmsObject.php @@ -320,7 +320,8 @@ class CmsObject implements ArrayAccess $methodName = 'set'.ucfirst($key); if (method_exists($this, $methodName)) { $this->$methodName($value); - } else { + } + else { $this->$key = $value; } } diff --git a/modules/cms/classes/CmsObjectQuery.php b/modules/cms/classes/CmsObjectQuery.php index da069f81f..2308213a3 100644 --- a/modules/cms/classes/CmsObjectQuery.php +++ b/modules/cms/classes/CmsObjectQuery.php @@ -75,7 +75,8 @@ class CmsObjectQuery if ($this->useCache) { return forward_static_call([$this->cmsObject, 'loadCached'], $this->theme, $fileName); - } else { + } + else { return forward_static_call([$this->cmsObject, 'load'], $this->theme, $fileName); } } diff --git a/modules/cms/classes/ComponentHelpers.php b/modules/cms/classes/ComponentHelpers.php index 8c848e9c6..5847c198f 100644 --- a/modules/cms/classes/ComponentHelpers.php +++ b/modules/cms/classes/ComponentHelpers.php @@ -59,7 +59,8 @@ class ComponentHelpers array_walk($property[$name], function (&$_value, $key) { $_value = Lang::get($_value); }); - } else { + } + else { $property[$name] = Lang::get($value); } } diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 4a360cea6..a1de966fe 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -194,7 +194,8 @@ class Controller extends BaseController */ if (!$page->layout) { $layout = Layout::initFallback($this->theme); - } elseif (($layout = Layout::loadCached($this->theme, $page->layout)) === null) { + } + elseif (($layout = Layout::loadCached($this->theme, $page->layout)) === null) { throw new CmsException(Lang::get('cms::lang.layout.not_found', ['name'=>$page->layout])); } @@ -280,7 +281,8 @@ class Controller extends BaseController $template = $this->twig->loadTemplate($this->page->getFullPath()); $this->pageContents = $template->render($this->vars); CmsException::unmask(); - } else { + } + else { $this->pageContents = $apiResult; } @@ -406,7 +408,8 @@ class Controller extends BaseController $componentObj->alias = $alias; $this->vars[$alias] = $this->layout->components[$alias] = $componentObj; - } else { + } + else { if (!$componentObj = $manager->makeComponent($name, $this->pageObj, $properties)) { throw new CmsException(Lang::get('cms::lang.component.not_found', ['name'=>$name])); } @@ -446,7 +449,8 @@ class Controller extends BaseController throw new CmsException(Lang::get('cms::lang.partial.invalid_name', ['name'=>$partial])); } } - } else { + } + else { $partialList = []; } @@ -465,7 +469,8 @@ class Controller extends BaseController */ if (is_array($result)) { $responseContents = array_merge($responseContents, $result); - } elseif (is_string($result)) { + } + elseif (is_string($result)) { $responseContents['result'] = $result; } @@ -485,16 +490,19 @@ class Controller extends BaseController } return Response::make()->setContent($responseContents); - } catch (ValidationException $ex) { + } + catch (ValidationException $ex) { /* * Handle validation errors */ $responseContents['X_OCTOBER_ERROR_FIELDS'] = $ex->getFields(); $responseContents['X_OCTOBER_ERROR_MESSAGE'] = $ex->getMessage(); return Response::make($responseContents, 406); - } catch (ApplicationException $ex) { + } + catch (ApplicationException $ex) { return Response::make($ex->getMessage(), 500); - } catch (Exception $ex) { + } + catch (Exception $ex) { /* * Display a "dumbed down" error if custom page is activated * otherwise display a more detailed error. @@ -535,10 +543,11 @@ class Controller extends BaseController $result = $componentObj->$handlerName(); return ($result) ?: true; } + } /* * Process code section handler */ - } else { + else { if (method_exists($this->pageObj, $handler)) { $result = $this->pageObj->$handler(); return ($result) ?: true; @@ -694,21 +703,25 @@ class Controller extends BaseController if (!strlen($componentAlias)) { if ($this->componentContext !== null) { $componentObj = $this->componentContext; - } elseif (($componentObj = $this->findComponentByPartial($partialName)) === null) { + } + elseif (($componentObj = $this->findComponentByPartial($partialName)) === null) { if ($throwException) { throw new CmsException(Lang::get('cms::lang.partial.not_found', ['name'=>$name])); - } else { + } + else { return false; } } /* * Component alias is supplied */ - } else { + } + else { if (($componentObj = $this->findComponentByName($componentAlias)) === null) { if ($throwException) { throw new CmsException(Lang::get('cms::lang.component.not_found', ['name'=>$componentAlias])); - } else { + } + else { return false; } } @@ -736,7 +749,8 @@ class Controller extends BaseController if ($partial === null) { if ($throwException) { throw new CmsException(Lang::get('cms::lang.partial.not_found', ['name'=>$name])); - } else { + } + else { return false; } } @@ -745,14 +759,16 @@ class Controller extends BaseController * Set context for self access */ $this->vars['__SELF__'] = $componentObj; - } else { + } + else { /* * Process theme partial */ if (($partial = Partial::loadCached($this->theme, $name)) === null) { if ($throwException) { throw new CmsException(Lang::get('cms::lang.partial.not_found', ['name'=>$name])); - } else { + } + else { return false; } } @@ -831,12 +847,14 @@ class Controller extends BaseController */ if ($event = $this->fireEvent('page.beforeRenderContent', [$name], true)) { $content = $event; - } elseif ($event = Event::fire('cms.page.beforeRenderContent', [$this, $name], true)) { + } + elseif ($event = Event::fire('cms.page.beforeRenderContent', [$this, $name], true)) { $content = $event; + } /* * Load content from theme */ - } elseif (($content = Content::loadCached($this->theme, $name)) === null) { + elseif (($content = Content::loadCached($this->theme, $name)) === null) { throw new CmsException(Lang::get('cms::lang.content.not_found', ['name'=>$name])); } @@ -988,7 +1006,8 @@ class Controller extends BaseController if (is_array($url)) { $_url = Request::getBaseUrl(); $_url .= CombineAssets::combine($url, $themePath); - } else { + } + else { $_url = Request::getBasePath().$themePath; if ($url !== null) { $_url .= '/'.$url; diff --git a/modules/cms/classes/FileHelper.php b/modules/cms/classes/FileHelper.php index 97766725c..8029e9c25 100644 --- a/modules/cms/classes/FileHelper.php +++ b/modules/cms/classes/FileHelper.php @@ -78,18 +78,20 @@ class FileHelper public static function formatIniString($data, $level = 1) { $content = null; - $sections = []; + foreach ($data as $key => $value) { if (is_array($value)) { if ($level == 1) { $sections[$key] = self::formatIniString($value, $level+1); - } else { + } + else { foreach ($value as $val) { $content .= $key.'[] = "'.self::escapeIniString($val).'"'.PHP_EOL; } } - } elseif (strlen($value)) { + } + elseif (strlen($value)) { $content .= $key.' = "'.self::escapeIniString($value).'"'.PHP_EOL; } } diff --git a/modules/cms/classes/Router.php b/modules/cms/classes/Router.php index 13c2fb950..9fdf0cceb 100644 --- a/modules/cms/classes/Router.php +++ b/modules/cms/classes/Router.php @@ -208,7 +208,8 @@ class Router $cacheable = Config::get('cms.enableRoutesCache'); if ($cacheable) { $cached = Cache::get($key, false); - } else { + } + else { $cached = false; } diff --git a/modules/cms/classes/SectionParser.php b/modules/cms/classes/SectionParser.php index ebd321064..74027e3e0 100644 --- a/modules/cms/classes/SectionParser.php +++ b/modules/cms/classes/SectionParser.php @@ -52,10 +52,12 @@ class SectionParser $result['code'] = preg_replace('/\?\>\s*$/', '', $result['code']); $result['markup'] = $sections[2]; - } elseif ($count == 2) { + } + elseif ($count == 2) { $result['settings'] = parse_ini_string($sections[0], true); $result['markup'] = $sections[1]; - } elseif ($count == 1) { + } + elseif ($count == 1) { $result['markup'] = $sections[0]; } @@ -83,10 +85,12 @@ class SectionParser $result['settings'] = self::adjustLinePosition($content); $result['code'] = self::calculateLinePosition($content); $result['markup'] = self::calculateLinePosition($content, 2); - } elseif ($count == 2) { + } + elseif ($count == 2) { $result['settings'] = self::adjustLinePosition($content); $result['markup'] = self::calculateLinePosition($content); - } elseif ($count == 1) { + } + elseif ($count == 1) { $result['markup'] = 1; } diff --git a/modules/cms/controllers/Index.php b/modules/cms/controllers/Index.php index fa1d5a0b4..3c4f23d93 100644 --- a/modules/cms/controllers/Index.php +++ b/modules/cms/controllers/Index.php @@ -76,7 +76,8 @@ class Index extends Controller new ComponentList($this, 'componentList'); new AssetList($this, 'assetList'); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); } } @@ -238,7 +239,8 @@ class Index extends Controller $deleted[] = $path; } } - } catch (Exception $ex) { + } + catch (Exception $ex) { $error = $ex->getMessage(); } diff --git a/modules/cms/formwidgets/Components.php b/modules/cms/formwidgets/Components.php index 445de3d92..1b693e5d4 100644 --- a/modules/cms/formwidgets/Components.php +++ b/modules/cms/formwidgets/Components.php @@ -36,6 +36,7 @@ class Components extends FormWidgetBase $manager = ComponentManager::instance(); $manager->listComponents(); + foreach ($this->model->settings['components'] as $name => $properties) { list($name, $alias) = strpos($name, ' ') ? explode(' ', $name) : [$name, $name]; @@ -55,7 +56,8 @@ class Components extends FormWidgetBase $componentObj->pluginIcon = $pluginDetails['icon']; } } - } catch (Exception $ex) { + } + catch (Exception $ex) { $componentObj = new UnknownComponent(null, $properties, $ex->getMessage()); $componentObj->alias = $alias; $componentObj->pluginIcon = 'icon-bug'; diff --git a/modules/cms/twig/DebugExtension.php b/modules/cms/twig/DebugExtension.php index d0c79de1e..bd538fa8f 100644 --- a/modules/cms/twig/DebugExtension.php +++ b/modules/cms/twig/DebugExtension.php @@ -99,7 +99,8 @@ class DebugExtension extends Twig_Extension $result .= $this->dump($vars, static::PAGE_CAPTION); - } else { + } + else { $this->variablePrefix = false; for ($i = 2; $i < $count; $i++) { @@ -108,9 +109,11 @@ class DebugExtension extends Twig_Extension if ($var instanceof ComponentBase) { $caption = [static::COMPONENT_CAPTION, get_class($var)]; - } elseif (is_array($var)) { + } + elseif (is_array($var)) { $caption = static::ARRAY_CAPTION; - } else { + } + else { $caption = [static::OBJECT_CAPTION, get_class($var)]; } @@ -148,9 +151,11 @@ class DebugExtension extends Twig_Extension if (!is_array($variables)) { if ($variables instanceof Paginator) { $variables = $this->paginatorToArray($variables); - } elseif (is_object($variables)) { + } + elseif (is_object($variables)) { $variables = $this->objectToArray($variables); - } else { + } + else { $variables = [$variables]; } } @@ -220,12 +225,15 @@ class DebugExtension extends Twig_Extension { if ($this->variablePrefix === true) { $output = '{{ %s }}'; - } elseif (is_array($this->variablePrefix)) { + } + elseif (is_array($this->variablePrefix)) { $prefix = implode('.', $this->variablePrefix); $output = '{{ '.$prefix.'.%s }}'; - } elseif ($this->variablePrefix) { + } + elseif ($this->variablePrefix) { $output = '{{ '.$this->variablePrefix.'.%s }}'; - } else { + } + else { $output = '%s'; } @@ -279,11 +287,14 @@ class DebugExtension extends Twig_Extension if ($variable instanceof ComponentBase) { $label = 'Component'; - } elseif ($variable instanceof Collection) { + } + elseif ($variable instanceof Collection) { $label = 'Collection('.$variable->count().')'; - } elseif ($variable instanceof Paginator) { + } + elseif ($variable instanceof Paginator) { $label = 'Paged Collection('.$variable->count().')'; - } elseif ($variable instanceof Model) { + } + elseif ($variable instanceof Model) { $label = 'Model'; } diff --git a/modules/cms/twig/FlashNode.php b/modules/cms/twig/FlashNode.php index fae4a48f1..c0234c569 100644 --- a/modules/cms/twig/FlashNode.php +++ b/modules/cms/twig/FlashNode.php @@ -43,7 +43,8 @@ class FlashNode extends Twig_Node ->outdent() ->write('}'.PHP_EOL) ; - } else { + } + else { $compiler ->addDebugInfo($this) ->write('$context["type"] = ') diff --git a/modules/cms/twig/FlashTokenParser.php b/modules/cms/twig/FlashTokenParser.php index 69faba566..bd3b439d4 100644 --- a/modules/cms/twig/FlashTokenParser.php +++ b/modules/cms/twig/FlashTokenParser.php @@ -27,7 +27,8 @@ class FlashTokenParser extends Twig_TokenParser if ($token = $stream->nextIf(Twig_Token::NAME_TYPE)) { $name = $token->getValue(); - } else { + } + else { $name = 'all'; } $stream->expect(Twig_Token::BLOCK_END_TYPE); diff --git a/modules/cms/twig/PlaceholderNode.php b/modules/cms/twig/PlaceholderNode.php index 0ee714890..650f147c7 100644 --- a/modules/cms/twig/PlaceholderNode.php +++ b/modules/cms/twig/PlaceholderNode.php @@ -54,7 +54,8 @@ class PlaceholderNode extends Twig_Node $compiler->addDebugInfo($this); if (!$isText) { $compiler->write("echo \$this->env->getExtension('CMS')->displayBlock("); - } else { + } + else { $compiler->write("echo twig_escape_filter(\$this->env, \$this->env->getExtension('CMS')->displayBlock("); } @@ -67,7 +68,8 @@ class PlaceholderNode extends Twig_Node if (!$isText) { $compiler->raw(";\n"); - } else { + } + else { $compiler->raw(");\n"); } diff --git a/modules/cms/twig/PlaceholderTokenParser.php b/modules/cms/twig/PlaceholderTokenParser.php index 767b6a0a0..018297b25 100644 --- a/modules/cms/twig/PlaceholderTokenParser.php +++ b/modules/cms/twig/PlaceholderTokenParser.php @@ -43,7 +43,8 @@ class PlaceholderTokenParser extends Twig_TokenParser $body = $this->parser->subparse([$this, 'decidePlaceholderEnd'], true); $stream->expect(Twig_Token::BLOCK_END_TYPE); - } else { + } + else { $params = $this->loadParams($stream); } diff --git a/modules/cms/widgets/AssetList.php b/modules/cms/widgets/AssetList.php index 53c894427..dcb85d2c3 100644 --- a/modules/cms/widgets/AssetList.php +++ b/modules/cms/widgets/AssetList.php @@ -175,7 +175,8 @@ class AssetList extends WidgetBase ['name'=>$path] )); } - } else { + } + else { $empty = File::isDirectoryEmpty($fullPath); if ($empty === false) { throw new ApplicationException(Lang::get( @@ -197,7 +198,8 @@ class AssetList extends WidgetBase } } } - } catch (Exception $ex) { + } + catch (Exception $ex) { $error = $ex->getMessage(); } @@ -367,7 +369,8 @@ class AssetList extends WidgetBase ['file'=>$basename] )); } - } elseif (is_dir($originalFullPath)) { + } + elseif (is_dir($originalFullPath)) { if (!@File::copyDirectory($originalFullPath, $newFullPath)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_moving_directory', @@ -538,7 +541,8 @@ class AssetList extends WidgetBase 'name' => $node->getFilename(), 'editable' => false ]; - } elseif ($node->isFile()) { + } + elseif ($node->isFile()) { $files[] = (object)[ 'type' => 'file', 'path' => File::normalizePath($this->getRelativePath($node->getPathname())), @@ -704,7 +708,8 @@ class AssetList extends WidgetBase $uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName()); die('success'); - } catch (Exception $ex) { + } + catch (Exception $ex) { $message = $fileName !== null ? Lang::get('cms::lang.asset.error_uploading_file', ['name' => $fileName, 'error' => $ex->getMessage()]) : $ex->getMessage(); diff --git a/modules/cms/widgets/TemplateList.php b/modules/cms/widgets/TemplateList.php index d218a1dc9..54d0db214 100644 --- a/modules/cms/widgets/TemplateList.php +++ b/modules/cms/widgets/TemplateList.php @@ -176,7 +176,8 @@ class TemplateList extends WidgetBase $filteredItems[] = $item; } } - } else { + } + else { $filteredItems = $normalizedItems; } @@ -198,7 +199,8 @@ class TemplateList extends WidgetBase } $foundGroups[$group]->items[] = $itemData; - } else { + } + else { $result[] = $itemData; } } @@ -283,7 +285,8 @@ class TemplateList extends WidgetBase if (Str::contains(Str::lower($item->title), $word)) { return true; } - } elseif (Str::contains(Str::lower($item->fileName), $word)) { + } + elseif (Str::contains(Str::lower($item->fileName), $word)) { return true; } diff --git a/modules/system/assets/js/framework.js b/modules/system/assets/js/framework.js index 781241d31..a6e71d6a0 100644 --- a/modules/system/assets/js/framework.js +++ b/modules/system/assets/js/framework.js @@ -336,7 +336,8 @@ if (window.jQuery === undefined) try { return JSON.parse(JSON.stringify(eval("({" + value + "})"))) - } catch (e) { + } + catch (e) { throw new Error('Error parsing the '+name+' attribute value. '+e) } } diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php index 7f53f5d9e..c748bde26 100644 --- a/modules/system/classes/CombineAssets.php +++ b/modules/system/classes/CombineAssets.php @@ -178,7 +178,8 @@ class CombineAssets { if ($extension === null) { $this->aliases = []; - } else { + } + else { $this->aliases[$extension] = []; } @@ -194,9 +195,11 @@ class CombineAssets { if ($extension === null) { return $this->aliases; - } elseif (isset($this->aliases[$extension])) { + } + elseif (isset($this->aliases[$extension])) { return $this->aliases[$extension]; - } else { + } + else { return null; } } @@ -238,7 +241,8 @@ class CombineAssets { if ($extension === null) { $this->filters = []; - } else { + } + else { $this->filters[$extension] = []; } @@ -254,9 +258,11 @@ class CombineAssets { if ($extension === null) { return $this->filters; - } elseif (isset($this->filters[$extension])) { + } + elseif (isset($this->filters[$extension])) { return $this->filters[$extension]; - } else { + } + else { return null; } } @@ -316,7 +322,8 @@ class CombineAssets if (count($combineCss) > count($combineJs)) { $extension = 'css'; $assets = $combineCss; - } else { + } + else { $extension = 'js'; $assets = $combineJs; } @@ -373,7 +380,8 @@ class CombineAssets if ($actionExists) { return URL::action($combineAction, [$outputFilename], false); - } else { + } + else { return Request::getBasePath().'/combine/'.$outputFilename; } } diff --git a/modules/system/classes/Controller.php b/modules/system/classes/Controller.php index f632eccac..ae68562b3 100644 --- a/modules/system/classes/Controller.php +++ b/modules/system/classes/Controller.php @@ -33,7 +33,8 @@ class Controller extends BaseController $combiner = new CombineAssets; return $combiner->getContents($cacheId); - } catch (Exception $ex) { + } + catch (Exception $ex) { return '/* '.$ex->getMessage().' */'; } } diff --git a/modules/system/classes/ErrorHandler.php b/modules/system/classes/ErrorHandler.php index ddc4d0046..b97289872 100644 --- a/modules/system/classes/ErrorHandler.php +++ b/modules/system/classes/ErrorHandler.php @@ -63,11 +63,13 @@ class ErrorHandler if ($proposedException instanceof BaseException) { $exception = $proposedException; // If there is an active mask prepared, use that. - } elseif (static::$activeMask !== null) { + } + elseif (static::$activeMask !== null) { $exception = static::$activeMask; $exception->setMask($proposedException); // Otherwise we should mask it with our own default scent. - } else { + } + else { $exception = new ApplicationException($proposedException->getMessage(), 0); $exception->setMask($proposedException); } @@ -100,7 +102,8 @@ class ErrorHandler { if (count(static::$maskLayers) > 0) { static::$activeMask = array_pop(static::$maskLayers); - } else { + } + else { static::$activeMask = null; } } diff --git a/modules/system/classes/ExceptionBase.php b/modules/system/classes/ExceptionBase.php index 45a178c72..967d5b04d 100644 --- a/modules/system/classes/ExceptionBase.php +++ b/modules/system/classes/ExceptionBase.php @@ -320,13 +320,17 @@ class ExceptionBase extends Exception foreach ($argument as $index => $obj) { if (is_array($obj)) { $value = 'array('.count($obj).')'; - } elseif (is_object($obj)) { + } + elseif (is_object($obj)) { $value = 'object('.get_class($obj).')'; - } elseif (is_integer($obj)) { + } + elseif (is_integer($obj)) { $value = $obj; - } elseif ($obj === null) { + } + elseif ($obj === null) { $value = "null"; - } else { + } + else { $value = "'".$obj."'"; } @@ -335,16 +339,21 @@ class ExceptionBase extends Exception if (count($items)) { $arg = 'array(' . count($argument) . ') [' . implode(', ', $items) . ']'; - } else { + } + else { $arg = 'array(0)'; } - } elseif (is_object($argument)) { + } + elseif (is_object($argument)) { $arg = 'object('.get_class($argument).')'; - } elseif ($argument === null) { + } + elseif ($argument === null) { $arg = "null"; - } elseif (is_integer($argument)) { + } + elseif (is_integer($argument)) { $arg = $argument; - } else { + } + else { $arg = "'".$argument."'"; } diff --git a/modules/system/classes/MarkupManager.php b/modules/system/classes/MarkupManager.php index 01a86e58f..19d5ceb7b 100644 --- a/modules/system/classes/MarkupManager.php +++ b/modules/system/classes/MarkupManager.php @@ -310,7 +310,8 @@ class MarkupManager if ($replaceWith) { $isWild = $callable; $isWild[0] = str_replace('*', $replaceWith, $callable[0]); - } else { + } + else { $isWild = true; } } @@ -319,7 +320,8 @@ class MarkupManager if ($replaceWith) { $isWild = $isWild ?: $callable; $isWild[1] = str_replace('*', $replaceWith, $callable[1]); - } else { + } + else { $isWild = true; } } diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index a9545d518..3f452e924 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -390,7 +390,8 @@ class PluginManager if (File::exists($path)) { $disabled = json_decode(File::get($path), true); $this->disabledPlugins = array_merge($this->disabledPlugins, $disabled); - } else { + } + else { $this->writeDisabled(); } } @@ -485,14 +486,16 @@ class PluginManager foreach ($required as $require) { if (!$this->hasPlugin($require)) { $disable = true; - } elseif (($pluginObj = $this->findByIdentifier($require)) && $pluginObj->disabled) { + } + elseif (($pluginObj = $this->findByIdentifier($require)) && $pluginObj->disabled) { $disable = true; } } if ($disable) { $this->disablePlugin($id); - } else { + } + else { $this->enablePlugin($id); } } diff --git a/modules/system/classes/SettingsManager.php b/modules/system/classes/SettingsManager.php index 855634a53..e59e78eb0 100644 --- a/modules/system/classes/SettingsManager.php +++ b/modules/system/classes/SettingsManager.php @@ -234,7 +234,8 @@ class SettingsManager list($author, $plugin) = explode('.', $owner); $uri[] = strtolower($author); $uri[] = strtolower($plugin); - } else { + } + else { $uri[] = strtolower($owner); } diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index 47aa66644..7a4b37aff 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -161,7 +161,8 @@ class UpdateManager try { $result = $this->requestUpdateList(); $newCount = array_get($result, 'update', 0); - } catch (Exception $ex) { + } + catch (Exception $ex) { $newCount = 0; } @@ -594,7 +595,8 @@ class UpdateManager try { $resultData = @json_decode($result->body, true); - } catch (Exception $ex) { + } + catch (Exception $ex) { throw new ApplicationException(Lang::get('system::lang.server.response_invalid')); } diff --git a/modules/system/classes/VersionManager.php b/modules/system/classes/VersionManager.php index 962c42a9f..59aa9e50d 100644 --- a/modules/system/classes/VersionManager.php +++ b/modules/system/classes/VersionManager.php @@ -103,7 +103,8 @@ class VersionManager if (is_array($details)) { $comment = array_shift($details); $scripts = $details; - } else { + } + else { $comment = $details; $scripts = []; } @@ -148,7 +149,8 @@ class VersionManager foreach ($pluginHistory as $history) { if ($history->type == self::HISTORY_TYPE_COMMENT) { $this->removeDatabaseComment($code, $history->version); - } elseif ($history->type == self::HISTORY_TYPE_SCRIPT) { + } + elseif ($history->type == self::HISTORY_TYPE_SCRIPT) { $this->removeDatabaseScript($code, $history->version, $history->detail); } } @@ -296,12 +298,14 @@ class VersionManager 'version' => $version, 'created_at' => new Carbon ]); - } elseif ($version && $currentVersion) { + } + elseif ($version && $currentVersion) { Db::table('system_plugin_versions')->where('code', $code)->update([ 'version' => $version, 'created_at' => new Carbon ]); - } elseif ($currentVersion) { + } + elseif ($currentVersion) { Db::table('system_plugin_versions')->where('code', $code)->delete(); } diff --git a/modules/system/console/CacheClear.php b/modules/system/console/CacheClear.php index 995e986be..9baec17b2 100644 --- a/modules/system/console/CacheClear.php +++ b/modules/system/console/CacheClear.php @@ -55,8 +55,9 @@ class CacheClear extends ClearCommand $command = App::make('System\Console\CacheClear'); $command->setLaravel(App::make('app')); $command->fire(); - } catch (\Exception $ex) { - + } + catch (\Exception $ex) { + // Do nothing } } } diff --git a/modules/system/console/OctoberUpdate.php b/modules/system/console/OctoberUpdate.php index 0b5c36e05..c1cfe8dbd 100644 --- a/modules/system/console/OctoberUpdate.php +++ b/modules/system/console/OctoberUpdate.php @@ -61,7 +61,8 @@ class OctoberUpdate extends Command if ($updates == 0) { $this->output->writeln('No new updates found'); return; - } else { + } + else { $this->output->writeln(sprintf('Found %s new %s!', $updates, Str::plural('update', $updates))); } diff --git a/modules/system/console/OctoberUtil.php b/modules/system/console/OctoberUtil.php index 9854c02f4..83f86b528 100644 --- a/modules/system/console/OctoberUtil.php +++ b/modules/system/console/OctoberUtil.php @@ -114,7 +114,8 @@ class OctoberUtil extends Command if ($totalCount > 0) { $this->comment(sprintf('Successfully deleted %s thumbs', $totalCount)); - } else { + } + else { $this->comment('No thumbs found to delete'); } } diff --git a/modules/system/controllers/MailTemplates.php b/modules/system/controllers/MailTemplates.php index 0ff8d5281..e4702c471 100644 --- a/modules/system/controllers/MailTemplates.php +++ b/modules/system/controllers/MailTemplates.php @@ -77,7 +77,8 @@ class MailTemplates extends Controller }); Flash::success('The test message has been successfully sent.'); - } catch (Exception $ex) { + } + catch (Exception $ex) { Flash::error($ex->getMessage()); } } diff --git a/modules/system/controllers/Settings.php b/modules/system/controllers/Settings.php index 56777beb4..7ce95d1d5 100644 --- a/modules/system/controllers/Settings.php +++ b/modules/system/controllers/Settings.php @@ -75,7 +75,8 @@ class Settings extends Controller $model = $this->createModel($item); $this->initWidgets($model); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); } } diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index 853d76145..3a7a0b433 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -166,7 +166,8 @@ class Updates extends Controller $this->vars['hasUpdates'] = array_get($result, 'hasUpdates', false); $this->vars['pluginList'] = array_get($result, 'plugins', []); $this->vars['themeList'] = array_get($result, 'themes', []); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); } @@ -212,7 +213,8 @@ class Updates extends Controller ]; $this->vars['updateSteps'] = $updateSteps; - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); } @@ -253,7 +255,8 @@ class Updates extends Controller ]; $this->vars['updateSteps'] = $updateSteps; - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); } @@ -371,7 +374,8 @@ class Updates extends Controller ]); return $this->onForceUpdate(); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); return $this->makePartial('project_form'); } @@ -430,7 +434,8 @@ class Updates extends Controller $this->vars['updateSteps'] = $updateSteps; return $this->makePartial('execute'); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); return $this->makePartial('plugin_form'); } @@ -502,7 +507,8 @@ class Updates extends Controller { try { $this->vars['checked'] = post('checked'); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->handleError($ex); } return $this->makePartial('disable_form'); @@ -522,7 +528,8 @@ class Updates extends Controller if ($disable) { $manager->disablePlugin($object->code, true); - } else { + } + else { $manager->enablePlugin($object->code, true); } @@ -534,7 +541,8 @@ class Updates extends Controller if ($disable) { Flash::success(Lang::get('system::lang.plugins.disable_success')); - } else { + } + else { Flash::success(Lang::get('system::lang.plugins.enable_success')); } diff --git a/modules/system/controllers/updates/_execute.htm b/modules/system/controllers/updates/_execute.htm index 91a14471b..e5770bfcf 100644 --- a/modules/system/controllers/updates/_execute.htm +++ b/modules/system/controllers/updates/_execute.htm @@ -98,11 +98,10 @@ success: function(data){ setTimeout(function() { deferred.resolve() }, 600) - if (step.code == 'completeUpdate' || step.code == 'completeInstall') { + if (step.code == 'completeUpdate' || step.code == 'completeInstall') this.success(data) - } else { + else setLoadingBar(false) - } }, error: function(data){ setLoadingBar(false) @@ -121,12 +120,10 @@ var loadingBar = $('#executeLoadingBar'), messageDiv = $('#executeMessage') - if (state) { + if (state) loadingBar.removeClass('bar-loaded') - } - else { + else loadingBar.addClass('bar-loaded') - } if (message) messageDiv.text(message) diff --git a/modules/system/models/File.php b/modules/system/models/File.php index d6e621bb1..6b6405a07 100644 --- a/modules/system/models/File.php +++ b/modules/system/models/File.php @@ -29,7 +29,8 @@ class File extends FileBase $uploadsDir = Config::get('cms.uploadsDir'); if ($this->isPublic()) { return base_path() . $uploadsDir . '/public/'; - } else { + } + else { return base_path() . $uploadsDir . '/protected/'; } } @@ -42,7 +43,8 @@ class File extends FileBase $uploadsDir = Config::get('cms.uploadsDir'); if ($this->isPublic()) { return Request::getBasePath() . $uploadsDir . '/public/'; - } else { + } + else { return Request::getBasePath() . $uploadsDir . '/protected/'; } } diff --git a/modules/system/models/MailSettings.php b/modules/system/models/MailSettings.php index ef5c2ef97..70468a217 100644 --- a/modules/system/models/MailSettings.php +++ b/modules/system/models/MailSettings.php @@ -61,7 +61,8 @@ class MailSettings extends Model if ($settings->smtp_authorization) { $config->set('mail.username', $settings->smtp_user); $config->set('mail.password', $settings->smtp_password); - } else { + } + else { $config->set('mail.username', null); $config->set('mail.password', null); } @@ -76,5 +77,6 @@ class MailSettings extends Model $config->set('services.mailgun.secret', $settings->mailgun_secret); break; } + } } diff --git a/modules/system/models/MailTemplate.php b/modules/system/models/MailTemplate.php index c5fba664c..7c028e386 100644 --- a/modules/system/models/MailTemplate.php +++ b/modules/system/models/MailTemplate.php @@ -107,7 +107,8 @@ class MailTemplate extends Model } self::$cache[$code] = $template; - } else { + } + else { $template = self::$cache[$code]; } diff --git a/modules/system/models/PluginVersion.php b/modules/system/models/PluginVersion.php index b6eb920b8..d8dbbe704 100644 --- a/modules/system/models/PluginVersion.php +++ b/modules/system/models/PluginVersion.php @@ -58,7 +58,8 @@ class PluginVersion extends Model if ($this->is_disabled) { $manager->disablePlugin($this->code, true); - } else { + } + else { $manager->enablePlugin($this->code, true); } @@ -67,7 +68,8 @@ class PluginVersion extends Model if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) { $this->disabledByConfig = in_array($this->code, $configDisabled); } - } else { + } + else { $this->name = $this->code; $this->description = Lang::get('system::lang.plugins.unknown_plugin'); $this->orphaned = true; diff --git a/modules/system/models/RequestLog.php b/modules/system/models/RequestLog.php index a2cc31b24..c6a9cc3a1 100644 --- a/modules/system/models/RequestLog.php +++ b/modules/system/models/RequestLog.php @@ -47,7 +47,8 @@ class RequestLog extends Model if (!$record->exists) { $record->count = 1; $record->save(); - } else { + } + else { $record->increment('count'); } diff --git a/modules/system/reportwidgets/Status.php b/modules/system/reportwidgets/Status.php index a78065fdd..c6fa87f31 100644 --- a/modules/system/reportwidgets/Status.php +++ b/modules/system/reportwidgets/Status.php @@ -20,7 +20,8 @@ class Status extends ReportWidgetBase { try { $this->loadData(); - } catch (Exception $ex) { + } + catch (Exception $ex) { $this->vars['error'] = $ex->getMessage(); } diff --git a/modules/system/traits/AssetMaker.php b/modules/system/traits/AssetMaker.php index 2fc6b3386..5ab71a9da 100644 --- a/modules/system/traits/AssetMaker.php +++ b/modules/system/traits/AssetMaker.php @@ -270,7 +270,8 @@ trait AssetMaker if ($build == 'core') { $build = 'v' . Parameters::get('system::core.build', 1); - } elseif ($pluginVersion = PluginVersion::getVersion($build)) { + } + elseif ($pluginVersion = PluginVersion::getVersion($build)) { $build = 'v' . $pluginVersion; } diff --git a/modules/system/traits/ConfigMaker.php b/modules/system/traits/ConfigMaker.php index 904b4d0d1..f0051e2df 100644 --- a/modules/system/traits/ConfigMaker.php +++ b/modules/system/traits/ConfigMaker.php @@ -33,19 +33,22 @@ trait ConfigMaker */ if (is_object($configFile)) { $config = $configFile; + } /* * Embedded config */ - } elseif (is_array($configFile)) { + elseif (is_array($configFile)) { $config = $this->makeConfigFromArray($configFile); + } /* * Process config from file contents */ - } else { + else { if (isset($this->controller) && method_exists($this->controller, 'getConfigPath')) { $configFile = $this->controller->getConfigPath($configFile); - } else { + } + else { $configFile = $this->getConfigPath($configFile); } diff --git a/modules/system/twig/Loader.php b/modules/system/twig/Loader.php index 73f4302e2..593e9b90a 100644 --- a/modules/system/twig/Loader.php +++ b/modules/system/twig/Loader.php @@ -74,7 +74,8 @@ class Loader implements Twig_LoaderInterface try { $this->findTemplate($name); return true; - } catch (Exception $exception) { + } + catch (Exception $exception) { return false; } }