Running phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig shows the following warnings/errors which should be fixed.
FILE: /var/www/html/web/modules/custom/field_permission/src/Plugin/FieldPermissionType/Base.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------
47 | ERROR | [x] Parameter $field_permissions_service has null default value, but is not marked as nullable.
| | (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)
63 | ERROR | [x] Parameter $field_storage has null default value, but is not marked as nullable.
| | (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/field_permission/src/Plugin/FieldPermissionType/Manager.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
52 | ERROR | [x] Parameter $field_storage has null default value, but is not marked as nullable.
| | (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/field_permission/field_permissions.module
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
34 | ERROR | [x] Parameter $items has null default value, but is not marked as nullable.
| | (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
Time: 1.78 secs; Memory: 8MB
PHP CODE SNIFFER REPORT SUMMARY
-----------------------------------------------------------------------------------------------------------------
FILE ERRORS WARNINGS
-----------------------------------------------------------------------------------------------------------------
/var/www/html/web/modules/custom/field_permission/field_permissions.module 1 0
/var/www/html/web/modules/custom/field_permission/src/Plugin/FieldPermissionType/Base.php 2 0
/var/www/html/web/modules/custom/field_permission/src/Plugin/FieldPermissionType/Manager.php 1 0
-----------------------------------------------------------------------------------------------------------------
A TOTAL OF 4 ERRORS AND 0 WARNINGS WERE FOUND IN 3 FILES
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX 4 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------------------------
SOURCE COUNT
--------------------------------------------------------------------------------------------------
[x] SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing 4
--------------------------------------------------------------------------------------------------
A TOTAL OF 4 SNIFF VIOLATIONS WERE FOUND IN 1 SOURCE
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SOURCES AUTOMATICALLY (4 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------------------------
Comments
Comment #2
Neeraj333 commentedComment #4
akram khanFixed all Coding standard PHPCS issue
Comment #5
akram khanComment #8
vishaljd commentedComment #10
vishaljd commentedComment #11
avpadernoThe tests failed, so the correct status is Needs work.
Comment #12
avpadernoThe issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, report which command has been used, which arguments have been used, and which report that command shown.
Comment #13
nikhilmahala11 commentedFixed all Coding standard PHPCS issues
Comment #14
sagartiwari commentedHello @nikhilmahala11 tested the patch you provided, it still have few errors.
../vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/field_permissions
FILE: ...tions/MAMP/htdocs/drupal_contrib/drupal-9.5-dev/web/modules/contrib/field_permissions/CHANGELOG.md
--------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
33 | WARNING | Line exceeds 80 characters; contains 93 characters
58 | WARNING | Line exceeds 80 characters; contains 140 characters
--------------------------------------------------------------------------------------------------------
FILE: ...tdocs/drupal_contrib/drupal-9.5-dev/web/modules/contrib/field_permissions/field_permissions.module
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
145 | ERROR | All functions defined in a module file must be prefixed with the module's name, found
| | "field_permission_field_config_edit_form_submit" but expected
| | "field_permissions_field_permission_field_config_edit_form_submit"
--------------------------------------------------------------------------------------------------------
Time: 305ms; Memory: 12MB
Comment #15
hardikpandya commentedComment #16
hardikpandya commentedComment #17
hardikpandya commentedComment #18
nayana_mvr commentedVerified the patch #17 on Drupal version 10.1.x and Field Permission version 8.x-1.x. The patch applied cleanly and except the following errors, all other coding standard issues are fixed.
Comment #19
avpadernoComment #20
avpadernoComment #21
pray_12 commentedHi,
Addressed the error and warning mentioned in #18.
Please Review.
Thankyou!!
Comment #22
avpadernoComment #23
avpadernoComment #26
sokru commentedFixed few remaining CS issues, since the phpcs job succeeds on CI, I set the status to RTBC.
Comment #29
avpadernoThe MR still needs to be reviewed, even if GitLab CI says there are no PHP_CodeSniffer warnings/errors.
Comment #30
clarkssquared commentedHi
I applied the updated MR !24 and I can still see PHPCS issues
retaining the status to needs review so that others can give their feedback
Comment #31
avpadernoGitLab CI does not report any PHP_CodeSniffer issues.
Comment #33
bluegeek9 commentedI updated the description with the current issues reported by phpcs.
Comment #37
bluegeek9 commentedAll tests including phpcs are passing.
Comment #38
denes.szabo commentedI tested the latest fix and I can confirm the MR#40 fixed all issues with PHP 8.4.
Comment #39
solideogloria commentedUpdating title and priority. Compatibility with PHP 8.4 is not a minor issue.
Comment #40
solideogloria commentedCan we get this merged, please? I confirmed that it fixes the issues.
Comment #42
japerryComment #44
richarddavies commentedHoping for a new release soon.
Comment #45
ph7 commentedApplied the 3322809-21 patch from #21 but still getting errors:
Deprecated: field_permissions_entity_field_access(): Implicitly marking parameter $items as nullable is deprecated, the explicit nullable type must be used instead in ./../modules/contrib/field_permissions/field_permissions.module on line 34