php-array-table icon indicating copy to clipboard operation
php-array-table copied to clipboard

Fix array to string conversion warning

Open 8ctopus opened this issue 3 months ago • 1 comments

Without the fix:

PHPUnit 10.5.55 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.11 with Xdebug 3.4.0beta1
Configuration: K:\dev\github\php-array-table\phpunit.xml

D........W..                                                      12 / 12 (100%)

Time: 00:00.526, Memory: 12.00 MB

1 test triggered 2 PHP warnings:

1) K:\dev\github\php-array-table\src\ArrayToTextTable.php:133
foreach() argument must be of type array|object, string given

Triggered by:

* SimpleTest::testCorrectBuilding#3
  K:\dev\github\php-array-table\tests\SimpleTest.php:20

2) K:\dev\github\php-array-table\src\ArrayToTextTable.php:158
foreach() argument must be of type array|object, string given

Triggered by:

* SimpleTest::testCorrectBuilding#3
  K:\dev\github\php-array-table\tests\SimpleTest.php:20

OK, but there were issues!
Tests: 12, Assertions: 12, Warnings: 2, PHPUnit Deprecations: 9.

Generating code coverage report in HTML format ... done [00:00.778]

8ctopus avatar Sep 22 '25 07:09 8ctopus