-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Migration faux pas #481
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I assume this is is still an issue... |
Indeed nothing was done to improve the situation. A PR would be very welcome if you have time. |
Hope my PR is sufficient. Let me know. This bug was affecting me directly also. |
This is:
The migration tool does a number of somewhat dumb, unexpected things.
What is the expected behavior?
As far as it can, the migration tool should make the changes necessary to move from PHPExcel to PHPSpreadsheet, but no more.
What is the current behavior?
The migration makes some changes that are inadvisable and easily avoided.
It appears to do a blanket global replacement of
PHPExcel
with\PhpOffice\PhpSpreadsheet\Spreadsheet
, but this includes places that this change should not be made, causing breakages. For example, I had a private property that held a PHPExcel instance, and it did this:became:
Which is not even valid PHP.
The instructions for the migration suggest running it in the project root, which includes the vendor folder - so the migration is applied to the installed PHPExcel package, and also makes changes to PHPSpreadsheet package wherever it happens to mention PHPExcel.
The migration should not touch anything in a
vendor
folder.What are the steps to reproduce?
You don't even need any code to demonstrate this; an empty project is enough:
The output shows that it has made changes to both the PHPExcel and PHPSpreadsheet files (excerpt):
Note that this also applies the replacements in non-PHP files, which is quite unnecessary.
Which versions of PhpSpreadsheet and PHP are affected?
I'm using PHPExcel 1.8.1 and PHPSpreadsheet 1.2.1. It probably affects others.
As far as I can see, the current blanket search and replace mechanism is extremely unlikely to produce working code, and probably causes more problems than it solves. The matches and replacements could be made much more specific, or better still, be based on an AST search rather than simple text.
The text was updated successfully, but these errors were encountered: