Releases: salient-labs/toolkit
Releases · salient-labs/toolkit
v0.20.70
Added
- Add
Arrayableinterface
Changed
- Move
Iteratornamespace fromLkrms\SupporttoLkrms - Rename iterators:
ObjectOrArrayIterator=>GraphIteratorRecursiveObjectOrArrayIterator=>RecursiveGraphIteratorRecursiveHasChildrenCallbackIterator=>RecursiveCallbackIterator
- Replicate
GraphIteratorasMutableGraphIteratorand removeMutableIteratorimplementation fromGraphIterator - Ditto for
RecursiveGraphIteratorandRecursiveMutableGraphIterator - In graph iterators, throw an exception instead of iterating over unknown
Traversableobjects FluentIteratorInterface:- Extend new
Arrayableinterface - Add optional
$preserveKeysparameter totoArray() - Rename
forEachWhileTrue()toforEachWhile()
- Extend new
- Clean up
File::find()
Fixed
- Fix
Convert::walkRecursive()issue where the wrong inner iterator is returned
v0.20.69
Added
- Sync: allow one closure to override multiple operations by using bitmasks in the
overrides()array passed to sync definition builders - Sync: add
SyncProvider::callbackPipeline()for convenience
Changed
-
Sync: improve date formatter handling
- Adopt
IDateFormatterin more locations - Receive and/or propagate date formatters for
CurlerviaHttpSyncProvider::getCurler() - Pass
$pathtoHttpSyncProvider::getDateFormatter()
- Adopt
Fixed
- Fix issue where
RecursiveHasChildrenCallbackIteratoris only effective on children of the root node- This issue caused
Curlerto fail to serializeCurlerFileandDateTimeInterfaceinstances in request data
- This issue caused
- Fix inconsistent return type of
RecursiveObjectOrArrayIterator::maybeReplaceCurrentWithArray() - Fix iterator-related bugs in
Curler::prepareData()
v0.20.68
Added
-
Sync: replace named parameters in endpoint paths with context values
- Resolve parameters like
groupIdin"/group/:groupId/users"from theISyncContextreceived by the operation - Convert names to snake_case and remove
_idsuffixes for comparison - Apply entity ID to
:idif it appears in an endpoint path - Throw an exception if the value of a named parameter contains a forward slash
- Allow multiple endpoint paths per entity
- Resolve parameters like
-
Sync: allow
Curlerbehaviour to be customised from within HTTP sync definitions viacurlerProperties() -
Sync: add
keyMap()andreadFromReadList()to sync definition builders for cleaner, more expressive grammar -
Sync: allow entity provider interfaces to cover multiple entities
-
Detect native
DateTimeInterfaceproperties during introspection -
Add
IDateFormatter -
IProviderContext/ProviderContext:- Reinstate ad-hoc value propagation via
withValue(),getValue(),hasValue() - Add
last()for quicker access to the stack
- Reinstate ad-hoc value propagation via
Changed
- Sync: don't defer creation of related entities if non-scalar data is available
- Sync: throw an exception if
ISyncEntityrelationships target classes that don't implementISyncEntity - Sync: apply entity ID to HTTP
CREATE,UPDATEandDELETEoperation URLs in addition toREAD - Sync: rework context propagation and generic types
- Sync: document provider requirements and entity class mapping
- Rename
ReflectiontoReflectand remove the facade with the same name - Review
Reflectand add support for DNF types
Removed
- Remove
Reflect::getClassesBetween()
v0.20.67
v0.20.66
v0.20.65
Changed
-
Cli: improve argument handling
- Allow options and positional arguments appearing before
--to be given in an arbitrary order - Improve empty string handling so
--option ''is taken as a value and--option=clears default or preceding values - Fix issue where options with an optional value are not always returned by
getEffectiveArgument() - Fix issue where
"-"cannot be given as a positional argument before"--" - Check for
nulland empty strings explicitly to prevent unintended behaviour when"0"is used as a short option or given as a value
- Allow options and positional arguments appearing before
-
Refactor
Builder- Rename
getClassName()togetService() - Replace overloaded methods with declared ones:
build()resolve()get()isset()go()
- Split
HasBuilderinterface intoReturnsBuilder,ResolvesBuilderand others - Add
HasBuildertrait to simplify builder servicing - Update "lk-util generate builder" command
- Allow properties to be excluded from "lk-util generate builder" output
- Allow methods to be forwarded from a builder to a new instance without calling
$builder->go()first
- Rename
Builder::get()togetB()andisset()toissetB()so instance methods with these names can be surfaced - Adopt method forwarding for
CurlerBuilder
Also:
- Make both callbacks in
IFluentInterface::if()optional
- Rename
v0.20.64
Changed
- Rename
IHierarchytoITreeableand build out- Require hierarchical entities to return parent and children properties
- Create implicit relationships between parents and children
- Sync: reinstate
_idand_idsmatching for properties without relationships - Sync: fall back to deferral of
$this->service()instead ofstatic::classinSyncEntity::defer()when no entity is specified - Sync: automatically defer incoming entities if possible
- Sync: Add support for resolution of deferred entities from providers
- Add
Sync::resolveDeferredEntities()to retrieve deferred entities from providers and/or the local entity store- Attempt to load entities via
getListA()with anidfilter, but if the provider doesn't implement this operation or doesn't claim the filter value, retrieve them individually
- Attempt to load entities via
- Add support for "fully offline" and "fully online" handling of cached entities (implementation pending)
- Actually call
IProvidable::postLoad()
- Add
- Sync: review context handling
- Add provider to
IProviderContext - Add
getContext()toIProvider - Simplify context propagation in
TProvidable,Introspector,SyncEntity,SyncProvider,SyncEntityProvider,SyncIntrospector - Remove unused
set()andget()methods fromIProviderContext - Rename
claimFilterValue()toclaimFilter() - Rename
getFilter()togetFilters() - Add
DeferredSyncEntityPolicyenumeration - Add
withDeferredSyncEntityPolicy()andgetDeferredSyncEntityPolicy()toISyncContext - Allow entities resolved by
SyncStore::resolveDeferredEntities()to be scoped to entities deferred since a checkpoint returned bySyncStore::getDeferredEntityCheckpoint() - Apply deferred sync entity policies in
SyncEntityProvider
- Add provider to
- Sync: review
SyncErrorandSyncErrorCollection- Move sync error reporting to
SyncStore - Remove parameters from
IApplication::stopSync()
- Move sync error reporting to
- Sync: review
SqlQueryandDbSyncProviderclasses - Sync: rename
SyncSerializeLinkTypetoSyncEntityLinkType - Sync: fix
SyncStoreissue whereIFacade::unload()is not always called onclose() - Console: remove unnecessary method
ConsoleLevel::toCode() - Replace
?? nullconstructs withisset()where possible
v0.20.63
v0.20.62
Changed
- Add
--checkoption tolk-util generatecommands, and print diffs instead of creating or replacing ".generated.php" files - Review timer functions in
System - Review
Application/IApplication:- Accept optional
$appNamevia constructor - Rename methods:
inProduction()->isProduction()logConsoleMessages()->logOutput()loadCache()->startCache()loadCacheIfExists()->resumeCache()unloadCache()->stopCache()loadSync()->startSync()unloadSync()->stopSync()writeResourceUsage()->reportResourceUsage()writeTimers()->reportTimers()
isProduction(): check environment variableenvfor value"production"logOutput(): reverse order of parametersstopSync(): replace$silentwith$reportErrorsand add$exitStatusregisterShutdownReport(): only suppress timers when$timerTypesis an empty array- Register one shutdown report per run, no matter how many service containers are created
- Fix issue where calling
get<dir>Path()with$create = falseprecludes creation of the directory when subsequently called with$create = true - Improve documentation
- Accept optional