Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
5b3b5128
Commit
5b3b5128
authored
Jan 28, 2016
by
Carsten Rose
Browse files
KeyValueStringParser: phpdoc
parent
1e907b7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
qfq/helper/KeyValueStringParser.php
View file @
5b3b5128
...
...
@@ -76,18 +76,16 @@ class KeyValueStringParser {
/**
* Parse key/value pairs string and returns them as an assoc array
*
* Valid: "a:1,b:2,c:,d", "," (empty key AND empty value)
* Invalid: ":" ((empty key forbidden)
* $keyValueMode:
* KEY_VALUE_PAIR: default. If only a key is given, the value is ''. E.G. 'a,b' >> [ 'a' => '', 'b' => '' ].
* KEY_VALUE_SINGLE: If only a key is given, the value is the same as the key. E.G. 'a,b' >> [ 'a' => 'a', 'b' => 'b' ].
* Hint $keyValueString: "a:1,b:2,c:,d", "," (empty key AND empty value)
*
* @param string $keyValueString string of key/value pairs
* @param string $keyValueString string of key/value pairs
. E.g.: 'a=100,b=test'
* @param string $keyValueDelimiter
* @param string $listDelimiter
* @param string $valueMode
* * VALUE_GIVEN: If only a key is given, the value is ''. E.G. 'a,b' >> [ 'a' => '', 'b' => '' ]
* * IF_VALUE_EMPTY_COPY_KEY: If only a key is given, the value is the same as the key. E.G. 'a,b' >> [ 'a' => 'a', 'b' => 'b' ].
* @return array associative array indexed by keys
* @throws UserException
* @throws UserException
Thrown if there is a value but no key.
*/
public
static
function
parse
(
$keyValueString
,
$keyValueDelimiter
=
":"
,
$listDelimiter
=
","
,
$valueMode
=
VALUE_GIVEN
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment