Note: This issue is reserved for an intern applicant at MD Systems. Please do not work on this unless assigned to it by us :)

Problem/Motivation

The interface committed in #2754253: Lack of standard result in collaboration of analyzers does not really contribute in any way, as there is already AnalyzerResultInterface.

Proposed resolution

Delete DefaultAnalyzerResultInterface.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Arla created an issue. See original summary.

tduong’s picture

Issue summary: View changes
toncic’s picture

Assigned: Unassigned » toncic
Status: Active » Needs review
FileSize
5.43 KB

Deleted DefaultAnalyzerResultInterface.

Status: Needs review » Needs work

The last submitted patch, 3: remove-2770667-3.patch, failed testing.

miro_dietiker’s picture

It seems there are coincidental changes here from a different issue...
See #2495737: No Past log event if parsing failed.

Plz make sure to only focus on the issue scope with extracting patches.

toncic’s picture

Status: Needs work » Needs review
FileSize
3.63 KB

Patch with only deleted file.

Status: Needs review » Needs work

The last submitted patch, 6: remove-2770667-6.patch, failed testing.

Bambell’s picture

Tests are failing because class Drupal\inmail\DefaultAnalyzerResult still implement this interface. Also, I think Git can be configured to generate more simple / readable patches when deleting or renaming files. Please ping me back Monday about this :).

toncic’s picture

Status: Needs work » Needs review
FileSize
4.11 KB
497 bytes

Removed to implement interface.

Bambell’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, setting to RTBC.

miro_dietiker’s picture

Status: Reviewed & tested by the community » Needs work

No, sorry. :-)

The Interface now has the doc blocks. The DefaultAnalyzerResult only refers to documentation through {@inheritdoc}

By dropping the interface, it also means moving the documentation down to DefaultAnalyzerResult.

toncic’s picture

Status: Needs work » Needs review
FileSize
8.38 KB
4.39 KB

Fixed documentation for functions.

tduong’s picture

Status: Needs review » Needs work

Nice :) Just some standard coding fixes:

  1. +++ b/src/DefaultAnalyzerResult.php
    @@ -87,35 +87,49 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   *  The address of the sender
    +   * @param $sender
    

    The description of the param should be below the @param annotation line and indented with 3 white-spaces from the * (see @param documentation, and add the dot at the end of the comment.

    Add the $sender type hint.

  2. +++ b/src/DefaultAnalyzerResult.php
    @@ -87,35 +87,49 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   *  The address of the sender, on NULL if it is not found
    

    Missing dot at the end of the sentence. And 3 white-spaces from *. There are many similar places that need to be fixed. Please check the other documentations and fix them accordingly.

  3. +++ b/src/DefaultAnalyzerResult.php
    @@ -87,35 +87,49 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   * Tells the status of user authentication.
    

    This comment is odd imo. Write something like "Determines if the user is authenticated."

  4. +++ b/src/DefaultAnalyzerResult.php
    @@ -87,35 +87,49 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   *  TRUE if user is authenticated. Otherwise, FALSE;
    

    Dot instead of semicolon ;)

  5. +++ b/src/DefaultAnalyzerResult.php
    @@ -140,70 +154,111 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   * @param $body
    

    Missing type hint, as well as many other places. Please check them out.

  6. +++ b/src/DefaultAnalyzerResult.php
    @@ -214,7 +269,12 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   * @return \Drupal\Core\Plugin\Context\ContextInterface[]
    

    Missing return description, something like "Contexts array of the given data type, keyed by context name."

toncic’s picture

Status: Needs work » Needs review
FileSize
8.65 KB
6.17 KB

Fixed coding standards.

tduong’s picture

Status: Needs review » Needs work

Good, looks better. More smell code to be fixed for you :P

  1. +++ b/src/DefaultAnalyzerResult.php
    @@ -88,8 +88,9 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface {
    +   *   The address of the sender
    

    Missing dot :P

  2. +++ b/src/DefaultAnalyzerResult.php
    @@ -99,7 +100,7 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface {
    +   *   The address of the sender, on NULL if it is not found.
    

    This should be "or" instead of "on"

  3. +++ b/src/DefaultAnalyzerResult.php
    @@ -197,7 +198,7 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface {
    +   *   The subject of message.
    

    Better "The message subject."

  4. +++ b/src/DefaultAnalyzerResult.php
    @@ -251,14 +252,14 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface {
    +   *   Throws ana exception if requested context does not exist.
    

    Typo: ana --> an

  5. +++ b/src/DefaultAnalyzerResult.php
    @@ -271,10 +272,11 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface {
        * Returns contexts with the given type
    

    Missing dot :P

  6. +++ b/src/DefaultAnalyzerResult.php
    @@ -271,10 +272,11 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface {
    +   *    Contexts array of the given data type.
    

    4 white spaces instead of 3 :P

toncic’s picture

Fixed coding standard.

toncic’s picture

Status: Needs work » Needs review
tduong’s picture

Status: Needs review » Needs work

Much better :D sorry, few more standards for you ^^'

  1. +++ b/src/DefaultAnalyzerResult.php
    @@ -140,70 +155,111 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   * Set the condition context for a given name.
    ...
    +   * Get the specific context from the list of available contexts.
    

    According to the Drupal API documentation standards, you should use a third person verb to start the summary of a class, interface, or method.

  2. +++ b/src/DefaultAnalyzerResult.php
    @@ -140,70 +155,111 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   * Gets the values for all defines contexts.
    

    Maybe better "Gets an array of all collected contexts for this analyzer result."

  3. +++ b/src/DefaultAnalyzerResult.php
    @@ -214,7 +270,13 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   *   Contexts array of the given data type.
    

    You've missed the last part of the sentence: "Contexts array of the given data type, keyed by context name."

  4. +++ b/src/DefaultAnalyzerResult.php
    @@ -214,7 +270,13 @@ class DefaultAnalyzerResult implements AnalyzerResultInterface, DefaultAnalyzerR
    +   * Returns contexts with the given type.
    

    Then probably this should be "Returns the contexts of the given type."

toncic’s picture

Status: Needs work » Needs review
FileSize
8.7 KB
1.58 KB

Fixed coding standard, I hope :).

tduong’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, now I guess it is alright! :D
Sorry for being a "too harsh teacher" ;P

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Committed. We can improve every time we use those methods...

I'm not so happy about the user + account term mixing, but also wasn't sure how to name it clean & consistently.

mbovan’s picture

I haven't seen this issue before... Seems like it broke tests in Mailhandler, so created an issue: #2783383: User DefaultAnalyzerResult instead of DefaultAnalyzerResultInterface.

miro_dietiker’s picture

@mbovan many issues about refactoring inmail are changing APIs and might break mailhandler.
Sorry about that, but cleanup our architecture is more important than a stable API. There are not many integrations yet, so the price isn't too big yet.

Status: Fixed » Closed (fixed)

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