1
0
mirror of https://github.com/rlanvin/php-rrule.git synced 2025-02-20 09:54:16 +01:00

Syntax fix for PHP 5.3

This commit is contained in:
rlanvin 2017-04-11 16:56:05 +01:00
parent 59d9226618
commit 031b5e78f1

View File

@ -30,11 +30,11 @@ class RfcParser
static public function parseLine($line, array $default = array())
{
$line = trim($line);
$property = array_merge([
$property = array_merge(array(
'name' => '',
'params' => [],
'params' => array(),
'value' => null
], $default);
), $default);
if ( strpos($line,':') === false ) {
if ( ! $property['name'] ) {
@ -77,9 +77,9 @@ class RfcParser
$lines = explode("\n", $string);
foreach ( $lines as $line ) {
$property = self::parseLine($line, [
$property = self::parseLine($line, array(
'name' => sizeof($lines) > 1 ? null : 'RRULE' // allow missing property name for single-line RRULE
]);
));
switch ( strtoupper($property['name']) ) {
case 'DTSTART':