Skip to content

Commit 6af1543

Browse files
hjuarez20enzolutions
authored andcommitted
[generate:event:subscriber] Added coding standard (#4076)
1 parent 918a883 commit 6af1543

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Command/Shared/EventsTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ public function eventsQuestion()
3737
}
3838

3939
$callbackSuggestion = str_replace('.', '_', $event);
40+
4041
$callback = $this->getIo()->ask(
4142
$this->trans('commands.generate.event.subscriber.questions.callback-name'),
42-
$callbackSuggestion
43+
$this->stringConverter->underscoreToCamelCase($callbackSuggestion)
4344
);
4445

4546
$eventCollection[$event] = $callback;

templates/base/class.php.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use {{ service.class }};
2323
* @var \{{ service.class }}
2424
*/
2525
protected ${{service.camel_case_name}};
26+
2627
{% endfor %}
2728
{% endif %}
2829
{% endblock %}

templates/module/src/event-subscriber.php.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ class {{ class }} implements EventSubscriberInterface {% endblock %}
4040

4141
return $events;
4242
}
43-
4443
{% for event_name, callback in events %}
44+
4545
/**
46-
* This method is called whenever the {{ event_name }} event is dispatched.
46+
* This method is called when the {{ event_name }} is dispatched.
4747
*
4848
* @param \Symfony\Component\EventDispatcher\Event $event
4949
* The dispatched event.

0 commit comments

Comments
 (0)