Details

    Description

      PDO MySQL driver returns integers and floats

      Integers and floats in result sets will now be returned using native PHP types instead of strings when using emulated prepared statements.

      This effects test artifacts with string API responses like testSegmentEditing-assert-seg3.json property metaCache:
      fakeSegId_3\":{\"nr\":\"3\" will become fakeSegId_3\":{\"nr\":3

      Potentially many more parts can be affected, so this has to be checked carefully.
      Especially places where === is used to compare against a DB response.

      Classes implementing PHP built-in interfaces must specify return type

      Most of the PHP internal classes are updated with tentative (=preliminary) return types [which ...] will be enforced since PHP 9.0.

      PHP 8.1 and later emits a deprecation notice if a class declaration has an incompatible return type and lack of a return type declaration is also considered a return type mismatch.

      This affects mainly zf1-future. In this PR the needed return types are added.

      Passing null to non-nullable internal function parameters is deprecated

      • preg_match(... string $subject)
      • file_get_contents( ... bool $use_include_path)
      • String functions: trim, str_replace, substr, ...

       

      fix deprecation messages

      [30-Nov-2023 Europe/Berlin] PHP Warning:  Undefined array key "tmgr:matchratio" in /var/www/translate5/application/modules/editor/src/Task/Import/FileParser/Xlf/Namespaces/Tmgr.php on line 53
      [30-Nov-2023 Europe/Berlin] PHP Warning:  Undefined array key "translate5:maxNumberOfLines" in /var/www/translate5/application/modules/editor/src/Task/Import/FileParser/Xlf/Namespaces/Translate5.php on line 65
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/translate5/library/ZfExtended/Worker/Abstract.php on line 581
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  ucfirst(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/translate5/application/modules/editor/Models/Export/Exported/Worker.php on line 57

      fixing by updating vendors

      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of Alchemy\BinaryDriver\Configuration::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php on line 26
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of Alchemy\BinaryDriver\Configuration::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php on line 79
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of Alchemy\BinaryDriver\Configuration::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php on line 87
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of Alchemy\BinaryDriver\Configuration::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php on line 95
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of Alchemy\BinaryDriver\Configuration::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php on line 103
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of PHPHtmlParser\Dom\Node\Collection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange]
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of QueryPath\CSS\Selector::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/querypath/QueryPath/src/QueryPath/CSS/Selector.php on line 76
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of QueryPath\CSS\Selector::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/querypath/QueryPath/src/QueryPath/CSS/Selector.php on line 61
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of QueryPath\DOMQuery::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/querypath/QueryPath/src/QueryPath/DOMQuery.php on line 367
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of QueryPath\DOMQuery::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/querypath/QueryPath/src/QueryPath/DOMQuery.php on line 3988
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  Return type of QueryPath\QueryPathIterator::current() should either be compatible with IteratorIterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/querypath/QueryPath/src/QueryPath/QueryPathIterator.php on line 22
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Db/Statement.php on line 212
      [30-Nov-2023 Europe/Berlin] PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/translate5/vendor/querypath/QueryPath/src/QueryPath/DOMQuery.php on line 100
      attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/Collection.php on line 133
       
       
       

       

      Attachments

        Issue Links

          Activity

            [TRANSLATE-2782] PHP 8.1 Compability
            aleksandar Aleksandar Mitrev added a comment - - edited

            When running test i get this error msg in 8.1:

            PHP Deprecated:  Return type of Zend_Controller_Action_HelperBroker_PriorityStack::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Controller/Action/HelperBroker/PriorityStack.php on line 91
            PHP Stack trace:
            PHP   1. {main}() /var/www/translate5/vendor/phpunit/phpunit/phpunit:0
            PHP   2. PHPUnit\TextUI\Command::main($exit = *uninitialized*) /var/www/translate5/vendor/phpunit/phpunit/phpunit:92
            PHP   3. PHPUnit\TextUI\Command->run($argv = [0 => '/usr/bin/phpunit', 1 => '--colors', 2 => '--verbose', 3 => '--cache-result-file', 4 => '/var/www/translate5/application/modules/editor/testcases/.phpunit.result.cache', 5 => '--include-path', 6 => '/var/www/translate5/application:/var/www/translate5/library:/var/www/translate5/vendor:/var/www/translate5/application/modules/editor/:.:/var/www/translate5/vendor/shardj/zf1-future/library/:/usr/share/php5:/usr/share/php', 7 => '--bootstrap', 8 => 'bootstrap.php', 9 => 'editorAPI/Translate2375Test.php'], $exit = TRUE) /var/www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:96
            PHP   4. PHPUnit\TextUI\Command->handleArguments($argv = [0 => '/usr/bin/phpunit', 1 => '--colors', 2 => '--verbose', 3 => '--cache-result-file', 4 => '/var/www/translate5/application/modules/editor/testcases/.phpunit.result.cache', 5 => '--include-path', 6 => '/var/www/translate5/application:/var/www/translate5/library:/var/www/translate5/vendor:/var/www/translate5/application/modules/editor/:.:/var/www/translate5/vendor/shardj/zf1-future/library/:/usr/share/php5:/usr/share/php', 7 => '--bootstrap', 8 => 'bootstrap.php', 9 => 'editorAPI/Translate2375Test.php']) /var/www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:111
            PHP   5. PHPUnit\TextUI\Command->handleBootstrap($filename = 'bootstrap.php') /var/www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:401
            PHP   6. PHPUnit\Util\FileLoader::checkAndLoad($filename = 'bootstrap.php') /var/www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:562
            PHP   7. PHPUnit\Util\FileLoader::load($filename = '/var/www/translate5/application/modules/editor/testcases/bootstrap.php') /var/www/translate5/vendor/phpunit/phpunit/src/Util/FileLoader.php:49
            PHP   8. include_once() /var/www/translate5/vendor/phpunit/phpunit/src/Util/FileLoader.php:65
            PHP   9. Zend_Application->bootstrap($resource = *uninitialized*) /var/www/translate5/application/modules/editor/testcases/bootstrap.php:61
            PHP  10. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap($resource = NULL) /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application.php:373
            PHP  11. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap($resource = NULL) /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/BootstrapAbstract.php:598
            PHP  12. Zend_Application_Bootstrap_BootstrapAbstract->_executeResource($resource = 'layout') /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/BootstrapAbstract.php:638
            PHP  13. Zend_Application_Resource_Layout->init() /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/BootstrapAbstract.php:695
            PHP  14. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap($resource = 'FrontController') /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Resource/Layout.php:54
            PHP  15. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap($resource = 'FrontController') /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/BootstrapAbstract.php:598
            PHP  16. Zend_Application_Bootstrap_BootstrapAbstract->_executeResource($resource = 'FrontController') /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/BootstrapAbstract.php:641
            PHP  17. Zend_Application_Resource_Frontcontroller->init() /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/BootstrapAbstract.php:695
            PHP  18. Zend_Application_Resource_Frontcontroller->getFrontController() /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Resource/Frontcontroller.php:53
            PHP  19. Composer\Autoload\ClassLoader->loadClass($class = 'Zend_Controller_Front') /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Resource/Frontcontroller.php:175
            PHP  20. Composer\Autoload\includeFile($file = '/var/www/translate5/vendor/composer/../shardj/zf1-future/library/Zend/Controller/Front.php') /var/www/translate5/vendor/composer/ClassLoader.php:428
            PHP  21. include() /var/www/translate5/vendor/composer/ClassLoader.php:571
            PHP  22. require_once() /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Controller/Front.php:27
            PHP  23. require_once() /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Controller/Action/HelperBroker.php:26
            
            
            aleksandar Aleksandar Mitrev added a comment - - edited When running test i get this error msg in 8.1: PHP Deprecated: Return type of Zend_Controller_Action_HelperBroker_PriorityStack::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Controller/Action/HelperBroker/PriorityStack.php on line 91 PHP Stack trace: PHP 1. {main}() / var /www/translate5/vendor/phpunit/phpunit/phpunit:0 PHP 2. PHPUnit\TextUI\Command::main($exit = *uninitialized*) / var /www/translate5/vendor/phpunit/phpunit/phpunit:92 PHP 3. PHPUnit\TextUI\Command->run($argv = [0 => '/usr/bin/phpunit' , 1 => '--colors' , 2 => '--verbose' , 3 => '--cache-result-file' , 4 => '/ var /www/translate5/application/modules/editor/testcases/.phpunit.result.cache' , 5 => '--include-path' , 6 => '/ var /www/translate5/application:/ var /www/translate5/library:/ var /www/translate5/vendor:/ var /www/translate5/application/modules/editor/:.:/ var /www/translate5/vendor/shardj/zf1- future /library/:/usr/share/php5:/usr/share/php' , 7 => '--bootstrap' , 8 => 'bootstrap.php' , 9 => 'editorAPI/Translate2375Test.php' ], $exit = TRUE) / var /www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:96 PHP 4. PHPUnit\TextUI\Command->handleArguments($argv = [0 => '/usr/bin/phpunit' , 1 => '--colors' , 2 => '--verbose' , 3 => '--cache-result-file' , 4 => '/ var /www/translate5/application/modules/editor/testcases/.phpunit.result.cache' , 5 => '--include-path' , 6 => '/ var /www/translate5/application:/ var /www/translate5/library:/ var /www/translate5/vendor:/ var /www/translate5/application/modules/editor/:.:/ var /www/translate5/vendor/shardj/zf1- future /library/:/usr/share/php5:/usr/share/php' , 7 => '--bootstrap' , 8 => 'bootstrap.php' , 9 => 'editorAPI/Translate2375Test.php' ]) / var /www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:111 PHP 5. PHPUnit\TextUI\Command->handleBootstrap($filename = 'bootstrap.php' ) / var /www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:401 PHP 6. PHPUnit\Util\FileLoader::checkAndLoad($filename = 'bootstrap.php' ) / var /www/translate5/vendor/phpunit/phpunit/src/TextUI/Command.php:562 PHP 7. PHPUnit\Util\FileLoader::load($filename = '/ var /www/translate5/application/modules/editor/testcases/bootstrap.php' ) / var /www/translate5/vendor/phpunit/phpunit/src/Util/FileLoader.php:49 PHP 8. include_once() / var /www/translate5/vendor/phpunit/phpunit/src/Util/FileLoader.php:65 PHP 9. Zend_Application->bootstrap($resource = *uninitialized*) / var /www/translate5/application/modules/editor/testcases/bootstrap.php:61 PHP 10. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap($resource = NULL) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application.php:373 PHP 11. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap($resource = NULL) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Bootstrap/BootstrapAbstract.php:598 PHP 12. Zend_Application_Bootstrap_BootstrapAbstract->_executeResource($resource = 'layout' ) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Bootstrap/BootstrapAbstract.php:638 PHP 13. Zend_Application_Resource_Layout->init() / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Bootstrap/BootstrapAbstract.php:695 PHP 14. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap($resource = 'FrontController' ) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Resource/Layout.php:54 PHP 15. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap($resource = 'FrontController' ) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Bootstrap/BootstrapAbstract.php:598 PHP 16. Zend_Application_Bootstrap_BootstrapAbstract->_executeResource($resource = 'FrontController' ) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Bootstrap/BootstrapAbstract.php:641 PHP 17. Zend_Application_Resource_Frontcontroller->init() / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Bootstrap/BootstrapAbstract.php:695 PHP 18. Zend_Application_Resource_Frontcontroller->getFrontController() / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Resource/Frontcontroller.php:53 PHP 19. Composer\Autoload\ ClassLoader ->loadClass($class = 'Zend_Controller_Front' ) / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Application/Resource/Frontcontroller.php:175 PHP 20. Composer\Autoload\includeFile($file = '/ var /www/translate5/vendor/composer/../shardj/zf1- future /library/Zend/Controller/Front.php' ) / var /www/translate5/vendor/composer/ ClassLoader .php:428 PHP 21. include() / var /www/translate5/vendor/composer/ ClassLoader .php:571 PHP 22. require_once() / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Controller/Front.php:27 PHP 23. require_once() / var /www/translate5/vendor/shardj/zf1- future /library/Zend/Controller/Action/HelperBroker.php:26

            People

              tlauria Thomas Lauria
              tlauria Thomas Lauria
              Axel Becher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: