diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-05-04 14:36:31 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-05-04 14:36:31 +0300 |
commit | 1d2c17a9e9ecb6efdb3acd27e51ba06af4104af2 (patch) | |
tree | 2b8b303fa0ad299dec1658988a9503a6d86f48dd /convert.php | |
parent | c46b30b1d7d350b2ce10febe335a0e2c00f82de2 (diff) |
Fix detection of config sample for new array syntax
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'convert.php')
-rw-r--r-- | convert.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/convert.php b/convert.php index 6d9fe57..6cc8cdd 100644 --- a/convert.php +++ b/convert.php @@ -105,10 +105,16 @@ $docBlock = file_get_contents($CONFIG_SAMPLE_FILE); // trim everything before this (including itself) $start = '$CONFIG = array('; +if (strpos($docBlock, $start) === false) { + $start = '$CONFIG = ['; +} $docBlock = substr($docBlock, strpos($docBlock, $start) + strlen($start)); // trim the end of the config variable $end = ');'; +if (strrpos($docBlock, $end) === false) { + $end = '];'; +} $docBlock = substr($docBlock, 0, strrpos($docBlock, $end)); // split on '/**' |