diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index d8d3638a2..37f674d10 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -69,10 +69,12 @@ Please ensure that your Pull Request satisfies the following coding standards:
- [PSR 1 Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
- [PSR 0 Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)
+To validate your changes against our coding standards, you may run `./vendor/bin/phpcs -nq --extensions="php"` in your development folder.
+
#### Team rules
The October team follows the [developer guidelines](https://octobercms.com/docs/help/developer-guide) as much as possible.
#### Escalation process
-We do our best to attend to all reported issues. If you have an important issue that requires attention, consider submitting a bounty using the [OctoberCMS Bounty Program](https://www.bountysource.com/teams/october).
\ No newline at end of file
+We do our best to attend to all reported issues. If you have an important issue that requires attention, consider submitting a bounty using the [OctoberCMS Bounty Program](https://www.bountysource.com/teams/october).
diff --git a/config/app.php b/config/app.php
index d427deb11..7f84c9bdf 100644
--- a/config/app.php
+++ b/config/app.php
@@ -56,7 +56,7 @@ return [
| -------- STOP! --------
| Before you change this value, consider carefully if that is actually
| what you want to do. It is HIGHLY recommended that this is always set
- | to UTC (as your server & DB timezone should be as well) and instead you
+ | to UTC (as your server & DB timezone should be as well) and instead you
| use cms.backendTimezone to set the default timezone used in the backend
| to display dates & times.
|
diff --git a/config/cms.php b/config/cms.php
index a2b2fb5af..1751f83f0 100644
--- a/config/cms.php
+++ b/config/cms.php
@@ -425,7 +425,7 @@ return [
| this feature on can create a conflict if you have a frontend Service
| Worker running. The 'scope' needs to be correctly set and not have a
| duplicate subfolder structure on the frontend, otherwise it will run
- | on both the frontend and backend of your website.
+ | on both the frontend and backend of your website.
|
| true - allow service workers to run in the backend
|
@@ -433,6 +433,6 @@ return [
|
*/
- 'enableBackendServiceWorkers' => false,
+ 'enableBackendServiceWorkers' => false,
];
diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php
index e4f38f800..ae3459235 100644
--- a/modules/backend/behaviors/FormController.php
+++ b/modules/backend/behaviors/FormController.php
@@ -159,7 +159,9 @@ class FormController extends ControllerBehavior
$this->formWidget->bindEvent('form.beforeRefresh', function ($holder) {
$result = $this->controller->formExtendRefreshData($this->formWidget, $holder->data);
- if (is_array($result)) $holder->data = $result;
+ if (is_array($result)) {
+ $holder->data = $result;
+ }
});
$this->formWidget->bindEvent('form.refreshFields', function ($fields) {
diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php
index 1dcfc3ef8..542e4c7cf 100644
--- a/modules/backend/behaviors/RelationController.php
+++ b/modules/backend/behaviors/RelationController.php
@@ -886,7 +886,6 @@ class RelationController extends ControllerBehavior
* Form
*/
elseif ($this->manageMode == 'form') {
-
if (!$config = $this->makeConfigForMode('manage', 'form', false)) {
return null;
}
@@ -1205,7 +1204,6 @@ class RelationController extends ControllerBehavior
* Add
*/
if ($this->viewMode == 'multi') {
-
$checkedIds = $recordId ? [$recordId] : post('checked');
if (is_array($checkedIds)) {
@@ -1221,14 +1219,12 @@ class RelationController extends ControllerBehavior
$this->relationObject->add($model, $sessionKey);
}
}
-
}
/*
* Link
*/
elseif ($this->viewMode == 'single') {
if ($recordId && ($model = $this->relationModel->find($recordId))) {
-
$this->relationObject->add($model, $sessionKey);
$this->viewWidget->setFormValues($model->attributes);
@@ -1242,7 +1238,6 @@ class RelationController extends ControllerBehavior
$parentModel->save();
}
}
-
}
}
@@ -1264,7 +1259,6 @@ class RelationController extends ControllerBehavior
* Remove
*/
if ($this->viewMode == 'multi') {
-
$checkedIds = $recordId ? [$recordId] : post('checked');
if (is_array($checkedIds)) {
@@ -1707,7 +1701,8 @@ class RelationController extends ControllerBehavior
*
* @return \Backend\Classes\WidgetBase
*/
- public function relationGetManageWidget() {
+ public function relationGetManageWidget()
+ {
return $this->manageWidget;
}
@@ -1716,7 +1711,8 @@ class RelationController extends ControllerBehavior
*
* @return \Backend\Classes\WidgetBase
*/
- public function relationGetViewWidget() {
+ public function relationGetViewWidget()
+ {
return $this->viewWidget;
}
-}
\ No newline at end of file
+}
diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php
index f76eec54e..f6916b4ef 100644
--- a/modules/backend/classes/Controller.php
+++ b/modules/backend/classes/Controller.php
@@ -231,7 +231,6 @@ class Controller extends ControllerBase
* Check that user is logged in and has permission to view this page
*/
if (!$isPublicAction) {
-
/*
* Not logged in, redirect to login screen or show ajax error.
*/
diff --git a/modules/backend/classes/FormField.php b/modules/backend/classes/FormField.php
index a59dbcaf3..5f52b5c23 100644
--- a/modules/backend/classes/FormField.php
+++ b/modules/backend/classes/FormField.php
@@ -688,7 +688,6 @@ class FormField
* relation value, all others will look up the relation object as normal.
*/
foreach ($keyParts as $key) {
-
if ($result instanceof Model && $result->hasRelation($key)) {
if ($key == $lastField) {
$result = $result->getRelationValue($key) ?: $default;
@@ -709,7 +708,6 @@ class FormField
}
$result = $result->{$key};
}
-
}
return $result;
diff --git a/modules/backend/classes/FormTabs.php b/modules/backend/classes/FormTabs.php
index d4360c3b4..709a0306e 100644
--- a/modules/backend/classes/FormTabs.php
+++ b/modules/backend/classes/FormTabs.php
@@ -31,12 +31,12 @@ class FormTabs implements IteratorAggregate, ArrayAccess
* @var string Default tab label to use when none is specified.
*/
public $defaultTab = 'backend::lang.form.undefined_tab';
-
+
/**
* @var array List of icons for their corresponding tabs.
*/
public $icons = [];
-
+
/**
* @var bool Should these tabs stretch to the bottom of the page layout.
*/
@@ -86,11 +86,11 @@ class FormTabs implements IteratorAggregate, ArrayAccess
if (array_key_exists('defaultTab', $config)) {
$this->defaultTab = $config['defaultTab'];
}
-
+
if (array_key_exists('icons', $config)) {
$this->icons = $config['icons'];
}
-
+
if (array_key_exists('stretch', $config)) {
$this->stretch = $config['stretch'];
}
@@ -182,7 +182,7 @@ class FormTabs implements IteratorAggregate, ArrayAccess
return $tablessFields;
}
-
+
/**
* Returns an icon for the tab based on the tab's name.
* @param string $name
@@ -194,7 +194,7 @@ class FormTabs implements IteratorAggregate, ArrayAccess
return $this->icons[$name];
}
}
-
+
/**
* Returns a tab pane CSS class.
* @param string $index
@@ -222,9 +222,10 @@ class FormTabs implements IteratorAggregate, ArrayAccess
*/
public function getIterator()
{
- return new ArrayIterator($this->suppressTabs
- ? $this->getAllFields()
- : $this->getFields()
+ return new ArrayIterator(
+ $this->suppressTabs
+ ? $this->getAllFields()
+ : $this->getFields()
);
}
diff --git a/modules/backend/classes/FormWidgetBase.php b/modules/backend/classes/FormWidgetBase.php
index 91bbf2be2..d505e770f 100644
--- a/modules/backend/classes/FormWidgetBase.php
+++ b/modules/backend/classes/FormWidgetBase.php
@@ -149,5 +149,4 @@ abstract class FormWidgetBase extends WidgetBase
return $this->formField->getValueFromData($this->data ?: $this->model, $defaultValue);
}
-
}
diff --git a/modules/backend/classes/NavigationManager.php b/modules/backend/classes/NavigationManager.php
index 4a3af1e18..1376a7891 100644
--- a/modules/backend/classes/NavigationManager.php
+++ b/modules/backend/classes/NavigationManager.php
@@ -124,7 +124,9 @@ class NavigationManager
*/
$orderCount = 0;
foreach ($item->sideMenu as $sideMenuItem) {
- if ($sideMenuItem->order !== -1) continue;
+ if ($sideMenuItem->order !== -1) {
+ continue;
+ }
$sideMenuItem->order = ($orderCount += 100);
}
@@ -530,4 +532,4 @@ class NavigationManager
{
return strtoupper($owner).'.'.strtoupper($code);
}
-}
\ No newline at end of file
+}
diff --git a/modules/backend/classes/WidgetManager.php b/modules/backend/classes/WidgetManager.php
index 35099a48d..ea39becff 100644
--- a/modules/backend/classes/WidgetManager.php
+++ b/modules/backend/classes/WidgetManager.php
@@ -257,4 +257,4 @@ class WidgetManager
unset($this->reportWidgets[$className]);
}
-}
\ No newline at end of file
+}
diff --git a/modules/backend/controllers/Files.php b/modules/backend/controllers/Files.php
index 51fcded78..adc5bcf32 100644
--- a/modules/backend/controllers/Files.php
+++ b/modules/backend/controllers/Files.php
@@ -30,7 +30,8 @@ class Files extends Controller
try {
return $this->findFileObject($code)->output('inline', true);
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
return Response::make(View::make('backend::404'), 404);
}
@@ -48,7 +49,8 @@ class Files extends Controller
true
);
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
return Response::make(View::make('backend::404'), 404);
}
diff --git a/modules/backend/controllers/UserRoles.php b/modules/backend/controllers/UserRoles.php
index caca7b288..bed79dbe9 100644
--- a/modules/backend/controllers/UserRoles.php
+++ b/modules/backend/controllers/UserRoles.php
@@ -51,7 +51,7 @@ class UserRoles extends Controller
/*
* Only super users can access
*/
- $this->bindEvent('page.beforeDisplay', function() {
+ $this->bindEvent('page.beforeDisplay', function () {
if (!$this->user->isSuperUser()) {
return Response::make(View::make('backend::access_denied'), 403);
}
diff --git a/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php b/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php
index 601893a45..5fad314c5 100644
--- a/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php
+++ b/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php
@@ -88,7 +88,8 @@ class DbBackendUserRoles extends Migration
'permissions' => $group->permissions ?? null
]);
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
$permissions[$group->id] = $group->permissions ?? null;
}
@@ -130,7 +131,8 @@ class DbBackendUserRoles extends Migration
$perms = json_decode($permString, true);
$userPerms = array_merge($userPerms, $perms);
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
}
if (count($userPerms) > 0) {
@@ -157,6 +159,7 @@ class DbBackendUserRoles extends Migration
'permissions' => json_encode($newPerms)
]);
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
}
}
diff --git a/modules/backend/formwidgets/CodeEditor.php b/modules/backend/formwidgets/CodeEditor.php
index e6dd6a1d5..9572aa62d 100644
--- a/modules/backend/formwidgets/CodeEditor.php
+++ b/modules/backend/formwidgets/CodeEditor.php
@@ -215,5 +215,4 @@ class CodeEditor extends FormWidgetBase
$this->displayIndentGuides = $preferences->editor_display_indent_guides;
$this->showPrintMargin = $preferences->editor_show_print_margin;
}
-
}
diff --git a/modules/backend/formwidgets/DataTable.php b/modules/backend/formwidgets/DataTable.php
index 40a5609b0..7c2525640 100644
--- a/modules/backend/formwidgets/DataTable.php
+++ b/modules/backend/formwidgets/DataTable.php
@@ -192,5 +192,4 @@ class DataTable extends FormWidgetBase
return $result;
}
-
}
diff --git a/modules/backend/formwidgets/DatePicker.php b/modules/backend/formwidgets/DatePicker.php
index 9c53bfd43..569bb6208 100644
--- a/modules/backend/formwidgets/DatePicker.php
+++ b/modules/backend/formwidgets/DatePicker.php
@@ -122,7 +122,7 @@ class DatePicker extends FormWidgetBase
if ($this->mode === 'date' && !$this->ignoreTimezone) {
$backendTimeZone = \Backend\Models\Preference::get('timezone');
$value->setTimezone($backendTimeZone);
- $value->setTime(0,0,0);
+ $value->setTime(0, 0, 0);
$value->setTimezone(Config::get('app.timezone'));
}
$value = $value->toDateTimeString();
diff --git a/modules/backend/formwidgets/NestedForm.php b/modules/backend/formwidgets/NestedForm.php
index a71152d6e..2eca428b0 100644
--- a/modules/backend/formwidgets/NestedForm.php
+++ b/modules/backend/formwidgets/NestedForm.php
@@ -35,7 +35,8 @@ class NestedForm extends FormWidgetBase
/**
* @inheritDoc
*/
- public function init() {
+ public function init()
+ {
$this->fillFromConfig([
'form',
'usePanelStyles',
@@ -62,13 +63,14 @@ class NestedForm extends FormWidgetBase
/**
* @inheritdoc
*/
- function render()
+ public function render()
{
$this->prepareVars();
return $this->makePartial('nestedform');
}
- function prepareVars() {
+ public function prepareVars()
+ {
$this->formWidget->previewMode = $this->previewMode;
}
}
diff --git a/modules/backend/formwidgets/RichEditor.php b/modules/backend/formwidgets/RichEditor.php
index 9387e8d28..af905d6fc 100644
--- a/modules/backend/formwidgets/RichEditor.php
+++ b/modules/backend/formwidgets/RichEditor.php
@@ -217,8 +217,8 @@ class RichEditor extends FormWidgetBase
$iterator = function ($links, $level = 0) use (&$iterator) {
$result = [];
- foreach ($links as $linkUrl => $link) {
+ foreach ($links as $linkUrl => $link) {
/*
* Remove scheme and host from URL
*/
diff --git a/modules/backend/formwidgets/TagList.php b/modules/backend/formwidgets/TagList.php
index 5d1e51b28..fa1d8fe51 100644
--- a/modules/backend/formwidgets/TagList.php
+++ b/modules/backend/formwidgets/TagList.php
@@ -198,9 +198,10 @@ class TagList extends FormWidgetBase
protected function getSeparatorCharacter()
{
switch (strtolower($this->separator)) {
- case 'comma': return ',';
- case 'space': return ' ';
+ case 'comma':
+ return ',';
+ case 'space':
+ return ' ';
}
}
-
}
diff --git a/modules/backend/helpers/Backend.php b/modules/backend/helpers/Backend.php
index 095207d46..9708c6b40 100644
--- a/modules/backend/helpers/Backend.php
+++ b/modules/backend/helpers/Backend.php
@@ -118,8 +118,8 @@ class Backend
'timeSince' => false,
'ignoreTimezone' => false,
], $options));
-
- if(!$dateTime) {
+
+ if (!$dateTime) {
return '';
}
@@ -156,5 +156,4 @@ class Backend
return ''.PHP_EOL;
}
-
}
diff --git a/modules/backend/models/BrandSetting.php b/modules/backend/models/BrandSetting.php
index f7a99851b..10821fd0e 100644
--- a/modules/backend/models/BrandSetting.php
+++ b/modules/backend/models/BrandSetting.php
@@ -43,7 +43,7 @@ class BrandSetting extends Model
'favicon' => \System\Models\File::class,
'logo' => \System\Models\File::class
];
-
+
/**
* @var string The key to store rendered CSS in the cache under
*/
@@ -181,5 +181,4 @@ class BrandSetting extends Model
return null;
}
-
}
diff --git a/modules/backend/models/ImportModel.php b/modules/backend/models/ImportModel.php
index 2569955b7..34622b46b 100644
--- a/modules/backend/models/ImportModel.php
+++ b/modules/backend/models/ImportModel.php
@@ -174,7 +174,9 @@ abstract class ImportModel extends Model
*/
protected function decodeArrayValue($value, $delimeter = '|')
{
- if (strpos($value, $delimeter) === false) return [$value];
+ if (strpos($value, $delimeter) === false) {
+ return [$value];
+ }
$data = preg_split('~(?isDir() && substr($node->getFileName(), 0, 6) == 'theme-') {
// Remove the theme- prefix and the .js suffix, create an user friendly and capitalized name
@@ -287,7 +286,6 @@ class Preference extends Model
$themes[$themeId] = $themeName;
}
}
-
}
// Sort the theme alphabetically, and push the default theme
diff --git a/modules/backend/traits/ErrorMaker.php b/modules/backend/traits/ErrorMaker.php
index 2c9505513..3d807c7e6 100644
--- a/modules/backend/traits/ErrorMaker.php
+++ b/modules/backend/traits/ErrorMaker.php
@@ -19,19 +19,19 @@ trait ErrorMaker
/**
* @return boolean Whether a fatal error has been set or not.
*/
- public function hasFatalError()
+ public function hasFatalError()
{
- return !is_null($this->fatalError);
+ return !is_null($this->fatalError);
}
-
+
/**
* @return string The fatal error message
*/
- public function getFatalError()
+ public function getFatalError()
{
- return $this->fatalError;
+ return $this->fatalError;
}
-
+
/**
* Sets standard page variables in the case of a controller error.
*/
diff --git a/modules/backend/traits/FormModelWidget.php b/modules/backend/traits/FormModelWidget.php
index 12a75c456..0186301c7 100644
--- a/modules/backend/traits/FormModelWidget.php
+++ b/modules/backend/traits/FormModelWidget.php
@@ -98,5 +98,4 @@ trait FormModelWidget
list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom);
return $model->getRelationType($attribute);
}
-
}
diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php
index 741fc7d46..623af759b 100644
--- a/modules/backend/widgets/Form.php
+++ b/modules/backend/widgets/Form.php
@@ -408,7 +408,6 @@ class Form extends WidgetBase
* If an array of fields is supplied, update specified fields individually.
*/
if (($updateFields = post('fields')) && is_array($updateFields)) {
-
foreach ($updateFields as $field) {
if (!isset($this->allFields[$field])) {
continue;
@@ -452,7 +451,7 @@ class Form extends WidgetBase
if (!is_array($eventResult)) {
continue;
}
-
+
$result = $eventResult + $result;
}
@@ -686,7 +685,6 @@ class Form extends WidgetBase
public function addFields(array $fields, $addToArea = null)
{
foreach ($fields as $name => $config) {
-
$fieldObj = $this->makeFormField($name, $config);
$fieldTab = is_array($config) ? array_get($config, 'tab') : null;
@@ -875,8 +873,8 @@ class Form extends WidgetBase
* Get field options from model
*/
$optionModelTypes = ['dropdown', 'radio', 'checkboxlist', 'balloon-selector'];
- if (in_array($field->type, $optionModelTypes, false)) {
+ if (in_array($field->type, $optionModelTypes, false)) {
/*
* Defer the execution of option data collection
*/
@@ -961,7 +959,9 @@ class Form extends WidgetBase
if (isset($field->config['options'])) {
$field->options(function () use ($field) {
$fieldOptions = $field->config['options'];
- if ($fieldOptions === true) $fieldOptions = null;
+ if ($fieldOptions === true) {
+ $fieldOptions = null;
+ }
$fieldOptions = $this->getOptionsFromModel($field, $fieldOptions);
return $fieldOptions;
});
@@ -1092,7 +1092,8 @@ class Form extends WidgetBase
* Checks if default values should be taken from data.
* This should be done when model exists or when explicitly configured
*/
- protected function shouldFetchDefaultValues() {
+ protected function shouldFetchDefaultValues()
+ {
$enableDefaults = object_get($this->config, 'enableDefaults');
if ($enableDefaults === false) {
return false;
@@ -1171,7 +1172,6 @@ class Form extends WidgetBase
*/
$parts = HtmlHelper::nameToArray($field->fieldName);
if (($value = $this->dataArrayGet($data, $parts)) !== null) {
-
/*
* Number fields should be converted to integers
*/
@@ -1261,7 +1261,6 @@ class Form extends WidgetBase
* Refer to the model method or any of its behaviors
*/
if (!is_array($fieldOptions) && !$fieldOptions) {
-
try {
list($model, $attribute) = $field->resolveModelAttribute($this->model, $field->fieldName);
}
diff --git a/modules/backend/widgets/MediaManager.php b/modules/backend/widgets/MediaManager.php
index b4a6a679a..3c517d8d2 100644
--- a/modules/backend/widgets/MediaManager.php
+++ b/modules/backend/widgets/MediaManager.php
@@ -1091,10 +1091,14 @@ class MediaManager extends WidgetBase
}
switch ($itemType) {
- case MediaLibraryItem::FILE_TYPE_IMAGE: return "icon-picture-o";
- case MediaLibraryItem::FILE_TYPE_VIDEO: return "icon-video-camera";
- case MediaLibraryItem::FILE_TYPE_AUDIO: return "icon-volume-up";
- default: return "icon-file";
+ case MediaLibraryItem::FILE_TYPE_IMAGE:
+ return "icon-picture-o";
+ case MediaLibraryItem::FILE_TYPE_VIDEO:
+ return "icon-video-camera";
+ case MediaLibraryItem::FILE_TYPE_AUDIO:
+ return "icon-volume-up";
+ default:
+ return "icon-file";
}
}
@@ -1873,7 +1877,7 @@ class MediaManager extends WidgetBase
'title' => $targetImageName,
'folder' => $targetFolder
];
- }
+ }
/**
* Detect if image is vector graphic (SVG)
diff --git a/modules/backend/widgets/ReportContainer.php b/modules/backend/widgets/ReportContainer.php
index 834b50dd0..add008ecf 100644
--- a/modules/backend/widgets/ReportContainer.php
+++ b/modules/backend/widgets/ReportContainer.php
@@ -423,7 +423,6 @@ class ReportContainer extends WidgetBase
$result[] = $property;
foreach ($properties as $name => $params) {
-
$property = [
'property' => $name,
'title' => isset($params['title']) ? Lang::get($params['title']) : $name,
diff --git a/modules/backend/widgets/Table.php b/modules/backend/widgets/Table.php
index 09c5c425e..5cca8e1ca 100644
--- a/modules/backend/widgets/Table.php
+++ b/modules/backend/widgets/Table.php
@@ -138,9 +138,8 @@ class Table extends WidgetBase
$isClientDataSource = $this->isClientDataSource();
$this->vars['clientDataSourceClass'] = $isClientDataSource ? 'client' : 'server';
- $this->vars['data'] = json_encode($isClientDataSource
- ? $this->dataSource->getAllRecords()
- : []
+ $this->vars['data'] = json_encode(
+ $isClientDataSource ? $this->dataSource->getAllRecords() : []
);
}
@@ -168,15 +167,17 @@ class Table extends WidgetBase
{
$result = [];
- foreach ($this->columns as $key=>$data) {
+ foreach ($this->columns as $key => $data) {
$data['key'] = $key;
- if (isset($data['title']))
+ if (isset($data['title'])) {
$data['title'] = trans($data['title']);
+ }
if (isset($data['options'])) {
- foreach ($data['options'] as &$option)
+ foreach ($data['options'] as &$option) {
$option = trans($option);
+ }
}
if (isset($data['validation'])) {
diff --git a/modules/backend/widgets/Toolbar.php b/modules/backend/widgets/Toolbar.php
index 4e7575dad..7d028eefa 100644
--- a/modules/backend/widgets/Toolbar.php
+++ b/modules/backend/widgets/Toolbar.php
@@ -58,7 +58,6 @@ class Toolbar extends WidgetBase
* Prepare the search widget (optional)
*/
if (isset($this->search)) {
-
if (is_string($this->search)) {
$searchConfig = $this->makeConfig(['partial' => $this->search]);
}
diff --git a/modules/cms/classes/Asset.php b/modules/cms/classes/Asset.php
index 57c64627c..c0920752f 100644
--- a/modules/cms/classes/Asset.php
+++ b/modules/cms/classes/Asset.php
@@ -208,12 +208,12 @@ class Asset extends Extendable
$this->originalFileName = $this->fileName;
$this->exists = true;
}
-
+
public function delete()
{
$fileName = Request::input('fileName');
$fullPath = $this->getFilePath($fileName);
-
+
$this->validateFileName($fileName);
if (File::exists($fullPath)) {
@@ -222,9 +222,9 @@ class Asset extends Extendable
'cms::lang.asset.error_deleting_file',
['name' => $fileName]
));
- }
+ }
}
- }
+ }
/**
* Validate the supplied filename, extension and path.
diff --git a/modules/cms/classes/AutoDatasource.php b/modules/cms/classes/AutoDatasource.php
index dca84da58..c16625fde 100644
--- a/modules/cms/classes/AutoDatasource.php
+++ b/modules/cms/classes/AutoDatasource.php
@@ -255,7 +255,9 @@ class AutoDatasource extends Datasource implements DatasourceInterface
}
// Filter out 'deleted' paths:
- $paths = array_filter($paths, function ($value) { return (bool) $value; });
+ $paths = array_filter($paths, function ($value) {
+ return (bool) $value;
+ });
// Return just an array of paths
return array_keys($paths);
diff --git a/modules/cms/classes/CmsCompoundObject.php b/modules/cms/classes/CmsCompoundObject.php
index 6b5346198..856d7d258 100644
--- a/modules/cms/classes/CmsCompoundObject.php
+++ b/modules/cms/classes/CmsCompoundObject.php
@@ -237,7 +237,6 @@ class CmsCompoundObject extends CmsObject
$componentName = $componentManager->resolve($componentName);
foreach ($this->settings['components'] as $sectionName => $values) {
-
$result = $sectionName;
if ($sectionName == $componentName) {
@@ -257,7 +256,6 @@ class CmsCompoundObject extends CmsObject
if ($sectionName == $componentName) {
return $result;
}
-
}
return false;
diff --git a/modules/cms/classes/CmsObjectCollection.php b/modules/cms/classes/CmsObjectCollection.php
index dc5321106..ffc7afc73 100644
--- a/modules/cms/classes/CmsObjectCollection.php
+++ b/modules/cms/classes/CmsObjectCollection.php
@@ -19,11 +19,9 @@ class CmsObjectCollection extends CollectionBase
public function withComponent($components, $callback = null)
{
return $this->filter(function ($object) use ($components, $callback) {
-
$hasComponent = false;
foreach ((array) $components as $componentName) {
-
if (!$callback && $object->hasComponent($componentName)) {
$hasComponent = true;
}
@@ -73,7 +71,6 @@ class CmsObjectCollection extends CollectionBase
$hasComponent = false;
foreach ((array) $components as $componentName) {
-
if (!$componentAlias = $object->hasComponent($componentName)) {
continue;
}
@@ -101,5 +98,4 @@ class CmsObjectCollection extends CollectionBase
return $hasComponent;
});
}
-
}
diff --git a/modules/cms/classes/ComponentBase.php b/modules/cms/classes/ComponentBase.php
index 337a9b6b7..5014ab1d8 100644
--- a/modules/cms/classes/ComponentBase.php
+++ b/modules/cms/classes/ComponentBase.php
@@ -306,7 +306,8 @@ abstract class ComponentBase extends Extendable
try {
return parent::__call($method, $parameters);
}
- catch (BadMethodCallException $ex) {}
+ catch (BadMethodCallException $ex) {
+ }
if (method_exists($this->controller, $method)) {
return call_user_func_array([$this->controller, $method], $parameters);
diff --git a/modules/cms/classes/ComponentHelpers.php b/modules/cms/classes/ComponentHelpers.php
index 15f0607a8..682c4208e 100644
--- a/modules/cms/classes/ComponentHelpers.php
+++ b/modules/cms/classes/ComponentHelpers.php
@@ -75,8 +75,9 @@ class ComponentHelpers
}
}
- if ($returnArray)
+ if ($returnArray) {
return $result;
+ }
return json_encode($result);
}
diff --git a/modules/cms/classes/Content.php b/modules/cms/classes/Content.php
index 220da6907..a2ba639b8 100644
--- a/modules/cms/classes/Content.php
+++ b/modules/cms/classes/Content.php
@@ -70,5 +70,4 @@ class Content extends CmsCompoundObject
return $result;
}
-
}
diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php
index 92a11db2e..77e2fa6df 100644
--- a/modules/cms/classes/Controller.php
+++ b/modules/cms/classes/Controller.php
@@ -841,7 +841,6 @@ class Controller
* Process Component handler
*/
if (strpos($handler, '::')) {
-
list($componentName, $handlerName) = explode('::', $handler);
$componentObj = $this->findComponentByName($componentName);
@@ -965,7 +964,6 @@ class Controller
* Process Component partial
*/
elseif (strpos($name, '::') !== false) {
-
list($componentAlias, $partialName) = explode('::', $name);
/*
diff --git a/modules/cms/classes/MediaViewHelper.php b/modules/cms/classes/MediaViewHelper.php
index be11ce15c..2d743dbac 100644
--- a/modules/cms/classes/MediaViewHelper.php
+++ b/modules/cms/classes/MediaViewHelper.php
@@ -102,5 +102,4 @@ class MediaViewHelper
break;
}
}
-
}
diff --git a/modules/cms/classes/Theme.php b/modules/cms/classes/Theme.php
index eb36938ee..110d47dfe 100644
--- a/modules/cms/classes/Theme.php
+++ b/modules/cms/classes/Theme.php
@@ -344,7 +344,7 @@ class Theme
$config = Yaml::parseFile($path);
} else {
$cacheKey = self::CONFIG_KEY.'::'.$this->getDirName();
- $config = Cache::rememberForever($cacheKey, function() use ($path) {
+ $config = Cache::rememberForever($cacheKey, function () use ($path) {
return Yaml::parseFile($path);
});
}
diff --git a/modules/cms/contracts/CmsObject.php b/modules/cms/contracts/CmsObject.php
index 8b79a8174..c6b9b67e6 100644
--- a/modules/cms/contracts/CmsObject.php
+++ b/modules/cms/contracts/CmsObject.php
@@ -2,7 +2,6 @@
interface CmsObject
{
-
/**
* Loads the template.
*
@@ -59,5 +58,4 @@ interface CmsObject
* @return string
*/
public function getTwigCacheKey();
-
}
diff --git a/modules/cms/controllers/ThemeLogs.php b/modules/cms/controllers/ThemeLogs.php
index 4e508fd6c..a229aef23 100644
--- a/modules/cms/controllers/ThemeLogs.php
+++ b/modules/cms/controllers/ThemeLogs.php
@@ -64,9 +64,10 @@ class ThemeLogs extends Controller
public function index_onDelete()
{
if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
-
foreach ($checkedIds as $recordId) {
- if (!$record = ThemeLog::find($recordId)) continue;
+ if (!$record = ThemeLog::find($recordId)) {
+ continue;
+ }
$record->delete();
}
diff --git a/modules/cms/controllers/Themes.php b/modules/cms/controllers/Themes.php
index 55058f8cf..5bdf1625d 100644
--- a/modules/cms/controllers/Themes.php
+++ b/modules/cms/controllers/Themes.php
@@ -49,7 +49,7 @@ class Themes extends Controller
/*
* Custom redirect for unauthorized request
*/
- $this->bindEvent('page.beforeDisplay', function() {
+ $this->bindEvent('page.beforeDisplay', function () {
if (!$this->user->hasAccess('cms.manage_themes')) {
return Backend::redirect('cms/themeoptions/update');
}
diff --git a/modules/cms/lang/ar/lang.php b/modules/cms/lang/ar/lang.php
index 295a5218f..aca084296 100644
--- a/modules/cms/lang/ar/lang.php
+++ b/modules/cms/lang/ar/lang.php
@@ -27,7 +27,7 @@ return [
],
'editor' => [
'settings' => 'الإعدادات',
- ],
+ ],
'asset' => [
'menu_label' => 'الأصول',
],
diff --git a/modules/cms/lang/es-ar/lang.php b/modules/cms/lang/es-ar/lang.php
index ff24128f5..4c5d62fe2 100644
--- a/modules/cms/lang/es-ar/lang.php
+++ b/modules/cms/lang/es-ar/lang.php
@@ -154,7 +154,7 @@ return [
'not_found' => "El componente ':name' no se encuentra.",
'method_not_found' => "El componente ':name' no contiene un método ':method'.",
],
- 'template' => [
+ 'template' => [
'invalid_type' => "Tipo de plantilla Desconocido.",
'not_found' => "No se encontró la plantilla solicitada.",
'saved'=> "La plantilla se ha guardado correctamente."
diff --git a/modules/cms/models/ThemeData.php b/modules/cms/models/ThemeData.php
index e06f1a859..49b7e4c01 100644
--- a/modules/cms/models/ThemeData.php
+++ b/modules/cms/models/ThemeData.php
@@ -69,7 +69,7 @@ class ThemeData extends Model
}
/**
- * Clear asset cache after saving to ensure `assetVar` form fields take
+ * Clear asset cache after saving to ensure `assetVar` form fields take
* immediate effect.
*/
public function afterSave()
@@ -77,7 +77,8 @@ class ThemeData extends Model
try {
CombineAssets::resetCache();
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
}
/**
@@ -151,7 +152,6 @@ class ThemeData extends Model
*/
public function initFormFields()
{
-
}
/**
@@ -227,7 +227,7 @@ class ThemeData extends Model
{
$theme = CmsTheme::getActiveTheme();
- if (!$theme){
+ if (!$theme) {
return;
}
diff --git a/modules/cms/models/ThemeExport.php b/modules/cms/models/ThemeExport.php
index c568a7736..0152fa3d7 100644
--- a/modules/cms/models/ThemeExport.php
+++ b/modules/cms/models/ThemeExport.php
@@ -110,7 +110,6 @@ class ThemeExport extends Model
File::deleteDirectory($tempPath);
}
catch (Exception $ex) {
-
if (strlen($tempPath) && File::isDirectory($tempPath)) {
File::deleteDirectory($tempPath);
}
diff --git a/modules/cms/models/ThemeImport.php b/modules/cms/models/ThemeImport.php
index d9e6f9274..9ebebf8b0 100644
--- a/modules/cms/models/ThemeImport.php
+++ b/modules/cms/models/ThemeImport.php
@@ -88,8 +88,7 @@ class ThemeImport extends Model
$this->theme = $theme;
$this->fill($data);
- try
- {
+ try {
$file = $this->uploaded_file()->withDeferred($sessionKey)->first();
if (!$file) {
throw new ApplicationException('There is no file attached to import!');
@@ -125,7 +124,6 @@ class ThemeImport extends Model
$file->delete();
}
catch (Exception $ex) {
-
if (!empty($tempPath) && File::isDirectory($tempPath)) {
File::deleteDirectory($tempPath);
}
diff --git a/modules/cms/models/ThemeLog.php b/modules/cms/models/ThemeLog.php
index 343f2fe05..6105e3150 100644
--- a/modules/cms/models/ThemeLog.php
+++ b/modules/cms/models/ThemeLog.php
@@ -94,7 +94,8 @@ class ThemeLog extends Model
try {
$record->save();
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
return $record;
}
diff --git a/modules/cms/twig/Extension.php b/modules/cms/twig/Extension.php
index ed07dfb95..8dfc67de5 100644
--- a/modules/cms/twig/Extension.php
+++ b/modules/cms/twig/Extension.php
@@ -193,8 +193,9 @@ class Extension extends TwigExtension
return $default;
}
- if ($event = Event::fire('cms.block.render', [$name, $result], true))
+ if ($event = Event::fire('cms.block.render', [$name, $result], true)) {
$result = $event;
+ }
$result = str_replace('', trim($default), $result);
return $result;
diff --git a/modules/cms/twig/FlashNode.php b/modules/cms/twig/FlashNode.php
index cf0f4ac7c..462a5382f 100644
--- a/modules/cms/twig/FlashNode.php
+++ b/modules/cms/twig/FlashNode.php
@@ -31,7 +31,7 @@ class FlashNode extends TwigNode
;
if ($attrib == 'all') {
- $compiler
+ $compiler
->addDebugInfo($this)
->write('foreach (Flash::getMessages() as $type => $messages) {'.PHP_EOL)
->indent()
diff --git a/modules/cms/twig/FrameworkNode.php b/modules/cms/twig/FrameworkNode.php
index ae75e1817..5c01fa3bb 100644
--- a/modules/cms/twig/FrameworkNode.php
+++ b/modules/cms/twig/FrameworkNode.php
@@ -38,7 +38,8 @@ class FrameworkNode extends TwigNode
->write("echo ''.PHP_EOL;" . PHP_EOL)
->write("echo ''.PHP_EOL;" . PHP_EOL)
+ .'/modules/system/assets/js/framework.combined-min.js\" as=\"script\" importance=\"low\">'.PHP_EOL;" . PHP_EOL)
+
->outdent()
->write("}" . PHP_EOL)
->write("else {" . PHP_EOL)
@@ -50,13 +51,14 @@ class FrameworkNode extends TwigNode
->write("echo ''.PHP_EOL;" . PHP_EOL)
->write("echo ''.PHP_EOL;" . PHP_EOL)
+ .'/modules/system/assets/js/framework.extras.js\" as=\"script\" importance=\"low\">'.PHP_EOL;" . PHP_EOL)
+
->outdent()
->write("}" . PHP_EOL)
->write("echo ''.PHP_EOL;" . PHP_EOL)
->write("echo ''.PHP_EOL;" . PHP_EOL)
+ .'/modules/system/assets/css/framework.extras'.(\$_minify ? '-min' : '').'.css\" as=\"style\" importance=\"low\">'.PHP_EOL;" . PHP_EOL)
;
}
else {
diff --git a/modules/cms/twig/Loader.php b/modules/cms/twig/Loader.php
index 88670f0e8..8550a96e6 100644
--- a/modules/cms/twig/Loader.php
+++ b/modules/cms/twig/Loader.php
@@ -1,7 +1,7 @@
getId('component-list') => $this->makePartial('items', [
- 'items' => $this->getData()]
- )];
+ return [
+ '#' . $this->getId('component-list') => $this->makePartial('items', [
+ 'items' => $this->getData()
+ ])
+ ];
}
protected function itemMatchesSearch(&$words, $item)
diff --git a/modules/system/ServiceProvider.php b/modules/system/ServiceProvider.php
index 7933df3ef..af2b86bb6 100644
--- a/modules/system/ServiceProvider.php
+++ b/modules/system/ServiceProvider.php
@@ -536,7 +536,7 @@ class ServiceProvider extends ModuleServiceProvider
*/
protected function registerValidator()
{
- $this->app->resolving('validator', function($validator) {
+ $this->app->resolving('validator', function ($validator) {
/*
* Allowed file extensions, as opposed to mime types.
* - extensions: png,jpg,txt
diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php
index 5cd13c815..8b4dacd4d 100644
--- a/modules/system/classes/CombineAssets.php
+++ b/modules/system/classes/CombineAssets.php
@@ -202,7 +202,7 @@ class CombineAssets
* @param string $localPath Prefix all assets with this path (optional)
* @return void
*/
- public function combineToFile($assets = [], $destination, $localPath = null)
+ public function combineToFile($assets, $destination, $localPath = null)
{
// Disable cache always
$this->storagePath = null;
@@ -212,8 +212,10 @@ class CombineAssets
if (substr($localPath, -1) !== '/') {
$localPath = $localPath.'/';
}
- $assets = array_map(function($asset) use ($localPath) {
- if (substr($asset, 0, 1) === '@') return $asset;
+ $assets = array_map(function ($asset) use ($localPath) {
+ if (substr($asset, 0, 1) === '@') {
+ return $asset;
+ }
return $localPath.$asset;
}, $assets);
}
diff --git a/modules/system/classes/ComposerManager.php b/modules/system/classes/ComposerManager.php
index 350e2f128..f731c3593 100644
--- a/modules/system/classes/ComposerManager.php
+++ b/modules/system/classes/ComposerManager.php
@@ -70,7 +70,9 @@ class ComposerManager
if (file_exists($file = $dir . '/autoload_namespaces.php')) {
$map = require $file;
foreach ($map as $namespace => $path) {
- if (isset($this->namespacePool[$namespace])) continue;
+ if (isset($this->namespacePool[$namespace])) {
+ continue;
+ }
$this->loader->set($namespace, $path);
$this->namespacePool[$namespace] = true;
}
@@ -79,7 +81,9 @@ class ComposerManager
if (file_exists($file = $dir . '/autoload_psr4.php')) {
$map = require $file;
foreach ($map as $namespace => $path) {
- if (isset($this->psr4Pool[$namespace])) continue;
+ if (isset($this->psr4Pool[$namespace])) {
+ continue;
+ }
$this->loader->setPsr4($namespace, $path);
$this->psr4Pool[$namespace] = true;
}
@@ -98,7 +102,9 @@ class ComposerManager
$includeFiles = require $file;
foreach ($includeFiles as $includeFile) {
$relativeFile = $this->stripVendorDir($includeFile, $vendorPath);
- if (isset($this->includeFilesPool[$relativeFile])) continue;
+ if (isset($this->includeFilesPool[$relativeFile])) {
+ continue;
+ }
require $includeFile;
$this->includeFilesPool[$relativeFile] = true;
}
diff --git a/modules/system/classes/MailManager.php b/modules/system/classes/MailManager.php
index ed707b29b..33e9dc003 100644
--- a/modules/system/classes/MailManager.php
+++ b/modules/system/classes/MailManager.php
@@ -192,7 +192,6 @@ class MailManager
$disableAutoInlineCss = false;
if ($template->layout) {
-
$disableAutoInlineCss = array_get($template->layout->options, 'disable_auto_inline_css', $disableAutoInlineCss);
$html = $this->renderTwig($template->layout->content_html, [
diff --git a/modules/system/classes/MarkupManager.php b/modules/system/classes/MarkupManager.php
index 64a3e0526..c621b66ca 100644
--- a/modules/system/classes/MarkupManager.php
+++ b/modules/system/classes/MarkupManager.php
@@ -124,7 +124,6 @@ class MarkupManager
}
foreach ($definitions as $name => $definition) {
-
switch ($type) {
case self::EXTENSION_TOKEN_PARSER:
$this->$items[$type][] = $definition;
@@ -227,7 +226,6 @@ class MarkupManager
}
foreach ($this->listFunctions() as $name => $callable) {
-
/*
* Handle a wildcard function
*/
@@ -261,7 +259,6 @@ class MarkupManager
}
foreach ($this->listFilters() as $name => $callable) {
-
/*
* Handle a wildcard function
*/
diff --git a/modules/system/classes/MediaLibrary.php b/modules/system/classes/MediaLibrary.php
index 859fa056d..645825750 100644
--- a/modules/system/classes/MediaLibrary.php
+++ b/modules/system/classes/MediaLibrary.php
@@ -735,8 +735,9 @@ class MediaLibrary
*/
protected function filterItemList(&$itemList, $filter)
{
- if (!$filter)
+ if (!$filter) {
return;
+ }
$result = [];
foreach ($itemList as $item) {
diff --git a/modules/system/classes/PluginBase.php b/modules/system/classes/PluginBase.php
index 18df4541f..4ad6afbe5 100644
--- a/modules/system/classes/PluginBase.php
+++ b/modules/system/classes/PluginBase.php
@@ -50,8 +50,9 @@ class PluginBase extends ServiceProviderBase
if (!array_key_exists('plugin', $configuration)) {
throw new SystemException(sprintf(
- 'The plugin configuration file plugin.yaml should contain the "plugin" section: %s.', $thisClass)
- );
+ 'The plugin configuration file plugin.yaml should contain the "plugin" section: %s.',
+ $thisClass
+ ));
}
return $configuration['plugin'];
diff --git a/modules/system/classes/SettingsManager.php b/modules/system/classes/SettingsManager.php
index e6c679122..82bb0f731 100644
--- a/modules/system/classes/SettingsManager.php
+++ b/modules/system/classes/SettingsManager.php
@@ -171,7 +171,6 @@ class SettingsManager
{
$filteredItems = [];
foreach ($items as $categoryName => $category) {
-
$filteredCategory = [];
foreach ($category as $item) {
$itemContext = is_array($item->context) ? $item->context : [$item->context];
diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php
index 8d4b43419..0f8264199 100644
--- a/modules/system/classes/UpdateManager.php
+++ b/modules/system/classes/UpdateManager.php
@@ -523,7 +523,6 @@ class UpdateManager
$this->versionManager->resetNotes()->setNotesOutput($this->notesOutput);
if ($this->versionManager->updatePlugin($plugin) !== false) {
-
foreach ($this->versionManager->getNotes() as $note) {
$this->note($note);
}
@@ -680,7 +679,9 @@ class UpdateManager
$requestedDetails = array_intersect_key($this->productCache[$type], array_flip($codes));
foreach ($requestedDetails as $detail) {
- if ($detail === -1) continue;
+ if ($detail === -1) {
+ continue;
+ }
$result[] = $detail;
}
diff --git a/modules/system/console/OctoberInstall.php b/modules/system/console/OctoberInstall.php
index 204b71d4e..3033b8f13 100644
--- a/modules/system/console/OctoberInstall.php
+++ b/modules/system/console/OctoberInstall.php
@@ -130,7 +130,8 @@ class OctoberInstall extends Command
$this->writeToConfig('app', ['debug' => $debug]);
}
- protected function askToInstallPlugins() {
+ protected function askToInstallPlugins()
+ {
$chosenToInstall = [];
if ($this->confirm('Install the October.Drivers plugin?', false)) {
$chosenToInstall[] = 'October.Drivers';
diff --git a/modules/system/console/OctoberUtil.php b/modules/system/console/OctoberUtil.php
index 7121a0bc5..398893d0d 100644
--- a/modules/system/console/OctoberUtil.php
+++ b/modules/system/console/OctoberUtil.php
@@ -160,7 +160,7 @@ class OctoberUtil extends Command
$combiner = CombineAssets::instance();
$bundles = $combiner->getBundles($type);
- if (!$bundles){
+ if (!$bundles) {
$this->comment('Nothing to compile!');
return;
}
@@ -198,7 +198,6 @@ class OctoberUtil extends Command
$stub = base_path() . '/modules/system/assets/js/lang/lang.stub';
foreach ($locales as $locale) {
-
/*
* Generate messages
*/
@@ -209,7 +208,7 @@ class OctoberUtil extends Command
if (File::isFile($srcPath) && $fallbackPath != $srcPath) {
$messages = array_replace_recursive($messages, require $srcPath);
}
-
+
/*
* Load possible replacements from /lang
*/
@@ -314,7 +313,10 @@ class OctoberUtil extends Command
{
foreach (File::directories(plugins_path()) as $authorDir) {
foreach (File::directories($authorDir) as $pluginDir) {
- if (!File::isDirectory($pluginDir.'/.git')) continue;
+ if (!File::isDirectory($pluginDir.'/.git')) {
+ continue;
+ }
+
$exec = 'cd ' . $pluginDir . ' && ';
$exec .= 'git pull 2>&1';
echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;
@@ -323,7 +325,10 @@ class OctoberUtil extends Command
}
foreach (File::directories(themes_path()) as $themeDir) {
- if (!File::isDirectory($themeDir.'/.git')) continue;
+ if (!File::isDirectory($themeDir.'/.git')) {
+ continue;
+ }
+
$exec = 'cd ' . $themeDir . ' && ';
$exec .= 'git pull 2>&1';
echo 'Updating theme: '. basename($themeDir) . PHP_EOL;
@@ -335,7 +340,7 @@ class OctoberUtil extends Command
{
$projectId = $this->option('projectId');
- if (empty($projectId)){
+ if (empty($projectId)) {
$this->error("No projectId defined, use --projectId= to set a projectId");
return;
}
@@ -348,7 +353,5 @@ class OctoberUtil extends Command
'system::project.name' => $result['name'],
'system::project.owner' => $result['owner'],
]);
-
}
-
}
diff --git a/modules/system/console/PluginList.php b/modules/system/console/PluginList.php
index e0bf4072c..9f5dbe5a5 100644
--- a/modules/system/console/PluginList.php
+++ b/modules/system/console/PluginList.php
@@ -34,7 +34,7 @@ class PluginList extends Command
$allPlugins = PluginVersion::all();
$pluginsCount = count($allPlugins);
- if ($pluginsCount <= 0 ) {
+ if ($pluginsCount <= 0) {
$this->info('No plugin found');
return;
}
diff --git a/modules/system/console/ThemeList.php b/modules/system/console/ThemeList.php
index 9547475c1..53287d1c6 100644
--- a/modules/system/console/ThemeList.php
+++ b/modules/system/console/ThemeList.php
@@ -42,7 +42,6 @@ class ThemeList extends Command
}
if ($this->option('include-marketplace')) {
-
// @todo List everything in the marketplace - not just popular.
$popularThemes = $updateManager->requestPopularProducts('theme');
diff --git a/modules/system/console/ThemeSync.php b/modules/system/console/ThemeSync.php
index 35f466614..b74eac611 100644
--- a/modules/system/console/ThemeSync.php
+++ b/modules/system/console/ThemeSync.php
@@ -181,7 +181,7 @@ class ThemeSync extends Command
}
// Confirm with the user
- if (!$this->confirmToProceed(sprintf('This will OVERWRITE the %s provided paths in "themes/%s" on the %s with content from the %s', count($validPaths), $themeName, $target, $source), function () { return true; })) {
+ if (!$this->confirmToProceed(sprintf('This will OVERWRITE the %s provided paths in "themes/%s" on the %s with content from the %s', count($validPaths), $themeName, $target, $source), true)) {
return;
}
diff --git a/modules/system/controllers/EventLogs.php b/modules/system/controllers/EventLogs.php
index b03c62472..7d7f474f2 100644
--- a/modules/system/controllers/EventLogs.php
+++ b/modules/system/controllers/EventLogs.php
@@ -65,9 +65,10 @@ class EventLogs extends Controller
public function index_onDelete()
{
if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
-
foreach ($checkedIds as $recordId) {
- if (!$record = EventLog::find($recordId)) continue;
+ if (!$record = EventLog::find($recordId)) {
+ continue;
+ }
$record->delete();
}
diff --git a/modules/system/controllers/RequestLogs.php b/modules/system/controllers/RequestLogs.php
index 435f6f968..23d0ceaaf 100644
--- a/modules/system/controllers/RequestLogs.php
+++ b/modules/system/controllers/RequestLogs.php
@@ -63,9 +63,10 @@ class RequestLogs extends Controller
public function index_onDelete()
{
if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
-
foreach ($checkedIds as $recordId) {
- if (!$record = RequestLog::find($recordId)) continue;
+ if (!$record = RequestLog::find($recordId)) {
+ continue;
+ }
$record->delete();
}
diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php
index 3cc7985b7..bbf461aad 100644
--- a/modules/system/controllers/Updates.php
+++ b/modules/system/controllers/Updates.php
@@ -189,14 +189,15 @@ class Updates extends Controller
}
//Filter out update scripts
- $details = array_filter($details, function($string) use ($path) {
+ $details = array_filter($details, function ($string) use ($path) {
return !preg_match('/^[a-z_\-0-9]*\.php$/i', $string) || !File::exists($path . '/updates/' . $string);
});
$contents[$version] = $details;
}
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
uksort($contents, function ($a, $b) {
return version_compare($b, $a);
@@ -209,7 +210,9 @@ class Updates extends Controller
{
$contents = null;
foreach ($filenames as $file) {
- if (!File::exists($path . '/'.$file)) continue;
+ if (!File::exists($path . '/'.$file)) {
+ continue;
+ }
$contents = File::get($path . '/'.$file);
@@ -369,7 +372,9 @@ class Updates extends Controller
$coreImportant = false;
foreach (array_get($result, 'core.updates', []) as $build => $description) {
- if (strpos($description, '!!!') === false) continue;
+ if (strpos($description, '!!!') === false) {
+ continue;
+ }
$detailsUrl = '//octobercms.com/support/articles/release-notes';
$description = str_replace('!!!', '', $description);
@@ -387,7 +392,9 @@ class Updates extends Controller
$isImportant = false;
foreach (array_get($plugin, 'updates', []) as $version => $description) {
- if (strpos($description, '!!!') === false) continue;
+ if (strpos($description, '!!!') === false) {
+ continue;
+ }
$isImportant = $hasImportantUpdates = true;
$detailsUrl = Backend::url('system/updates/details/'.PluginVersion::makeSlug($code).'/upgrades').'?fetch=1';
@@ -910,7 +917,6 @@ class Updates extends Controller
public function onRemoveTheme()
{
if ($themeCode = post('code')) {
-
ThemeManager::instance()->deleteTheme($themeCode);
Flash::success(trans('cms::lang.theme.delete_theme_success'));
diff --git a/modules/system/database/migrations/2015_10_01_000014_Db_System_Mail_Layout_Rename.php b/modules/system/database/migrations/2015_10_01_000014_Db_System_Mail_Layout_Rename.php
index 7102c02c8..1b28ca53b 100644
--- a/modules/system/database/migrations/2015_10_01_000014_Db_System_Mail_Layout_Rename.php
+++ b/modules/system/database/migrations/2015_10_01_000014_Db_System_Mail_Layout_Rename.php
@@ -13,7 +13,8 @@ class DbSystemMailLayoutRename extends Migration
$layout->content_text = preg_replace("/({{\s*message\s*[|]raw\s*}})/i", "{{ content|raw }}", $layout->content_text);
$layout->forceSave();
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
}
}
diff --git a/modules/system/database/migrations/2017_10_23_000024_Db_System_Mail_Layouts_Add_Options_Field.php b/modules/system/database/migrations/2017_10_23_000024_Db_System_Mail_Layouts_Add_Options_Field.php
index 0cac68edb..cc907699e 100644
--- a/modules/system/database/migrations/2017_10_23_000024_Db_System_Mail_Layouts_Add_Options_Field.php
+++ b/modules/system/database/migrations/2017_10_23_000024_Db_System_Mail_Layouts_Add_Options_Field.php
@@ -11,11 +11,11 @@ class DbSystemMailLayoutsAddOptionsField extends Migration
$table->text('options')->nullable()->after('is_locked');
});
}
-
+
public function down()
{
Schema::table('system_mail_layouts', function (Blueprint $table) {
- $table->dropColumn('options');
+ $table->dropColumn('options');
});
}
}
diff --git a/modules/system/helpers/DateTime.php b/modules/system/helpers/DateTime.php
index 4aaa80eb5..9401dfb5b 100644
--- a/modules/system/helpers/DateTime.php
+++ b/modules/system/helpers/DateTime.php
@@ -68,7 +68,8 @@ class DateTime
else {
try {
$value = Carbon::parse($value);
- } catch (Exception $ex) {}
+ } catch (Exception $ex) {
+ }
}
if (!$value instanceof Carbon && $throwException) {
@@ -131,5 +132,4 @@ class DateTime
return strtr($format, $replacements);
}
-
}
diff --git a/modules/system/lang/en/client.php b/modules/system/lang/en/client.php
index fdca0db16..32baa8887 100644
--- a/modules/system/lang/en/client.php
+++ b/modules/system/lang/en/client.php
@@ -65,8 +65,8 @@ return [
],
'scopes' => [
'apply_button_text' => 'Apply',
- 'clear_button_text' => 'Clear'
- ],
+ 'clear_button_text' => 'Clear'
+ ],
'dates' => [
'all' => 'all',
'filter_button_text' => 'Filter',
diff --git a/modules/system/lang/es-ar/lang.php b/modules/system/lang/es-ar/lang.php
index ba45104d6..5989370ee 100644
--- a/modules/system/lang/es-ar/lang.php
+++ b/modules/system/lang/es-ar/lang.php
@@ -128,7 +128,7 @@ return [
'install_completing' => 'Finalizó el proceso de instalación',
'install_success' => 'El plugin se ha instalado correctamente.',
],
- 'updates' => [
+ 'updates' => [
'title' => 'Administrar actualizaciones',
'name' => 'Actualizaciones de software',
'menu_label' => 'Actualizaciones',
@@ -174,7 +174,7 @@ return [
'file_error' => 'El servidor no pudo entregar el paquete.',
'file_corrupt' => 'El archivo se encuentra dañado.',
],
- 'behavior' => [
+ 'behavior' => [
'missing_property' => 'Clase :class debe definir la propiedad $:property utilizada por :behavior comportamiento.',
],
'config' => [
diff --git a/modules/system/lang/fa/client.php b/modules/system/lang/fa/client.php
index 3598aa7c8..52f2a18f9 100644
--- a/modules/system/lang/fa/client.php
+++ b/modules/system/lang/fa/client.php
@@ -49,7 +49,7 @@ return [
'cancel_button_text' => 'انصراف',
'widget_remove_confirm' => 'این ابزارک حذف شود؟'
],
-'datepicker' => [
+ 'datepicker' => [
'previousMonth' => 'ماه قبل',
'nextMonth' => 'ماه بعد',
'months' => ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
diff --git a/modules/system/lang/fi/client.php b/modules/system/lang/fi/client.php
index 46cece1fa..18f86a062 100644
--- a/modules/system/lang/fi/client.php
+++ b/modules/system/lang/fi/client.php
@@ -64,8 +64,8 @@ return [
],
'scopes' => [
'apply_button_text' => 'Ota käyttöön',
- 'clear_button_text' => 'Tyhjennä'
- ],
+ 'clear_button_text' => 'Tyhjennä'
+ ],
'dates' => [
'all' => 'kaikki',
'filter_button_text' => 'Suodata',
diff --git a/modules/system/lang/sv/lang.php b/modules/system/lang/sv/lang.php
index 616273c7d..bbf60c5fc 100644
--- a/modules/system/lang/sv/lang.php
+++ b/modules/system/lang/sv/lang.php
@@ -218,7 +218,7 @@ return [
'none' => [
'label' => 'Inga uppdateringar',
'help' => 'Inga nya uppdateringar hittades.'
- ],
+ ],
'important_action' => [
'empty' => 'Välj åtgärd',
'confirm' => 'Bekräfta uppdatering',
diff --git a/modules/system/lang/zh-tw/lang.php b/modules/system/lang/zh-tw/lang.php
index 4769515aa..7dadf2f19 100644
--- a/modules/system/lang/zh-tw/lang.php
+++ b/modules/system/lang/zh-tw/lang.php
@@ -261,7 +261,7 @@ return [
'view_the_dashboard' => '查看儀表板',
'manage_branding' => '自訂後台'
],
- 'media' => [
+ 'media' => [
'invalid_path' => "不合法的路徑: ':path'.",
'folder_size_items' => '個數',
],
diff --git a/modules/system/models/EventLog.php b/modules/system/models/EventLog.php
index bba8648a9..a4b53795d 100644
--- a/modules/system/models/EventLog.php
+++ b/modules/system/models/EventLog.php
@@ -58,7 +58,8 @@ class EventLog extends Model
try {
$record->save();
}
- catch (Exception $ex) {}
+ catch (Exception $ex) {
+ }
return $record;
}
diff --git a/modules/system/models/MailLayout.php b/modules/system/models/MailLayout.php
index 01273ad68..30e46601a 100644
--- a/modules/system/models/MailLayout.php
+++ b/modules/system/models/MailLayout.php
@@ -141,5 +141,4 @@ class MailLayout extends Model
{
return MailParser::parse(FileHelper::get(View::make($code)->getPath()));
}
-
}
diff --git a/modules/system/models/MailSetting.php b/modules/system/models/MailSetting.php
index 348ca9be8..deca9d4e1 100644
--- a/modules/system/models/MailSetting.php
+++ b/modules/system/models/MailSetting.php
@@ -88,7 +88,6 @@ class MailSetting extends Model
$config->set('mail.from.address', $settings->sender_email);
switch ($settings->send_mode) {
-
case self::MODE_SMTP:
$config->set('mail.host', $settings->smtp_address);
$config->set('mail.port', $settings->smtp_port);
@@ -127,10 +126,8 @@ class MailSetting extends Model
$config->set('services.ses.region', $settings->ses_region);
break;
}
-
}
-
/**
* @return array smtp_encryption options values
*/
diff --git a/modules/system/traits/AssetMaker.php b/modules/system/traits/AssetMaker.php
index 9954689b9..673e53596 100644
--- a/modules/system/traits/AssetMaker.php
+++ b/modules/system/traits/AssetMaker.php
@@ -55,7 +55,6 @@ trait AssetMaker
if ($type == null || $type == 'css') {
foreach ($this->assets['css'] as $asset) {
-
/*
* Prevent duplicates
*/
@@ -314,10 +313,8 @@ trait AssetMaker
protected function removeDuplicates()
{
foreach ($this->assets as $type => &$collection) {
-
$pathCache = [];
foreach ($collection as $key => $asset) {
-
if (!$path = array_get($asset, 'path')) {
continue;
}
@@ -329,7 +326,6 @@ trait AssetMaker
$pathCache[$path] = true;
}
-
}
}
diff --git a/modules/system/traits/ConfigMaker.php b/modules/system/traits/ConfigMaker.php
index 449aede8c..92245ab83 100644
--- a/modules/system/traits/ConfigMaker.php
+++ b/modules/system/traits/ConfigMaker.php
@@ -51,7 +51,6 @@ trait ConfigMaker
* Process config from file contents
*/
else {
-
if (isset($this->controller) && method_exists($this->controller, 'getConfigPath')) {
$configFile = $this->controller->getConfigPath($configFile);
}
@@ -101,7 +100,7 @@ trait ConfigMaker
/**
* Makes a config object from an array, making the first level keys properties of a new object.
- *
+ *
* @param array $configArray Config array.
* @return stdClass The config object
*/
diff --git a/modules/system/twig/Loader.php b/modules/system/twig/Loader.php
index 6be498588..341d08959 100644
--- a/modules/system/twig/Loader.php
+++ b/modules/system/twig/Loader.php
@@ -2,7 +2,7 @@
use App;
use File;
-use Twig\Source as TwigSource;;
+use Twig\Source as TwigSource;
use Twig\Loader\LoaderInterface as TwigLoaderInterface;
use Exception;
diff --git a/modules/system/views/exception.php b/modules/system/views/exception.php
index 4ec127dc1..4879c907d 100644
--- a/modules/system/views/exception.php
+++ b/modules/system/views/exception.php
@@ -69,4 +69,4 @@
SyntaxHighlighter.all()