- Issue created by @kiseleva.t
- Merge request !23Issue #3519195: Fix PHP 8.4 nullable type declarations. → (Open) created by kiseleva.t
In PHP 8.4, declaring functions/methods with parameters containing null as a default value, but without null as one of the types (either as a nullable syntax or as a Union type with null) is deprecated.
https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullabl...
phpcs --standard=SlevomatCodingStandard --sniffs=SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
FILE: /app/docroot/modules/contrib/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
64 | ERROR | [x] Parameter $logger_factory has null default value, but is not marked as nullable.
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------
FILE: /app/docroot/modules/contrib/aggregator/tests/src/Functional/migrate_drupal_ui/MigrateUpgradeExecuteTestBase.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
44 | ERROR | [x] Parameter $available_paths has null default value, but is not marked as nullable.
44 | ERROR | [x] Parameter $missing_paths has null default value, but is not marked as nullable.
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------
FILE: /app/docroot/modules/contrib/aggregator/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
75 | ERROR | [x] Parameter $settings has null default value, but is not marked as nullable.
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------
FILE: /app/docroot/modules/contrib/aggregator/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
75 | ERROR | [x] Parameter $settings has null default value, but is not marked as nullable.
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------
Needs work
2.0
Code