Skip to content

AnnotateThrowables: support analysis of called functions and methods#2998

Merged
TomasVotruba merged 12 commits intorectorphp:masterfrom
Aerendir:support-throwing-functions
Mar 6, 2020
Merged

AnnotateThrowables: support analysis of called functions and methods#2998
TomasVotruba merged 12 commits intorectorphp:masterfrom
Aerendir:support-throwing-functions

Conversation

@Aerendir
Copy link
Copy Markdown
Contributor

@Aerendir Aerendir commented Mar 3, 2020

Was #2928

Support

  • functions;
  • $varName->method();
  • $methodParam->method();
  • $this->method();

@Aerendir Aerendir changed the title Support analysis of called functions. AnnotateThrowables: support analysis of called functions. Mar 3, 2020
@Aerendir
Copy link
Copy Markdown
Contributor Author

Aerendir commented Mar 3, 2020

@TomasVotruba , Ready to be merged!

Before merging, please check this code:
https://github.com/rectorphp/rector/pull/2998/files#diff-7992343b214da5dce624ce2b1e55384aR367-R388

@Aerendir
Copy link
Copy Markdown
Contributor Author

Aerendir commented Mar 3, 2020

Do not merge: some work still required...

I'm testing the Rector in an app and it causes exceptions...

@TomasVotruba
Copy link
Copy Markdown
Member

I'm waiting, no troubles

Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
@Aerendir
Copy link
Copy Markdown
Contributor Author

Aerendir commented Mar 3, 2020

Needs refactoring and checks to pass.

@Aerendir
Copy link
Copy Markdown
Contributor Author

Aerendir commented Mar 4, 2020

@TomasVotruba , completely refactored and ready to be merged! 💪

Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left few notes to refactor for less class complexity.

The Rector rule is getting huge. Healthy maximum limit is around 250 lines. Anything higher usually lead to long tracing of bug later.
Service decoupling should allow that.

Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
@Aerendir Aerendir changed the title AnnotateThrowables: support analysis of called functions. AnnotateThrowables: support analysis of called functions and methods Mar 5, 2020
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
Comment thread rules/coding-style/src/Rector/Throw_/AnnotateThrowablesRector.php Outdated
@Aerendir
Copy link
Copy Markdown
Contributor Author

Aerendir commented Mar 5, 2020

I did a very deep refactoring.

I created some classes and put them where and gave them a name I think may be appropriate .

Please, review the code as I don't know if you prefer different namings/namespacings/etc...

@TomasVotruba TomasVotruba self-requested a review March 6, 2020 13:15
@TomasVotruba
Copy link
Copy Markdown
Member

Looks good 👍

@TomasVotruba TomasVotruba merged commit 5a5d5dc into rectorphp:master Mar 6, 2020
@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 👏

@Aerendir Aerendir deleted the support-throwing-functions branch March 6, 2020 14:39
TomasVotruba added a commit that referenced this pull request Oct 17, 2022
rectorphp/rector-src@71b1142 [CodeQuality] Skip different value left and right on SimplifyEmptyArrayCheckRector (#2998)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants