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

Trying to get property on a non-object when parsing a list in short array syntax #506

Open
greg0ire opened this issue Jan 25, 2019 · 0 comments

Comments

@greg0ire
Copy link
Contributor

Q A
Bundle version 1.4.3
Symfony version 4.1.9
PHP version 7.1

Expected behavior

No crash

Actual behavior

In FormExtractor.php line 169:
                                                
  [ErrorException]                              
  Notice: Trying to get property of non-object  
                                                

Exception trace:
 () at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/Extractor/File/FormExtractor.php:169
 JMS\TranslationBundle\Translation\Extractor\File\FormExtractor->getDomain() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/Extractor/File/FormExtractor.php:119
 JMS\TranslationBundle\Translation\Extractor\File\FormExtractor->enterNode() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:123
 PhpParser\NodeTraverser->traverseNode() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:146
 PhpParser\NodeTraverser->traverseNode() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
 PhpParser\NodeTraverser->traverseArray() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
 PhpParser\NodeTraverser->traverseNode() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
 PhpParser\NodeTraverser->traverseArray() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
 PhpParser\NodeTraverser->traverseNode() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
 PhpParser\NodeTraverser->traverseArray() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
 PhpParser\NodeTraverser->traverseNode() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
 PhpParser\NodeTraverser->traverseArray() at /app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:91
 PhpParser\NodeTraverser->traverse() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/Extractor/File/FormExtractor.php:452
 JMS\TranslationBundle\Translation\Extractor\File\FormExtractor->visitPhpFile() at n/a:n/a
 call_user_func_array() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/Extractor/FileExtractor.php:235
 JMS\TranslationBundle\Translation\Extractor\FileExtractor->extract() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/ExtractorManager.php:137
 JMS\TranslationBundle\Translation\ExtractorManager->extract() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/Updater.php:253
 JMS\TranslationBundle\Translation\Updater->setConfig() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Translation/Updater.php:143
 JMS\TranslationBundle\Translation\Updater->process() at /app/vendor/jms/translation-bundle/JMS/TranslationBundle/Command/ExtractTranslationCommand.php:131
 JMS\TranslationBundle\Command\ExtractTranslationCommand->execute() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /app/src/ManoMano/TranslatorBundle/Command/SyncTranslationCommand.php:210
 ManoMano\TranslatorBundle\Command\SyncTranslationCommand->extractTranslations() at /app/src/ManoMano/TranslatorBundle/Command/SyncTranslationCommand.php:104
 ManoMano\TranslatorBundle\Command\SyncTranslationCommand->execute() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:911
 Symfony\Component\Console\Application->doRunCommand() at /app/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:89
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:262
 Symfony\Component\Console\Application->doRun() at /app/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:145
 Symfony\Component\Console\Application->run() at /app/bin/console:27

Steps to reproduce

Use a short list syntax, like this:
[,$b, $c] = [41, 42, 43]

The long list syntax (list(,$b, $c) = [41, 42, 43]) works.

arnaud-lb added a commit to arnaud-lb/JMSTranslationBundle that referenced this issue Jul 9, 2019
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

1 participant