Problem/Motivation

Make sure Socialbase Drupal 9.4 compatible
Make it PHP 8.0 compatible
Improving coding standards.

Proposed resolution

1. Use tools like PHPStan and PHPCS to scan for incompatible changes and fix them

Issue fork socialblue-3314704

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

navneet0693 created an issue. See original summary.

navneet0693’s picture

Status: Active » Needs review
cinarb’s picture

Assigned: Unassigned » cinarb

Hi Ill review this =)

cinarb’s picture

Assigned: cinarb » Unassigned
Status: Needs review » Needs work

After I run PHPstan, I don't get any errors:

---------------------------------------------------------------------------------------------------------------------
cindyv@lnb000015col:~...$ lando phpstan analyse web/themes/contrib/socialblue

Xdebug: [Step Debug] Could not connect to debugging client. Tried: 192.168.1.10:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(

Note: Using configuration file /app/phpstan.neon.
8/8 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors
---------------------------------------------------------------------------------------------------------------------

Using phpcs:

---------------------------------------------------------------------------------------------------------------------

cindyv@lnb000015col:~.../web/themes/contrib/socialblue$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,info,md,yml,twig .

FILE: .../web/themes/contrib/socialblue/theme-settings.php
--------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 8 LINES
--------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | WARNING | [x] Unused use statement
4 | ERROR | [ ] Missing short description in doc comment
131 | ERROR | [x] Data types in @var tags need to be fully namespaced
215 | ERROR | [x] Data types in @param tags need to be fully namespaced
218 | ERROR | [x] Data types in @throws tags need to be fully namespaced
260 | ERROR | [x] Data types in @param tags need to be fully namespaced
263 | ERROR | [x] Data types in @throws tags need to be fully namespaced
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

FILE: /.../web/themes/contrib/socialblue/templates/node/event/node--event--teaser--sky.html.twig
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
36 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/themes/contrib/socialblue/templates/layout/region--header.html.twig
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
15 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: .../web/themes/contrib/socialblue/color/color.inc
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
8 | WARNING | Unused variable $info.
-----------------------------------------------------------------------------------------

FILE: .../web/themes/contrib/socialblue/components/00-config/variables/colors.twig
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: .../web/themes/contrib/socialblue/components/02-atoms/badge/badge-variation.twig
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: .../web/themes/contrib/socialblue/components/02-atoms/button/button--floating.twig
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

Time: 113ms; Memory: 10MB

--------------------------------------------------------------------------------------------------------------------------

I fixed the remaining phpcs errors, but I didn't know how to proceed with this one:

FILE: .../web/themes/contrib/socialblue/color/color.inc
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
8 | WARNING | Unused variable $info.
-----------------------------------------------------------------------------------------

Time: 114ms; Memory: 10MB

Notice I didn't check for phpcs errors in CSS file extensions due to the big amount of errors to be fixed. I think it is best to create another issue for that.

navneet0693’s picture

Thank @cinarb for your contribution !! Great work.

navneet0693’s picture

Status: Needs work » Needs review
tbsiqueira’s picture

Status: Needs review » Reviewed & tested by the community
navneet0693’s picture

Version: 2.3.x-dev » 2.4.x-dev

  • navneet0693 committed d5fe68f on 2.4.x
    Issue #3314704: Improve socialblue codebase quality
    
navneet0693’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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