Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
e5371c8
Add timezone Europe/Berlin
chr-is May 20, 2023
7acdf37
Bump actions/cache from 3 to 4
dependabot[bot] Feb 1, 2024
5c3a532
Apply cs-fixer changes
phil-davis Feb 2, 2024
31b90cd
Merge pull request #637 from sabre-io/dependabot/github_actions/actio…
phil-davis Feb 2, 2024
54b7952
Bump codecov/codecov-action from 3 to 4
dependabot[bot] Feb 2, 2024
c5b0742
Merge pull request #638 from sabre-io/dependabot/github_actions/codec…
phil-davis Feb 2, 2024
7f5ddc4
chore: use php-cs-fixer 3.49
phil-davis Feb 11, 2024
7968406
Merge pull request #639 from phil-davis/cs-fixer-3.49
phil-davis Feb 11, 2024
db65228
chore: use php-cs-fixer 3.51
phil-davis Mar 4, 2024
7c3a8db
Merge pull request #642 from phil-davis/cs-fixer-3.51
phil-davis Mar 4, 2024
624a4f9
chore: apply cs-fixer 3.54.0 changes
phil-davis Apr 18, 2024
b20cd3d
Merge pull request #644 from phil-davis/cs-fixer-20240418
phil-davis Apr 18, 2024
f14092f
chore: bump php-cs-fixer requirement to 3.54
phil-davis Apr 19, 2024
caa7af8
Merge pull request #645 from phil-davis/cs-fixer-3.54
phil-davis Apr 19, 2024
a848f93
add `lineIndex` and `lineString` properties to Node
JohnRDOrazio Apr 23, 2024
800aac9
creat Unit Test
JohnRDOrazio Apr 25, 2024
2a65337
ITip\Broker: handle timezones in replies to exception events
gharlan May 8, 2024
620ee98
remove comment
gharlan May 8, 2024
9192bfe
php-cs-fixer
JohnRDOrazio May 8, 2024
ec31757
remove unnecessary error descriptions
JohnRDOrazio May 8, 2024
8a2dab4
Merge pull request #649 from JohnRDOrazio/validation-fix
phil-davis May 9, 2024
bee4fa7
Add comments about use of getTimestamp
phil-davis May 9, 2024
d4bf35b
Merge pull request #652 from gharlan/recurrence-id-timezone
phil-davis May 9, 2024
e5976c9
chore: stop exporting php-cs-fixer config
phil-davis May 10, 2024
fe5d261
Merge pull request #654 from phil-davis/export-ignore-php-cs-fixer
phil-davis May 10, 2024
8bf65e2
chore: bump dev dependencies
phil-davis May 14, 2024
a865996
Merge pull request #655 from phil-davis/bump-dev-deps-20240514
phil-davis May 14, 2024
1a61550
yearly rrule compliance by the iterator when start date does not foll…
kroky May 14, 2024
72a1fe9
test: add more test scenarios for testYearlyStartDateNotOnRRuleList
phil-davis May 17, 2024
254f85d
Merge pull request #656 from kroky/bugfix/bymonth-rrule
phil-davis May 17, 2024
5d7ca00
throw ParseException when null input is provided
phil-davis May 27, 2024
227f681
Merge pull request #658 from phil-davis/issue-657
phil-davis May 27, 2024
b9c39da
Reproduce bug where dst leap is passed on to subsequent occurences
cyrilvanschreven-proton Apr 22, 2024
b37ef3d
Fix test code format
phil-davis May 9, 2024
963189b
Handle summer time start for daily recurrences
phil-davis May 9, 2024
2feab3f
Handle summer time start for weekly recurrences
phil-davis May 9, 2024
3b37fbc
Handle summer time start for monthly recurrences
phil-davis May 9, 2024
f4a0bba
Handle summer time start for yearly recurrences
phil-davis May 9, 2024
778177c
Refactor summer time start logic into advanceTheDate function
phil-davis May 9, 2024
fb5689a
Handle summer time start for hourly recurrences
phil-davis May 9, 2024
018789e
Refactor advanceTheDate
phil-davis May 9, 2024
d0cb455
fix: refactor advanceTheDate
phil-davis May 17, 2024
eef9fa6
Handle case when BYMONTHDAY falls on summer time start
phil-davis May 17, 2024
9b20d5e
Handle case when day at or near end of month falls on summer time start
phil-davis May 17, 2024
102909e
refactor hourly time jump logic into adjustForTimeJumpsOfHourlyEvent …
phil-davis May 27, 2024
85d72e0
refactor original start time calculation into startTime method
phil-davis May 27, 2024
cc112fb
refactor adjustForTimeJumpsOfHourlyEvent to be protected
phil-davis May 27, 2024
9d68c7a
Handle summer time start for weekly BYDAY recurrences
phil-davis May 30, 2024
5a3dd88
Add test case for Weekly BYDAY with BYHOUR on summer-time
phil-davis May 30, 2024
9039f90
Add test cases and fix YEARLY with BYMONTH on summer-time transition
phil-davis May 30, 2024
1d0d0bd
Add test cases and fix YEARLY with BYMONTH BYDAY on summer-time trans…
phil-davis May 30, 2024
1b388aa
Merge pull request #653 from phil-davis/dst-leap-648
phil-davis Jun 6, 2024
4f21237
Fix VTODO validation for PERCENT-COMPLETE
jarikmarwede Aug 1, 2024
091a161
Merge pull request #664 from jarikmarwede/master
phil-davis Aug 1, 2024
c14420f
test: extra property is allowed in VTODO
phil-davis Aug 1, 2024
db14749
Merge pull request #665 from phil-davis/test-percent
phil-davis Aug 1, 2024
7727269
chore: adjust code to make php-cs-fixer and phpstan pass
phil-davis Aug 28, 2024
e1cc246
Use php-cs-fixer 3.62.0
phil-davis Aug 28, 2024
ad1a838
Merge pull request #667 from phil-davis/fix-ci-20240828
phil-davis Aug 28, 2024
d734e21
fix(VAlarm) Alarm related to DTSTART of VTODO
tpayen Apr 7, 2023
3e1e0d3
Merge pull request #616 from tpayen/fix/valarm-vtodo
phil-davis Aug 28, 2024
8888958
chore: use php-cs-fixer 3.63
phil-davis Aug 28, 2024
f61b41a
Merge pull request #668 from phil-davis/php-cs-fixer-3.63
phil-davis Aug 28, 2024
554c2c7
docs: Remove outdated build status in README.md
DeepDiver1975 Sep 4, 2024
a4a2bc3
Merge pull request #671 from sabre-io/DeepDiver1975-patch-1
DeepDiver1975 Sep 4, 2024
57492ab
chore: apply php-cs-fixer 3.64 changes
phil-davis Sep 4, 2024
fad6391
Merge pull request #672 from phil-davis/apply-cs-fixer-3.64
phil-davis Sep 4, 2024
9e72aca
Allow unknown value data types for VALUE
heiglandreas Sep 10, 2024
3bfeaee
refactor: Replace dirname(__FILE__) with __DIR__
ChristophWurst Sep 17, 2024
3473e7c
Throw InvalidDataException when RRule is invalid
mathroc Oct 11, 2024
ab14f5e
fixup: fix test
mathroc Oct 11, 2024
c532bfc
Merge pull request #675 from ChristophWurst/refactor/dirname-to-dir
phil-davis Oct 14, 2024
46bce0e
chore: add PHP 8.4 to CI of master
phil-davis Oct 14, 2024
cba15f0
Merge pull request #694 from phil-davis/add-php-8.4-to-ci-master
phil-davis Oct 14, 2024
a2f05dd
fix: check if event status was changed to cancelled and generate appr…
SebastianKrupinski Aug 28, 2024
28e191b
Merge pull request #669 from SebastianKrupinski/fix-status-cancelled
phil-davis Oct 14, 2024
53f73a4
Merge pull request #692 from mathroc/patch-1
phil-davis Oct 14, 2024
f7cef9c
Add tests for skipping unknown parameters
heiglandreas Oct 14, 2024
1f22f4a
Rework handling of values that are not recognized
heiglandreas Oct 14, 2024
48f48cf
chore: forward port 4.5.6
phil-davis Oct 22, 2024
2fcc82e
Merge pull request #698 from phil-davis/forward-port-4.5.6
phil-davis Oct 22, 2024
c8ef5fd
Merge pull request #674 from heiglandreas/allow-unknown-value-data-types
phil-davis Oct 22, 2024
8a59036
chore: bump php-cs-fixer to 3.65
phil-davis Dec 1, 2024
0795eed
Merge pull request #703 from phil-davis/bump-cs-fixer-3.65
phil-davis Dec 1, 2024
f1ff642
chore(deps): bump codecov/codecov-action from 4 to 5
dependabot[bot] Dec 1, 2024
7d22dbd
Merge pull request #704 from sabre-io/dependabot/github_actions/codec…
phil-davis Dec 1, 2024
d1161c8
chore(deps-dev): update phpstan/phpstan requirement from ^1.12 to ^2.0
dependabot[bot] Dec 1, 2024
fc1c755
Merge pull request #705 from sabre-io/dependabot/composer/phpstan/php…
phil-davis Dec 2, 2024
fff6c76
Merge pull request #618 from chr-is/issue-617
phil-davis Apr 14, 2025
778bb46
chore: bump dev dependencies
phil-davis Apr 17, 2025
90f3757
Merge pull request #711 from phil-davis/dev-dependency-bump-20250417
phil-davis Apr 17, 2025
b86fa76
chore(deps): bump actions/checkout from 4 to 5
dependabot[bot] Sep 2, 2025
21a5ee4
Improve check for empty property names
kristoffermollerhoj Sep 4, 2025
6eee31d
Ran php-cs-fixer (on files I have not modified myself)
kristoffermollerhoj Sep 4, 2025
0ddabb7
chore(tests): apply php-cs-fixer format changes to test code
phil-davis Sep 16, 2025
3909dc3
Merge pull request #725 from sabre-io/dependabot/github_actions/actio…
phil-davis Sep 16, 2025
f0f61a1
ci: add tests for PHP 8.4 and 8.5
Chris53897 Oct 24, 2025
1b833ad
ci: add tests for PHP 8.4 and 8.5
Chris8934 Oct 24, 2025
099a377
fix: use RDATE in time range check and use all instances
SebastianKrupinski Nov 20, 2025
7ba9fa6
chore: adjust CI for PHP 8.5
phil-davis Dec 1, 2025
61c968d
chore: only run php-cs-fixer on PHP 7.4
phil-davis Dec 1, 2025
bc43da4
Merge pull request #733 from Chris53897/patch-1
phil-davis Dec 1, 2025
aaa9462
chore(deps): bump actions/checkout from 5 to 6
dependabot[bot] Dec 2, 2025
9f217d9
Merge pull request #737 from sabre-io/dependabot/github_actions/actio…
phil-davis Dec 2, 2025
192d94d
Merge pull request #726 from KristofferFM/kristoffer-moellerhoej-impr…
phil-davis Dec 2, 2025
0481e4c
Issue-722: Fixing problem with broker adding exdate property with flo…
kristoffermollerhoj Aug 27, 2025
861341a
Merge pull request #723 from KristofferFM/kristoffer-moellerhoej-issu…
phil-davis Dec 2, 2025
0351e78
Fixed problem with variable scope
kristoffermollerhoj Aug 25, 2025
46daffb
Merge pull request #721 from KristofferFM/fix-variable-scope
phil-davis Dec 2, 2025
96c3152
chore: forward port 4.5.7
phil-davis Dec 2, 2025
8b28880
Merge pull request #741 from phil-davis/forward-port-4.5.7
phil-davis Dec 2, 2025
25a6731
Improve error check in Mimedir parser
kristoffermollerhoj Sep 8, 2025
4bf2c58
Fixed cornercase for recurrent event for organizer and no attendee
kristoffermollerhoj Sep 10, 2025
1ca8ffb
Merge pull request #735 from SebastianKrupinski/fix/handle-rdate-impr…
ChristophWurst Dec 12, 2025
93f212c
chore(deps): bump actions/cache from 4 to 5 (#744)
dependabot[bot] Jan 2, 2026
49d53f1
fix: send participation reply on fresh event
SebastianKrupinski Dec 30, 2025
b6d80d0
Merge pull request #743 from SebastianKrupinski/fix/send-reply-on-eve…
ChristophWurst Jan 9, 2026
9fe7c0e
Merge pull request #728 from KristofferFM/kristoffer-moellerhoej-sche…
phil-davis Jan 12, 2026
89602af
Merge pull request #727 from KristofferFM/kristoffer-moellerhoej-mime…
phil-davis Jan 12, 2026
2ce84f7
Prepare 4.5.8
phil-davis Jan 12, 2026
2f4bd8e
Merge pull request #752 from phil-davis/forwardport-changelog-4.5.8
phil-davis Jan 12, 2026
b014792
chore(deps): bump codecov/codecov-action from 5 to 6
dependabot[bot] Apr 2, 2026
8f3c7e7
chore: apply cs-fixer changes
phil-davis Apr 2, 2026
2104a3e
Merge pull request #754 from sabre-io/dependabot/github_actions/codec…
phil-davis Apr 2, 2026
ebc4c1a
fix(itip): handle null old calendar/event
ChristophWurst Mar 19, 2026
ec4f976
Merge pull request #753 from sabre-io/fix/itip-broker-old-calendar-null
phil-davis May 31, 2026
fdf34ea
feat(VCard): add getByTypes method (#717)
JimKnoxx Jun 24, 2025
98f2bf5
Merge pull request #718 from JimKnoxx/717-getByTypes
phil-davis May 31, 2026
a4b3152
fix(timezonedata): Replace deprecated IANA timezone names
ralflang Apr 13, 2026
091d6d8
fix: document that FindFromTimezoneMap:find does not throw
phil-davis May 31, 2026
2a799e6
Merge pull request #756 from ralflang/fix/deprecated-timezone-names
phil-davis May 31, 2026
85d5d6f
chore: changelogs for 4.5.9 and 4.6.0
phil-davis May 31, 2026
a95f4e1
Merge pull request #764 from phil-davis/forward-port-changelog-4.6.0
phil-davis May 31, 2026
2685914
Record upstream master 2024-06-06 (1b388aab) as merged
Sep 30, 2026
82dd5a7
Merge upstream sabre-io/vobject master 2026-05-31 (a95f4e1d)
Sep 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
coverage: ['pcov']
code-style: ['no']
code-analysis: ['no']
include:
- php-versions: '7.4'
coverage: 'none'
coverage: 'pcov'
code-style: 'yes'
code-analysis: 'yes'
- php-versions: '8.5'
coverage: 'pcov'
code-style: 'no'
code-analysis: 'yes'
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
Expand All @@ -36,7 +42,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
Expand All @@ -48,8 +54,8 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Code Analysis (PHP CS-Fixer)
if: matrix.code-analysis == 'yes'
run: php vendor/bin/php-cs-fixer fix --dry-run --diff
if: matrix.code-style == 'yes'
run: PHP_CS_FIXER_IGNORE_ENV=true php vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Code Analysis (PHPStan)
if: matrix.code-analysis == 'yes'
Expand All @@ -59,5 +65,5 @@ jobs:
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml

- name: Code Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v6
if: matrix.coverage != 'none'
4 changes: 4 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
$config->setRules([
'@PSR1' => true,
'@Symfony' => true,
'nullable_type_declaration' => [
'syntax' => 'question_mark',
],
'nullable_type_declaration_for_default_null_value' => true,
]);

return $config;
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,65 @@ ChangeLog
* #3 Add daily occurrences to nextMonth and NextYear
* #4 Enhance fast forward speed if no count value has been given

4.6.0 (2026-05-31)
------------------
* #718 feat(VCard): add getByTypes method (@JimKnoxx)
* #756 fix: Update deprecated timezone names (@ralflang)

4.5.9 (2026-05-31)
------------------
* #759 fix(itip): handle null old calendar/event (@ChristophWurst)

4.5.8 (2026-01-12)
------------------

* #721: Fix variable scope (@KristofferFM)
* #723: Broker shouldn't add EXDATE property with floating timezone (@KristofferFM)
* #726: Improved check on property name (@KristofferFM)
* #727: Improve error checks in Mimedir parser (@KristofferFM)
* #728: Removing attendee from scheduled recurring event should generate an EXDATE property (@KristofferFM)
* #735: use RDATE in time range check and use all instances (@SebastianKrupinski)
* #743: send participation reply on fresh event (@SebastianKrupinski)

4.5.7 (2025-04-17)
------------------

* #618: Add new exchangetimezone 'Amsterdam, Berlin, Bern, Rom, Stockholm, Wien' (@chr-is)
* #674: Allow unknown value data types for VALUE (@heiglandreas)
* #707: add phpdoc return types for arrayaccess methods (@smhg)

4.5.6 (2024-10-14)
------------------

* #662: add PHP 8.4 to CI (@phil-davis)
* #669: fix: check if event status was changed to cancelled and generate appropriate message (@SebastianKrupinski)
* #673: Fix Implicitly marking parameter $param as nullable is deprecated (@cedric-anne)
* #675: refactor: Replace dirname(__FILE__) with __DIR__ (@ChristophWurst)
* #692: Throw InvalidDataException when RRule is invalid (@mathroc)

4.5.5 (2024-07-02)
------------------

* #632: Add PHP 8.3 to CI (@phil-davis)
* #649: add lineIndex and lineString properties to a Property Node (@JohnRDOrazio)
* #652: ITip\Broker: handle timezones in replies to exception events (@gharlan)
* #654: chore: stop exporting php-cs-fixer config (@phil-davis)
* #656: Yearly rrule compliance by the iterator (@kroky)
* #658: throw ParseException when null input is provided (@phil-davis)
* #653: Handle summer time jumps in event recurrences (@phil-davis)

4.5.4 (2023-11-09)
------------------

* #619: fixed issue: Undefined index: plusminus (@sash04ek)
* #622: Create Issue467Test.php for 619 (@sash04ek)
* #623: docs: fix type definition for oldCalendar (@kesselb)

4.5.3 (2023-01-22)
------------------

* #607: Apply 'Support sabre/xml v4' and needed code changes to 4.5 branch (@phil-davis)

4.5.2 (2023-01-20)
------------------

Expand Down
2 changes: 1 addition & 1 deletion bin/bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

$start = microtime(true);

$lol = Sabre\VObject\Reader::read($data);
$lol = VObject\Reader::read($data);

echo 'time: '.(microtime(true) - $start)."\n";
6 changes: 3 additions & 3 deletions bin/bench_freebusygenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include __DIR__.'/../vendor/autoload.php';

if ($argc < 2) {
echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " freebusy benchmark\n";
echo 'sabre/vobject ', VObject\Version::VERSION, " freebusy benchmark\n";
echo "\n";
echo "This script can be used to measure the speed of generating a\n";
echo "free-busy report based on a calendar.\n";
Expand All @@ -19,7 +19,7 @@
$bench = new Hoa\Bench\Bench();
$bench->parse->start();

$vcal = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
$vcal = VObject\Reader::read(fopen($inputFile, 'r'));

$bench->parse->stop();

Expand All @@ -31,7 +31,7 @@
$bench->fb->start();

for ($i = 0; $i < $repeat; ++$i) {
$fb = new Sabre\VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone);
$fb = new VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone);
$results = $fb->getResult();
}
$bench->fb->stop();
Expand Down
4 changes: 2 additions & 2 deletions bin/bench_manipulatevcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include __DIR__.'/../vendor/autoload.php';

if ($argc < 2) {
echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " manipulation benchmark\n";
echo 'sabre/vobject ', VObject\Version::VERSION, " manipulation benchmark\n";
echo "\n";
echo "This script can be used to measure the speed of opening a large amount of\n";
echo "vcards, making a few alterations and serializing them again.\n";
Expand All @@ -17,7 +17,7 @@

$input = file_get_contents($inputFile);

$splitter = new Sabre\VObject\Splitter\VCard($input);
$splitter = new VObject\Splitter\VCard($input);

$bench = new Hoa\Bench\Bench();

Expand Down
75 changes: 37 additions & 38 deletions bin/mergeduplicates.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,53 +96,52 @@ function write($vcard)
$collectedNames[$fn] = $vcard;
++$stats['Unique cards'];
continue;
} else {
// Starting comparison for all properties. We only check if properties
// in the current vcard exactly appear in the earlier vcard as well.
foreach ($vcard->children() as $newProp) {
if (in_array($newProp->name, $ignoredProperties)) {
// We don't care about properties such as UID and REV.
continue;
}
$ok = false;
foreach ($collectedNames[$fn]->select($newProp->name) as $compareProp) {
if ($compareProp->serialize() === $newProp->serialize()) {
$ok = true;
break;
}
}
// Starting comparison for all properties. We only check if properties
// in the current vcard exactly appear in the earlier vcard as well.
foreach ($vcard->children() as $newProp) {
if (in_array($newProp->name, $ignoredProperties)) {
// We don't care about properties such as UID and REV.
continue;
}
$ok = false;
foreach ($collectedNames[$fn]->select($newProp->name) as $compareProp) {
if ($compareProp->serialize() === $newProp->serialize()) {
$ok = true;
break;
}
}

if (!$ok) {
if ('EMAIL' === $newProp->name || 'TEL' === $newProp->name) {
// We're going to make another attempt to find this
// property, this time just by value. If we find it, we
// consider it a success.
foreach ($collectedNames[$fn]->select($newProp->name) as $compareProp) {
if ($compareProp->getValue() === $newProp->getValue()) {
$ok = true;
break;
}
}

if (!$ok) {
// Merging the new value in the old vcard.
$collectedNames[$fn]->add(clone $newProp);
if (!$ok) {
if ('EMAIL' === $newProp->name || 'TEL' === $newProp->name) {
// We're going to make another attempt to find this
// property, this time just by value. If we find it, we
// consider it a success.
foreach ($collectedNames[$fn]->select($newProp->name) as $compareProp) {
if ($compareProp->getValue() === $newProp->getValue()) {
$ok = true;
++$stats['Merged values'];
break;
}
}
}

if (!$ok) {
// echo $newProp->serialize() . " does not appear in earlier vcard!\n";
++$stats['Error'];
if ($debug) {
fwrite($debug, "Missing '".$newProp->name."' property in duplicate. Earlier vcard:\n".$collectedNames[$fn]->serialize()."\n\nLater:\n".$vcard->serialize()."\n\n");
if (!$ok) {
// Merging the new value in the old vcard.
$collectedNames[$fn]->add(clone $newProp);
$ok = true;
++$stats['Merged values'];
}
}
}

$vcard->destroy();
continue 2;
if (!$ok) {
// echo $newProp->serialize() . " does not appear in earlier vcard!\n";
++$stats['Error'];
if ($debug) {
fwrite($debug, "Missing '".$newProp->name."' property in duplicate. Earlier vcard:\n".$collectedNames[$fn]->serialize()."\n\nLater:\n".$vcard->serialize()."\n\n");
}

$vcard->destroy();
continue 2;
}
}

Expand Down
4 changes: 2 additions & 2 deletions bin/rrulebench.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include __DIR__.'/../vendor/autoload.php';

if ($argc < 4) {
echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " RRULE benchmark\n";
echo 'sabre/vobject ', VObject\Version::VERSION, " RRULE benchmark\n";
echo "\n";
echo "This script can be used to measure the speed of the 'recurrence expansion'\n";
echo 'system.';
Expand All @@ -18,7 +18,7 @@
$bench->parse->start();

echo "Parsing.\n";
$vobj = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
$vobj = VObject\Reader::read(fopen($inputFile, 'r'));

$bench->parse->stop();

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"sabre/xml" : "^3.0 || ^4.0"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "^3.54",
"friendsofphp/php-cs-fixer": "^3.94",
"phpunit/phpunit" : "^9.6",
"phpunit/php-invoker" : "^2.0 || ^3.1",
"phpstan/phpstan": "^1.11"
"phpstan/phpstan": "^2.1"
},
"suggest" : {
"hoa/bench" : "If you would like to run the benchmark scripts"
Expand Down Expand Up @@ -94,7 +94,7 @@
"phpstan analyse lib tests --memory-limit 1G"
],
"cs-fixer": [
"php-cs-fixer fix"
"PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix"
],
"phpunit": [
"phpunit --configuration tests/phpunit.xml"
Expand Down
29 changes: 14 additions & 15 deletions lib/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,16 @@ public function select(string $name): array

if (is_null($group)) {
return $result;
} else {
// If we have a group filter as well, we need to narrow it down
// more.
return array_filter(
$result,
function ($child) use ($group) {
return $child instanceof Property && (null !== $child->group ? strtoupper($child->group) : '') === $group;
}
);
}

// If we have a group filter as well, we need to narrow it down
// more.
return array_filter(
$result,
function ($child) use ($group) {
return $child instanceof Property && (null !== $child->group ? strtoupper($child->group) : '') === $group;
}
);
}

// If we got to this point, it means there was no 'name' specified for
Expand Down Expand Up @@ -422,13 +422,12 @@ public function __get(string $name): ?Node
$matches = $this->select($name);
if (0 === count($matches)) {
return null;
} else {
$firstMatch = current($matches);
/* @var $firstMatch Property */
$firstMatch->setIterator(new ElementList(array_values($matches)));

return $firstMatch;
}
$firstMatch = current($matches);
/* @var $firstMatch Property */
$firstMatch->setIterator(new ElementList(array_values($matches)));

return $firstMatch;
}

/**
Expand Down
12 changes: 3 additions & 9 deletions lib/Component/VAlarm.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ public function getEffectiveTriggerTime(): \DateTimeImmutable
/** @var VEvent|VTodo $parentComponent */
$parentComponent = $this->parent;
if ('START' === $related) {
if ('VTODO' === $parentComponent->name) {
$propName = 'DUE';
} else {
$propName = 'DTSTART';
}

$effectiveTrigger = $parentComponent->$propName->getDateTime();
$effectiveTrigger = $parentComponent->DTSTART->getDateTime();
} else {
if ('VTODO' === $parentComponent->name) {
$endProp = 'DUE';
Expand Down Expand Up @@ -102,9 +96,9 @@ public function isInTimeRange(\DateTimeInterface $start, \DateTimeInterface $end
}

return false;
} else {
return $start <= $effectiveTrigger && $end > $effectiveTrigger;
}

return $start <= $effectiveTrigger && $end > $effectiveTrigger;
}

/**
Expand Down
Loading
Loading