‪TYPO3CMS  11.5
TYPO3\CMS\Core\Utility\PermutationUtility Class Reference

Static Public Member Functions

static array meltStringItems (array $payload, string $previousResult='')
 
static array meltArrayItems (array $payload, array $previousResult=[])
 

Static Protected Member Functions

static nextItems (array &$payload)
 
static asString ($item)
 

Detailed Description

Class with helper functions for permuting items.

Definition at line 23 of file PermutationUtility.php.

Member Function Documentation

◆ asString()

static TYPO3\CMS\Core\Utility\PermutationUtility::asString (   $item)
staticprotected

Definition at line 97 of file PermutationUtility.php.

◆ meltArrayItems()

static array TYPO3\CMS\Core\Utility\PermutationUtility::meltArrayItems ( array  $payload,
array  $previousResult = [] 
)
static

◆ meltStringItems()

static array TYPO3\CMS\Core\Utility\PermutationUtility::meltStringItems ( array  $payload,
string  $previousResult = '' 
)
static

Combines string items of multiple arrays as cross-product into flat items.

Example:

  • ‪meltStringItems([['a', 'b'], ['c', 'd'], ['e', 'f']])
  • ‪results into ['ace', 'acf', 'ade', 'adf', 'bce', 'bcf', 'bde', 'bdf']
Parameters
array[]$payload‪Distinct array that should be melted
string$previousResult‪Previous item results
Returns
‪array

Definition at line 36 of file PermutationUtility.php.

Referenced by TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\checkIfIndexPhpReturnsShortcutRedirectWithPageIdAndTypeNumProvidedDataProvider(), TYPO3\CMS\Core\Tests\Unit\Utility\PermutationUtilityTest\meltStringItemsIsExecuted(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\pageIsRenderedWithDomainsDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\pageIsRenderedWithPathsAndChineseDefaultLanguageDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\pageIsRenderedWithPathsDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteWithoutRequiredCHashRequestTest\pageIsRenderedWithValidCacheHashDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\pageIsRenderedWithValidCacheHashDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithValidCacheHashDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteWithoutRequiredCHashRequestTest\pageRenderingStopsWithInvalidCacheHashDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\pageRenderingStopsWithInvalidCacheHashDataProvider(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageRenderingStopsWithInvalidCacheHashDataProvider(), and TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\shortcutsAreRedirectedDataProvider().

◆ nextItems()

static TYPO3\CMS\Core\Utility\PermutationUtility::nextItems ( array &  $payload)
staticprotected

Definition at line 85 of file PermutationUtility.php.