Skip to content

Commit 38faada

Browse files
committed
fix: fire created event though event configured for update
1 parent 39eaabd commit 38faada

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Attribute/SubscribeDoctrineEvents.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,15 @@
1616
*
1717
* @author Roni Saha <[email protected]>
1818
*/
19-
2019
#[\Attribute(\Attribute::TARGET_CLASS)]
21-
/* @final */ class SubscribeDoctrineEvents
20+
/* @final */
21+
class SubscribeDoctrineEvents
2222
{
23-
public $events = array();
23+
public array $events = [];
2424

25-
public function __construct(array $values)
25+
public function __construct(array|string $values)
2626
{
27-
if (isset($values['value'])) {
28-
$values['events'] = $values['value'];
29-
}
30-
if (!isset($values['events'])) {
31-
return;
32-
}
33-
34-
$this->events = is_array($values['events']) ? $values['events'] : array_map('trim', explode(',', $values['events']));
27+
$this->events = is_array($values) ? $values : array_map('trim', explode(',', $values));
3528

3629
$this->events = array_filter($this->events);
3730
}

0 commit comments

Comments
 (0)