diff options
-rw-r--r-- | 230.patch | 69 | ||||
-rw-r--r-- | composer.json | 26 | ||||
-rw-r--r-- | php-gettext-gettext.spec | 15 |
3 files changed, 18 insertions, 92 deletions
diff --git a/230.patch b/230.patch deleted file mode 100644 index 7de523b..0000000 --- a/230.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 03a36641bd9b13b1084ffa9dc330d7ebd2700ed1 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Thu, 10 Oct 2019 16:25:20 +0200 -Subject: [PATCH 1/2] Fix TypeError with 7.4 - -TypeError: Argument 1 passed to Gettext\Translations::Gettext\{closure}() must be an instance of Gettext\Translation, array given - -From UPGRADINGS - . Calling get_object_vars() on an ArrayObject instance will now always return - the properties of the ArrayObject itself (or a subclass). Previously it - returned the values of the wrapped array/object unless the STD_PROP_LIST - flag was specified. ---- - src/Translations.php | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/src/Translations.php b/src/Translations.php -index 083b4ad..05d6a3e 100644 ---- a/src/Translations.php -+++ b/src/Translations.php -@@ -435,11 +435,13 @@ public function find($context, $original = '') - */ - public function countTranslated() - { -- $callback = function (Translation $v) { -- return ($v->hasTranslation()) ? $v->getTranslation() : null; -- }; -- -- return count(array_filter(get_object_vars($this), $callback)); -+ $c = 0; -+ foreach($this as $v) { -+ if ($v->hasTranslation()) { -+ $c++; -+ } -+ } -+ return $c; - } - - /** - -From bfc9a85db55107ed58ce8e9ca84be077e03eec41 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Thu, 10 Oct 2019 16:28:19 +0200 -Subject: [PATCH 2/2] Fix Invalid characters passed for attempted conversion - (7.4) - ---- - src/Extractors/PhpCode.php | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/Extractors/PhpCode.php b/src/Extractors/PhpCode.php -index ef31449..34243b9 100644 ---- a/src/Extractors/PhpCode.php -+++ b/src/Extractors/PhpCode.php -@@ -122,11 +122,11 @@ function ($match) { - case '\\': - return '\\'; - case 'x': -- return chr(hexdec(substr($match[0], 1))); -+ return chr(hexdec(substr($match[1], 1))); - case 'u': -- return self::unicodeChar(hexdec(substr($match[0], 1))); -+ return self::unicodeChar(hexdec(substr($match[1], 1))); - default: -- return chr(octdec($match[0])); -+ return chr(octdec($match[1])); - } - }, - $value diff --git a/composer.json b/composer.json index 24b5083..b970be6 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "library", "description": "PHP gettext manager", "keywords": ["js", "gettext", "i18n", "translation", "po", "mo"], - "homepage": "https://github.com/oscarotero/Gettext", + "homepage": "https://github.com/php-gettext/Gettext", "license": "MIT", "authors": [ { @@ -15,25 +15,18 @@ ], "support": { "email": "oom@oscarotero.com", - "issues": "https://github.com/oscarotero/Gettext/issues" + "issues": "https://github.com/php-gettext/Gettext/issues" }, "require": { - "php": ">=5.4.0", + "php": "^7.2", "gettext/languages": "^2.3" }, "require-dev": { - "illuminate/view": "*", - "twig/twig": "^1.31|^2.0", - "twig/extensions": "*", - "symfony/yaml": "~2", - "phpunit/phpunit": "^4.8|^5.7|^6.5", - "squizlabs/php_codesniffer": "^3.0" - }, - "suggest": { - "illuminate/view": "Is necessary if you want to use the Blade extractor", - "twig/twig": "Is necessary if you want to use the Twig extractor", - "twig/extensions": "Is necessary if you want to use the Twig extractor", - "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator" + "phpunit/phpunit": "^8.0", + "squizlabs/php_codesniffer": "^3.0", + "brick/varexporter": "^0.2.1", + "friendsofphp/php-cs-fixer": "^2.15", + "oscarotero/php-cs-fixer-config": "^1.0" }, "autoload": { "psr-4": { @@ -49,6 +42,7 @@ "test": [ "phpunit", "phpcs" - ] + ], + "cs-fix": "php-cs-fixer fix" } } diff --git a/php-gettext-gettext.spec b/php-gettext-gettext.spec index c1777c2..7df4409 100644 --- a/php-gettext-gettext.spec +++ b/php-gettext-gettext.spec @@ -13,8 +13,8 @@ Name: php-gettext-gettext -Version: 4.7.0 -Release: 2%{?dist} +Version: 5.5.1 +Release: 1%{?dist} BuildArch: noarch License: MIT @@ -25,8 +25,6 @@ Source0: %{url}/archive/v%{version}.tar.gz # dltests.sh is used to do this, and is included in this repository. Source1: tests-v%{version}.tar.bz2 -Patch0: https://patch-diff.githubusercontent.com/raw/oscarotero/Gettext/pull/230.patch - BuildRequires: dos2unix %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(gettext/languages) >= 2.3.0 with php-composer(gettext/languages) < 3) @@ -63,7 +61,6 @@ Autoloader: %{_datadir}/php/Gettext/autoload.php %prep %setup -a1 -n Gettext-%{version} -%patch0 -p1 # The documentation has the wrong newline codes dos2unix *.md @@ -96,7 +93,8 @@ cp -ar src/* %{buildroot}/%{_datadir}/php/Gettext/ %check -sed -i "s:include_once.*:\ninclude_once '%{buildroot}/%{_datadir}/php/Gettext/autoload.php';:" tests/bootstrap.php +# Upstream no longer contains tests/bootstrap.php file +#sed -i "s:include_once.*:\ninclude_once '%{buildroot}/%{_datadir}/php/Gettext/autoload.php';:" tests/bootstrap.php # gettext has some optional dependencies that we are not integrating with at this time (we can later # if desired). Thus, we need to skip the tests on these integration points since they will fail @@ -107,7 +105,7 @@ sed -i "s:include_once.*:\ninclude_once '%{buildroot}/%{_datadir}/php/Gettext/au ret=0 for cmd in php php71 php72 php73 php74; do if which $cmd; then - $cmd %{_bindir}/phpunit --bootstrap tests/bootstrap.php --filter ^\(\(?!\(testBlade\|testTwig\)\).\)*$ tests + $cmd %{_bindir}/phpunit --bootstrap %{buildroot}/%{_datadir}/php/Gettext/autoload.php tests fi done exit $ret @@ -124,6 +122,9 @@ exit $ret %changelog +* Fri Jul 24 2020 Sundeep Anand <suanand@fedoraproject.org> - 5.5.1-1 +- update to 5.5.1 (#1768669) + * Thu Oct 10 2019 Remi Collet <remi@remirepo.net> - 4.7.0-2 - update to 4.7.0 - use range dependencies |