@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | Event::on( |
59 | 59 | CraftVariable::class, |
60 | 60 | CraftVariable::EVENT_INIT, |
61 | - function (Event $event) { |
|
61 | + function(Event $event) { |
|
62 | 62 | /** @var CraftVariable $variable */ |
63 | 63 | $variable = $event->sender; |
64 | 64 | $variable->set('similar', SimilarVariable::class); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | Event::on( |
78 | 78 | Plugins::class, |
79 | 79 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
80 | - function (PluginEvent $event) { |
|
80 | + function(PluginEvent $event) { |
|
81 | 81 | if ($event->plugin === $this) { |
82 | 82 | } |
83 | 83 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | // Write down elements per site and similar counts |
140 | 140 | $queryConditions[$siteId][] = $elementId; |
141 | - $key = $siteId . '-' . $elementId; |
|
141 | + $key = $siteId.'-'.$elementId; |
|
142 | 142 | $similarCounts[$key] = $config['count']; |
143 | 143 | } |
144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $query = $this->getElementQuery($elementClass, $criteria); |
148 | 148 | |
149 | 149 | // Make sure we fetch the elements that are similar only |
150 | - $query->on(ElementQuery::EVENT_AFTER_PREPARE, function (CancelableEvent $event) use ($queryConditions) { |
|
150 | + $query->on(ElementQuery::EVENT_AFTER_PREPARE, function(CancelableEvent $event) use ($queryConditions) { |
|
151 | 151 | /** @var ElementQuery $query */ |
152 | 152 | $query = $event->sender; |
153 | 153 | $first = true; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | foreach ($elements as $element) { |
167 | 167 | // The `count` property is added dynamically by our CountBehavior behavior |
168 | - $key = $element->siteId . '-' . $element->id; |
|
168 | + $key = $element->siteId.'-'.$element->id; |
|
169 | 169 | if (!empty($similarCounts[$key])) { |
170 | 170 | /** @noinspection PhpUndefinedFieldInspection */ |
171 | 171 | $element->count = $similarCounts[$key]; |