Skip to content

Commit

Permalink
iCalcreator-2.27.19
Browse files Browse the repository at this point in the history
  • Loading branch information
iCalcreator committed Apr 10, 2019
1 parent cb11e9c commit 586a175
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 62 deletions.
6 changes: 3 additions & 3 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* copyright (c) 2007-2019 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
* Link https://kigkonsult.se
* Package iCalcreator
* Version 2.27.17
* Version 2.27.18
* License Subject matter of licence is the software iCalcreator.
* The above copyright, link, package and version notices,
* this licence notice and the invariant [rfc5545] PRODID result use
Expand Down Expand Up @@ -33,12 +33,12 @@
* iCalcreator package autoloader
*
* @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
* @since 2.27.17 - 2019-03-30
* @since 2.27.18 - 2019-04-09
*/
/**
* Do NOT alter or remove the constant!!
*/
define( 'ICALCREATOR_VERSION', 'iCalcreator 2.27.17' );
define( 'ICALCREATOR_VERSION', 'iCalcreator 2.27.18' );
/**
* load iCalcreator src and support classes and Traits
*/
Expand Down
10 changes: 8 additions & 2 deletions releaseNotes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

iCalcreator 2.27.17 releaseNotes
iCalcreator 2.27.16 releaseNotes

2.27.1 Deprecated Vcalendar/<component>::deleteProperty/getProperty()/setProperty methods,
replaced by property delete-/get-/set-methods
Expand Down Expand Up @@ -38,4 +38,10 @@ iCalcreator 2.27.17 releaseNotes

2.27.16 Major improved performance for Vcalendar::selectComponents() (i.e RecurFactory) on more simple recurs patterns

2.17.17 Parse eol-htab bug, StringFactory
------------

2.27.17 bug - also HTAB "\t" can be used as line separator (StringFactory::concatRows/convEolChar)

2.27.18 bugs - SelectFactory::selectComponents args calendar, cType reviewing

2.27.19 bug - typo in DateTimeFactory::dateTimeHasOffset
4 changes: 2 additions & 2 deletions src/IcalBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* copyright (c) 2007-2019 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
* Link https://kigkonsult.se
* Package iCalcreator
* Version 2.27.17
* Version 2.27.18
* License Subject matter of licence is the software iCalcreator.
* The above copyright, link, package and version notices,
* this licence notice and the invariant [rfc5545] PRODID result use
Expand Down Expand Up @@ -61,7 +61,7 @@
* Do NOT alter or remove the constant!!
*/
if( ! defined( 'ICALCREATOR_VERSION' )) {
define( 'ICALCREATOR_VERSION', 'iCalcreator 2.27.17' );
define( 'ICALCREATOR_VERSION', 'iCalcreator 2.27.18' );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Util/DateTimeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,10 @@ public static function dateTime2Str( $datetime ) {
* @param DateTime $datetime
* @return bool
* @static
* @since 2.26.7 - 2018-11-24
* @since 2.27.19 - 2019-04-09
*/
public static function dateTimeHasOffset( DateTime $datetime ) {
return DateTimeZoneFactory::hasOffset( ($datetime->getTimezone())->getName());
return DateTimeZoneFactory::hasOffset( $datetime->getTimezone()->getName());
}

/**
Expand Down
65 changes: 33 additions & 32 deletions src/Util/SelectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

use function array_change_key_case;
use function array_keys;
use function array_map;
use function array_unique;
use function count;
use function in_array;
Expand All @@ -48,14 +47,16 @@
use function ksort;
use function sprintf;
use function stripos;
use function strtolower;
use function substr;
use function ucfirst;
use function usort;

/**
* iCalcreator geo support class
*
* @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
* @since 2.27.6 - 2018-12-29
* @since 2.27.18 - 2019-04-08
*/
class SelectFactory
{
Expand Down Expand Up @@ -111,7 +112,7 @@ class SelectFactory
* @throws RuntimeException
* @throws Exception
* @static
* @since 2.27.14 - 2019-03-12
* @since 2.27.18 - 2019-04-08
*/
public static function selectComponents(
Vcalendar $calendar,
Expand Down Expand Up @@ -140,14 +141,15 @@ public static function selectComponents(
if( is_array( $startY )) {
return SelectFactory::selectComponents2( $calendar, $startY );
}
/* check default dates */
/* assert boundary dates */
SelectFactory::assertDateArguments( $startY, $startM, $startD, $endY, $endM, $endD );
/* check component types */
/* assert component types */
$cType = SelectFactory::assertComponentTypes( $cType );
/* check bool args */
/* assert bool args */
SelectFactory:: assertBoolArguments( $flat, $any, $split );
/* iterate components */
$result = [];
$calendar = clone $calendar;
$calendar->sort( Vcalendar::UID );
$compUIDold = null;
$exdateList = $recurIdList = [];
Expand Down Expand Up @@ -842,6 +844,31 @@ private static function assertDateArguments(
}
}

/**
* Return reviewed component types
*
* @param array|string $cType
* @return array
* @access private
* @static
* @since 2.27.18 - 2019-04-07
*/
private static function assertComponentTypes( $cType = null ) {
if( empty( $cType )) {
return Vcalendar::$VCOMPS;
}
if( ! is_array( $cType )) {
$cType = [ $cType ];
}
foreach( $cType as $cix => & $theType ) {
$theType = ucfirst( strtolower( $theType ));
if( ! Util::isCompInList( $theType, Vcalendar::$VCOMPS )) {
$theType = Vcalendar::VEVENT;
}
}
return array_unique( $cType );
}

/**
* Assert bool arguments
*
Expand Down Expand Up @@ -871,32 +898,6 @@ private static function assertBoolArguments(
}
}

/**
* Return checked compoment types
*
* @param array|string $cType
* @return array
* @access private
* @static
* @since 2.27.14 - 2019-03-13
*/
private static function assertComponentTypes( $cType ) {
static $STRTOLOWER = 'strtolower';
static $UCFIRST = 'ucfirst';
if( empty( $cType )) {
return Vcalendar::$VCOMPS;
}
if( ! is_array( $cType )) {
$cType = [ $cType ];
}
foreach( $cType as $cix => $theType ) {
if( ! Util::isCompInList( $theType, Vcalendar::$VCOMPS )) {
$cType[$cix] = Vcalendar::VEVENT;
}
}
return array_unique( $cType );
}

/**
* Return comp end date(time) from dtend/due/duration properties
*
Expand Down
Loading

0 comments on commit 586a175

Please sign in to comment.