Documentation and PHPDoc Blocks are wrong

Created on 23 May 2022, over 2 years ago
Updated 13 November 2023, about 1 year ago

The README.md has a few code blocks which contain (I believe) wrong examples. The Event implements the interface EventSchedulerInterface, but it should be the EventScheduleInterface. So copy and paste from the documentation results in errors and with an IDE to wrong imports.

Calling \Drupal::service('')->dispatch() .. I guess is also a first draft line, which needs the actual scheduler key added. ('event_scheduler.scheduler'?)

Further: In the event example there is static NAME = 'foobar'; Even though I use PHP 7.4 my IDE. I guess it should be const NAME.

Also: Symfony and even Drupal have switched the dispatch() arguments. Therefore first the Event Object, 2nd the event name. It would be great to have that here too.

In the README.md also the $event->initialise(MyEvent::NAME, ... is wrong, because you seemed to have removed the first argument.

πŸ“Œ Task
Status

Active

Version

2.1

Component

Documentation

Created by

πŸ‡©πŸ‡ͺGermany ro-no-lo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024