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

strtolower() expects parameter 1 to be string, object given #544

Closed
TheRatG opened this issue Jun 23, 2020 · 3 comments
Closed

strtolower() expects parameter 1 to be string, object given #544

TheRatG opened this issue Jun 23, 2020 · 3 comments
Labels

Comments

@TheRatG
Copy link
Contributor

TheRatG commented Jun 23, 2020

Q A
Bundle version 1.5.4
Symfony version 4.4
PHP version 7.3

Actual behavior

  "exception" => TypeError {
    #message: "strtolower() expects parameter 1 to be string, object given"
    #code: 0
    #file: "./vendor/jms/translation-bundle/Translation/Extractor/File/FormExtractor.php"
    #line: 357
    trace: {
      ./vendor/jms/translation-bundle/Translation/Extractor/File/FormExtractor.php:357 { …}
      ./vendor/jms/translation-bundle/Translation/Extractor/File/FormExtractor.php:111 { …}
      ./vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:123 { …}
      ./vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:146 { …}

Steps to reproduce

Form

translation:extract en -vvv

How to fix

Add string convert

if (!isset($returningMethods[strtolower((string)$var->name)])) {
@goetas
Copy link
Collaborator

goetas commented Jun 24, 2020

Hi, indeed that seems the right fix. Can you make a pull request for it? (editing

if (!isset($returningMethods[strtolower($var->name)])) {
?)

@goetas goetas added the bug label Jun 24, 2020
@TheRatG
Copy link
Contributor Author

TheRatG commented Jun 27, 2020

Hi, indeed that seems the right fix. Can you make a pull request for it? (editing

#545

goetas added a commit that referenced this issue Jun 27, 2020
strtolower() expects parameter 1 to be string, object given Issue #544
@goetas
Copy link
Collaborator

goetas commented Jun 27, 2020

Solved in #545

@goetas goetas closed this as completed Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants