@@ -52,7 +52,7 @@ |
||
| 52 | 52 | return true; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - /** |
|
| 55 | + /** |
|
| 56 | 56 | * @inheritdoc |
| 57 | 57 | */ |
| 58 | 58 | public function safeDown() |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | Event::on( |
| 89 | 89 | Plugins::class, |
| 90 | 90 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 91 | - function (PluginEvent $event) { |
|
| 91 | + function(PluginEvent $event) { |
|
| 92 | 92 | if ($event->plugin === $this) { |
| 93 | 93 | $this->reasons->clearCache(); |
| 94 | 94 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | Event::on( |
| 99 | 99 | Plugins::class, |
| 100 | 100 | Plugins::EVENT_AFTER_UNINSTALL_PLUGIN, |
| 101 | - function (PluginEvent $event) { |
|
| 101 | + function(PluginEvent $event) { |
|
| 102 | 102 | if ($event->plugin === $this) { |
| 103 | 103 | $this->reasons->clearCache(); |
| 104 | 104 | Craft::$app->getProjectConfig()->remove('reasons_conditionals'); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | Event::on( |
| 111 | 111 | Fields::class, |
| 112 | 112 | Fields::EVENT_AFTER_SAVE_FIELD_LAYOUT, |
| 113 | - function (FieldLayoutEvent $event) { |
|
| 113 | + function(FieldLayoutEvent $event) { |
|
| 114 | 114 | if (Craft::$app->getRequest()->getIsConsoleRequest()) { |
| 115 | 115 | return; |
| 116 | 116 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | Event::on( |
| 142 | 142 | Fields::class, |
| 143 | 143 | Fields::EVENT_AFTER_DELETE_FIELD_LAYOUT, |
| 144 | - function (FieldLayoutEvent $event) { |
|
| 144 | + function(FieldLayoutEvent $event) { |
|
| 145 | 145 | $fieldLayout = $event->layout; |
| 146 | 146 | if (!$fieldLayout) { |
| 147 | 147 | return; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | Event::on( |
| 231 | 231 | View::class, |
| 232 | 232 | View::EVENT_BEFORE_RENDER_TEMPLATE, |
| 233 | - function (/** @scrutinizer ignore-unused */ TemplateEvent $event) { |
|
| 233 | + function(/** @scrutinizer ignore-unused */ TemplateEvent $event) { |
|
| 234 | 234 | try { |
| 235 | 235 | Craft::$app->getView()->registerAssetBundle(ReasonsAssetBundle::class); |
| 236 | 236 | } catch (InvalidConfigException $e) { |
@@ -70,8 +70,8 @@ |
||
| 70 | 70 | } else { |
| 71 | 71 | $targetFieldUid = $targetFieldIdOrUid; |
| 72 | 72 | } |
| 73 | - $return[$targetFieldUid] = \array_map(function (array $rules) { |
|
| 74 | - return \array_map(function (array $rule) { |
|
| 73 | + $return[$targetFieldUid] = \array_map(function(array $rules) { |
|
| 74 | + return \array_map(function(array $rule) { |
|
| 75 | 75 | $fieldIdOrUid = $rule['fieldId'] ?? $rule['field']; |
| 76 | 76 | if (!StringHelper::isUUID($fieldIdOrUid)) { |
| 77 | 77 | $fieldUid = Db::uidById(Table::FIELDS, $fieldIdOrUid); |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | $conditionals = Json::decodeIfJson($conditionals); |
| 311 | 311 | foreach ($conditionals as $targetFieldId => $statements) { |
| 312 | 312 | $targetFieldUid = $this->getFieldUidById((int)$targetFieldId); |
| 313 | - $return[$targetFieldUid] = \array_map(function (array $rules) { |
|
| 314 | - return \array_map(function (array $rule) { |
|
| 313 | + $return[$targetFieldUid] = \array_map(function(array $rules) { |
|
| 314 | + return \array_map(function(array $rule) { |
|
| 315 | 315 | $fieldId = $rule['fieldId']; |
| 316 | 316 | return [ |
| 317 | 317 | 'field' => $this->getFieldUidById("$fieldId"), |
@@ -338,8 +338,8 @@ discard block |
||
| 338 | 338 | $conditionals = Json::decodeIfJson($conditionals); |
| 339 | 339 | foreach ($conditionals as $targetFieldUid => $statements) { |
| 340 | 340 | $targetFieldId = $this->getFieldIdByUid($targetFieldUid); |
| 341 | - $return[$targetFieldId] = \array_map(function (array $rules) { |
|
| 342 | - return \array_map(function (array $rule) { |
|
| 341 | + $return[$targetFieldId] = \array_map(function(array $rules) { |
|
| 342 | + return \array_map(function(array $rule) { |
|
| 343 | 343 | return [ |
| 344 | 344 | 'fieldId' => $this->getFieldIdByUid($rule['field']), |
| 345 | 345 | 'compare' => $rule['compare'], |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | { |
| 523 | 523 | if (!isset($this->fieldUidsById)) { |
| 524 | 524 | $allFields = $this->getAllFields(); |
| 525 | - $this->fieldUidsById = \array_reduce($allFields, function (array $carry, FieldInterface $field) { |
|
| 525 | + $this->fieldUidsById = \array_reduce($allFields, function(array $carry, FieldInterface $field) { |
|
| 526 | 526 | $carry["{$field->id}"] = $field->uid; |
| 527 | 527 | return $carry; |
| 528 | 528 | }, []); |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | { |
| 541 | 541 | if (!isset($this->fieldIdsByUid)) { |
| 542 | 542 | $allFields = $this->getAllFields(); |
| 543 | - $this->fieldIdsByUid = \array_reduce($allFields, function (array $carry, FieldInterface $field) { |
|
| 543 | + $this->fieldIdsByUid = \array_reduce($allFields, function(array $carry, FieldInterface $field) { |
|
| 544 | 544 | $carry[$field->uid] = (int)$field->id; |
| 545 | 545 | return $carry; |
| 546 | 546 | }, []); |