Swat improvements#180
Draft
cviebrock wants to merge 31 commits into
Draft
Conversation
It makes the provider classes look bloated
Moving the logic into the formatting classes themselves keeps SwatI18NLocale cleaner. Also, ensure that the overrideable properties are defined correctly, with typing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
silverorange/concentraterequirement to^3.0.0SwatNumber::roundUp()andSwatNumber::roundToEven()methods by switching to native PHPround()withPHP_ROUND_HALF_UP/PHP_ROUND_HALF_EVENflagsSwatNumber::ordinal()and only use ICU-methods since theintlextension is required by the packageSwatDBEnumMapper(was using@templateincorrectly)SwatDBRangeclassSwatI18N*classesSwatI18NLocale::get()where valid locales would get cached, and then could get returned for invalid lookupsSwatI18NLocale::formatCurrency()SwatI18NLocale::roundToEven()toSwatNumber::roundToEven()instead of reimplementing itSwatI18NLocale::getFractionalPrecision()where, if the underlying system local used a comma as a decimal separator, the precision was incorrectly returnedSwatI18NNumberFormat(and thereforeSwatI18NCurrencyFormat) no longer extendSwatObject, so no longer have need for a__toString()methodNew Features
SwatDBRecordsetWrappershould now properly infer the type of it's records if marked up correctly. Child classes should add the following notation to the class-level docblock:where
XXXis the class being wrapped. For example, aChapterWrapperclass would look like:Potential Breaking Changes
SwatDB::getGroupedOptionArray()andSwatDB::initArray()may require downstream changesSwatDBDataObjectmethods; downstream overrides should be checked that they conform:hasSubDataObject($key): boolsetDatabase(MDB2_Driver_Common $db, array $set = []): voidsave(): void(fromSwatDBRecordable)load(mixed $id): bool(fromSwatDBRecordable)delete(): void(fromSwatDBRecordable)isModified(): bool(fromSwatDBRecordable)checkDB(): voidsetFlushableCache(SwatDBCacheNsFlushable $cache): void(fromSwatDBFlushable)marshall(array $tree = []): array(fromSwatDBMarshallable)unmarshall(array $data = []): void(fromSwatDBMarshallable)getSerializableSubDataObjects(): arraygetSerializablePrivateProperties(): array