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

Added PHP export #409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dimitar-kunchev
Copy link

Additional exporter to a PHP array. Keys are the cod of the country, although I am not entirely sure if that is the best approach.

public function convert()
{
array_walk($this->countries, [$this, 'processCountry']);
return $this->prefix . "\n" . implode(",\n",$this->bodyChunks) . "\n" . $this->suffix;
Copy link
Owner

Choose a reason for hiding this comment

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

You should use the var_export function which produces a parsable string representation of a variable, that is what you want here.

Copy link
Owner

Choose a reason for hiding this comment

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

@dimitar-kunchev what do you think?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry I forgot about that PR. Yes, var_export should do the trick.

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

Successfully merging this pull request may close these issues.

2 participants