Skip to content

[TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector#4636

Merged
samsonasik merged 4 commits intomainfrom
nullable-compare
Aug 3, 2023
Merged

[TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector#4636
samsonasik merged 4 commits intomainfrom
nullable-compare

Conversation

@samsonasik
Copy link
Copy Markdown
Member

No description provided.

@samsonasik
Copy link
Copy Markdown
Member Author

Fixed 🎉 /cc @staabm

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba let's merge to have faster feedback to test ;)

@samsonasik samsonasik merged commit 527f214 into main Aug 3, 2023
@samsonasik samsonasik deleted the nullable-compare branch August 3, 2023 15:05
{
public static function getOrderBy($orderby, $direction = 'ASC', $default = '')
{
if (null !== $orderby && ! empty($orderby)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

will is_null() calls also be covered?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, I tried:

if (! is_null($orderby) && ! empty($orderby)) {
     return $orderby.' '.$direction;
}

and it also changed to nullable string ?string 👍

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants