- Issue created by @solideogloria
- Assigned to ighosh
- ๐ฎ๐ณIndia ighosh
Checked the module. There are a lot of files that need its coding standards fixed. I'll work on these.
- ๐ฎ๐ณIndia ighosh
I have created the Merge Request for this. Please review and let me know if there are any issues with the changes.
https://git.drupalcode.org/project/rest_api_authentication/-/merge_reque... - Status changed to Needs work
11 months ago 3:00pm 10 January 2024 I noticed that you removed a use of
exit()
in RestAPI.php. Was that intentional? It might change the effects.Overall, it looks like a good improvement. I don't use this module, however, so it's up to other users to verify the changes work.
- ๐ฎ๐ณIndia ighosh
@solideogloria Thanks for noticing that. It was not intentional. I'll quickly update the MR. Thanks!
- Status changed to Needs review
11 months ago 2:44pm 11 January 2024 - Issue was unassigned.
Marking Critical, because the module's code looks absolutely terrible.
Also, the MR is targeting the wrong branch. It should be against 2.x
- Status changed to Needs work
7 months ago 1:49pm 21 May 2024 - ๐ฎ๐ณIndia ighosh
Hi @solideogloria. Thanks for pointing that out. I'll add the updated MR link in this MR itself.
- ๐ฎ๐ณIndia ighosh
Hi All. Updated MR - https://git.drupalcode.org/project/rest_api_authentication/-/merge_reque...
Please review. - Status changed to Needs review
7 months ago 12:24pm 27 May 2024 - Status changed to Needs work
7 months ago 4:44pm 28 May 2024 - ๐ต๐ญPhilippines roberttabigue
Hi @IGhosh,
After applying your latest MR !5 to the Drupal REST & JSON API module against 2.0.12 on Drupal 10, not all of the PHPCS errors were resolved.
See below:FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/rest_api_authentication.info.yml ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/Form/miniorangeAPIAuth.php --------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES --------------------------------------------------------------------------------------------------------------------------------------- 23 | ERROR | Class name doesn't match filename; expected "class miniorangeAPIAuth" 81 | WARNING | Unused global variable $base_url. 82 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 295 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead --------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/setupAuthenticationForm.php ---------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | Class name doesn't match filename; expected "class setupAuthenticationForm" ---------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/customerSetupForm.php ---------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | Class name doesn't match filename; expected "class customerSetupForm" ---------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/upgradePlansForm.php --------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES --------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | Class name doesn't match filename; expected "class upgradePlansForm" 24 | WARNING | Unused global variable $base_url. --------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/advancedSettingsForm.php ------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | Class name doesn't match filename; expected "class advancedSettingsForm" ------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/Utilities.php -------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------------- 86 | WARNING | Unused variable $ajax_form. 95 | WARNING | Unused variable $ajax_form. -------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/MiniorangeApiAuthSupport.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 170 | WARNING | Unused variable $response. ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/Routing/RouteSubscriber.php ---------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------------- 35 | WARNING | Unused private method restLoginRount() ---------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/requestForDemoForm.php ----------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | Class name doesn't match filename; expected "class requestForDemoForm" ----------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/rest_api_authentication/src/Authentication/Provider/restAPI.php ------------------------------------------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------------------ 18 | ERROR | Class name doesn't match filename; expected "class restAPI" ------------------------------------------------------------------------------------------------------------------------------------------------
I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml rest_api_authentication
I'm moving this to โNeeds workโ for now.
Thank you!
- ๐ฎ๐ณIndia ighosh
Hi @roberttabigue, In my system the only phpcs issues that are still coming up are the ones that I am not sure whether to remove or not as those changes/files are created by @arsh244, one of the maintainers of this module.
I updated the names of a few files because those are classes that had names starting with a small letter, but it should've been a capital letter.
I have not removed a few unused variables as I believe a confirmation from one of the maintainers might be required to do so.
Other than these, I have fixed most of the phpcs issues.
BTW, do let me know if there has been any mistake from my end. - Status changed to Fixed
6 months ago 6:42am 24 June 2024 - Status changed to Fixed
6 months ago 9:31am 24 June 2024