Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonFile::__toString() must return a string value #193

Closed
rela1470 opened this issue Apr 18, 2016 · 3 comments
Closed

JsonFile::__toString() must return a string value #193

rela1470 opened this issue Apr 18, 2016 · 3 comments

Comments

@rela1470
Copy link

Collect git info Catchable fatal error.

JsonFile::__toString() must return a string value

My preparations are not enough?

Runtime: PHP 5.5.33 with Xdebug 2.4.0

{
    "repositories": [
    ],
    "require": {
        "pear/pear": "dev-master",
        "pear/log": "*@stable",
        "pear/http_request2": "v2.3.0"
    },
    "require-dev": {
        "phpunit/phpunit": "4.8.23",
        "satooshi/php-coveralls": "dev-master"
    },
    "include-path": [
        "vendor/pear/http_request2"
    ]
}
Coverage:   1.95% (2553/131215)
Collect git info
Read environment variables
Dump submitting json file: /Users/Watanabe/work/multi/system/addon/rave/build/logs/coveralls-upload.json
PHP Catchable fatal error:  Method Satooshi\Bundle\CoverallsV1Bundle\Entity\JsonFile::__toString() must return a string value in /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Api/Jobs.php on line 117
PHP Stack trace:
PHP   1. {main}() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/bin/coveralls:0
PHP   2. Symfony\Component\Console\Application->run() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/bin/coveralls:22
PHP   3. Symfony\Component\Console\Application->doRun() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Application.php:117
PHP   4. Symfony\Component\Console\Application->doRunCommand() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Application.php:186
PHP   5. Symfony\Component\Console\Command\Command->run() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Application.php:791
PHP   6. Satooshi\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->execute() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Command/Command.php:256
PHP   7. Satooshi\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->executeApi() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:114
PHP   8. Satooshi\Bundle\CoverallsV1Bundle\Repository\JobsRepository->persist() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:161
PHP   9. Satooshi\Bundle\CoverallsV1Bundle\Repository\JobsRepository->dumpJsonFile() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Repository/JobsRepository.php:67
PHP  10. Satooshi\Bundle\CoverallsV1Bundle\Api\Jobs->dumpJsonFile() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Repository/JobsRepository.php:138
PHP  11. file_put_contents() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Api/Jobs.php:117

Catchable fatal error: Method Satooshi\Bundle\CoverallsV1Bundle\Entity\JsonFile::__toString() must return a string value in /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Api/Jobs.php on line 117

Call Stack:
    0.0002     227296   1. {main}() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/bin/coveralls:0
    0.0164    1632896   2. Symfony\Component\Console\Application->run() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/bin/coveralls:22
    0.0205    2009776   3. Symfony\Component\Console\Application->doRun() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Application.php:117
    0.0207    2010744   4. Symfony\Component\Console\Application->doRunCommand() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Application.php:186
    0.0207    2011288   5. Symfony\Component\Console\Command\Command->run() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Application.php:791
    0.0211    2015776   6. Satooshi\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->execute() /Users/Watanabe/work/multi/system/addon/rave/vendor/symfony/console/Command/Command.php:256
    0.0324    3062584   7. Satooshi\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->executeApi() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:114
    0.0382    3701040   8. Satooshi\Bundle\CoverallsV1Bundle\Repository\JobsRepository->persist() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:161
    3.5431   48444272   9. Satooshi\Bundle\CoverallsV1Bundle\Repository\JobsRepository->dumpJsonFile() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Repository/JobsRepository.php:67
    3.5432   48444376  10. Satooshi\Bundle\CoverallsV1Bundle\Api\Jobs->dumpJsonFile() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Repository/JobsRepository.php:138
    3.5432   48444424  11. file_put_contents() /Users/Watanabe/work/multi/system/addon/rave/vendor/satooshi/php-coveralls/src/Satooshi/Bundle/CoverallsV1Bundle/Api/Jobs.php:117
@BrunoSpy
Copy link

BrunoSpy commented Aug 3, 2016

Did you find a solution ?

I have the same issue : https://travis-ci.org/BrunoSpy/epeires2/jobs/149427714

@bgaillard
Copy link

Hi, we also encountered the problem today and debugged it.

In fact the problem comes from an encoding problem on source files, we encounter it in files saved by one of our developer using an ANSI encoding.

To solve the problem we saved all our source files again using UTF-8 without BOM and now we do not have any problem anymore.

I do not have time for now to write a PR to fix this problem or display a warning / error in case one file has a bad encoding.

But I think this can now be reproduced easily by writting only one source file in ANSI encoding and running coveralls in CLI and local mode.

Hope this helps.

@keradus
Copy link
Member

keradus commented May 16, 2018

ref #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants