Problem/Motivation

I see that the module follows very old PHP standard practices, for example it doesn't follow the function return type hinting, among other features that need to be added

More information about Drupal's coding standards

Steps to reproduce

Look into the module's source code, it is using outdated PHP practices.

Proposed resolution

Upgrade the module follow recent standard practices for writing more robust PHP code.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

danrod created an issue. See original summary.

danrod’s picture

Issue tags: +Novice

yusuf_khan made their first commit to this issue’s fork.

yusuf_khan’s picture

Im working on it

yusuf_khan’s picture

Assigned: Unassigned » yusuf_khan
Status: Active » Needs review
danrod’s picture

Hi @yusuf_khan PHPCS and PHPSTAN tests are not passing, could you check, please?

danrod’s picture

Status: Needs review » Needs work
yusuf_khan’s picture

Status: Needs work » Needs review

@danrod Thank you for reviewing my MR. In my latest commit, I have fixed the PHP_CodeSniffer and PHPStan-related pipeline failures, and the pipeline is now passing successfully. Could you please review it again when you have time?

vinodhini.e’s picture

Hi, Hi, I tested this module on Drupal 10.5.1 and ran code quality checks using PHPCS and PHPStan.

After applying MR !16 and re-running the reports:

PHPCS issues are fixed
PHPStan issues are still being reported

Details of PHPStan issues:

File: tests/src/Functional/RadiostosliderAdminTest.php

Line 23: Class extends unknown class Drupal\Tests\BrowserTestBase
Line 45: setUp() calls parent::setUp() but class does not extend a valid parent
Lines 48, 69, 160: Access to undefined property $rootUser
Lines 48, 69, 160: Call to undefined method drupalLogin()
Lines 56, 60, 71, 162: Call to undefined method drupalGet()
Lines 59, 61, 73, 164: Call to undefined method assertSession()
Line 152: Call to undefined method assertNotEquals()

Entity-related issues:

Line 82: Drupal\node\Entity\NodeType::create() unknown class
Line 88, 104: Drupal\field\Entity\FieldStorageConfig::create() unknown class
Line 95, 118: Drupal\field\Entity\FieldConfig::create() unknown class
Lines 126, 139: Drupal\node\Entity\Node::create() unknown class

Total: 24 PHPStan errors

The module still requires fixes to resolve PHPStan issues. Thanks.

yusuf_khan’s picture

@ vinodhini.e vendor/bin/phpstan analyze web/modules/contrib/radiostoslider-3581162 --level=1 --memory-limit=1G

6/6 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors

ykhan@COMM--YKHAN-MAC my-drupal-site $

ykhan@COMM--YKHAN-MAC my-drupal-site $ ddev drush st
Drupal version : 11.3.3
Site URI : http://my-drupal-site.ddev.site
DB driver : mysql
DB hostname : db
DB port : 3306
DB username : db
DB name : db
Database : Connected
Drupal bootstrap : Successful
Default theme : olivero
Admin theme : claro
PHP binary : /usr/bin/php8.4
PHP config : /etc/php/8.4/cli/php.ini
PHP OS : Linux
PHP version : 8.4.14
Drush script : /var/www/html/vendor/bin/drush.php
Drush version : 13.7.1.0
Drush temp : /tmp
Drush configs : /var/www/html/vendor/drush/drush/drush.yml
Install profile : standard
Drupal root : /var/www/html/web
Site path : sites/default
Files, Public : sites/default/files
Files, Temp : /tmp
Drupal config : sites/default/files/sync
ykhan@COMM--YKHAN-MAC my-drupal-site $

yusuf_khan’s picture

Assigned: yusuf_khan » Unassigned
danrod’s picture

StatusFileSize
new32.18 KB

Tested this and works ok, strangely the widget does not work with the Gin Admin theme, but I'll open a different issue for this.

There's some UX issues (please see attachment) that I will address in this MR

danrod’s picture

Status: Needs review » Needs work
danrod’s picture

StatusFileSize
new79.01 KB

I think it looks better now (see screenshot).

I'll move this fixed, please let me know if you have any suggestions and I reopen this.

danrod’s picture

Status: Needs work » Needs review

danrod’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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