Releases: salient-labs/toolkit
v0.21.0
Changed
-
Sync: rename
HydrationFlagtoHydrationPolicyand rework related methodsISyncContext:- Rename:
withHydrationFlags()->withHydrationPolicy()maybeApplyFilterPolicy()->applyFilterPolicy()getHydrationFlags()->getHydrationPolicy()
- Add:
online()offline()offlineFirst()getOffline()
ISyncEntityProvider:- Rename:
withoutResolvingDeferrals()->doNotResolve()withoutHydration()->doNotHydrate()withHydration()->hydrate()
- Add:
resolveEarly()resolveLate()offlineFirst()
SyncEntityProvider:- Track online/offline status in
ISyncContext - Remove deprecated
getFuzzyResolver()
- Rename:
v0.20.89
v0.20.88
v0.20.87
Added
- Sync: add
SyncInvalidRequestException
Changed
-
Sync: improve entity deferral and hydration
- Optionally limit hydration flag scope to a given depth
- Add
ISyncEntityProvider::withoutResolvingDeferrals(),withoutHydration()andwithHydration()to simplify manipulation of the underlying context Sync::deferredEntity(): ignore hydration flags in favour of deferral policySync::resolveDeferred(): resolve relationships first to take advantage of more entities per round trip- In
SyncEntityResolver::getByName(), catchSyncFilterPolicyViolationExceptionand make a second attempt without the filter - When resolving named parameters in
HttpSyncDefinition::runHttpOperation(), claim matching filters before checking for matching values, reversing the previous order
-
lk-util generate sync entity:- Generate sync entities with relationships and parent/child properties
- Allow properties in the reference entity to be skipped
- Treat entity properties with suffix
_idor_idsas relationships
-
Convert::valueToCode(): improve string escaping and add support for multiline arrays -
Declare
Builder::getTerminators()so subclasses don't need to
Removed
- Sync: remove dangerous
HydrationFlag::NO_FILTERoption
Fixed
- Sync: fix issue where deferred entities that are immediately resolved by the provider are not assigned to the variable originally passed by reference
- Sync: fix issue where checks are performed against the child of the intended context during entity and relationship deferral
- Sync: fix issue where hydration flags are incorrectly performed on the receiving entity
- Fix
CliCommand::getEffectiveArgument()issue where short arguments with name"0"are not returned correctly
v0.20.86
Added
-
Sync: implement hydration of relationships
- Add
HydrationFlag - Allow hydration flags to be applied to sync contexts globally or per-entity
- Implement suppressed, lazy, deferred and eager hydration of relationships
- Apply parent/child relationships via
addChild()/setParent() - Register entities with the entity store before processing deferred entities and relationships to prevent race conditions and infinite recursion
- Add magic methods to
DeferredSyncEntityfor on-demand resolution of deferred entities (similar to lazy hydration implemented viaIteratorAggregateinDeferredRelationship) - Add
Sync::resolveDeferred() - Allow deferred entities and relationships to be resolved via callback instead of assignment
- Store resolved entities and relationships in
DeferredSyncEntityandDeferredRelationshipso they can forward property actions and method calls until they go out of scope - Throw an exception if an attempt is made to resolve the same deferred entity or relationship multiple times
- In
Sync::resolveDeferredEntities(), remove attempt to resolve multiple entities viagetListA()in favour of resolving the first instance of each entity in its own context to ensure parent entities are surfaced to providers
- Add
-
Sync: add protected
DbSyncProvider::first()method to simplify retrieval of a single entity -
Add
Convert::toValue() -
Add
Test::isFloatValue()
Changed
-
Sync: simplify filter policy API
- Add
ISyncProvider::getFilterPolicy()so providers can specify a default without implementinggetDefinition() - Add
SyncProvider::run()to minimise the need for boilerplate safety checks in providers where sync operations are performed by declared methods
- Add
-
Sync: improve error reporting
- Remove
$toConsoleparameter fromSync::error() - Add
Sync::enableErrorReporting()anddisableErrorReporting() - Fix issue where output from
Sync::reportErrors()is not unescaped
- Remove
-
Sync: rename classes and methods:
DeferredSyncEntity->DeferredEntityDeferredSyncEntityPolicy->DeferralPolicySyncFilterPolicy->FilterPolicySync::getDeferredEntityCheckpoint()->getDeferralCheckpoint()ISyncContext::withDeferredSyncEntityPolicy()->withDeferralPolicy()ISyncContext::getDeferredSyncEntityPolicy()->getDeferralPolicy()
-
Add optional
$countparameter toConsole::message{,Once}() -
DbConnector: useDB2CODEPAGEto enable UTF-8 before connecting to Db2 -
DbSyncProvider: remove UTF-8 locale assertion -
Convert/Test: accept leading and trailing spaces in integer and boolean strings
Removed
- Remove unused entity deferral methods from
SyncEntityandSyncEntityProvider - Remove references to
DeferredSyncEntity::$Entity's unsupported nullability
Fixed
- In
ConsoleFormatter::escapeTags(), mitigatePREG_JIT_STACKLIMIT_ERRORwhen printing longConsolemessages with many special characters (e.g. JSON-encoded values) by only escaping recognised tag delimiters - Fix
Event::listen()callback signature
v0.20.85
v0.20.84
Added
- Add
Inflectclass withindefinite()method that determines which indefinite article ("a" or "an") to use before a word - Add
Arr::first()andArr::last()
Changed
generate sync entity command:
- Add a default description to entity classes
generate sync provider command:
-
Only use
FluentIteratorInterfaceas a magic method return type -
Add
.gitattributesfile to reduce package size
Removed
- Remove
--extendoption fromgenerate sync providercommand
v0.20.83
Added
- Add
FilesystemErrorExceptionand throw it instead of returningfalsefrom (most)Filemethods - Add
InvalidRuntimeConfigurationException - Add
Graph::from()to allow passing the initial object or array by value
Changed
- Rename
FilesystemtoFile - Finalise deprecation of
File::find()as a standalone method, replacing it with aRecursiveFilesystemIterator()factory - Rename methods:
File::createTemporaryDirectory()->createTempDir()File::maybeCreate()->create()File::maybeCreateDirectory()->createDir()File::maybeDelete()->delete()File::maybeDeleteDirectory()->deleteDir()File::pruneDirectory()->pruneDir()Graph::getInnerGraph()->inner()
Removed
- Remove
Filefacade (Lkrms\Utility\Fileis a drop-in replacement after adopting the method names above)
Fixed
- Make non-strict comparisons in
Filestrict