Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Marker. Navigation between original and override observers. #38

Closed
VitaliyBoyko opened this issue Mar 12, 2020 · 4 comments
Closed

Comments

@VitaliyBoyko
Copy link
Contributor

Line Markers between original and overridden observers (with the same name and the same event).

@lbajsarowicz
Copy link

Could you explain more with some example?
I don't get the idea :-)

@VitaliyBoyko
Copy link
Contributor Author

VitaliyBoyko commented Mar 13, 2020

@lbajsarowicz
For example:
You have some observer in the first module global area (First_Module/etc/events.xml).

  <event name="avesome_event">
        <observer name="foo" instance="Bar" />
    </event>

You replaces the implementation for the frontend area in the second module (Second_Module/etc/frontend/events.xml).

  <event name="avesome_event">
        <observer name="foo" instance="Bar2" />
    </event>

The main idea is to visualize that an observer is overridden because it could be done by accident. (It's from real life, believe me 😄)
The second idea to have convenient navigation between those classes.

Also, I'm working on inspection duplicated names for the same area: #27. However, for different areas, an inspection is not an applicable option as an observer could be overridden intentionally as well and adding Second_Module to the First_Module sequences is not required. Therefore, I think we can only visualize this via line markers.

Thank you for your interest :)

@VitaliyBoyko
Copy link
Contributor Author

And the case with the same area override using sequences should be covered by line markers as well.

@VitaliyBoyko VitaliyBoyko changed the title Line Marker. Navigation between original and overiden observers. Line Marker. Navigation between original and override observers. Mar 16, 2020
@VitaliyBoyko
Copy link
Contributor Author

Well, I've overthought this one once again. Using line marker here seems to be overhead. Override an observer using an observer name is not a good practice. It is better to show the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants