php-gettext / Gettext

PHP library to collect and manipulate gettext (.po, .mo, .php, .json, etc)
MIT License
687 stars 134 forks source link

Make it easier to extend scanning classes #235

Closed schlessera closed 4 years ago

schlessera commented 4 years ago

The FunctionsScanner and StringReader classes are directly referenced in the pieces of logic that use them. If you want to extend one of these, you have to duplicate a big chunk of logic just to change the class reference for the new call.

This PR extracts the class name into a protected static property that can be changed in extending classes, to avoid the need to copy-paste big chunks of logic when they need to be changed.

Related issue: #231