5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------------- 
  Line   src/Plugin/Block/UsaJobsBlock.php                                   
 ------ -------------------------------------------------------------------- 
         Class Drupal\usajobs\Plugin\Block\USAJobsBlock was not found while  
         trying to analyse it - autoloading is probably not configured       
         properly.                                                           
         💡 Learn more at https://phpstan.org/user-guide/autoloading          
 ------ -------------------------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   usajobs.theme.inc                                  
 ------ --------------------------------------------------- 
  37     Call to deprecated function format_date():         
         in drupal:8.0.0 and is removed from drupal:9.0.0.  
         Use \Drupal::service('date.formatter')->format().  
  42     Call to deprecated function format_date():         
         in drupal:8.0.0 and is removed from drupal:9.0.0.  
         Use \Drupal::service('date.formatter')->format().  
 ------ --------------------------------------------------- 

 [ERROR] Found 3 errors  
CommentFileSizeAuthor
#3 3139566-no-error.png199.54 KBvishalkhode
#3 3139566-3.patch1.4 KBvishalkhode

Comments

yonas.legesse created an issue. See original summary.

vishalkhode’s picture

Assigned: Unassigned » vishalkhode
vishalkhode’s picture

StatusFileSize
new1.4 KB
new199.54 KB

Please review.
No Error

vishalkhode’s picture

Status: Active » Needs review
mradcliffe’s picture

Status: Needs review » Reviewed & tested by the community

Nice work. Thank you for the patch, @vishalkhode.

similarity index 98%
rename from src/Plugin/Block/UsaJobsBlock.php

rename from src/Plugin/Block/UsaJobsBlock.php
rename to src/Plugin/Block/USAJobsBlock.php

Having to rename the class seems like it is a bug in phpstan or drupal-check.

This should be okay though as long as cache is cleared when the module is updated. Since the module doesn't have a stable release, it probably is OK.

phoang’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

This is no longer used on new version of Drupal 9 release.

vishalkhode’s picture

Hi mradcliffe/phoang,

Not sure, what exactly you mean by `This is no longer used on Drupal 9 version.`As mentioned by drupal check that: drupal_render & format_date function in now deprecated (https://api.drupal.org/api/drupal/core%21includes%21common.inc/function/..., https://api.drupal.org/api/drupal/core%21includes%21common.inc/function/...) and rather service has to be used instead and same I did with patch.
Also, class rename is not a bug in phpstan or drupal-check. This is correct error thrown because class name and filename must have to be the exactly same (case sensitive). and this is as the Drupal coding standard as well.

Thanks,
Vishal

mradcliffe’s picture

@phoang, do you mean that this module is no longer supported or maintained for Drupal 9?

It may make sense to update the module page with regard to the status of the module if that is the case.

phoang’s picture

Sorry guys for the confusion. I meant that the current module has been writing with new API structures and it will be ready for Drupal 9 version. Therefor, the patch of the file is no longer used in upcoming Drupal 9 release version.

vishalkhode’s picture

Ok, thanks guys for the confirmation.