Skip to content

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