Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

[spatch] Replacing "||" doesn't work #161

Open
aik099 opened this issue Apr 18, 2019 · 0 comments
Open

[spatch] Replacing "||" doesn't work #161

aik099 opened this issue Apr 18, 2019 · 0 comments

Comments

@aik099
Copy link

aik099 commented Apr 18, 2019

Hi,

I'm using following spatch file:

-X === null || X === ''
+empty(X)

for a:

<?php

if ( $value === null || $value === '' ) {
    echo 'something';
}

code.

The replacement result is however:

<?php

if ( $value === '' ) {
    echo 'something';
}

instead of

<?php

if ( empty($value) ) {
    echo 'something';
}

Not sure why it's not working. When using sgrep I was able to find that code, but spatch replaces is in non-expected way.

Thanks.

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

No branches or pull requests

1 participant