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

Fix ParserInterface implementations #120

Merged
merged 7 commits into from
Mar 30, 2019
Merged

Fix ParserInterface implementations #120

merged 7 commits into from
Mar 30, 2019

Conversation

equinoxmatt
Copy link
Contributor

@equinoxmatt equinoxmatt commented Feb 20, 2019

All the parsers (except ini) were not compliant with the ParserInterface. Most of them returned array|null, rather than array defined in the interface. Rather than fixing the parsers, (array) casts were being used in the consuming code (Config).

This PR:

  • Makes all parsers compliant with the ParserInterface.
  • Returns empty array in cases where null is returned from the parser parse() function.
  • Removes (array) casting.
  • General cleanup (remove unused params, docblocks etc).

@equinoxmatt equinoxmatt changed the title Fix parserinterface implementations Fix ParserInterface implementations Feb 20, 2019
@filips123 filips123 self-requested a review March 25, 2019 18:23
Copy link
Collaborator

@filips123 filips123 left a comment

Choose a reason for hiding this comment

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

It would probably be better to use array casting instead of ternary operators in all parsers. It would be cleaner and only one line instead of two.

So code will be:

return (array) $this->parse($data, $filename);

@equinoxmatt
Copy link
Contributor Author

It would probably be better to use array casting instead of ternary operators in all parsers. It would be cleaner and only one line instead of two.

So code will be:

return (array) $this->parse($data, $filename);

@filips123 I have addressed your comments now 👍

@filips123 filips123 merged commit 7440903 into hassankhan:develop Mar 30, 2019
@filips123
Copy link
Collaborator

Thanks!

@DavidePastore DavidePastore added this to the 2.0.2 milestone Dec 7, 2020
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.

None yet

3 participants