j0k3r / graby

Graby helps you extract article content from web pages
MIT License
363 stars 73 forks source link

Convert configuration to Value Object #284

Closed j0k3r closed 2 years ago

j0k3r commented 2 years ago

Mostly to enforce type of each parameter of a config. Also, enforce type for the input configuration using setAllowedTypes.

See https://github.com/j0k3r/graby/pull/283#pullrequestreview-849144036

Is it something like that you were talking about @jtojnar?

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.03%) to 95.035% when pulling bb954afd23fb4f86bbd3879d0c9900fc7263d398 on feature/config-as-value-object into 68aa2800a1fadff31f04a4981425ad40b77a49b3 on master.

jtojnar commented 2 years ago

Yeah, that looks about right. Once we bump to PHP 8, we will even be able to switch to named parameters and ditch options resolver altogether. And then with readonly properties, we won’t even need the getters.

j0k3r commented 2 years ago

I think I'm done @jtojnar, can you take a look? 🙏