Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Printer "pExpr_List" does not exist #22

Closed
firchtsai opened this issue Sep 28, 2015 · 9 comments
Closed

Printer "pExpr_List" does not exist #22

firchtsai opened this issue Sep 28, 2015 · 9 comments
Assignees
Labels

Comments

@firchtsai
Copy link

You guys did a really cool tool!

But I got some errors when I try to convert Doctrine 1.2.5 on PHP 7
https://github.com/doctrine/doctrine1

Please help!

first error:
Could not convert file "source/Doctrine/Connection/UnitOfWork.php" cause : Printer "pExpr_List" does not exist /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Dispatcher.php 117

fallowing the seconed error:
Fatal error: Uncaught TypeError: Argument 1 passed to PhpParser\Node\Stmt\If_::construct() must be an instance of PhpParser\Node\Expr, null given, called in /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php on line 108 and defined in /root/php-to-zephir/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If.php:28
Stack trace:
#0 /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php(108): PhpParser\Node\Stmt\If
->construct(NULL, Array)
#1 /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php(36): PhpToZephir\Converter\Printer\Stmt\SwitchPrinter->convertSwitchToIfelse(Object(PhpParser\Node\Stmt\Switch
))
#2 [internal function]: PhpToZephir\Converter\Printer\Stmt\SwitchPrinter->convert(Object(PhpParser\Node\Stmt\Switch
))
#3 /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Dispatcher.php(92): call_user_func_array(Array, Array)
#4 /root/php-to-z in /root/php-to-zephir/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php on line 28

@fezfez fezfez self-assigned this Sep 28, 2015
@fezfez fezfez added the bug label Sep 28, 2015
@fezfez
Copy link
Owner

fezfez commented Sep 28, 2015

Hi !

Thanks for the report, i'll take that.

fezfez added a commit that referenced this issue Sep 28, 2015
@fezfez
Copy link
Owner

fezfez commented Sep 28, 2015

I've fixed the "Printer "pExpr_List" does not exist" in master but i cant reproduce the fatal. Can you identify the class who cause the fatal and paste the code here ?

Thanks !

@fezfez
Copy link
Owner

fezfez commented Sep 28, 2015

As i understand, this is a "switch" who provoke the fatal

@fezfez
Copy link
Owner

fezfez commented Sep 28, 2015

You can add "--debug" to identify where the fatal appear

@firchtsai
Copy link
Author

Thanks for your fast reply!

After I add "--debug" and run again, I got these errors:

[PhpToZephir\Converter\Manipulator\ArrayManipulator::findComplexArrayDimFetch 40 Non supported funccall in array] line "61" class "Doctrine_Hydrator_ScalarDriver"


[pExpr_List] line "242" class "Doctrine\Doctrine_Connection_UnitOfWork"
Could not convert file "source/Doctrine/Connection/UnitOfWork.php" cause : Printer "pExpr_List" does not exist /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Dispatcher.php 117


Fatal error: Uncaught TypeError: Argument 1 passed to PhpParser\Node\Stmt\If_::construct() must be an instance of PhpParser\Node\Expr, null given, called in /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php on line 108 and defined in /root/php-to-zephir/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If.php:28
Stack trace:
#0 /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php(108): PhpParser\Node\Stmt\If
->construct(NULL, Array)
#1 /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php(36): PhpToZephir\Converter\Printer\Stmt\SwitchPrinter->convertSwitchToIfelse(Object(PhpParser\Node\Stmt\Switch
))
#2 [internal function]: PhpToZephir\Converter\Printer\Stmt\SwitchPrinter->convert(Object(PhpParser\Node\Stmt\Switch
))
#3 /root/php-to-zephir/vendor/fezfez/php-to-zephir/src/PhpToZephir/Converter/Dispatcher.php(92): call_user_func_array(Array, Array)
#4 /root/php-to-z in /root/php-to-zephir/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php on line 28

@fezfez
Copy link
Owner

fezfez commented Sep 29, 2015

Can you retry with dev-master ?

@firchtsai
Copy link
Author

I retry with dev-maste, and pExpr_List error gone!
Thank you very much!

But I still got this error:
[PhpToZephir\Converter\Manipulator\ArrayManipulator::findComplexArrayDimFetch 40 Non supported funccall in array] line "61" class "Doctrine_Hydrator_ScalarDriver"

What should I do to bypass it?

@fezfez
Copy link
Owner

fezfez commented Sep 29, 2015

You can use the version 0.2.1 with the support of pExpr_List

I open a new issue for func call in array (see #23).

Thanks for your help !

@fezfez fezfez closed this as completed Sep 29, 2015
@quickshiftin
Copy link

@fezfez I'm still getting this error. I don't see a Printer class for pExpr_List in the src/PhpToZephir/Converter/Printer directory of the project.

I've checked on master & 0.2.1. What is a pExpr_List referring to in PHP? I might be able to crank out the Printer class if I know.

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

No branches or pull requests

3 participants