Skip to content

Commit

Permalink
Merge pull request #12 from Icinga/php-81-support
Browse files Browse the repository at this point in the history
PHP 8.1 Support
  • Loading branch information
nilmerg authored Mar 24, 2022
2 parents 104a31a + 3ff39d6 commit f7df9b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
os: ['ubuntu-latest']
include:
- php: '5.6'
allow_failure: true
- php: '7.0'
allow_failure: true

steps:
- name: Checkout code base
Expand Down Expand Up @@ -51,20 +46,16 @@ jobs:
runs-on: ${{ matrix.os }}

env:
phpunit-version: 9.5.4
phpunit-version: 9.5

strategy:
fail-fast: false
matrix:
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
os: ['ubuntu-latest']
include:
- php: '7.0'
phpunit-version: 6.5.14
- php: '7.1'
phpunit-version: 7.5.20
- php: '7.2'
phpunit-version: 8.5.15
phpunit-version: 8.5

steps:
- name: Checkout code base
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Icinga PHP Library - Internationalization (i18n)

[![PHP Support](https://img.shields.io/badge/php-%3E%3D%205.6-777BB4?logo=PHP)](https://php.net/)
[![PHP Support](https://img.shields.io/badge/php-%3E%3D%207.2-777BB4?logo=PHP)](https://php.net/)
![Build Status](https://github.com/Icinga/ipl-i18n/workflows/PHP%20Tests/badge.svg?branch=master)

`ipl\i18n` provides a translation suite using PHP's native [gettext](https://www.php.net/gettext) extension.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://github.com/Icinga/ipl-i18n",
"license": "MIT",
"require": {
"php": ">=5.6.0",
"php": ">=7.2",
"ext-intl": "*",
"ext-gettext": "*",
"ipl/stdlib": ">=0.6.0"
Expand Down
10 changes: 8 additions & 2 deletions src/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function translatePlural($singular, $plural, $number, $context = null)
$this->translationDomain,
$singular,
$plural,
$number,
$number ?? 0,
$context
);
}
Expand All @@ -90,6 +90,12 @@ public function translatePlural($singular, $plural, $number, $context = null)
*/
public function translatePluralInDomain($domain, $singular, $plural, $number, $context = null)
{
return StaticTranslator::$instance->translatePluralInDomain($domain, $singular, $plural, $number, $context);
return StaticTranslator::$instance->translatePluralInDomain(
$domain,
$singular,
$plural,
$number ?? 0,
$context
);
}
}

0 comments on commit f7df9b3

Please sign in to comment.