Skip to content

Releases: salient-labs/toolkit

v0.20.70

26 Oct 10:08
v0.20.70
138d384

Choose a tag to compare

Added

  • Add Arrayable interface

Changed

  • Move Iterator namespace from Lkrms\Support to Lkrms
  • Rename iterators:
    • ObjectOrArrayIterator => GraphIterator
    • RecursiveObjectOrArrayIterator => RecursiveGraphIterator
    • RecursiveHasChildrenCallbackIterator => RecursiveCallbackIterator
  • Replicate GraphIterator as MutableGraphIterator and remove MutableIterator implementation from GraphIterator
  • Ditto for RecursiveGraphIterator and RecursiveMutableGraphIterator
  • In graph iterators, throw an exception instead of iterating over unknown Traversable objects
  • FluentIteratorInterface:
    • Extend new Arrayable interface
    • Add optional $preserveKeys parameter to toArray()
    • Rename forEachWhileTrue() to forEachWhile()
  • Clean up File::find()

Fixed

  • Fix Convert::walkRecursive() issue where the wrong inner iterator is returned

v0.20.69

26 Oct 10:08
v0.20.69
56db18b

Choose a tag to compare

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 IDateFormatter in more locations
    • Receive and/or propagate date formatters for Curler via HttpSyncProvider::getCurler()
    • Pass $path to HttpSyncProvider::getDateFormatter()

Fixed

  • Fix issue where RecursiveHasChildrenCallbackIterator is only effective on children of the root node
    • This issue caused Curler to fail to serialize CurlerFile and DateTimeInterface instances in request data
  • Fix inconsistent return type of RecursiveObjectOrArrayIterator::maybeReplaceCurrentWithArray()
  • Fix iterator-related bugs in Curler::prepareData()

v0.20.68

26 Oct 10:08
v0.20.68
be84508

Choose a tag to compare

Added

  • Sync: replace named parameters in endpoint paths with context values

    • Resolve parameters like groupId in "/group/:groupId/users" from the ISyncContext received by the operation
    • Convert names to snake_case and remove _id suffixes for comparison
    • Apply entity ID to :id if 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
  • Sync: allow Curler behaviour to be customised from within HTTP sync definitions via curlerProperties()

  • Sync: add keyMap() and readFromReadList() to sync definition builders for cleaner, more expressive grammar

  • Sync: allow entity provider interfaces to cover multiple entities

  • Detect native DateTimeInterface properties during introspection

  • Add IDateFormatter

  • IProviderContext/ProviderContext:

    • Reinstate ad-hoc value propagation via withValue(), getValue(), hasValue()
    • Add last() for quicker access to the stack

Changed

  • Sync: don't defer creation of related entities if non-scalar data is available
  • Sync: throw an exception if ISyncEntity relationships target classes that don't implement ISyncEntity
  • Sync: apply entity ID to HTTP CREATE, UPDATE and DELETE operation URLs in addition to READ
  • Sync: rework context propagation and generic types
  • Sync: document provider requirements and entity class mapping
  • Rename Reflection to Reflect and remove the facade with the same name
  • Review Reflect and add support for DNF types

Removed

  • Remove Reflect::getClassesBetween()

v0.20.67

26 Oct 10:08
v0.20.67
6da9d87

Choose a tag to compare

Changed

  • Convert: improve handling of blank lines in linesToLists()

v0.20.66

26 Oct 10:08
v0.20.66
7b46ba1

Choose a tag to compare

Changed

  • Convert: add support for multi-line items to linesToLists()

v0.20.65

26 Oct 10:08
v0.20.65
5ec4d6e

Choose a tag to compare

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 null and empty strings explicitly to prevent unintended behaviour when "0" is used as a short option or given as a value
  • Refactor Builder

    • Rename getClassName() to getService()
    • Replace overloaded methods with declared ones:
      • build()
      • resolve()
      • get()
      • isset()
      • go()
    • Split HasBuilder interface into ReturnsBuilder, ResolvesBuilder and others
    • Add HasBuilder trait 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() to getB() and isset() to issetB() so instance methods with these names can be surfaced
    • Adopt method forwarding for CurlerBuilder

    Also:

    • Make both callbacks in IFluentInterface::if() optional

v0.20.64

26 Oct 10:08
v0.20.64
2b0d3c0

Choose a tag to compare

Changed

  • Rename IHierarchy to ITreeable and build out
    • Require hierarchical entities to return parent and children properties
    • Create implicit relationships between parents and children
  • Sync: reinstate _id and _ids matching for properties without relationships
  • Sync: fall back to deferral of $this->service() instead of static::class in SyncEntity::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 an id filter, but if the provider doesn't implement this operation or doesn't claim the filter value, retrieve them individually
    • Add support for "fully offline" and "fully online" handling of cached entities (implementation pending)
    • Actually call IProvidable::postLoad()
  • Sync: review context handling
    • Add provider to IProviderContext
    • Add getContext() to IProvider
    • Simplify context propagation in TProvidable, Introspector, SyncEntity, SyncProvider, SyncEntityProvider, SyncIntrospector
    • Remove unused set() and get() methods from IProviderContext
    • Rename claimFilterValue() to claimFilter()
    • Rename getFilter() to getFilters()
    • Add DeferredSyncEntityPolicy enumeration
    • Add withDeferredSyncEntityPolicy() and getDeferredSyncEntityPolicy() to ISyncContext
    • Allow entities resolved by SyncStore::resolveDeferredEntities() to be scoped to entities deferred since a checkpoint returned by SyncStore::getDeferredEntityCheckpoint()
    • Apply deferred sync entity policies in SyncEntityProvider
  • Sync: review SyncError and SyncErrorCollection
    • Move sync error reporting to SyncStore
    • Remove parameters from IApplication::stopSync()
  • Sync: review SqlQuery and DbSyncProvider classes
  • Sync: rename SyncSerializeLinkType to SyncEntityLinkType
  • Sync: fix SyncStore issue where IFacade::unload() is not always called on close()
  • Console: remove unnecessary method ConsoleLevel::toCode()
  • Replace ?? null constructs with isset() where possible

v0.20.63

26 Oct 10:08
v0.20.63
a70e169

Choose a tag to compare

Changed

  • Replace Whoops with new ErrorHandler class

v0.20.62

26 Oct 10:08
v0.20.62
38c3270

Choose a tag to compare

Changed

  • Add --check option to lk-util generate commands, and print diffs instead of creating or replacing ".generated.php" files
  • Review timer functions in System
  • Review Application/IApplication:
    • Accept optional $appName via constructor
    • Rename methods:
      • inProduction() -> isProduction()
      • logConsoleMessages() -> logOutput()
      • loadCache() -> startCache()
      • loadCacheIfExists() -> resumeCache()
      • unloadCache() -> stopCache()
      • loadSync() -> startSync()
      • unloadSync() -> stopSync()
      • writeResourceUsage() -> reportResourceUsage()
      • writeTimers() -> reportTimers()
    • isProduction(): check environment variable env for value "production"
    • logOutput(): reverse order of parameters
    • stopSync(): replace $silent with $reportErrors and add $exitStatus
    • registerShutdownReport(): only suppress timers when $timerTypes is 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 = false precludes creation of the directory when subsequently called with $create = true
    • Improve documentation

v0.20.61

26 Oct 10:08
v0.20.61
eb2994e

Choose a tag to compare

Changed

  • Sync: improve entity deferral and implement relationships between entities