$ drupal-check -ad web/modules/unused_modules

 ------ ------------------------------------------------------------------------------
  Line   src\UnusedModulesController.php
 ------ ------------------------------------------------------------------------------
  23     \Drupal calls should be avoided in classes, use dependency injection instead
  77     \Drupal calls should be avoided in classes, use dependency injection instead
 ------ ------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------
  Line   src\UnusedModulesExtensionDecorator.php
 ------ ------------------------------------------------------------------------------
  60     Drupal\unused_modules\UnusedModulesExtensionDecorator::__construct() does not call parent constructor from
         Drupal\Core\Extension\Extension.
 ------ ------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------
  Line   src\UnusedModulesHelperService.php
 ------ ---------------------------------------------------------------------------
  53     Variable $available_modules in isset() always exists and is not nullable.
  124    Variable $module might not be defined.
  213    Call to deprecated function drush_get_command():
         ()
  219    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ---------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------
  Line   unused_modules.drush.inc
 ------ ------------------------------------------------------------------------------
  10     Function unused_modules_drush_command not found while trying to analyse it - autoloading is probably not
         configured properly.
  33     Function unused_modules_drush_help not found while trying to analyse it - autoloading is probably not
         configured properly.
  43     Function drush_unused_modules not found while trying to analyse it - autoloading is probably not configured
         properly.
  48     Function drush_unused_modules_show_projects not found.
  51     Function drush_unused_modules_show_projects not found.
  60     Function drush_unused_modules_show_modules not found.
  63     Function drush_unused_modules_show_modules not found.
  85     Function drush_unused_modules_show_projects not found while trying to analyse it - autoloading is probably not
         configured properly.
  121    Call to deprecated function drush_print().
  124    Function drush_print_table not found.
  139    Function drush_unused_modules_show_modules not found while trying to analyse it - autoloading is probably not
         configured properly.
  181    Call to deprecated function drush_print().
  184    Function drush_print_table not found.
  191    Function unused_modules_drush_command_alter not found while trying to analyse it - autoloading is probably not
         configured properly.
 ------ ------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------
  Line   unused_modules.site_audit.inc
 ------ ------------------------------------------------------------------------------
         Class SiteAuditCheckExtensionsUnused was not found while trying to analyse it - autoloading is probably not
         configured properly.
 ------ ------------------------------------------------------------------------------

 [ERROR] Found 22 errors

Comments

Sergiu Stici created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new457 bytes

Here's the patch, please review.

vuil’s picture

Title: Deprecated Code Report » Deprecated Code Report (D9 compliant)
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Drupal 9 compatibility

The patch #2 is OK, but the summary is updated, and the issue needs so much additional work.

-enzo-’s picture

Hi folks

I tested patch #2, and there is still one issue, any idea how this should be addresed?

------ ----------------------------------------------------------------------------------------------------------------------------------
  Line   unused_modules.site_audit.inc
 ------ ----------------------------------------------------------------------------------------------------------------------------------
         Class SiteAuditCheckExtensionsUnused was not found while trying to analyse it - autoloading is probably not configured properly.
 ------ ----------------------------------------------------------------------------------------------------------------------------------
vuil’s picture

I added my employer only.

-enzo-’s picture

@vuil

I am not saying is your fault, I am just asking if anyone knows how to fix it

ndf’s picture

Maintainer here

Site_audit.inc is loaded by https://www.drupal.org/project/site_audit

Not sure if it is possible to let drupal-check understand this.

Imo we can skip this file or create a follow up for it.
If all other deprecations are fixed that is already supernice and rtbc by me

elgandoz’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new860 bytes
new337 bytes

The previous patch applies fine, I just added the core_version_requirement: ^8 || ^9.
Even after installing Site Audit module, I still get issues with the autoloader and I'm not able to figure it out.
Tested on Drupal 9.0.0-rc1, module works as usual.
Despite that issue, I reckon this would be good to go.

elgandoz’s picture

StatusFileSize
new838 bytes
new315 bytes

After uploading the previous patch, I realized I made a mistake in replacing the core version, making the module incompatible with older versions.
Please disregard my previous submission and use the following.

elgandoz’s picture

Status: Reviewed & tested by the community » Needs review

  • ndf committed 148b8ec on 8.x-1.x
    #3083213 by Project Update Bot, Sergiu Stici, vuil, elgandoz, ndf:...
elgandoz’s picture

Status: Needs review » Fixed

Since the code has been committed, I'll mark this as fixed, feel free the re-open if there's any issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vuil’s picture

Please plan new stable version of the project / module. Thank you.

ndf’s picture

Ok I will soon

elgandoz’s picture

@ndf: the new stable version doesn't have the core_version_requirement: ^8 || ^9 (but present in the patch!). Therefore the module is still not compatible with D9