Skip to content

add rector#1077

Merged
markstory merged 3 commits into3.xfrom
3.x-rector
Mar 29, 2026
Merged

add rector#1077
markstory merged 3 commits into3.xfrom
3.x-rector

Conversation

@LordSimal
Copy link
Copy Markdown
Contributor

No description provided.

@LordSimal LordSimal force-pushed the 3.x-rector branch 2 times, most recently from 019811f to 2074e96 Compare March 29, 2026 15:14
public function getView(): View
{
if ($this->view) {
if ($this->view instanceof BakeView) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder why rector wouldnt just do the faster !== null here.
Since it is technically clear that it can only be that object or null.

Copy link
Copy Markdown
Member

@dereuromark dereuromark Mar 29, 2026

Choose a reason for hiding this comment

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

I also would find the current way if ($this->view) "clean", since we always shortcut the bool way with if checks if its clear about the scope (no ambiguity).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied rules:
 * FlipTypeControlToUseExclusiveTypeRector
 * NullableCompareToNullRector

@markstory markstory merged commit a2dcfa5 into 3.x Mar 29, 2026
7 of 9 checks passed
@markstory markstory deleted the 3.x-rector branch March 29, 2026 19:44
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.

3 participants