src/SlugGenerator.php
private function transform(string $text, string $valid, iterable $transforms, string $locale): string
	{
		$regexRegular = '([^'.$valid.']+)us';
		$regexCase = $this->createCaseRegex($valid);

		foreach ($transforms as $transform) {
			$regex = ($transform === 'Lower' || $transform === 'Upper') ? $regexCase : $regexRegular;
			if ($locale) {
				$text = $this->applyTransformRule($text, $transform, $locale, $regex);
			}
			$text = $this->applyTransformRule($text, $transform, '', $regex);
		}

		return $text;
	}
private function transform(string $text, string $valid, iterable $transforms, string $locale): string
	{
		$regexRegular = '([^'.$valid.']+)us';
		$regexCase = $this->createCaseRegex($valid);

		foreach ($transforms as $transform) {
			$regex = ($transform === 'Lower' || $transform === 'Upper') ? $regexCase : $regexRegular;
			if ($locale) {
				$text = $this->applyTransformRule($text, $transform, $locale, $regex);
			}
			$text = $this->applyTransformRule($text, $transform, '', $regex);
		}

		return $text;
	}
private function transform ( string $ text , string $ valid , iterable $ transforms , string $ locale ) : string { $ regexRegular = '([^' . $ valid . ']+)us' ; $ regexCase = $ this -> createCaseRegex ( $ valid ) ; foreach ( $ transforms as $ transform ) { $ regex = ( $ transform === 'Lower' || $ transform === 'Upper' ) ? $ regexCase : $ regexRegular ; if ( $ locale ) { $ text = $ this -> applyTransformRule ( $ text , $ transform , $ locale , $ regex ) ; } $ text = $ this -> applyTransformRule ( $ text , $ transform , '' , $ regex ) ; } return $ text ; }
Apply all transforms with the specified locale
to the invalid parts of the text.

@param string   $text
@param string   $valid
@param iterable $transforms
@param string   $locale

@return string
Apply all transforms with the specified locale to the invalid parts of the text .