protected function analyzeStrings(array $strings)
	{
		$info = ['alternationsCount' => 0, 'quantifier' => ''];
		if ($strings[0] === [])
		{
			$info['quantifier'] = '?';
			unset($strings[0]);
		}

		$chars = $this->getChars($strings);
		if (count($chars) > 1)
		{
			++$info['alternationsCount'];
			$info['chars'] = array_values($chars);
			$strings       = array_diff_key($strings, $chars);
		}

		$info['strings']            = array_values($strings);
		$info['alternationsCount'] += count($strings);

		return $info;
	}
protected function analyzeStrings(array $strings)
	{
		$info = ['alternationsCount' => 0, 'quantifier' => ''];
		if ($strings[0] === [])
		{
			$info['quantifier'] = '?';
			unset($strings[0]);
		}

		$chars = $this->getChars($strings);
		if (count($chars) > 1)
		{
			++$info['alternationsCount'];
			$info['chars'] = array_values($chars);
			$strings       = array_diff_key($strings, $chars);
		}

		$info['strings']            = array_values($strings);
		$info['alternationsCount'] += count($strings);

		return $info;
	}
protected function analyzeStrings ( array $ strings ) { $ info = [ 'alternationsCount' => 0 , 'quantifier' => '' ] ; if ( $ strings [ 0 ] === [ ] ) { $ info [ 'quantifier' ] = '?' ; unset ( $ strings [ 0 ] ) ; } $ chars = $ this -> getChars ( $ strings ) ; if ( count ( $ chars ) > 1 ) { ++ $ info [ 'alternationsCount' ] ; $ info [ 'chars' ] = array_values ( $ chars ) ; $ strings = array_diff_key ( $ strings , $ chars ) ; } $ info [ 'strings' ] = array_values ( $ strings ) ; $ info [ 'alternationsCount' ] += count ( $ strings ) ; return $ info ; }
Analyze given strings to determine how to serialize them

The returned array may contains any of the following elements:

- (string) quantifier Either '' or '?'
- (array)  chars      List of values from single-char strings
- (array)  strings    List of multi-char strings

@param  array[] $strings
@return array
Analyze given strings to determine how to serialize them