Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
shows the following warnings/errors, which should be fixed.
FILE: ./src/Controller/VirtualEventsEventEndedController.php
----------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically.
| | The first wrong one is
| | Drupal\Component\Utility\UrlHelper.
25 | ERROR | [x] Expected 1 space after IF keyword; 0 found
25 | ERROR | [x] Expected 1 space after closing parenthesis; found
| | 0
30 | WARNING | [x] A comma should follow the last multiline array
| | item. Found: $url
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Entity/VirtualEventsConfigEntity.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
95 | ERROR | [x] Use null coalesce operator instead of ternary
| | operator.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Entity/VirtualEventsEventEntity.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
190 | WARNING | Unused variable $sources.
----------------------------------------------------------------------
FILE: ./src/Form/VirtualEventsConfigEntityForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------
18 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
19 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
20 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
24 | WARNING | Unused variable $formBuilder.
24 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
26 | WARNING | Unused variable $pluginConfigForms.
33 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
62 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
64 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
83 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
89 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
97 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------
FILE: ./src/Form/VirtualEventsFormatterEntityForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 12 LINES
----------------------------------------------------------------------
38 | WARNING | Unused variable $virtual_events_config_id.
39 | WARNING | Unused variable $config.
40 | WARNING | Unused variable $virtualEventsCommon.
40 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
41 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
42 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
43 | WARNING | Unused variable $allBundles.
43 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
45 | WARNING | Unused variable $sources.
46 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
50 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
52 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
69 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
72 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventFormatterPluginBase.php
----------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically.
| | The first wrong one is
| | Drupal\Core\Entity\Display\EntityViewDisplayInterface.
15 | WARNING | [x] Unused use statement
15 | ERROR | [x] There must be one blank line after the last USE
| | statement; 2 found;
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventFormatterPluginManager.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\Core\Cache\CacheBackendInterface.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventPostHandlePluginBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\Component\Plugin\PluginBase.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventPostHandlePluginManager.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\Core\Cache\CacheBackendInterface.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventPreHandlePluginBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\Component\Plugin\PluginBase.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventPreHandlePluginManager.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\Core\Cache\CacheBackendInterface.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventSourcePluginBase.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically.
| | The first wrong one is
| | Drupal\Component\Plugin\PluginBase.
109 | ERROR | [x] Expected 1 space before opening brace; found 0
110 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Plugin/VirtualEventSourcePluginManager.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\Core\Cache\CacheBackendInterface.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Services/VirtualEventsCommonService.php
----------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
46 | WARNING | [ ] \Drupal calls should be avoided in classes, use
| | dependency injection instead
69 | WARNING | [ ] Unused variable $key.
102 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, question marks, colons, or
| | closing parentheses
104 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, question marks, colons, or
| | closing parentheses
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/VirtualEventsUninstallValidator.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The
| | first wrong one is
| | Drupal\virtual_events\Entity\VirtualEventsConfigEntity.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./virtual_events.module
----------------------------------------------------------------------
FOUND 3 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically.
| | The first wrong one is
| | Drupal\Core\Entity\EntityFormInterface.
42 | WARNING | [x] A comma should follow the last multiline array
| | item. Found: NULL
106 | WARNING | [ ] Unused variable $sourceOpt.
231 | ERROR | [x] Expected 1 space after IF keyword; 0 found
231 | ERROR | [x] Expected 1 space after closing parenthesis;
| | found 0
239 | WARNING | [ ] Unused variable $sourcesResults.
292 | WARNING | [ ] Unused variable
| | $virtualEventsSourcePluginManager.
368 | WARNING | [ ] Unused variable $plugin.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./virtual_events.routing.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
7 | WARNING | The administration page callback should probably use
| | "administer site configuration" - which implies the
| | user can change something - rather than "access
| | administration pages" which is about viewing but not
| | changing configurations.
----------------------------------------------------------------------
Time: 473ms; Memory: 14MB