There are a lot of coding standards issues in Feeds 8.x-3.x. Some of them can (almost) be fixed automatically by PHP_CodeSniffer. See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automati...

Let's do that.

There are more coding standard violations reported on https://pareview.sh/pareview/https-git.drupal.org-project-feeds.git-8.x-3.x, but these are very different from what is being reported on https://www.drupal.org/pift-ci-job/992076.

CommentFileSizeAuthor
#107 2939688-107[MediaTargetBase].patch1.54 KBisa.bel
#101 fixing_code-2939688-101.patch13.58 KBrohit.rawat619
#80 interdiff-2939688-78-80[EntityProcessorBase+Tests].txt1.12 KBmegachriz
#80 2939688-80[EntityProcessorBase+Tests].patch9.93 KBmegachriz
#78 interdiff-2939688-77-78[EntityProcessorBase+Tests].txt10.25 KBmegachriz
#78 2939688-78[EntityProcessorBase+Tests].patch9.92 KBmegachriz
#77 2939688-77[File+Tests].patch7.91 KBbruno.bicudo
#77 2939688-77[EntityProcessorBase+Tests].patch10.49 KBbruno.bicudo
#75 2939688-75_sniffer.txt21.41 KBbruno.bicudo
#75 2939688-75[Others].patch19.31 KBbruno.bicudo
#75 2939688-75[Tests].patch31.11 KBbruno.bicudo
#75 2939688-75[Feeds].patch5.68 KBbruno.bicudo
#75 2939688-75[UserRole+Tests].patch2.41 KBbruno.bicudo
#75 2939688-75[Syndication+Tests].patch4.75 KBbruno.bicudo
#75 2939688-75[File+Tests].patch7.02 KBbruno.bicudo
#75 2939688-75[EntityProcessorBase+Tests].patch10.52 KBbruno.bicudo
#71 interdiff-2939688-69-71.txt2.16 KBmegachriz
#71 feeds-coding-standards-FeedsDrushCommands-2939688-71.patch10.7 KBmegachriz
#69 interdiff-2939688-64-69.txt5.46 KBmegachriz
#69 feeds-coding-standards-FeedsDrushCommands-2939688-69.patch10.73 KBmegachriz
#64 2939688-64_sniffer.txt15.25 KBbruno.bicudo
#64 2939688-64[Tests].patch54.61 KBbruno.bicudo
#64 2939688-64[Others].patch27.64 KBbruno.bicudo
#64 2939688-64[Form_Plugin].patch8.61 KBbruno.bicudo
#64 2939688-64[Feeds].patch53.02 KBbruno.bicudo
#63 2939688-63[Commands].patch9.81 KBbruno.bicudo
#57 2939688-57_sniffer.txt15.26 KBbruno.bicudo
#57 2939688-57[Tests].patch40.35 KBbruno.bicudo
#57 2939688-57[src].patch7.77 KBbruno.bicudo
#57 2939688-57[routing.yml].patch643 bytesbruno.bicudo
#57 2939688-57[Result].patch415 bytesbruno.bicudo
#57 2939688-57[Plugin].patch5.03 KBbruno.bicudo
#57 2939688-57[Laminas].patch474 bytesbruno.bicudo
#57 2939688-57[Form].patch3.58 KBbruno.bicudo
#57 2939688-57[Feeds].patch51.99 KBbruno.bicudo
#57 2939688-57[Exception].patch487 bytesbruno.bicudo
#57 2939688-57[EventSubscriber].patch937 bytesbruno.bicudo
#57 2939688-57[Event].patch1.15 KBbruno.bicudo
#57 2939688-57[Entity].patch1.53 KBbruno.bicudo
#57 2939688-57[Component].patch5.05 KBbruno.bicudo
#57 2939688-57[Commands].patch9.6 KBbruno.bicudo
#53 2939688-53[Commands].patch3.66 KBbruno.bicudo
#51 2939688-51[Tests].patch4.67 KBbruno.bicudo
#51 2939688-51[src].patch481 bytesbruno.bicudo
#51 2939688-51[Plugin].patch1.75 KBbruno.bicudo
#51 2939688-51[Feeds].patch36.52 KBbruno.bicudo
#51 2939688-51[Component].patch572 bytesbruno.bicudo
#51 2939688-51[Commands].patch7.4 KBbruno.bicudo
#51 2939688-51[Annotation].patch642 bytesbruno.bicudo
#47 2939688-47[Component].patch1.93 KBbruno.bicudo
#47 2939688-47[Feeds].patch5.1 KBbruno.bicudo
#47 2939688-47[Plugin].patch1.49 KBbruno.bicudo
#47 2939688-47[src].patch430 bytesbruno.bicudo
#41 issuesPatch-41.txt70.15 KBGuilherme Rabelo
#41 2939688-41.patch99.2 KBGuilherme Rabelo
#33 2939688-33.patch22.34 KBurvashi_vora
#31 2939688-31.patch28.79 KBurvashi_vora
#28 2939688-28.patch2.09 MBmohit.bansal623
#25 feeds-coding-standards-2939688-25.patch3.76 KBmegachriz
#21 interdiff-2939688-20-21.txt10.89 KBmegachriz
#21 feeds-coding-standards-2939688-21.patch46.76 KBmegachriz
#20 feeds-coding-standards-2939688-20.patch41.94 KBmegachriz
#17 interdiff-2939688-16-17.txt1.21 KBmegachriz
#17 feeds-coding-standards-2939688-17.patch12.81 KBmegachriz
#16 interdiff-2939688-14-16.txt626 bytesmegachriz
#16 feeds-coding-standards-2939688-16.patch12.72 KBmegachriz
#14 feeds-coding-standards-2939688-14.patch12.71 KBmegachriz
#11 interdiff-2939688-10-11.txt4.71 KBmegachriz
#11 feeds-coding-standards-2939688-11.patch49.27 KBmegachriz
#10 interdiff-2939688-09-10.txt475 bytesmegachriz
#10 feeds-coding-standards-2939688-10.patch49.01 KBmegachriz
#9 interdiff-2939688-7-9.txt7.5 KBmegachriz
#9 feeds-coding-standards-2939688-9.patch49 KBmegachriz
#7 feeds-coding-standards-2939688-7.patch45.78 KBmegachriz
#3 feeds-coding-standards-2939688-3.patch90.8 KBmegachriz
#2 feeds-coding-standards-2939688-2.patch93.58 KBmegachriz

Issue fork feeds-2939688

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

Status: Active » Needs review
StatusFileSize
new93.58 KB

Inside the Feeds code base I executed the following command on the command line:
phpcbf --standard=Drupal .

Then reviewed all the changes and corrected some of the automated fixes. For example: code that is commented out I want to leave untouched.

megachriz’s picture

StatusFileSize
new90.8 KB

In the patch some code was included I was still working on. New patch.

  • MegaChriz committed 6e4110b on 8.x-3.x
    Issue #2939688 by MegaChriz: Fixed some coding standards that could...
megachriz’s picture

Status: Needs review » Active

Nothing known was broken, so committed #3!

Back to active for the remaining style fixes.

  • MegaChriz committed f22ded9 on 8.x-3.x
    Issue #2939688 by MegaChriz: coding standards: add inheritdoc for all...
megachriz’s picture

Status: Active » Needs review
StatusFileSize
new45.78 KB

Coding standards for code in tests.

Status: Needs review » Needs work

The last submitted patch, 7: feeds-coding-standards-2939688-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

megachriz’s picture

Status: Needs work » Needs review
StatusFileSize
new49 KB
new7.5 KB

Fixing test failures and more coding standard fixes in the tests.

megachriz’s picture

StatusFileSize
new49.01 KB
new475 bytes
megachriz’s picture

  • MegaChriz committed dd5ff82 on 8.x-3.x
    Issue #2939688 by MegaChriz: Fixed most coding standards in tests folder...
megachriz’s picture

Status: Needs review » Active

Committed #11.

Back to active for the remaining style fixes.

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new12.71 KB

Some more coding standard fixes in tests.

Status: Needs review » Needs work

The last submitted patch, 14: feeds-coding-standards-2939688-14.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

megachriz’s picture

Status: Needs work » Needs review
StatusFileSize
new12.72 KB
new626 bytes
megachriz’s picture

StatusFileSize
new12.81 KB
new1.21 KB

  • MegaChriz committed 8459c95 on 8.x-3.x
    Issue #2939688 by MegaChriz: Fixed some more coding standards in tests...
megachriz’s picture

Status: Needs review » Active

Committed #17.

And back to active again.

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new41.94 KB

A large amount of coding standard fixes. Let's see if these cause any issues or if I skipped over a few coding standards issues.

megachriz’s picture

Some more fixes.

megachriz’s picture

Status: Needs review » Active

Committed #21. There are a few still left, so back to "active" again.

  • MegaChriz committed e3f1555 on 8.x-3.x
    Issue #2939688 by MegaChriz: Fixed more coding standards.
    
megachriz’s picture

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new3.76 KB

Fixes for coding standard violations that slipped in lately.

megachriz’s picture

Status: Needs review » Active

Committed #25. Back to "active" for remaining coding standard issues.

  • MegaChriz committed f212da3 on 8.x-3.x
    Issue #2939688 by MegaChriz: Some coding standards fixes.
    
mohit.bansal623’s picture

Status: Active » Needs review
StatusFileSize
new2.09 MB
darvanen’s picture

Status: Needs review » Needs work

Thanks for this patch @mohit.bansal623 but it is simply too big to review. As you can see @MegaChriz has been addressing this issue in bite-sized pieces. Can I suggest that you supply a patch for just a few files, or even just one if the changes are large? As a guide let's try to keep the patches below 50KB.

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

urvashi_vora’s picture

Assigned: megachriz » Unassigned
StatusFileSize
new28.79 KB

I tried reducing the patch size @darvanen. Uploading a patch for some files.

megachriz’s picture

Thanks for the patch. I could be wrong, but it looks like that the patch is adding more coding standard issues than it fixes. Or did I miss changes in the Drupal coding standards?

Examples:

  1. +++ b/feeds.install
    @@ -8,68 +8,74 @@
    +function feeds_uninstall() ¶
    +{
    

    If I'm not mistaken, Drupal coding standards say that the opening accolade should be on the same line as the function name.

  2. +++ b/feeds.install
    @@ -8,68 +8,74 @@
    +    // @todo remove keyvalue store and queue things.
    

    Drupal uses two spaces for indenting instead of 4.

  3. +++ b/feeds.install
    @@ -8,68 +8,74 @@
    -        'unsigned' => TRUE,
    -        'not null' => TRUE,
    +        'unsigned' => true,
    +        'not null' => true,
    

    Drupal uses uppercase for boolean values in code (in docblocks they may be lowercase).

  4. +++ b/feeds.install
    @@ -8,68 +8,74 @@
    +        $schema->createTable(
    +            'feeds_clean_list', [
    +            'description' => 'Keeps a list of items to clean after the process stage.',
    +            'fields' => [
    +            'feed_id' => [
    +            'description' => 'The ID of the feed.',
    +            'type' => 'int',
    +            'unsigned' => true,
    +            'not null' => true,
    +            ],
    +            'entity_id' => [
    +            'description' => 'The ID of the entity to clean.',
    +            'type' => 'int',
    +            'unsigned' => true,
    +            'not null' => true,
    +            ],
    +            ],
    +            ]
    

    Missing indentation for the arrays.

So I suspect that maybe a different coding standards profile was used when checking the code (not the Drupal one). If you use Coder Sniffer, you need to explicitly specify you want to use one of the Drupal rulesets. See https://www.drupal.org/docs/contributed-modules/code-review-module/insta...

urvashi_vora’s picture

Status: Needs work » Needs review
StatusFileSize
new22.34 KB

Hi, I worked on the patch, uploading it, please review it.

irinaz’s picture

Issue tags: +GlobalSprint2021
irinaz’s picture

Assigned: Unassigned » megachriz
Issue tags: -GlobalSprint2021
Guilherme Rabelo’s picture

Hi, i will review this last patch.

Guilherme Rabelo’s picture

Assigned: Guilherme Rabelo » Unassigned

I found some erros and i cant apply this last patch. So i will unassigned and wait for the updates patch

darvanen’s picture

Hi @Guilherme Rabelo and welcome to the Drupal community :)

Thanks for reviewing the patch, to make the most of the time you spent doing so, any information you can provide on the problems you encountered will help those working on it be able to fix it - or potentially help you with it.

For instance: I'd like to check that you were applying the patch to the 8.x -3.x-dev version of the module, and that you used the -p1 flag on the patch command from within the modules/feeds/ folder?

joelpittet’s picture

Status: Needs review » Needs work

These issues can be tricky because they touch code potentially modified by other patches.

Here is the current output when trying to apply the patch.

100 22875  100 22875    0     0   194k      0 --:--:-- --:--:-- --:--:--  208k
patching file src/Component/CsvParser.php
patching file src/Entity/Feed.php
Hunk #1 succeeded at 438 (offset 1 line).
patching file src/EventSubscriber/LazySubscriber.php
patching file src/Exception/FeedsRuntimeException.php
patching file src/Feeds/Parser/OpmlParser.php
Hunk #1 FAILED at 70.
1 out of 1 hunk FAILED -- saving rejects to file src/Feeds/Parser/OpmlParser.php.rej
patching file src/Feeds/State/CleanState.php
patching file src/Feeds/State/CleanStateInterface.php
patching file src/FeedsExecutable.php
patching file src/FeedsQueueExecutable.php
patching file src/Plugin/Field/FieldFormatter/FeedsItemGuidFormatter.php
patching file src/Plugin/Field/FieldFormatter/FeedsItemUrlFormatter.php
patching file tests/src/Functional/PrivateFileTest.php
patching file tests/src/Kernel/Entity/FeedTest.php
Hunk #2 succeeded at 298 (offset 10 lines).
patching file tests/src/Traits/FeedsReflectionTrait.php
patching file tests/src/Unit/Component/CsvParserTest.php
patching file tests/src/Unit/Feeds/Fetcher/DirectoryFetcherTest.php
patching file tests/src/Unit/Feeds/Fetcher/HttpFetcherTest.php
patching file tests/src/Unit/Feeds/Fetcher/UploadFetcherTest.php
patching file tests/src/Unit/Feeds/Parser/SitemapParserTest.php
Hunk #1 succeeded at 8 (offset 1 line).
Hunk #2 succeeded at 85 (offset 1 line).
patching file tests/src/Unit/Feeds/Parser/SyndicationParserTest.php
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] n
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file tests/src/Unit/Feeds/Parser/SyndicationParserTest.php.rej
patching file tests/src/Unit/Plugin/QueueWorker/FeedQueueWorkerBaseTest.php
patching file tests/src/Unit/Plugin/QueueWorker/FeedRefreshTest.php
patching file tests/src/Unit/Result/FetcherResultTest.php

Where a couple failed to apply.

And here are some of the remaining changes:

❯ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

FILE: /Users/joel/Contrib/feeds/feeds.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 24 | ERROR | Empty installation hooks are not necessary
----------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Unit/Component/XmlParserTraitTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 58 | ERROR | The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
 59 | ERROR | The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines
 60 | ERROR | The array declaration extends to column 110 (the limit is 80). The array content should be split up over multiple lines
 61 | ERROR | The array declaration extends to column 134 (the limit is 80). The array content should be split up over multiple lines
 62 | ERROR | The array declaration extends to column 118 (the limit is 80). The array content should be split up over multiple lines
 63 | ERROR | The array declaration extends to column 118 (the limit is 80). The array content should be split up over multiple lines
 64 | ERROR | The array declaration extends to column 122 (the limit is 80). The array content should be split up over multiple lines
 69 | ERROR | The array declaration extends to column 114 (the limit is 80). The array content should be split up over multiple lines
 72 | ERROR | The array declaration extends to column 166 (the limit is 80). The array content should be split up over multiple lines
 75 | ERROR | The array declaration extends to column 166 (the limit is 80). The array content should be split up over multiple lines
 78 | ERROR | The array declaration extends to column 138 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Unit/Component/CsvParserTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 58 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Unit/Feeds/Parser/Form/CsvParserFeedFormTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 30 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemUrlFormatterTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 60 | ERROR | The array declaration extends to column 177 (the limit is 80). The array content should be split up over multiple lines
 61 | ERROR | The array declaration extends to column 190 (the limit is 80). The array content should be split up over multiple lines
 62 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemGuidFormatterTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 67 | ERROR | The array declaration extends to column 221 (the limit is 80). The array content should be split up over multiple lines
 68 | ERROR | The array declaration extends to column 189 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemImportedFormatterTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 82 | ERROR | The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Functional/CronTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 95 | ERROR | The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Functional/Feeds/Parser/Form/CsvParserFeedFormTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 28 | ERROR | The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Functional/UpdateNonExistentTest.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
 312 | ERROR | The array declaration extends to column 101 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Kernel/SkipNewTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 33 | ERROR | The array declaration extends to column 114 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/tests/src/Kernel/FeedsEventsTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 117 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 139 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 180 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 222 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Form/FeedScheduleImportForm.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 56 | ERROR | The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Form/CustomSourceDeleteForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 90 | ERROR | [x] Each PHP statement must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Form/FeedDeleteForm.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------
 58 | ERROR | The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
 64 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Form/FeedUnlockForm.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 39 | ERROR | The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Zend/Extension/Georss/Entry.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 10 | ERROR | The text '@deprecated in favor of \Drupal\feeds\Laminas\Extension\Georss\Entry. Use that instead.' does not match the standard format: @deprecated in
    |       | %deprecation-version% and is removed from %removal-version%. %extra-info%.
 10 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Plugin/Type/FeedsAnnotationFactory.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 10 | ERROR | The text '@deprecated in Feeds 8.x-3.0-alpha6, will be removed before Feeds 8.x-3.0.' does not match the standard format: @deprecated in %deprecation-version%
    |       | and is removed from %removal-version%. %extra-info%.
 10 | ERROR | Each @deprecated tag must have a @see tag immediately following it
 24 | ERROR | The trigger_error message 'FeedsAnnotationFactory is deprecated in Feeds 8.x-3.0-alpha6 and will be removed before Feeds 8.x-3.0. Implement
    |       | \Drupal\Core\Plugin\ContainerFactoryPluginInterface instead.' does not match the relaxed standard format: %thing% is deprecated in %deprecation-version% any free
    |       | text %removal-version%. %extra-info%. See %cr-link%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Component/XmlParserTrait.php
----------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------
 15 | WARNING | Property name "$_elementRegex" should not be prefixed with an underscore to indicate visibility
 15 | ERROR   | Class property $_elementRegex should use lowerCamel naming without underscores
 22 | WARNING | Property name "$_useError" should not be prefixed with an underscore to indicate visibility
 22 | ERROR   | Class property $_useError should use lowerCamel naming without underscores
 29 | WARNING | Property name "$_entityLoader" should not be prefixed with an underscore to indicate visibility
 29 | ERROR   | Class property $_entityLoader should use lowerCamel naming without underscores
 36 | WARNING | Property name "$_errors" should not be prefixed with an underscore to indicate visibility
 36 | ERROR   | Class property $_errors should use lowerCamel naming without underscores
----------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Annotation/FeedsTarget.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 26 | ERROR | Class property $field_types should use lowerCamel naming without underscores
-------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Annotation/FeedsSource.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 26 | ERROR | Class property $field_types should use lowerCamel naming without underscores
-------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/TargetDefinition.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 148 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Feeds/Target/EntityReference.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 159 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Feeds/Target/UserRole.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
 120 | ERROR | The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Feeds/Item/SitemapItem.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 10 | ERROR | Missing member variable doc comment
 11 | ERROR | Missing member variable doc comment
 12 | ERROR | Missing member variable doc comment
 13 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Feeds/Item/OpmlItem.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 10 | ERROR | Missing member variable doc comment
 11 | ERROR | Missing member variable doc comment
 12 | ERROR | Missing member variable doc comment
 13 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Feeds/Item/SyndicationItem.php
-------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------
 10 | ERROR | Missing member variable doc comment
 11 | ERROR | Missing member variable doc comment
 12 | ERROR | Missing member variable doc comment
 13 | ERROR | Class property $author_name should use lowerCamel naming without underscores
 13 | ERROR | Missing member variable doc comment
 14 | ERROR | Missing member variable doc comment
 15 | ERROR | Missing member variable doc comment
 16 | ERROR | Missing member variable doc comment
 17 | ERROR | Missing member variable doc comment
 18 | ERROR | Missing member variable doc comment
 19 | ERROR | Missing member variable doc comment
 20 | ERROR | Missing member variable doc comment
-------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Commands/FeedsDrushCommands.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------------------------------------
 142 | ERROR | The array declaration extends to column 141 (the limit is 80). The array content should be split up over multiple lines
 180 | ERROR | The array declaration extends to column 142 (the limit is 80). The array content should be split up over multiple lines
 224 | ERROR | The array declaration extends to column 144 (the limit is 80). The array content should be split up over multiple lines
 323 | ERROR | The array declaration extends to column 140 (the limit is 80). The array content should be split up over multiple lines
 357 | ERROR | The array declaration extends to column 142 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/FeedTypeAccessControlHandler.php
----------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------
 28 | WARNING | [ ] Code after the RETURN statement on line 26 cannot be executed
 28 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 38 | WARNING | [ ] Code after the RETURN statement on line 36 cannot be executed
 38 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/FeedForm.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  64 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
 157 | ERROR | The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
 191 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/joel/Contrib/feeds/src/Event/EventDispatcherTrait.php
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 24 | WARNING | Property name "$_eventDispatcher" should not be prefixed with an underscore to indicate visibility
 24 | ERROR   | Class property $_eventDispatcher should use lowerCamel naming without underscores
-------------------------------------------------------------------------------------------------------------------

Time: 2.96 secs; Memory: 20MB

But note some changes are API changes when renaming things for example so we can't make those changes easily.

Guilherme Rabelo’s picture

Assigned: Unassigned » Guilherme Rabelo

I rerolled the #33 patch and after that i was able to apply the patch. Now i will work on the issues to fixe.

Guilherme Rabelo’s picture

Assigned: Guilherme Rabelo » Unassigned
Status: Needs work » Needs review
StatusFileSize
new99.2 KB
new70.15 KB

I cound't apply #33 patch.
So i rerolled the module from 8.x-3.x and after that i can run the phpcs and shows me a lot of issues about coding standadrs. The problems are in issuesPatch-41.txt file. So i fixed almost of the issues. Still have some unused variable problems, that i think its more interesting to someone who knows more about this module fixe this issues.

Needs to review this patch.

megachriz’s picture

Status: Needs review » Needs work

Thanks for working on fixing the coding standards!
Here are my remarks on the patch. Since it was a big patch, I might not have spotted everything yet.

  1. +++ b/src/Annotation/FeedsSource.php
    @@ -23,6 +23,6 @@ class FeedsSource extends FeedsBase {
    -  public $field_types;
    +  public $fieldTypes;
    
    +++ b/src/Annotation/FeedsTarget.php
    @@ -23,6 +23,6 @@ class FeedsTarget extends FeedsBase {
    -  public $field_types;
    +  public $fieldTypes;
    

    I'm not sure if I want to change this as it would break implementations in other modules.

  2. +++ b/src/Commands/FeedsDrushCommands.php
    @@ -129,7 +129,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('Please specify the ID of the feed you want to enable.'));
    
    @@ -148,7 +151,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('There is no feed with id :id', [':id' => $fid]));
    
    @@ -167,7 +170,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('Please specify the ID of the feed you want to disable.'));
    
    @@ -186,7 +192,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('There is no feed with id :id', [':id' => $fid]));
    
    @@ -209,7 +215,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('Please specify the ID of the feed you want to import.'));
    
    @@ -218,10 +224,13 @@ class FeedsDrushCommands extends DrushCommands {
    -        throw new \Exception($this->t('The specified feed is disabled. If you want to force importing, specify --import-disabled.'));
    
    @@ -229,7 +238,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('There is no feed with id :id', [':id' => $fid]));
    
    @@ -310,7 +319,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('Please specify the ID of the feed you want to lock.'));
    
    @@ -320,15 +329,20 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('There is no feed with id :id', [':id' => $fid]));
    
    @@ -344,7 +358,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('Please specify the ID of the feed you want to unlock.'));
    
    @@ -362,7 +379,7 @@ class FeedsDrushCommands extends DrushCommands {
    -      throw new \Exception($this->t('There is no feed with id :id', [':id' => $fid]));
    

    I like these message to remain translatable. Perhaps they shouldn't be thrown in the form of an exception.

  3. +++ b/src/Component/CsvParser.php
    @@ -225,7 +225,7 @@ class CsvParser implements \Iterator {
    -    // Skip empty lines that aren't wrapped in an enclosure.
    +      // Skip empty lines that aren't wrapped in an enclosure.
         } while (!strlen(rtrim($line, "\r\n")));
    

    This isn't indented because it applies on what happens in `while()` in the line below. Having it indented looks like some code is missing in my opinion. What should we do about this one?

  4. +++ b/src/Component/CsvParser.php
    @@ -290,7 +290,7 @@ class CsvParser implements \Iterator {
    -      $next_byte = isset($line[$index + 1]) ? $line[$index + 1] : '';
    +      $next_byte = isset($line[$index + 1]) ?? $line[$index + 1] : '';
    

    If two question marks are used, you would write it like this:
    $var ?? '';
    instead of
    isset($var) ?? $var : '';

  5. +++ b/src/Controller/CustomSourceListController.php
    @@ -158,7 +158,7 @@ class CustomSourceListController extends ControllerBase {
    +    $row = $source['type'] ?? 'blank';
    

    Overwriting the $row variable here looks wrong.

  6. +++ b/src/FeedTypeAccessControlHandler.php
    @@ -25,8 +25,6 @@ class FeedTypeAccessControlHandler extends EntityAccessControlHandler {
    -        break;
    
    @@ -35,8 +33,6 @@ class FeedTypeAccessControlHandler extends EntityAccessControlHandler {
    -        break;
    

    Aren't these breaks needed in order for code to go to the correct case? Not sure though.

  7. +++ b/src/Feeds/Fetcher/DirectoryFetcher.php
    @@ -38,12 +38,12 @@ class DirectoryFetcher extends PluginBase implements FetcherInterface {
    -        throw new \RuntimeException($this->t('%source has an invalid file extension.', ['%source' => $path]));
    +        throw new \RuntimeException("'$path' has an invalid file extension.'");
    ...
    -      throw new \RuntimeException($this->t('%source is not a readable directory or file.', ['%source' => $path]));
    +      throw new \RuntimeException("'$path' is not a readable directory or file.'");
    
    +++ b/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php
    @@ -119,7 +119,7 @@ class HttpFetcherFeedForm extends ExternalPluginFormBase implements ContainerInj
    -      throw new \RuntimeException($this->t('The feed from %site seems to be broken because of error "%error".', $args));
    +      throw new \RuntimeException("The feed from '$args->%site' seems to be broken because of error '$args->%error'.");
    
    +++ b/src/Feeds/Fetcher/HttpFetcher.php
    @@ -162,7 +162,7 @@ class HttpFetcher extends PluginBase implements ClearableInterface, FetcherInter
    -      throw new \RuntimeException($this->t('The feed from %site seems to be broken because of error "%error".', $args));
    +      throw new \RuntimeException("The feed from '$args->%site' seems to be broken because of error '$args->%error'.");
    
    +++ b/src/Feeds/Parser/SyndicationParser.php
    @@ -42,10 +42,10 @@ class SyndicationParser extends ParserBase implements ParserInterface {
    -      throw new \RuntimeException($this->t('The feed from %site seems to be broken because of error "%error".', $args));
    +      throw new \RuntimeException("The feed from '$args->%site' seems to be broken because of error '$args->%error'.");
    
    +++ b/src/Feeds/Processor/EntityProcessorBase.php
    @@ -273,7 +273,7 @@ abstract class EntityProcessorBase extends ProcessorBase implements EntityProces
    -          $state->setMessage(t('Cleaning %entity failed because of non-existing action plugin %name.', [
    +          $state->setMessage($this->t('Cleaning %entity failed because of non-existing action plugin %name.', [
    
    @@ -534,9 +534,9 @@ abstract class EntityProcessorBase extends ProcessorBase implements EntityProces
    -      throw new ValidationException($this->t('An entity with ID %id already exists.', [
    +      throw new ValidationException('An entity with ID %id already exists.', [
    
    @@ -629,10 +629,10 @@ abstract class EntityProcessorBase extends ProcessorBase implements EntityProces
    -      throw new EntityAccessException($this->t('Invalid user with ID %uid mapped to %label.', [
    +      throw new EntityAccessException('Invalid user with ID %uid mapped to %label.', [
    
    @@ -652,7 +652,7 @@ abstract class EntityProcessorBase extends ProcessorBase implements EntityProces
    -    throw new EntityAccessException($this->t('User %name is not authorized to @op @bundle.', $args));
    +    throw new EntityAccessException('User %name is not authorized to @op @bundle.', $args);
    
    +++ b/src/Feeds/Target/ConfigEntityReference.php
    @@ -215,10 +215,7 @@ class ConfigEntityReference extends FieldTargetBase implements ConfigurableTarge
    -    throw new ReferenceNotFoundException($this->t('Referenced entity not found for field %field with value %target_id.', [
    -      '%target_id' => $values['target_id'],
    -      '%field' => $this->configuration['reference_by'],
    -    ]));
    +    throw new ReferenceNotFoundException("Referenced entity not found for field '$this->configuration['reference_by']' with value '$values->['target_id']'.'");
    
    +++ b/src/Feeds/Target/EntityReference.php
    @@ -268,10 +271,7 @@ class EntityReference extends FieldTargetBase implements ConfigurableTargetInter
    -      throw new ReferenceNotFoundException($this->t('Referenced entity not found for field %field with value %target_id.', [
    -        '%target_id' => $values['target_id'],
    -        '%field' => $this->configuration['reference_by'],
    -      ]));
    +      throw new ReferenceNotFoundException("Referenced entity not found for field '$this->configuration['reference_by']' with value '$values->['target_id']'.");
    
    +++ b/src/Feeds/Target/File.php
    @@ -208,9 +208,7 @@ class File extends EntityReference {
    -    throw new TargetValidationException($this->t('There was an error saving the file: %file', [
    -      '%file' => $filepath,
    -    ]));
    +    throw new TargetValidationException("There was an error saving the file: '$filepath'");
    
    @@ -240,16 +238,12 @@ class File extends EntityReference {
    -      throw new TargetValidationException($this->t('The file, %url, failed to save because the extension, %ext, is invalid.', [
    -        '%url' => $url,
    -        '%ext' => $extension,
    -      ]));
    +      throw new TargetValidationException("The file, '$url', failed to save because the extension, '$extension', is invalid.");
    
    @@ -273,7 +267,7 @@ class File extends EntityReference {
    -      throw new TargetValidationException($this->t('Download of %url failed with code @code.', $args));
    +      throw new TargetValidationException("Download of '$args->%url' failed with code '$args->@code'.");
    
    +++ b/src/Feeds/Target/UserRole.php
    @@ -93,9 +93,7 @@ class UserRole extends ConfigEntityReference {
    -      throw new ReferenceNotFoundException($this->t('The role %role cannot be assigned because it does not exist.', [
    -        '%role' => $values['target_id'],
    -      ]));
    +      throw new ReferenceNotFoundException("The role '$values->['target_id']' cannot be assigned because it does not exist.");
    
    @@ -108,16 +106,15 @@ class UserRole extends ConfigEntityReference {
    -        throw new TargetValidationException($this->t('The role %role may not be referenced.', [
    -          '%role' => $entity_id,
    -        ]));
    +        throw new TargetValidationException("The role '$entity_id' may not be referenced.");
    

    I'd like these messages somehow to be displayed translated to the end user.

  8. +++ b/src/Feeds/Item/OpmlItem.php
    @@ -7,9 +7,32 @@ namespace Drupal\feeds\Feeds\Item;
    +  /**
    +   * Item title.
    +   *
    ...
    +  /**
    +   * Item xmlurl.
    +   *
    ...
    +  /**
    +   * Item categories.
    +   *
    ...
    +  /**
    +   * Item htmlurl.
    +   *
    
    +++ b/src/Feeds/Item/SitemapItem.php
    @@ -7,9 +7,32 @@ namespace Drupal\feeds\Feeds\Item;
    +  /**
    +   * Sitemap item url.
    +   *
    ...
    +  /**
    +   * Sitemap lastmod.
    +   *
    ...
    +  /**
    +   * Sitemap change freq.
    +   *
    ...
    +  /**
    +   * Sitemap priority.
    +   *
    

    Some of these properties could use more useful descriptions, I think.

  9. +++ b/tests/modules/feeds_test_alter_source/feeds_test_alter_source.info.yml
    @@ -3,4 +3,4 @@ type: module
    -  - feeds
    +  - drupal:feeds
    
    +++ b/tests/modules/feeds_test_entity/feeds_test_entity.info.yml
    @@ -3,5 +3,5 @@ type: module
    -  - feeds
    ...
    +  - drupal:feeds
    
    +++ b/tests/modules/feeds_test_events/feeds_test_events.info.yml
    @@ -3,4 +3,4 @@ type: module
    -  - feeds
    +  - drupal:feeds
    
    +++ b/tests/modules/feeds_test_extra_sources/feeds_test_extra_sources.info.yml
    @@ -3,4 +3,4 @@ type: module
    -  - feeds
    +  - drupal:feeds
    
    +++ b/tests/modules/feeds_test_files/feeds_test_files.info.yml
    @@ -3,4 +3,4 @@ type: module
    -  - feeds
    +  - drupal:feeds
    
    +++ b/tests/modules/feeds_test_multiple_cron_runs/feeds_test_multiple_cron_runs.info.yml
    @@ -3,4 +3,4 @@ type: module
    -  - feeds
    +  - drupal:feeds
    
    +++ b/tests/modules/feeds_test_plugin/feeds_test_plugin.info.yml
    @@ -3,4 +3,4 @@ type: module
    -  - feeds
    +  - drupal:feeds
    

    'drupal' is not the correct project. 'feeds' is not part of Drupal core.

    I think it should be 'feeds:feeds' instead.

  10. +++ b/tests/src/Functional/Commands/FeedsDrushCommandsTest.php
    @@ -426,7 +426,7 @@ class FeedsDrushCommandsTest extends FeedsBrowserTestBase {
    +    var_dump($feed);
    

    There is debug code here.

  11. +++ b/tests/src/Kernel/Feeds/Target/PathTest.php
    @@ -5,7 +5,6 @@ namespace Drupal\Tests\feeds\Kernel\Feeds\Target;
    -use Drupal\Tests\pathauto\Functional\PathautoTestHelperTrait;
    
    @@ -13,8 +12,6 @@ use Drupal\Tests\pathauto\Functional\PathautoTestHelperTrait;
    -  use PathautoTestHelperTrait;
    -
    

    Why is PathautoTestHelperTrait removed here? I think that it is needed for the test?

darvanen’s picture

My 2c where there was a question or similar opening:

#42.0: "This is a big patch" - I think contributers would have more luck getting a patch through if you focussed on a single file at a time as I've previously encouraged.

#42.1: This is not a coding standards change, the code standards allow for either snake or camel case. I agree they should not be altered.

#42.3: I don't mind this change on a Do-While, the comment is inside the brackets and therefore *to me* makes sense to be indented. If it's bothersome perhaps consider changing to a While loop instead?

#42.6: There are return commands so the breaks are inaccessible, it's fine to remove them.

#42.9: I agree that feeds:feeds is the right name to use.

I agree with all the points I did not mention.

amanire’s picture

#42.1: This is not a coding standards change, the code standards allow for either snake or camel case. I agree they should not be altered.

That is true for Drupal 8, but we are running Drupal 9 and trying to update some custom code that extends SyndicationItem to be in conformance with PHPCS Drupal. But we are stuck with snake case-related errors until this patch gets merged.

Maybe this requires a major version increment to indicate that it is backwards incompatible?

megachriz’s picture

@amanire
Changing the annotation properties for FeedsTarget plugins will break a lot of Feeds plugins in contrib though. I'm not sure if that break is worth it - even when upping the major version. Upping the major version is what I want to do soon anyway (as soon as Drupal 10 support is added), to indicate that Drupal 8 support is dropped.

I agree it is nice if the code fully complies with the Drupal coding standards, but I think that the impact/costs are too high. I don't have the resources to respond to all support requests that this change will generate.

bruno.bicudo’s picture

Assigned: Unassigned » bruno.bicudo

I'll work on it :)

bruno.bicudo’s picture

Assigned: bruno.bicudo » Unassigned
Status: Needs work » Needs review
StatusFileSize
new430 bytes
new1.49 KB
new5.1 KB
new1.93 KB

I worked on #41's patch to correct some Dependency Injection issues which were causing the module to break when adding new feeds.

Also worked on FeedsAnnotationFactory to correct the trigger_error message, referencing it to #3136615: Remove deprecated FeedsAnnotationFactory class as to match the relaxed standard format.

Most "unusable variables" weren't touched, as it's more suitable for someone with more knowledge about the module to check.

Note that the content inside [ ] on each patch references to the folder where i worked on for that single patch.

Feed patch was also sent to #3248925-11: Dependency injection for \Drupal calls in classes correcting dependency injection issues.

megachriz’s picture

Status: Needs review » Needs work

Thanks for the patches!

My review:

  • 2939688-47[src].patch
    Why is StringTranslationTrait imported here? What coding standard issue does that fix? Also I think it is more common to only use the trait name inside the class and the full namespaced trait in the top of the file. So as follows:
    use Drupal\Core\StringTranslation\StringTranslationTrait;
    
    /**
     * A class.
     */
    class SomeClass {
      use StringTranslationTrait;
    
  • 2939688-47[Plugin].patch
    Here I have the same question about the StringTranslationTrait.
    +++ b/src/Plugin/Type/FeedsAnnotationFactory.php
    @@ -22,7 +22,7 @@ class FeedsAnnotationFactory extends ContainerFactory {
    -    @trigger_error('FeedsAnnotationFactory is deprecated in Feeds 8.x-3.0-alpha6 and will be removed before Feeds 8.x-3.0. Implement \Drupal\Core\Plugin\ContainerFactoryPluginInterface instead.', E_USER_DEPRECATED);
    +    @trigger_error('FeedsAnnotationFactory is deprecated in feeds:8.x-3.0 (alpha6) and will be removed in feeds:8.x-3.0. Implement \Drupal\Core\Plugin\ContainerFactoryPluginInterface instead. See https://www.drupal.org/project/feeds/issues/3136615', E_USER_DEPRECATED);
    

    The version where FeedsAnnotationFactory got deprecated is in 8.x-3.0-alpha6. Not 8.x-3.0 (alpha6). Perhaps the word 'Feeds' can be removed.

    But maybe it is not much worth to fix it anymore. I'm planning to remove FeedsAnnotationFactory soon - at the moment where Drupal 10 support will be added.

  • 2939688-47[Feeds].patch
    I skip this one because it is already handled in #3248925: Dependency injection for \Drupal calls in classes
  • 2939688-47[Component].patch
    +++ b/src/Component/CsvParser.php
    @@ -185,26 +185,30 @@ class CsvParser implements \Iterator {
    -  /**
    -   * Implements \Iterator::current().
    -   *
    +  /*
    ...
        * since PHP 8.0. Add that as soon as Drupal 9 is no longer supported. And
        * then remove the "#[\ReturnTypeWillChange]" line.
        */
       #[\ReturnTypeWillChange]
    +
    +  /**
    +   * Implements \Iterator::current().
    +   */
    ...
    -  /**
    -   * Implements \Iterator::key().
    -   *
    +  /*
        * @todo return type should be "mixed", but that keyword is only available
        * since PHP 8.0. Add that as soon as Drupal 9 is no longer supported. And
        * then remove the "#[\ReturnTypeWillChange]" line.
        */
       #[\ReturnTypeWillChange]
    +
    +  /**
    +   * Implements \Iterator::key().
    +   */
    

    I think that this should not be changed as it is required for PHP 8.1 compatibility.

    Rest of the patch looks okay.

I see not everything from #41 is included yet, so the issue would need to be left open after above issues are handled/resolved.

bruno.bicudo’s picture

Assigned: Unassigned » bruno.bicudo

Hi MegaChriz, thanks for the feedback.

2939688-47[src].patch

  • It correts Undefined method 't' on the getLabel method's return. I'll be correcting this one to reflect your sample.

2939688-47[Plugin].patch

  • For this one, the relaxed standard for @trigger_error only allows the standard project:n.x-n.n. With -alpha6 it only displays a warning (which i think is not a problem). It also requires a %cr-link%, that's why I included the link to #3136615. Should i keep the link to the issue and edit this to reflect -alpha6 as it only generates a warning?

2939688-47[Component].patch

  • This one only puts #[\ReturnTypeWillChange] before the function comment block. Leaving it below the comment block generates an error on the comments. I just moved it above, but it's still declared right before the function itself with a special comment only for it :)

I'll double check #41 and try to apply what's stated on your feedback at #42, including keeping snake case variables to avoid breaking other contrib modules.

So, I'll be working on it :)

megachriz’s picture

@bruno.bicudo

  • For the deprecated message, at least keep the mentioned version "8.x-3.0-alpha6".
  • As far as I know, PHP 8.1 requires #[\ReturnTypeWillChange] to be declared right before the function and thus after the docblock.
    Drupal Core also does this. See for example Drupal\Component\Render\FormattableMarkup::count():
    /**
     * Returns the string length.
     *
     * @return int
     *   The length of the string.
     */
    #[\ReturnTypeWillChange]
    public function count() {
      return mb_strlen($this->string);
    }
    

    It sounds like that the coding standards need to be updated for this behavior in PHP 8.1.

bruno.bicudo’s picture

Assigned: bruno.bicudo » Unassigned
Status: Needs work » Needs review
StatusFileSize
new642 bytes
new7.4 KB
new572 bytes
new36.52 KB
new1.75 KB
new481 bytes
new4.67 KB

Hi @MegaChriz,

I worked on this issue following what you pointed in #42, #48 and #50.

Some points i didn’t touch:

#42.3 – I agree with @darvanen that

the comment is inside the brackets and therefore *to me* makes sense to be indented.

#42.5 – I couldn’t understand why $row is being overwritten here, so i’ll leave this one for someone with better understanding.

#42.6 – I agree with @darvanen that

There are return commands so the breaks are inaccessible, it's fine to remove them.

#42.8 – I couldn’t think of more useful descriptions for these properties, as they have a very simple context.

I also worked on every Dependency Injection that were missing on these files, but i’ll review it in details on #3248925: Dependency injection for \Drupal calls in classes

Every change was also tested on the UI to make sure nothing is breaking and that translations are working as intended.

Needs review :)

bruno.bicudo’s picture

Assigned: Unassigned » bruno.bicudo
Status: Needs review » Active

I'm sending a new patch to correct the DruschCommands kernel tests errors regarding the exit code (which i forgot to check before).

bruno.bicudo’s picture

Assigned: bruno.bicudo » Unassigned
Status: Active » Needs review
StatusFileSize
new3.66 KB

Adds const EXIT_ERROR = 1; and returns self::EXIT_ERROR; after each logger()->error() message to match the expected error code on Kernel Tests.

Johnny Santos’s picture

Assigned: Unassigned » Johnny Santos

Im going to review it

megachriz’s picture

Status: Needs review » Needs work

@bruno.bicudo
I see some of your patches fail to apply. Can it be that they are a diff against an earlier patch? It would be better to create a diff against 8.x-3.x. For example, "2939688-51[Annotation].patch" looks like it only undoes some change in an earlier patch, but effectively doesn't change anything for 8.x-3.x.

bruno.bicudo’s picture

@MegaChriz

I indeed diffed them against #41. I'll create the diffs against 8.x-3.x as pointed.

Thanks for the feedback :)

Working on it.

bruno.bicudo’s picture

Ok, so i broke #41 patch into smaller pieces (to keep sanity) and worked on the content of the patches so that it applies against 8.x-3.x as pointed.

I tested everything again to make sure nothing is broken, and so far everything is ok.

Unused variables remains untouched.

Needs review :)

bruno.bicudo’s picture

Assigned: bruno.bicudo » Unassigned
Status: Needs work » Needs review

Silly me, forgot to change status and unassign :P

The last submitted patch, 57: 2939688-57[Feeds].patch, failed testing. View results

The last submitted patch, 57: 2939688-57[Commands].patch, failed testing. View results

The last submitted patch, 57: 2939688-57[src].patch, failed testing. View results

The last submitted patch, 57: 2939688-57[Result].patch, failed testing. View results

bruno.bicudo’s picture

StatusFileSize
new9.81 KB

Corrects exit code for --import-disabled error message on [Commands] patch.

I couldn't fix the errors in [Feeds], [src] and [results] :/

bruno.bicudo’s picture

Okay, so... I focused on studying and understanding the tests, and I realized that some changes, despite fixing the CS, were causing some strange errors not only in the tests, but in the module itself.

I then reworked all the patches (now with a better understanding of it), and I think this time it's ok for review.

As the number of patches was large in my last upload (14 patches) and most were just small changes, this time I split it into just 4 patches to keep things organized (sorry for cluttering the feed with too many patches :P).

Unused variables and #[\ReturnTypeWillChange] remains untouched (see sniffer.txt for details).

Needs review.

PS.: Failed tests due to addition of dependency injection of services on classes. Tests.patch contains all the changes made on those tests.

Status: Needs review » Needs work

The last submitted patch, 64: 2939688-64[Tests].patch, failed testing. View results

bruno.bicudo’s picture

Status: Needs work » Needs review

  • MegaChriz committed 9e080cc on 8.x-3.x authored by bruno.bicudo
    Issue #2939688 by bruno.bicudo, MegaChriz: Fixed a few coding standards...
megachriz’s picture

I've committed the patch "2939688-64[Form_Plugin].patch" with one small change:

+++ b/src/Form/CustomSourceDeleteForm.php
@@ -87,7 +87,8 @@ class CustomSourceDeleteForm extends ConfirmFormBase {
-    return parent::buildForm($form, $form_state);;
+    return parent::buildForm($form, $form_state);
+    ;

Here we only needed to remove the second semicolon. No need to add a new line with just a semicolon.

I hope to look at the other patches later.

megachriz’s picture

From #64, from the patch 2939688-64[Others].patch I specifically picked the Drush commands part as that part looked mostly good, but I saw some minor things to change. For example, I saw you added @throws \Drush\Exceptions\UserAbortException and I figured it would be good to add that to the other methods too that throw that exception. Other change is that I put an array on multiple lines.

Let's see what the testbot says.

megachriz’s picture

Review for "2939688-64[Others].patch" - excluding the FeedsDrushCommands part (see #69).

  1. +++ b/feeds.routing.yml
    @@ -67,7 +67,7 @@ entity.feeds_feed.receive:
    -    _access: 'TRUE'
    +    _access: 'access content'
    
    @@ -76,7 +76,7 @@ entity.feeds_feed.subscribe:
    -    _access: 'TRUE'
    +    _access: 'access content'
    

    These should remain 'TRUE'. External resources should be able to push data to these paths and for that there should be no access restriction.

  2. +++ b/src/Component/XmlParserTrait.php
    @@ -12,14 +12,14 @@ trait XmlParserTrait {
    -  protected static $_elementRegex = '[:A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}][:A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}\\.\\-0-9\\xB7\\x{0300}-\\x{036F}\\x{203F}-\\x{2040}]*';
    +  protected static $elementRegex = '[:A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}][:A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}\\.\\-0-9\\xB7\\x{0300}-\\x{036F}\\x{203F}-\\x{2040}]*';
    ...
    -  protected static $_useError;
    +  protected static $useError;
    
    @@ -28,14 +28,14 @@ trait XmlParserTrait {
    -  protected static $_entityLoader;
    +  protected static $entityLoader;
    ...
    -  protected static $_errors = [];
    +  protected static $errors = [];
    
    @@ -76,14 +76,14 @@ trait XmlParserTrait {
    -    static::$_useError = libxml_use_internal_errors(TRUE);
    +    static::$useError = libxml_use_internal_errors(TRUE);
    ...
    -      static::$_entityLoader = libxml_disable_entity_loader(TRUE);
    +      static::$entityLoader = libxml_disable_entity_loader(TRUE);
    
    @@ -94,18 +94,18 @@ trait XmlParserTrait {
    -      static::$_errors[$error->level][] = [
    +      static::$errors[$error->level][] = [
    ...
    -    libxml_use_internal_errors(static::$_useError);
    +    libxml_use_internal_errors(static::$useError);
    ...
    -      libxml_disable_entity_loader(static::$_entityLoader);
    +      libxml_disable_entity_loader(static::$entityLoader);
    
    @@ -118,7 +118,7 @@ trait XmlParserTrait {
    -    return static::$_errors;
    +    return static::$errors;
    
    @@ -131,7 +131,7 @@ trait XmlParserTrait {
    -    return preg_replace('/(<' . static::$_elementRegex . '[^>]*)\s+xmlns\s*=\s*("|\').*?(\2)([^>]*>)/u', '$1$4', $xml);
    +    return preg_replace('/(<' . static::$elementRegex . '[^>]*)\s+xmlns\s*=\s*("|\').*?(\2)([^>]*>)/u', '$1$4', $xml);
    
    +++ b/src/Event/EventDispatcherTrait.php
    @@ -21,7 +21,7 @@ trait EventDispatcherTrait {
    -  private $_eventDispatcher;
    +  private $eventDispatcher;
    
    @@ -45,10 +45,10 @@ trait EventDispatcherTrait {
    -    if (!isset($this->_eventDispatcher)) {
    -      $this->_eventDispatcher = \Drupal::service('event_dispatcher');
    +    if (!isset($this->eventDispatcher)) {
    +      $this->eventDispatcher = \Drupal::service('event_dispatcher');
         }
    -    return $this->_eventDispatcher;
    +    return $this->eventDispatcher;
    
    @@ -58,7 +58,7 @@ trait EventDispatcherTrait {
    -    $this->_eventDispatcher = $event_dispatcher;
    +    $this->eventDispatcher = $event_dispatcher;
    

    These intentionally start with an underscore to avoid possible collisions with classes that use the trait.

  3. +++ b/src/FeedImportHandler.php
    @@ -51,7 +51,8 @@ class FeedImportHandler extends FeedHandlerBase {
    -      throw new LockException($this->t('The feed @id / @fid is locked.', $args));
    +      $errorMessage = $this->t('The feed @id / @fid is locked.', $args);
    +      throw new LockException($errorMessage);
    

    I think that this change is not necessary.

  4. +++ b/src/Zend/Extension/Georss/Entry.php
    @@ -7,8 +7,10 @@ use Drupal\feeds\Laminas\Extension\Georss\Entry as LaminasEntry;
    - * @deprecated in favor of
    + * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
      *   \Drupal\feeds\Laminas\Extension\Georss\Entry. Use that instead.
    + *
    

    The deprecation happened in feeds:8.x-3.0-alpha11, not drupal:8.7.0. I think I'll remove it in the 4.0.0 version.

    Good to add a link to an issue, but the link is wrong. The deprecation happened in https://www.drupal.org/project/feeds/issues/3152178.

megachriz’s picture

StatusFileSize
new10.7 KB
new2.16 KB

OK, in #69 I got the indentation wrong. New patch.

megachriz’s picture

Status: Needs review » Needs work

The patch in #71 is now committed. Three patches from #64 still need work.

bruno.bicudo’s picture

Assigned: Unassigned » bruno.bicudo

I'll work on it.

bruno.bicudo’s picture

Assigned: bruno.bicudo » Unassigned
Status: Needs work » Needs review
StatusFileSize
new10.52 KB
new7.02 KB
new4.75 KB
new2.41 KB
new5.68 KB
new31.11 KB
new19.31 KB
new21.41 KB

Hi @MegaChriz

I worked on everything that was pointed on #70.

I also reverted the changes to exceptions where i was passing a variable ($errorMessage) as pointed in #70.4 on other classes.

I split the bigger patch in 4 new patches with the naming <className>+Tests so that it's easier for you to check them :). Those will (for sure) have errors, but that's because they need the editions made in the test (Mocking of injected services).

Unused variables keep untouched and, as we didn't (yet) find a good way to translate exceptions, phpcs will keep warning about them :/

All that said, needs review. :)

The last submitted patch, 75: 2939688-75[File+Tests].patch, failed testing. View results

bruno.bicudo’s picture

Fixes EntityProcessorBase specifically requiring the mysql database. Changed to a gereric database requirement.

Fixes File service dependency injection of file.repository, provided that this service only exists from D9.3 onwards.

Needs review together with the other patches on #75 :)

megachriz’s picture

StatusFileSize
new9.92 KB
new10.25 KB

Review of 2939688-77[EntityProcessorBase+Tests].patch

  1. +++ b/src/Feeds/Processor/EntityProcessorBase.php
    @@ -2,8 +2,11 @@
    +use Drupal\Component\Datetime\Time;
    
    @@ -12,7 +15,9 @@ use Drupal\Core\Field\FieldItemListInterface;
    +use Drupal\Core\Render\Renderer;
    
    @@ -97,13 +145,31 @@ abstract class EntityProcessorBase extends ProcessorBase implements EntityProces
    +   * @param \Drupal\Component\Datetime\Time $date_time
    ...
    +   * @param \Drupal\Core\Render\Renderer $renderer_service
    

    It is recommended to require interfaces instead of classes, if they are available. This makes the code more flexible and also easier to test in unit tests.
    Note: for the database service I haven't found a suitable interface, so there it's okay to require a class instead.

  2. +++ b/src/Feeds/Processor/EntityProcessorBase.php
    @@ -40,6 +46,48 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
    +  /**
    +   * The messenger service.
    +   *
    +   * @var Drupal\Core\Messenger\Messenger
    +   */
    +  protected $messengerService;
    

    It looks like the messenger property isn't used in the class, so we don't need it here, I think.

  3. +++ b/src/Feeds/Processor/EntityProcessorBase.php
    @@ -40,6 +46,48 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
    +  protected $rendererService;
    ...
    +  protected $loggerInterface;
    ...
    +  protected $databaseService;
    

    I think it is okay to shorten these property names: leave out the words 'Service' and 'Interface'. I have come across cases where I found it more convenient to add the word 'Service', but I think it isn't needed here.

  4. I also like to set the class properties in the same order as they are in the constructor.

I've updated that patch.

Other

From the 'Files' info on this issue, it would be good to uncheck "Display" for those that are no longer relevant. Especially now that there are multiple patches to review it becomes harder for me to see which are still relevant. And since it now has been a few weeks that I last visited this issue. I've unchecked "2939688-75[EntityProcessorBase+Tests].patch" and "2939688-77[EntityProcessorBase+Tests].patch" now, since I posted a new patch for that one here.

bruno.bicudo’s picture

Right! Sorry for the mess, I'm still learning how to (correctly) use drupal.org, but I'm really grateful for your feedback @MegaChriz

megachriz’s picture

For the EntityProcessorBase patch I made a few small corrections in the code comments. One being the wrong class/interface mentioned in the docblock. If this passes tests (and has no more code style issues), I think that one is ready for commit.

I think for better overview of what's left to review, I'd like to switch from patches to issue forks. Then I hope it easier to see which parts are still open.

megachriz’s picture

Committed #80.

I created several issues forks now, so now I can hide the patches that they are based on + the patches that look no longer relevant.

@bruno.bicudo
If I missed a few patches, let me know!

bruno.bicudo’s picture

Great @MegaChriz, indeed i sent a lot of patches to this one hahaha

I checked the list and looks like all of them are included. Thanks!

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

jayesh.d’s picture

Assigned: Unassigned » jayesh.d

Hi @MegaChriz,
reviewing your patch. Thanks!!!

jayesh.d’s picture

Assigned: jayesh.d » Unassigned
Status: Needs review » Needs work

Hi @MegaChriz,
I tested your patch. But patch test is failing.

SR COMPUTER@DESKTOP-CHNCDT9 MINGW64 /c/xampp/htdocs/Project/siteforcontributing/web/modules/contrib/feeds-2939688 (8.x-3.x)
$ git apply -v 2939688-80[EntityProcessorBase+Tests].patch
Checking patch src/Feeds/Processor/EntityProcessorBase.php...
error: while searching for:
      '@entity' => mb_strtolower($this->entityTypeLabel()),
      '%label' => $label,
      '%guid' => $guid,
      '@errors' => \Drupal::service('renderer')->renderRoot($element),
      ':url' => $this->url('entity.feeds_feed_type.mapping', ['feeds_feed_type' => $this->feedType->id()]),
    ];
    if ($label || $label === '0') {

error: patch failed: src/Feeds/Processor/EntityProcessorBase.php:587
error: src/Feeds/Processor/EntityProcessorBase.php: patch does not apply
Checking patch tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php...
Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Status: Needs work » Reviewed & tested by the community

#80 failed because #80 patch with 8.x-3.x branch is up to date with 'origin/8.x-3.x'.
so please closed or fixed this issue.
otherwise some developer spent time to re-rolled patch.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
megachriz’s picture

Assigned: Unassigned » megachriz
Status: Reviewed & tested by the community » Needs review

I said in #88 that #80 was committed! And I hided all patch files to indicate that they are no longer relevant.

There are now 6 merge requests left to review. They are listed underneath the issue summary. Originally, these changes were in one big patch but I had requested to split them, so I can review and commit them in smaller chunks.

kunal_sahu’s picture

  • MegaChriz committed 651ab32d on 8.x-3.x
    Issue #2939688 by bruno.bicudo, MegaChriz: Fixed a few coding standards...

  • MegaChriz committed 1c244876 on 8.x-3.x
    Issue #2939688 by bruno.bicudo, MegaChriz: Fixed coding standards and...

  • MegaChriz committed 605f7137 on 8.x-3.x
    Issue #2939688 by bruno.bicudo, MegaChriz: Fixed coding standards for...
rohit.rawat619’s picture

Assigned: megachriz » rohit.rawat619
Status: Needs review » Active

try to fixing some coding standard

rohit.rawat619’s picture

Assigned: rohit.rawat619 » Unassigned
Status: Active » Needs review
StatusFileSize
new13.58 KB
arpitk’s picture

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

Hi the patch #101 applied cleanly. However there are still many issues reported by phpcs. Working on and providing updated patch.

Thanks!

megachriz’s picture

@arpitk
I think that the first step is to review the three remaining merge requests that are open. Or if you want to write a patch, only make changes that are not covered by the MR's. When I've time to review this issue again, I'll first handle off the open merge requests.

avpaderno’s picture

Assigned: arpitk » Unassigned
zkhan.aamir’s picture

Issue tags: +Coding standards
avpaderno’s picture

Title: Fix coding standards » Fix the errors/warnings reported by PHP_CodeSniffer
isa.bel’s picture

StatusFileSize
new1.54 KB

Hello, after updating to the latest version of this module (beta4), which includes this MR originated from this issue I began to have this error:

ArgumentCountError: Too few arguments to function Drupal\feeds\Feeds\Target\File::__construct(), 9 passed in web/modules/contrib/feeds/src/Plugin/Type/Target/MediaTargetBase.php on line 49 and exactly 11 expected in Drupal\feeds\Feeds\Target\File->__construct() (line 101 of modules/contrib/feeds/src/Feeds/Target/File.php).

Therefore I created a patch specifically for this, if you guys can review it, I really appreciate it.

megachriz’s picture

@isa.bel
Thanks for the patch, but I think it would be better to update this in #2928904: Add a mapping target to media field, as the code you are changing is not yet part of Feeds.
Looking at #2928904: Add a mapping target to media field, it looks like your changes are already applied to the latest patch that is provided there. So I think all you need is to update to a newer patch from that issue.

isa.bel’s picture

Hi @MegaChriz, thank you for your reply, we were already using that patch, but from comment #56 so it was outdated, I already updated it and applied it, and now the code is already in place. Thanks again!

MegaChriz changed the visibility of the branch 2939688-Syndication+Tests to hidden.

MegaChriz changed the visibility of the branch 2939688-File+Tests to hidden.

MegaChriz changed the visibility of the branch 2939688-UserRole+Tests to hidden.

  • MegaChriz committed e095386b on 8.x-3.x
    Issue #2939688 by MegaChriz, bruno.bicudo: Fixed a few coding standard...

  • MegaChriz committed 39bd1540 on 8.x-3.x
    Issue #2939688 by MegaChriz, bruno.bicudo: Fixed a few coding standard...

  • MegaChriz committed 71795a31 on 8.x-3.x
    Issue #2939688 by MegaChriz, bruno.bicudo: Fixed a few more coding...

MegaChriz changed the visibility of the branch 2939688-Feeds to hidden.

MegaChriz changed the visibility of the branch 2939688-Others to hidden.

MegaChriz changed the visibility of the branch 2939688-Tests to hidden.

MegaChriz changed the visibility of the branch 2939688-coding-standard-issue to hidden.

MegaChriz changed the visibility of the branch 2939688-fix-coding-standards to hidden.

  • MegaChriz committed d8995c5f on 8.x-3.x
    Issue #2939688 by MegaChriz: Fixed remaining phpcs issues.
    
megachriz’s picture

Status: Needs work » Fixed

The remaining phpcs issues have been fixed!

Since this issue started, we now also have eslint, phpstan and styleint issues to fix, but let's do that in a follow-up.

megachriz’s picture

Status: Fixed » Closed (fixed)

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