aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/arrayparser.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/arrayparser.php')
-rw-r--r--lib/private/arrayparser.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/arrayparser.php b/lib/private/arrayparser.php
index 3bb394a5163..c4ad1264fbb 100644
--- a/lib/private/arrayparser.php
+++ b/lib/private/arrayparser.php
@@ -30,6 +30,9 @@ class ArrayParser {
const TYPE_STRING = 3;
const TYPE_ARRAY = 4;
+ /**
+ * @param string $string
+ */
function parsePHP($string) {
$string = $this->stripPHPTags($string);
$string = $this->stripAssignAndReturn($string);
@@ -47,6 +50,9 @@ class ArrayParser {
return $string;
}
+ /**
+ * @param string $string
+ */
function stripAssignAndReturn($string) {
$string = trim($string);
if (substr($string, 0, 6) === 'return') {
@@ -74,6 +80,9 @@ class ArrayParser {
return null;
}
+ /**
+ * @param string $string
+ */
function getType($string) {
$string = strtolower($string);
$first = substr($string, 0, 1);
@@ -90,19 +99,31 @@ class ArrayParser {
}
}
+ /**
+ * @param string $string
+ */
function parseString($string) {
return substr($string, 1, -1);
}
+ /**
+ * @param string $string
+ */
function parseNum($string) {
return intval($string);
}
+ /**
+ * @param string $string
+ */
function parseBool($string) {
$string = strtolower($string);
return $string === 'true';
}
+ /**
+ * @param string $string
+ */
function parseArray($string) {
$body = substr($string, 5);
$body = trim($body);
@@ -131,6 +152,9 @@ class ArrayParser {
return $result;
}
+ /**
+ * @param string $body
+ */
function splitArray($body) {
$inSingleQuote = false;//keep track if we are inside quotes
$inDoubleQuote = false;