Review main Abandoned

61521[WIP][TASK] Unify handling of errorParams in linkvalidator

Sybille Peters CR 0 V 0 Normal +123 −89 updated 02/16/20, 08:01

Commit message

* protected parameter errorParams was unnecessarily redefined
  in ExternalLinktype class (already introduced in parent
  class AbstractLinkType)
* errorType had inconsistent type (string and int), now use
  string
* initializing of errorParams is done consistently
  in AbstractLinkType
* usage of errorParams is now done consistently in various
  Linktype checker classes
* the error message is now only constructed once
  when generating the report

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 8

Review log 1420

  1. Sybille Peters uploaded patch set 1 08/21/19, 12:40

  2. TYPO3com voted on patch set 1 V +1 08/21/19, 12:51 Completed build in 11m 01s on Wed, 21 Aug, 12:51 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35757

  3. Oliver Klee commented on patch set 1 08/22/19, 11:02

    AbstractLinktype.php:46

    As you the method is new, you can also use the opportunity and add an :void return type and get rid of the abbreviation (Params -> Parameters).

    AbstractLinktype.php:48

    Should the field really be unset, or should it be emptied instead (i.e., set to an empty array so that it always is an array)?

    AbstractLinktype.php:54

    As you touch the method, you can use the opportunity to also add the :void return typew.

    AbstractLinktype.php:69

    I don't think we need the PHPDoc as long as it does not add anything to what the type declarations already say. Ditto for the other methods.

    AbstractLinktype.php:78

    : void

    AbstractLinktype.php:94

    : void

    AbstractLinktype.php:110

    : void

    ExternalLinktype.php:97

    : void

    FileLinktype.php:27

    @var string

    FileLinktype.php:62

    As of PHP 7.1, you can combine these two catch clauses into one: https://stackoverflow.com/questions/8439581/catching-multiple-exception-types-in-one-catch-block

    FileLinktype.php:69

    As $idValidUrl is a boolean anyway, you can shorten ($isValidUrl === true) to ($isValidUrl) and ($isValidUrl === false) to (!$isValidUrl).

    FileLinktype.php:82

    As you touch the signature anyway, you can add a :string return type declaration.

    InternalLinktype.php:226

    : string

    LinkHandler.php:134

    : string

    LinktypeInterface.php:62

    : string
  4. Sybille Peters uploaded patch set 2 08/22/19, 15:54

  5. Sybille Peters commented on patch set 2 08/22/19, 16:00

    AbstractLinktype.php:46 Reply

    Done

    AbstractLinktype.php:48 Reply

    Done

    AbstractLinktype.php:54 Reply

    Done

    AbstractLinktype.php:69 Reply

    Done

    AbstractLinktype.php:78 Reply

    Done

    AbstractLinktype.php:94 Reply

    Done

    AbstractLinktype.php:110 Reply

    Done

    ExternalLinktype.php:97 Reply

    Done

    FileLinktype.php:27 Reply

    Done

    FileLinktype.php:62 Reply

    Done

    FileLinktype.php:69 Reply

    Done

    FileLinktype.php:82 Reply

    Done

    InternalLinktype.php:226 Reply

    Done

    LinkHandler.php:134 Reply

    Done

    LinktypeInterface.php:62 Reply

    Done
  6. TYPO3com voted on patch set 2 V +1 08/22/19, 16:04 Completed build in 09m 46s on Thu, 22 Aug, 04:04 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35773

  7. Oliver Klee commented on patch set 2 08/25/19, 16:46

    AbstractLinktype.php:52

    If I understand this correctly, $value is expected to be an array of strings. So we can change the PHPDoc type annotation (not the type declaration) to string[] to make this explicit.

    AbstractLinktype.php:66

    Do we need string casts in all the new getters (as it's possible to pass an array of non-string values as well)?

    ExternalLinktype.php:144

    Shorter: if ($isValidUrl)

    FileLinktype.php:27

    For consistency, I propose changing this to the three-line DocBlock.

    FileLinktype.php:67

    Shorter: $isValidURL = $isValidURL && $file !== null && !$file->isMissing();
  8. Sybille Peters uploaded patch set 3 09/17/19, 16:41

  9. Sybille Peters commented on patch set 2 09/17/19, 16:41

    AbstractLinktype.php:52 Reply

    Done

    AbstractLinktype.php:66 Reply Unresolved

    I don't understand this comment.

    ExternalLinktype.php:144 Reply

    Done

    FileLinktype.php:27 Reply

    Done

    FileLinktype.php:67 Reply

    Done
  10. TYPO3com voted on patch set 3 V +1 09/17/19, 16:51 Completed build in 10m 04s on Tue, 17 Sep, 04:51 PM Test Summary: 47555 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36525

  11. Lina Wolf commented on patch set 3 V -1 09/17/19, 20:14

    I created test links of the following kinds: tt_content:bodytext internal link to a hidden page error message before: "Page 'hidden page' (3) is not visible." Afterwards: "No information about the error is available." The error message for a missing file stays the same. Error for an external url pointing to a 404 page Before: "The requested url was not found (404)" afterwards: "No information about the error is available." I think the error messages before contained much more information. I did truncate the table tx_linkvalidator_link to force regeneration of error codes. Still the "No information" error messages stay.
  12. Sybille Peters uploaded patch set 4 09/18/19, 07:00

  13. TYPO3com voted on patch set 4 V +1 09/18/19, 07:10 Completed build in 10m 06s on Wed, 18 Sep, 07:10 AM Test Summary: 47555 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36527

  14. Sybille Peters uploaded patch set 5 09/18/19, 15:34

  15. TYPO3com voted on patch set 5 V +1 09/18/19, 15:49 Completed build in 11m 51s on Wed, 18 Sep, 03:49 PM Test Summary: 47555 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36558

  16. Sybille Peters uploaded patch set 6 09/18/19, 16:11

  17. TYPO3com voted on patch set 6 V +1 09/18/19, 16:21 Completed build in 09m 24s on Wed, 18 Sep, 04:21 PM Test Summary: 47555 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36559

  18. Tymoteusz Motylewski commented on patch set 6 CR -1 10/23/19, 08:25

    AbstractLinktype.php:65 Unresolved

    why does it take 3 types? haven't you simplified it?

    FileLinktype.php:79 Unresolved

    please do not change public functions interface

    InternalLinktype.php:33 Unresolved

    chnge in conts, no breaking changes please

    InternalLinktype.php:222 Unresolved

    same here

    LinkHandler.php:34 Unresolved

    same here

    LinkHandler.php:134 Unresolved

    same here, we can't change interface of the public methods (breaking change)

    LinktypeInterface.php:63 Unresolved

    and here
  19. Benni Mack commented on patch set 6 02/15/20, 09:25

    What is the status of this change? Will somebody pick this up?
  20. Sybille Peters abandoned the change 02/16/20, 08:01

    Abandoning for now. Too many changes in the meantime.