- Issue created by @andypost
- Merge request !7816Draft: [8.4] Fix implicitly nullable type declarations in core/modules #3444026 → (Closed) created by andypost
- Status changed to Needs review
8 months ago 3:51am 29 April 2024 - 🇮🇳India onkararun
Hi @andypost i have tested MR !7816 3444026-8.4-fix-null-modules on Drupal Version 11.x-dev & PHP Version 8.3
Testing Steps:-
1). Install Drupal 11.x version.
2). /projects/drupal/ git remote add drupal-3444026 https://git.drupalcode.org/issue/drupal-3444026.git
3). git fetch drupal-3444026
4). git checkout -b '3444026-8.4-fix-null-modules' --track drupal-3444026/'3444026-8.4-fix-null-modules'During testing the code i found some error on following files
1. core/modules/node/src/NodeForm.php - when i cheked this file using php -d error_reporting="E_ALL" -l core/modules/node/src/NodeForm.php|grep deprecated then i didn't get anything but when i checked the same file using vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml core/modules/node/src/NodeForm.php then i got the error
FILE: /var/www/html/drupal/core/modules/node/src/NodeForm.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
240 | ERROR | Missing parameter type
242 | ERROR | Missing parameter type
----------------------------------------------------------------------So i removed this error by adding parameter type like below :-
/**
* Form submission handler for the 'preview' action.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/before the above comment was like below :-
/**
* Form submission handler for the 'preview' action.
*
* @param $form
* An associative array containing the structure of the form.
* @param $form_state
* The current state of the form.
*/
except this all the files code are fine - 🇫🇷France andypost
@Arun.k thank you, I moved this manual changes to separate issue 📌 [8.4] Fix implicitly nullable type declarations for phpstan job Needs review
- 🇫🇷France andypost
I think we should automate conversion and file separate issue to exceptions and manual fixes for docs
Using
~/.config/composer/vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php -vvv
# .php-cs-fixer.dist.php $finder = \PhpCsFixer\Finder::create() # ->in(__DIR__) ->in("core/modules") ->name('*.engine') ->name('*.module') ->name('*.profile') ->name('*.theme') ->name('*.inc') ->name('*.php'); $config = new \PhpCsFixer\Config(); return $config->setRules([ 'nullable_type_declaration_for_default_null_value' => true, ]) ->setFinder($finder);
- Status changed to Closed: won't fix
8 months ago 2:33pm 9 May 2024 - 🇫🇷France andypost
Discussed to not split fixes https://drupal.slack.com/archives/C04CHUX484T/p1715262829267749