Skip to content

Commit 3d3d268

Browse files
Reverted coding style changes
1 parent 0315638 commit 3d3d268

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

administrator/components/com_fields/src/Helper/FieldsHelper.php

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public static function extract($contextString, $item = null)
8686
return $parts;
8787
}
8888

89+
8990
/**
9091
* Returns the fields for the given context.
9192
* If the item is an object the returned fields do have an additional field
@@ -214,14 +215,14 @@ function ($f) {
214215
*/
215216
$dispatcher->dispatch('onCustomFieldsBeforePrepareField', new BeforePrepareFieldEvent('onCustomFieldsBeforePrepareField', [
216217
'context' => $context,
217-
'item' => $item,
218+
'item' => $item,
218219
'subject' => $field,
219220
]));
220221

221222
// Gathering the value for the field
222223
$value = $dispatcher->dispatch('onCustomFieldsPrepareField', new PrepareFieldEvent('onCustomFieldsPrepareField', [
223224
'context' => $context,
224-
'item' => $item,
225+
'item' => $item,
225226
'subject' => $field,
226227
]))->getArgument('result', []);
227228

@@ -238,9 +239,9 @@ function ($f) {
238239
*/
239240
$eventAfter = new AfterPrepareFieldEvent('onCustomFieldsAfterPrepareField', [
240241
'context' => $context,
241-
'item' => $item,
242+
'item' => $item,
242243
'subject' => $field,
243-
'value' => &$value, // @todo: Remove reference in Joomla 6, see AfterPrepareFieldEvent::__constructor()
244+
'value' => &$value, // @todo: Remove reference in Joomla 6, see AfterPrepareFieldEvent::__constructor()
244245
]);
245246
$dispatcher->dispatch('onCustomFieldsAfterPrepareField', $eventAfter);
246247
$value = $eventAfter->getValue();
@@ -309,7 +310,7 @@ public static function getField(
309310
}
310311

311312
if (Multilanguage::isEnabled() && isset($item->language) && $item->language != '*') {
312-
self::$fieldCache->setState('filter.language', ['*', $item->language]);
313+
self::$fieldsCache->setState('filter.language', ['*', $item->language]);
313314
}
314315

315316
self::$fieldCache->setState('filter.context', $context);
@@ -368,14 +369,14 @@ public static function getField(
368369
*/
369370
$dispatcher->dispatch('onCustomFieldsBeforePrepareField', new BeforePrepareFieldEvent('onCustomFieldsBeforePrepareField', [
370371
'context' => $context,
371-
'item' => $item,
372+
'item' => $item,
372373
'subject' => $field,
373374
]));
374375

375376
// Gathering the value for the field
376377
$value = $dispatcher->dispatch('onCustomFieldsPrepareField', new PrepareFieldEvent('onCustomFieldsPrepareField', [
377378
'context' => $context,
378-
'item' => $item,
379+
'item' => $item,
379380
'subject' => $field,
380381
]))->getArgument('result', []);
381382

@@ -392,9 +393,9 @@ public static function getField(
392393
*/
393394
$eventAfter = new AfterPrepareFieldEvent('onCustomFieldsAfterPrepareField', [
394395
'context' => $context,
395-
'item' => $item,
396+
'item' => $item,
396397
'subject' => $field,
397-
'value' => &$value, // @todo: Remove reference in Joomla 6, see AfterPrepareFieldEvent::__constructor()
398+
'value' => &$value, // @todo: Remove reference in Joomla 6, see AfterPrepareFieldEvent::__constructor()
398399
]);
399400
$dispatcher->dispatch('onCustomFieldsAfterPrepareField', $eventAfter);
400401
$value = $eventAfter->getValue();
@@ -437,7 +438,7 @@ public static function render($context, $layoutFile, $displayData)
437438

438439
if ($value == '') {
439440
// Trying to render the layout on Fields itself
440-
$value = LayoutHelper::render($layoutFile, $displayData, null, ['component' => 'com_fields', 'client' => 0]);
441+
$value = LayoutHelper::render($layoutFile, $displayData, null, ['component' => 'com_fields','client' => 0]);
441442
}
442443

443444
return $value;
@@ -459,7 +460,7 @@ public static function prepareForm($context, Form $form, $data)
459460
// Extracting the component and section
460461
$parts = self::extract($context);
461462

462-
if (!$parts) {
463+
if (! $parts) {
463464
return true;
464465
}
465466

@@ -468,12 +469,12 @@ public static function prepareForm($context, Form $form, $data)
468469
// When no fields available return here
469470
$fields = self::getFields($parts[0] . '.' . $parts[1]);
470471

471-
if (!$fields) {
472+
if (! $fields) {
472473
return true;
473474
}
474475

475476
$component = $parts[0];
476-
$section = $parts[1];
477+
$section = $parts[1];
477478

478479
$assignedCatids = $data->catid ?? $data->fieldscatid ?? $form->getValue('catid');
479480

@@ -520,7 +521,7 @@ public static function prepareForm($context, Form $form, $data)
520521
$fieldTypes = self::getFieldTypes();
521522

522523
// Creating the dom
523-
$xml = new \DOMDocument('1.0', 'UTF-8');
524+
$xml = new \DOMDocument('1.0', 'UTF-8');
524525
$fieldsNode = $xml->appendChild(new \DOMElement('form'))->appendChild(new \DOMElement('fields'));
525526
$fieldsNode->setAttribute('name', 'com_fields');
526527

@@ -561,11 +562,11 @@ public static function prepareForm($context, Form $form, $data)
561562
* have the 'default' group with id 0 which is not in the database,
562563
* so we create it virtually here.
563564
*/
564-
$defaultGroup = new \stdClass();
565-
$defaultGroup->id = 0;
566-
$defaultGroup->title = '';
565+
$defaultGroup = new \stdClass();
566+
$defaultGroup->id = 0;
567+
$defaultGroup->title = '';
567568
$defaultGroup->description = '';
568-
$iterateGroups = array_merge([$defaultGroup], $model->getItems());
569+
$iterateGroups = array_merge([$defaultGroup], $model->getItems());
569570

570571
// Looping through the groups
571572
foreach ($iterateGroups as $group) {
@@ -580,7 +581,7 @@ public static function prepareForm($context, Form $form, $data)
580581
$fieldset->setAttribute('addfieldpath', '/administrator/components/' . $component . '/models/fields');
581582
$fieldset->setAttribute('addrulepath', '/administrator/components/' . $component . '/models/rules');
582583

583-
$label = $group->title;
584+
$label = $group->title;
584585
$description = $group->description;
585586

586587
if (!$label) {
@@ -608,9 +609,9 @@ public static function prepareForm($context, Form $form, $data)
608609
foreach ($fieldsPerGroup[$group->id] as $field) {
609610
try {
610611
$dispatcher->dispatch('onCustomFieldsPrepareDom', new PrepareDomEvent('onCustomFieldsPrepareDom', [
611-
'subject' => $field,
612+
'subject' => $field,
612613
'fieldset' => $fieldset,
613-
'form' => $form,
614+
'form' => $form,
614615
]));
615616

616617
/*
@@ -739,7 +740,7 @@ public static function getAssignedCategoriesIds($fieldId)
739740
return [];
740741
}
741742

742-
$db = Factory::getDbo();
743+
$db = Factory::getDbo();
743744
$query = $db->getQuery(true);
744745

745746
$query->select($db->quoteName('a.category_id'))
@@ -768,7 +769,7 @@ public static function getAssignedCategoriesTitles($fieldId)
768769
return [];
769770
}
770771

771-
$db = Factory::getDbo();
772+
$db = Factory::getDbo();
772773
$query = $db->getQuery(true);
773774

774775
$query->select($db->quoteName('c.title'))
@@ -791,7 +792,7 @@ public static function getAssignedCategoriesTitles($fieldId)
791792
*/
792793
public static function getFieldsPluginId()
793794
{
794-
$db = Factory::getDbo();
795+
$db = Factory::getDbo();
795796
$query = $db->getQuery(true)
796797
->select($db->quoteName('extension_id'))
797798
->from($db->quoteName('#__extensions'))
@@ -856,7 +857,7 @@ public static function getFieldTypes()
856857
*/
857858
public static function clearFieldsCache()
858859
{
859-
self::$fieldCache = null;
860-
self::$fieldCache = null;
860+
self::$fieldCache = null;
861+
self::$fieldsCache = null;
861862
}
862-
}
863+
}

0 commit comments

Comments
 (0)