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

Ensured unpacked array has at least 2 elements to avoid undefined index warning #56

Merged
merged 2 commits into from
Feb 15, 2021
Merged

Ensured unpacked array has at least 2 elements to avoid undefined index warning #56

merged 2 commits into from
Feb 15, 2021

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Feb 2, 2021

This is a small fix for a warning I have noticed when running the mezzio:swoole:stop command:

Warning: Undefined array key 1 in /home/shlink/vendor/mezzio/mezzio-swoole/src/Command/IsRunningTrait.php on line 28

It's caused when the $pids array only has one element. Using array_pad we ensure the array is filled with nulls up to 2 positions, which keeps the same behavior but prevents the warning.

Signed-off-by: Alejandro Celaya <alejandro@alejandrocelaya.com>
Signed-off-by: Alejandro Celaya <alejandro@alejandrocelaya.com>
@weierophinney weierophinney added the Bug Something isn't working label Feb 15, 2021
@weierophinney weierophinney added this to the 3.1.3 milestone Feb 15, 2021
@weierophinney weierophinney merged commit 4793f6f into mezzio:3.2.x Feb 15, 2021
@weierophinney weierophinney modified the milestones: 3.1.3, 3.2.1 Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants