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

Feature: OrderedListInterface#combine #250

Open
boesing opened this issue Mar 26, 2024 · 0 comments
Open

Feature: OrderedListInterface#combine #250

boesing opened this issue Mar 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@boesing
Copy link
Owner

boesing commented Mar 26, 2024

For native PHP arrays, there is a array_combine function which combines the values of two arrays to a map where all values from the first array are used as keys and all values of the 2nd array are used values.

Obviously, both arrays have to have the same size. The value which is passed to OrderedListInterface#combine should represent the keys while the OrderedListInterface itself can be used as values.

/**
 * @template TValue
 */
interface OrderedListInterface
{
    /** 
     * @template T of array-key
     * @param OrderedListInterface<T> $keys 
     * @return MapInterface<T,TValue>
    public function combine(OrderedListInterface $keys): MapInterface;
}
@boesing boesing added the enhancement New feature or request label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant