From 2cc648db45ddd8ba4f2b06b34af46ce37d114155 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 12 Nov 2024 15:56:00 +0000 Subject: [PATCH] Dev: Code style from CS fix --- Editor.php | 6 +++--- Editor/Field.php | 2 +- Editor/Join.php | 23 +++++++++++------------ Editor/Options.php | 4 ++-- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Editor.php b/Editor.php index ab302ca..ca84704 100644 --- a/Editor.php +++ b/Editor.php @@ -705,8 +705,8 @@ public function process($data) $debugInfo = &$this->_debugInfo; $debugInfo[] = 'Editor PHP libraries - version ' . $this->version; - - $this->_db->debug(function ($mess) use (&$debugInfo) { + + $this->_db->debug(static function ($mess) use (&$debugInfo) { $debugInfo[] = $mess; }); } @@ -994,7 +994,7 @@ private function _process($data) 'error' => '', 'fieldErrors' => [], 'ipOpts' => [], - 'options' => [] + 'options' => [], ]; $action = Editor::action($data); diff --git a/Editor/Field.php b/Editor/Field.php index d1de4f2..29b2b5e 100644 --- a/Editor/Field.php +++ b/Editor/Field.php @@ -154,7 +154,7 @@ public function __construct($dbField = null, $name = null) private $_validator = []; /** @var Upload|null */ - private $_upload = null; + private $_upload; /** @var callable */ private $_xss; diff --git a/Editor/Join.php b/Editor/Join.php index 079832e..f1d88b3 100644 --- a/Editor/Join.php +++ b/Editor/Join.php @@ -483,9 +483,9 @@ public function whereSet($_ = null) /** * Get data. * - * @param Editor $editor Host Editor instance - * @param mixed[] $data Data from the parent table's get and were we need - * to add out output. + * @param Editor $editor Host Editor instance + * @param mixed[] $data Data from the parent table's get and were we need + * to add out output. * * @internal */ @@ -675,28 +675,27 @@ public function create($editor, $parentId, $data) } /** - * Get options for the fields in this join + * Get options for the fields in this join. * - * @param array $options Array to write the read options into - * @param Database $db Database connection object - * @param bool $refresh Refresh indication flag - * @return void + * @param array $options Array to write the read options into + * @param Database $db Database connection object + * @param bool $refresh Refresh indication flag * * @internal */ - public function options(&$options, $db, $refresh) { + public function options(&$options, $db, $refresh) + { // Field options foreach ($this->_fields as $field) { $optsInst = $field->options(); if ($optsInst) { $opts = $optsInst->exec($db, $refresh); - + if ($opts !== false) { if ($this->_type === 'object') { $name = $this->name() . '.' . $field->name(); - } - else { + } else { $name = $this->name() . '[].' . $field->name(); } diff --git a/Editor/Options.php b/Editor/Options.php index 6094be5..37768d1 100644 --- a/Editor/Options.php +++ b/Editor/Options.php @@ -101,7 +101,7 @@ class Options extends Ext private $_manualAdd = []; /** @var callable|null */ - private $_customFn = null; + private $_customFn; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Public methods @@ -309,7 +309,7 @@ public function where($_ = null) * * @internal */ - public function exec($db, $refresh, $search=null) + public function exec($db, $refresh, $search = null) { // If search only, and not a search action, then just return false if ($this->searchOnly() && !$search) {