Skip to content

Commit

Permalink
Add intl-version to matrix
Browse files Browse the repository at this point in the history
As it looks like some intl-versions are bolloks....
  • Loading branch information
heiglandreas committed Apr 20, 2023
1 parent 785110c commit d44357a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ jobs:
matrix:
# operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
icu-versions: ['73.1', '71.1', '69.1', '67.1']
experimental: [false]
include:
- php-versions: '8.3'
experimental: true
name: PHP ${{ matrix.php-versions }} # Test on ${{ matrix.operating-system }}
name: PHP ${{ matrix.php-versions }}-icu${{ matrix.icu-versions }} # Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: sodium
extensions: sodium, intl-${{matrix.icu-version}}
ini-values: post_max_size=256M, short_open_tag=On
coverage: xdebug
- name: prepare
Expand Down
6 changes: 6 additions & 0 deletions intlTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
/**
* Copyright Andreas Heigl <[email protected]>
*
* Licensed under the MIT-license. For details see the included file LICENSE.md
*/
11 changes: 9 additions & 2 deletions src/CalendarDayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ public static function createCalendarDay(int $day, int $month, string $calendar)
$calendar
));
}
$calendar = IntlCalendar::createInstance('UTC', '@calendar=' . $calendar);

return new CalendarDay($day, $month, $calendar);
$icuCalendar = IntlCalendar::createInstance('UTC', '@calendar=' . $calendar);
if (null === $calendar) {
throw new UnknownCalendar(sprintf(
'The calendar %s could not be created',
$calendar
));
}

return new CalendarDay($day, $month, $icuCalendar);
}
}

0 comments on commit d44357a

Please sign in to comment.