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

Implement undefined method in Encoding class #378

Merged
merged 5 commits into from Dec 25, 2020
Merged

Implement undefined method in Encoding class #378

merged 5 commits into from Dec 25, 2020

Conversation

tomlutzenberger
Copy link
Contributor

The __toString method was missing/not implemented, even though it is called in some cases.

Fixes #364

The __toString method was missing/not implemented, even though it is called in some cases.

Fixes #364
Copy link
Collaborator

@k00ni k00ni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomlutzenberger Thank you for your contribution!

Can you please fix coding style issues (run vendor/bin/php-cs-fixer fix) and add at least one test, which demonstrates the original problem and your fix?

@tomlutzenberger
Copy link
Contributor Author

I fixed the issues but was not able to even run the existing tests. It seems PHPUnit is not a dependency and is therefore not found in PHPStorm.
Do I miss something here?

@k00ni
Copy link
Collaborator

k00ni commented Dec 23, 2020

We use symfony/phpunit-bridge which allows us to run PHPUnit on PHP 5.6 - 7.4. You can run tests locally by executing vendor/bin/simple-phpunit. It will install PHPUnit in a sub-folder and run tests. Might need to set <env name="SYMFONY_PHPUNIT_VERSION" value="7.5"/> in phpunit.xml though.

@tomlutzenberger
Copy link
Contributor Author

It's hard to understand the logic in the Font class without any method documentation, especially the character translation and encoding part. Even though I spent almost all day to get the tests up and running, I wasn't able to write a test due to lack of knowledge about the structure of PDF files 😞

Copy link
Collaborator

@k00ni k00ni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty and added a few tests which proof your fix is working. Looks good now. Thank you for your effort.

@k00ni k00ni merged commit a4bb6d2 into smalot:master Dec 25, 2020
@tomlutzenberger tomlutzenberger deleted the fix-undefined-encoding-method branch December 27, 2020 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call to undefined method Smalot\PdfParser\Encoding::__toString()
2 participants