wapmorgan / Morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time intervals. / Морфологическая библиотека для английского и русского языков. Склоняет имена собственные, названия географических объектов, склонение и плюрализация имен собственных и другое.
http://wapmorgan.github.io/Morphos/
MIT License
784 stars 103 forks source link

How to upgrade Morphos without breaking the code? #143

Open duzun opened 9 months ago

duzun commented 9 months ago

Hi, I'm using Morphos for many years in one project. I thought it is using the semver convention. But a minor version upgrade from 3.2.26 to 3.2.27 broke my project.

It removed morphos\Russian\NounPluralization::$consonants and morphos\Russian\NounDeclension::getAllCases(), which both were public.

How do you recommend to use and upgrade Morphos?

Thank you, Dumitru

wapmorgan commented 7 months ago

It moved to \morphos\Russian\RussianLanguage::$consonants and \morphos\Russian\NounDeclension::getCases respectively

duzun commented 7 months ago

Thanks for the details.

My question is more about the process of upgrading over time without breaking the depending project. If this project is following semver, upgrading only the minor version should not break anything. If this project is not following semver, then I'd pin it's version in my comopser.json and avoid updates.

wapmorgan commented 7 months ago

@duzun thanks for attention at this problem. Firstly, I try to release with semver, but only for public and documented (= listed in README-files) functions. Both of them ($consonants and getAllCases) were members of trait RussianLanguage, used in all russian classes. Since 3.2.27 they became just classes, and there is not option to access them via any russian-language classes.

Secondly, both of them are proposed for internal usage. Unfortunately there is not package access mode (like in Java).

So, If you use any of functions documented in README's, so I do my best to guarantee semver for them. (If not, please point me). For any other functions, there's no guarantees.