Review main Abandoned

39053[BUGFIX] Use fully qualified class name for signals

Mathias Brodala CR 0 V 0 Hard +322 −67 updated 06/03/15, 07:00

Commit message

To dispatch signals which will not change after moving or renaming
classes, the fully qualified class name must be used.

Also some code is wrapped to avoid long lines.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 22

Show 2 more files

Review log 9

  1. Mathias Brodala uploaded patch set 1 04/29/15, 07:15

  2. Andreas Kienast voted on patch set 1 CR +1 V +1 05/07/15, 07:10

  3. Frank Nägler commented on patch set 1 CR -1 05/08/15, 23:43

    I see no benefit for this patch. the main problem still exists.
  4. Christian Kuhn commented on patch set 1 CR -2 05/08/15, 23:46

    I don't think this improves the overall situation: You're aiming to guard for developer stupidity if classes are moved around. This is not a technical improvement. Additionally, using the ::class thing could make the situation even worse if for example the phpstorm refactor feature is used to rename a class: the according signal identifier would be adapted, too. Maybe taking the class name as identifier is a bad idea in the first place, a "unique" identifier would be more suitable, for example the "timestamp now" - same logic we use for exeptions. We have a similar problem with hook arrays: all old hooks still contain t3lib/class.tcemain.php as identifier which is not a cool thing. So an identfier freed from the current class name would be much better to circumvent such clashed once and for all. -2 until this is fully sorted out, sorry for this blocker.
  5. Mathias Brodala commented on patch set 1 05/11/15, 07:49

    I wasn't aware of the refactoring feature. In that case we should replace all identifiers with static strings instead (thus just like pre ::class era.) Would this also change upon refactoring?
  6. Christian Kuhn commented on patch set 1 05/11/15, 10:19

    no, it wouldn't change. but it also does not help much.
  7. Mathias Brodala commented on patch set 1 05/11/15, 10:34

    I did a quick check and in TYPO3.Flow there are also string literals used for dispatching signals. So maybe this is the way to go.
  8. Markus Klein commented on patch set 1 06/02/15, 22:51

    I'm also for using plain strings. For new signals we should use speaking names independent of class names. Replacing the ::class just because phpstorm might rename them on refactoring is not a solution, since phpstorm is rather intelligent and also finds those class names in strings and does renames there as well. I ran into this multiple times in extensions. So IMO we can keep the ::class stuff.
  9. Mathias Brodala abandoned the change 06/03/15, 07:00

    Alright then, let's find a more reliable solution.