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

Replace + Array Union Operator with array_merge #1324

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

ghostwriter
Copy link
Member

@ghostwriter ghostwriter commented Aug 7, 2023

Fix #1323 - https://3v4l.org/JFpUQ

The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.

https://www.php.net/manual/en/language.operators.array.php

Merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array.

If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. If, however, the arrays contain numeric keys, the later value will not overwrite the original value, but will be appended.

Values in the input arrays with numeric keys will be renumbered with incrementing keys starting from zero in the result array.

https://www.php.net/manual/en/function.array-merge.php

Fix #1323

Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
@ghostwriter ghostwriter added Patch Backwards compatible bug fixes and improvements Fixed for bug fixes or error corrections labels Aug 7, 2023
@ghostwriter ghostwriter added this to the 1.6.6 milestone Aug 7, 2023
@ghostwriter ghostwriter self-assigned this Aug 7, 2023
@ghostwriter ghostwriter linked an issue Aug 7, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #1324 (818cb89) into 1.6.x (68782e9) will not change coverage.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              1.6.x    #1324   +/-   ##
=========================================
  Coverage     77.88%   77.88%           
  Complexity     1014     1014           
=========================================
  Files            76       76           
  Lines          2595     2595           
=========================================
  Hits           2021     2021           
  Misses          574      574           
Files Changed Coverage Δ
library/Mockery/Reflector.php 94.01% <0.00%> (ø)

@ghostwriter ghostwriter merged commit d36f524 into 1.6.x Aug 7, 2023
18 of 22 checks passed
@ghostwriter ghostwriter deleted the bugfix/1323-fix-error-in-type-declaration branch August 7, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed for bug fixes or error corrections Patch Backwards compatible bug fixes and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in type declaration for iterable|object.
2 participants