Skip to content
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

Fix for warning Trying to access array offset on value of type bool #188

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

xtremevision
Copy link

Hi,

Using Magento 2.4.6-p2 open source and colinmollenhour/credis v1.16.0. Using a command line script I am getting this error:

PHP Warning: Trying to access array offset on value of type bool in colinmollenhour/credis/Client.php on line 1156

Not sure why this is happening. Have not debugged in depth, but

$execResponse = array_pop($response);

is actually false, so doing:

                    if(!empty($execResponse))
                    {
                        foreach ($queuedResponses as $key => $command) {
                            list($name, $arguments) = $command;
                            $response[] = $this->decode_reply($name, $execResponse[$key], $arguments);
                        }    
                    }

suppresses the warning.

Michael.

@xtremevision
Copy link
Author

Fixed phpcs error.

@colinmollenhour
Copy link
Owner

Indentation is still wrong.. Do you not use an IDE that handles indentation?

@xtremevision
Copy link
Author

xtremevision commented May 20, 2024

Indentation is still wrong.. Do you not use an IDE that handles indentation?

Did you get my reply? I replied directly to the email but am not seeing it here yet.

image

@colinmollenhour colinmollenhour merged commit f11a89f into colinmollenhour:master Jul 4, 2024
@colinmollenhour
Copy link
Owner

Thanks for the PR. Sorry for the delay, got way behind on email...

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