Page MenuHomeDevCentral

Allow to map Vector elements into HashMap
ClosedPublic

Authored by dereckson on Jul 1 2023, 19:02.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 10:56
Unknown Object (File)
Sun, Nov 24, 22:17
Unknown Object (File)
Sat, Nov 23, 03:11
Unknown Object (File)
Fri, Nov 22, 22:32
Unknown Object (File)
Wed, Nov 20, 22:00
Unknown Object (File)
Wed, Nov 20, 21:44
Unknown Object (File)
Tue, Nov 19, 06:43
Unknown Object (File)
Fri, Nov 15, 06:52
Subscribers
None

Details

Summary

Callback must return an array of exactly two elements:
[key, value]

It can takes in parameter ($value) or ($key, $value).

This array is used to build a HashMap with at most the
same number of elements than the vector.

If several identical keys are returned by the different
callback executions, the last value is kept.

This is the reverse operation from D3214.

Test Plan

Unit tests are provided.

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Errors
SeverityLocationCodeMessage
Erroromnitools/src/Collections/BaseVector.php:136PHPCS.E.Generic.Files.LineLength.MaxExceededGeneric.Files.LineLength.MaxExceeded
Warningomnitools/tests/Collections/VectorTest.php:207PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsedGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
Warningomnitools/tests/Collections/VectorTest.php:207PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsedGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
Unit
Tests Passed
Branch
vector2map
Build Status
Buildable 5072
Build 5353: arc lint + arc unit

Event Timeline

dereckson created this revision.
This revision is now accepted and ready to land.Jul 1 2023, 19:06
This revision was landed with ongoing or failed builds.Jul 1 2023, 19:06
This revision was automatically updated to reflect the committed changes.