v0.99.75
Achieved with the changes detailed below:
- Completion of
CoreAPI review - Cleaner access to constants via classes that implement their interfaces
- Progress towards decoupling the
Corecomponent fromContainer - Progress towards rewritten "sli generate" commands
Added
Core
- Add
Serializableinterface - Add, implement and adopt
InvalidDataException - Add, implement and adopt
EventDispatcherInterfaceandEventListenerProviderInterface - Add
Builder::getStaticConstructor()to allow use of a static method for instantiation instead of the constructor - Add
MetricCollector::getMaxTimers()to provide maximum number of timers running simultaneously per group
Utility
- Add
File::eof()andFile::select() - Add
File::getIndentation() - Add
Inflect::list(), with optional Oxford comma support - Add
Reflect::getDeclaring(),Reflect::getFileName()andgetNamespaceName()
Changed
- Rename exception interfaces to reduce verbosity
- Move
IndentationtoSalient\Utility\Support - Move
MimeTypetoSalient\Contract\Http - Move
SqlQuerytoSalient\Db
Cache
- Treat
DateIntervalTTLs like integers, i.e. delete the item if TTL is <= 0 seconds
Console
- Rename:
ConsoleWriterInterface->ConsoleInterfaceConsoleWriter->ConsoleConsoleMessageType->HasMessageTypeConsoleMessageTypeGroup->HasMessageTypes
- Implement
HasMessageLevel,HasMessageLevels,HasMessageTypeandHasMessageTypesfrom theConsolefacade
Core
- Rename:
AbstractBuilder->BuilderAbstractFacade->Facadeand move toSalient\Core\FacadeAbstractStore->StoreAbstractStreamWrapper->StreamWrapperAbstractException->Exceptionand move toSalient\Core\ExceptionAbstractMultipleErrorException->MultipleErrorExceptionand move toSalient\Core\ExceptionHasBuilder->BuildableTraitHasChainableMethods->ChainableTraitHasFacade->FacadeAwareInstanceTraitHasMutator->ImmutableTraitHasNormaliser->NormalisableTraitHasReadableProperties->ReadableTraitHasWritableProperties->WritableTraitJsonSchemaInterface->HasJsonSchemaProcessmethods:getText()->getOutputAsText()getNewText()->getNewOutputAsText()
ProvidableEntityInterface->ProviderEntityInterfaceand move toSalient\Core\EntityReadsProtectedProperties->ReadableProtectedPropertiesTraitSerializeRulesInterfacemethods:getIncludeMeta()->getDynamicProperties()withIncludeMeta()->withDynamicProperties()
UnloadsFacades->FacadeAwareTrait
- Rename, move to
Salient\Contractand update constants:EscapeSequence->HasEscapeSequenceFileDescriptor->HasFileDescriptorListConformity->HasConformityMessageLevel->HasMessageLevelMessageLevelGroup->HasMessageLevelsTextComparisonAlgorithm->HasTextComparisonFlagTextComparisonFlag->HasTextComparisonFlag
- Move:
StoppableEventInterface->Salient\Contract\Core\EventEventDispatcher->Salient\Core\EventStoppableEventTrait->Salient\Core\EventFacadeInterface->Salient\Contract\Core\FacadeFacadeAwareInterface->Salient\Contract\Core\FacadeArrayMapperInterface->Salient\Contract\Core\PipelineDateFormatter->Salient\Core\DateDateFormatParser->Salient\Core\DateDateParser->Salient\Core\DateDotNetDateParser->Salient\Core\DateProvidable->Salient\Core\EntitySerializeRulesInterface->Salient\Core\EntityExceptionTrait->Salient\Core\ExceptionMultipleErrorExceptionTrait->Salient\Core\ExceptionAbstractEntity->Salient\Core\ProviderAbstractProvider->Salient\Core\ProviderProviderContext->Salient\Core\Provider
- Don't accept a container when creating a builder (builders are tightly coupled with constructors, so no container is needed)
- In
Facade, only useContainerif it is defined - Detect date properties and parameters via native type hints even if
Temporalis not implemented - Refactor
Facade::getService()for simplicity - Narrow
Hierarchicalreturn types to$thisas needed - Refactor
Normalisable::normaliseProperty()for clarity - Make
$contexta required parameter ofProvidablemethodsprovide()andprovideMultiple()and remove$provideraccordingly - Refactor
Providable::provideMultiple()for consistency withConstructible - Improve uninitialised property handling in
TreeableTrait - Replace
ConfigurationManager::getMany()withgetMultiple() - Extend
DateParserInterfacefromDateFormatterInterface - In
DateParserInterface::parse(), specify that$timezoneis ignored if$valuehas a timezone and update implementations accordingly - Deregister
ErrorHandlerwhen the facade it's running behind is unloaded - In
MultipleErrorException:- Rename
getMessageWithoutErrors()togetMessageOnly() - Add
$consoleparameter toreportErrors()
- Rename
- In
Process:- Improve robustness of stream handling
- Always throw
ProcessTerminatedBySignalExceptionwhen a process is killed, not just whenwait()is called - Add and throw
ProcessDidNotTerminateException - Do not throw
ProcessExceptionfor stream-related errors
- Add
ClassReflectionand adopt instead ofIntrospectorandIntrospectionClasswhere possible- Fix issue where reserved properties are ignored when getting "magic" properties
- Fix issue where properties with asymmetric handling are not serialized, e.g. when a protected property is read via
__get()and written via_setMyProperty() - Do not allow multiple properties or "magic" property methods to resolve to the same name after normalisation
- Do not allow dynamic property properties to be serviced by "magic" property methods
- Do not allow
Treeableclasses to return invalid parent/children properties
PHPDoc
- Collect and propagate context data to allow expansion of relative class types like
static,$thisandself
PHPStan
- Preserve key types when
$preserveKeys = trueis passed toArr::flatten() - Handle optional keys in arrays passed to
Arr::flatten()
Sli
- Refactor "generate facade" command
- Add new options:
--implement <interface>--skip-deprecated(previous behaviour was to skip deprecated methods unconditionally)
- Exclude
@internalmethods from facades
- Add new options:
- Build out PHPDoc tag handling and other abstractions in
AbstractGenerateCommand
Sync
- Extend
ClassReflectionfromReflectionclasses - Rename
Reflectionclasses for consistency - Refactor
SyncSerializeRulesInterfacefor consistency withSerializeRulesInterface - Rename
SyncSerializeRulesInterfacemethods:getIncludeCanonicalId()->getCanonicalId()withIncludeCanonicalId()->withCanonicalId()
- Rename
SyncSerializeRulesBuildermethods:includeMeta()->dynamicProperties()includeCanonicalId()->canonicalId()
- Do not extend
AbstractEntityfromAbstractSyncEntity - Remove
TemporalfromSyncEntityInterfaceand implement it inAbstractSyncEntity - Refactor
SyncEntityProviderInterface::getResolver()and downstream implementations- Accept closures for
$namePropertyand$weightProperty - Require
$namePropertyclosures to returnstring - Handle uninitialised properties and invalid values gracefully
- Accept closures for
Utility
- Optionally preserve keys in
Arr::pluck(),Arr::flatten()andReflect::getNames() - In
Test::isBuiltinType(), optionally exclude relative class types and/or theresourcetype, and remove soft-reserved typesenumandnumericentirely
Removed
Core
- Remove
getB(),issetB(),unsetB()fromBuilderInterface(implementation details are not needed in the contract) - Remove unused
Exception::withExitStatus()method - Remove
MultipleErrorExceptionTrait::getMetadata()to prevent errors being reported twice - Remove
GraphInterfacefrom API - Remove
NormaliserFlag - Remove unused
PipeInterfaceand related code - Remove unused
Process::isTerminatedBySignal() - Remove unused
WritesProtectedPropertiestrait - Remove date formatter caching from
AbstractProvider- Remove
finalfromAbstractProvider::getDateFormatter()and replace with a default implementation - Deprecate
AbstractProvider::createDateFormatter()and make itfinalto force downstream implementation updates
- Remove
PHPDoc
- Remove
$trackInheritanceparameter fromPHPDoc::forClass()
Sli
- Remove support for setting properties via generated builders
Utility
- Remove
Indentation::from()(replaced withFile::getIndentation())
Fixed
Core
- Fix issue where a deregistered
ErrorHandlercannot be re-registered and may still report errors on shutdown - Fix issue where multiple calls to
ErrorHandler::deregister()may remove other error/exception handlers - Fix issue where timeout behaviour may be incorrect after calling
Process::setTimeout()
PHPDoc
- Do not inherit DocBlocks from private members of inherited classes
- Fix issue where empty template maps are needlessly inherited
Utility
- Fix
Date::maybeSetTimezone()issue where+00:00, the timezone applied when timestamps are parsed, is not handled correctly - Add missing
int<1,max>type to tab size inIndentation