Note this only applies to Rules in Drupal 7 - Rules in Drupal 8 complies with current coding standards and patches are required to be free of new standards violations before they are committed.
Rules 7.x-2.x however was written under a previous set of coding standards - Drupal core has changed standards drastically since then, with many new standards aimed primarily at D8 code. Drupal core policy is this:
All new code should follow the current standards, regardless of (core) version. Existing code in older versions may be updated, but doesn't necessarily have to be. Especially for larger code-bases (like Drupal core), updating the code of a previous version for the current standards may be too huge of a task. However, code in current versions should follow the current standards.
There are more reasons than just "may be too huge of a task" to leave the 7.x-2.x code mostly untouched - modifying class names, variable names, etc. has a great potential to break code and break contributed modules that integrate with Rules. Likewise, coding standards patches touch many parts of the code base, so have a great potential to break other work-in-progress patches that address real problems (bug reports) or make real improvements (feature requests) - coding standards changes are extremely minor in importance related to these.
Because of this, I am not interested in putting in a lot of effort to change anything EXCEPT for things that may / are known to cause problems (like extra whitespace or missing EOL at ends of files) and things that will actually HELP people who use Rules (like missing or incomplete documentation comments).
If you would like to submit patches here, make sure they are restricted to one and only one type of standards violation - that will make them easier to review. Also, don't spend effort in reformatting code - restrict yourself to the the two categories I mentioned above.
| Comment | File | Size | Author |
|---|---|---|---|
| #48 | 2990280-48.patch | 34.03 KB | tr |
| #46 | 2990280-46.patch | 25.21 KB | tr |
| #45 | 2990280-45.patch | 25.23 KB | tr |
| #42 | 2990280-42.patch | 18.54 KB | tr |
| #39 | 2990280-39.patch | 20.38 KB | tr |
Comments
Comment #2
tr commentedThis patch fixes "Expected 1 newline at end of file" errors
Comment #3
tr commentedRelated issue #2382927: taxonomy.rules.inc provides a class and has no files[] entry in rules.info - the resolution of that will fix "It's only necessary to declare files[] if they declare a class or interface." errors.
Comment #4
tr commentedRe-roll of #1, because I missed one occurrence.
Comment #6
tr commentedThis patch fixes "Visibility must be declared on method" and ensures that declared visibilities are correct.
Comment #7
tr commentedThis patch changes true to TRUE in a few places.
Comment #9
tr commentedCommitted #6 and #7.
Comment #10
tr commentedWhitespace.
Comment #12
tr commentedArray fixes - whitespace, commas, indentation.
Comment #14
tr commentedPunctuation.
Make @todo, @todo:, TODO, @TODO comments uniform so they are easier to search for.
Comment #16
tr commented"The $text argument to l() should be enclosed within t() so that it is translatable"
Comment #18
tr commented"Expected 1 blank line before function"
Comment #20
tr commentedCommitted #18.
Comment #21
tr commentedCSS coding standards and validation.
Comment #23
tr commentedCommitted #21.
Comment #25
tr commentedThis patch addresses some of these violations:
Comment #27
tr commentedComment #28
tr commentedAdded some missing function doc comments, some missing @param and @return comments and some missing type information on @param and @return comments, fixed some whitespace issues and a few multivalue arrays missing a , after the last item.
Comment #30
tr commentedComment #31
tr commentedThis patch fixes most occurrences the following coding standards violations:
Documentation changes only.
Comment #32
tr commentedCommitted.
Comment #33
tr commentedThis patch adds types to some @param and @return doc comments, corrects some syntactically wrong @param and @return comments, adds some missing @param and @return comments, and adds some missing function doc comments.
Comment #34
tr commentedCommitted #33.
Comment #36
tr commentedMore typing in @param and @return doc comments, added some @var comments and more missing function/parameter comments. Fixed some array wrapping.
Comment #38
tr commentedCommitted #36
Comment #39
tr commentedMostly adding some missing function docs. Also correcting some comments and some line-length issues.
Comment #41
tr commentedCommitted.
Comment #42
tr commentedMore doxygen comment work (missing types mostly) and missing function comments. Some corrected in-line comments.
Comment #44
tr commentedCommitted.
Comment #45
tr commentedMore documentation comments, including @param, @return, @var.
Comment #46
tr commentedI mixed in one line from another patch, causing test failures. That's why we test before commit ...
Here's a corrected version of #45
Comment #48
tr commentedMore fixes in preparation for a new D7 release. Indentation and missing documentation.
And out of curiosity I've tested against PHP 7.4 as well. I know Drupal core doesn't completely support PHP 7.4 at this point in time, but I would like to see if the tests flag any problems in the Rules code. I expect some test fails due to core.
Comment #50
tr commentedThe PHP 7.4 fails seem to all come from core.
Committed #48. I'm closing this issue because I think most of the remaining issues are "won't fix" and because I don't see a need to keep this open any more just in case someone else should want to work on it.
If you're inclined to fix some of the remaining missing documentation warning or other standards, please open a new issue.