Problem/Motivation
Getting following error/warnings
FILE: /app/modules/contrib/maillog/src/Controller/MaillogController.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
126 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
--------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/maillog/src/Plugin/Mail/Maillog.php
---------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
---------------------------------------------------------------------------
43 | ERROR | [x] Use null coalesce operator instead of ternary operator.
47 | ERROR | [x] Use null coalesce operator instead of ternary operator.
63 | ERROR | [x] Use null coalesce operator instead of ternary operator.
81 | ERROR | [x] Use null coalesce operator instead of ternary operator.
100 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------
FILE: /app/modules/contrib/maillog/tests/src/Kernel/MailTest.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
77 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
-------------------------------------------------------------------------------------------------------------------------------------------
Time: 2.02 secs; Memory: 10MB
Steps to reproduce
Run following command
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/maillog/
Proposed resolution
Above error/warnings need to be fixed