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:
parent
59d9226618
commit
031b5e78f1
@ -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':
|
||||
|
Loading…
x
Reference in New Issue
Block a user