Skip to content

[New Rule] LocalizedException SHOULD only be thrown in the Presentation layer #49

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

Closed
lenaorobei opened this issue Mar 1, 2019 · 2 comments
Assignees
Labels
accepted New rule is accepted Progress: good first issue Issues is easy to get started with proposal New rule proposal

Comments

@lenaorobei
Copy link
Contributor

lenaorobei commented Mar 1, 2019

Rule

LocalizedException SHOULD only be thrown in the Presentation layer (Controllers, Blocks).

Source: Technical Guidelines.

Possible Implementation

Subscribe to the T_THROW token. If LocalizedException is thrown, check if file path contains Block or Controller. If not, raise a warning.

@lenaorobei lenaorobei added proposal New rule proposal accepted New rule is accepted Progress: good first issue Issues is easy to get started with labels Mar 1, 2019
@lenaorobei lenaorobei changed the title [New Rule] LocalizedException SHOULD only be thrown in the Presentation layer (Controllers, Blocks). [New Rule] LocalizedException SHOULD only be thrown in the Presentation layer Mar 1, 2019
@larsroettig larsroettig self-assigned this Mar 3, 2019
@larsroettig
Copy link
Member

Hi @lenaorobei, are also ViewModel Presentation layer missing in this List I will add this what you mean.

@larsroettig
Copy link
Member

Close because of Impelementation does not solve it able with the new requirements with tokens

See:
magento/devdocs#3871

magento-devops-reposync-svc pushed a commit that referenced this issue Sep 2, 2021
…-coding-standard-253

[Imported] AC-952: Create unit test for Magento2\Less\SemicolonSpacingSniff check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted New rule is accepted Progress: good first issue Issues is easy to get started with proposal New rule proposal
Projects
None yet
Development

No branches or pull requests

2 participants