zendframework / zend-i18n

I18n component from Zend Framework
BSD 3-Clause "New" or "Revised" License
65 stars 49 forks source link

PHP 7.4compatibility #113

Closed trasher closed 5 years ago

trasher commented 5 years ago

Running on PHP 7.4 (which has reached RC1 last week), depreciations are shown.

Expected results

Works with php 7.4

For the error I've seen, the fix should be:

--- ./src/Translator/Loader/Gettext.php.patch   2019-09-09 10:01:11.452282178 +0200
+++ ./src/Translator/Loader/Gettext.php 2019-09-09 10:03:33.676984850 +0200
@@ -139,7 +139,7 @@ class Gettext extends AbstractFileLoader
         }

         // Read header entries
-        if (array_key_exists('', $textDomain)) {
+        if ($textDomain->offsetExists('')) {
             $rawHeaders = explode("\n", trim($textDomain['']));

             foreach ($rawHeaders as $rawHeader) {
michalbundyra commented 5 years ago

Fixed in #122