Follow-up to #3185646: Fix coding standarts

There are still quite a few coding standard issues as reported on https://www.drupal.org/pift-ci-job/1930263. Let's fix some more. Some functions parameters in filefield_paths.module are documented with the comment "TODO.". Let's see if we can fix these as well.

I leave the coding standard issues in filefield_paths.api.inc untouched, as some of these are already handled in #2911652: Implements hook_filefield_paths_process_file breaking.

Code changes will follow.

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

MegaChriz created an issue. See original summary.

megachriz’s picture

Code so far is posted, but I've not documented the parameters for the function _filefield_paths_batch_update_process() yet.

megachriz’s picture

I opened the merge request just in order to be able to see the test results.

megachriz’s picture

Status: Active » Needs review

The parameters for _filefield_paths_batch_update_process() are now updated.

I also made \Drupal\Tests\filefield_paths\Functional\FileFieldPathsTestBase::createFileField() truly compatible with \Drupal\Tests\file\Functional\FileFieldCreationTrait::createFileField(). It wasn't strictly compatible because in FileFieldPathsTestBase's version, the parameter $third_party_settings was listed at the place where $widget_settings is in FileFieldCreationTrait's version:

public function createFileField($name, $entity_type, $bundle, $storage_settings = [], $field_settings = [], $widget_settings = []) {

FileFieldPathsTestBase::createFileField() before:

public function createFileField($name, $entity_type, $bundle, $storage_settings = [], $field_settings = [], $third_party_settings = [], $widget_settings = []) {

FileFieldPathsTestBase::createFileField() after:

public function createFileField($name, $entity_type, $bundle, $storage_settings = [], $field_settings = [], $widget_settings = [], $third_party_settings = []) {
megachriz’s picture

I've rebased the branch on the latest dev and made some more coding standards fixes.

megachriz’s picture

From the remaining ones, the type hints in FileFieldPathsTestBase cannot be added because that would make it incompatible with Drupal\Tests\file\Functional\FileFieldTestBase::createFileField().

For the deprecation warning, I'm not sure where to put @see to. Should it be to the issue the deprecation was added? Or would we need to create a change record first?

megachriz’s picture

Assigned: megachriz » Unassigned

It is ready for review, so unassigning.

solideogloria’s picture

Status: Needs review » Needs work

The PHP null coalesce operator ?? was used in the changes. That requires PHP 7.4. Could you add the PHP version requirement to the info.yml file? The module still supports Drupal 9.3, and some users might not be at PHP 7.4 yet.

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

  • voleger committed 489c61b0 on 8.x-1.x authored by megachriz
    Issue #3192110 by megachriz, voleger, solideogloria: Fix more coding...
voleger’s picture

Status: Needs work » Fixed

I will merge this now, as I'm working on #3480113: Update .gitlab-ci.yml file. I'll make further changes there. Thanks

voleger’s picture

Status: Fixed » Closed (fixed)

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