Releases: bakame-php/http-structured-fields
Releases · bakame-php/http-structured-fields
version 2.0.0
Added
Bytesclass replace theByteSequenceclass.Ietfenum.- methods
fromRFC9651,fromRfc8941,toRFC9651,toRfc8941, to ease parsing/serializing Structured Fields. - method
equals, to allow comparison of Structured Fields DataType. - method
whento allow conditional addition to Structured Field DataType. - methods
map,reduce,filter,sortto all containers classes. - methods
isEmpty,isNotEmptyto all containers classes. - methods
getByIndex,hasIndices,indicesto all containers classes. - methods
getByKey,hasKeys,indexByKey,keyByIndex,toAssociativeto all ordered map classes (DictionaryandParameters). StructuredFieldProviderinterfaceItem::parameterByKeyandItem::parameterByIndexmethods to mirror the new public API.- All
Itemnamed constructors have atryequivalent which returnnullinstead of throwing an exception Parameters::valueByKeyParameters::valueByIndex- Added a validation mechanism to facilitate
ItemandParametersvalidation against field definition. Dictionary::mergeParametersByPairs,Dictionary::mergeParametersByAssociativeParameters::mergeParametersByPairs,Parameters::mergeParametersByAssociative
Fixed
- Fixed
Typeinference. - Container
IteratorAggregateinterface always uses theindexas key; it uses to be thekeyfor Ordered Map.
Deprecated
- None
Removed
- Removed the
Parserfrom the public API. MemberContainer,MemberList,MemberOrderedMap, and all the Parser related methods.- All deprecated methods during the version 1 cycle.
Item::parameterreplaced byItem::parameterByKeyParameters:getreplaced byParameters::getByKeyParameters:pairreplaced byParameters::getByIndexDictionary:getreplaced byDictionary::getByKeyDictionary:pairreplaced byDictionary::getByIndexOuterList:removereplaced byOuterList:removeByIndicesInnerList:removereplaced byInnerList:removeByIndices::hasNoMemberand::hasMembersmethods have been replaced byisEmptyandisNotEmptyon containersDictionary::toPairsandParameters::toPairsByteSequenceclass replaced byBytesclassDataType::createmethod use a specific DataType class instead.Valueinternal class.
version 1.3.0
Added
DataType::createreturns anStructuredFieldinstance from aniterableconstruct.DataType::serializereturns the HTTP string representation of a structured field.
Fixed
InnerList::fromPairshould not throw if the pair is empty becuse an inner list can be emoty.
Deprecated
DataType::builduseDataType::serializeinstead.
Removed
- None
version 1.2.2
Added
- None
Fixed
Type::ByteSequencevalue is renamed frombytesequencetobinaryto comply with the RFC.
Deprecated
- None
Removed
- None
version 1.2.1
Added
- None
Fixed
Item::newis fixed to better handle parsing with parameters values.
Deprecated
- None
Removed
- None
version 1.2.0
Added
- Support for the
DisplayStringtype ByteSequence::tryFromEncodedToken::tryFromStringOuterList::fromPairsDataTypeenumType::fromVariableType::tryFromVariableParser::newto simplify parser usage.
Fixed
- Tests file moved under the
/testsdirectory - Fix
Type::tryFromVariableto correctly detect string type derivative. - the
Typeenum is now a baked string Enum.
Deprecated
Type::fromValueuseType::fromVariableinsteadType::tryFromValueuseType::tryFromVariableinstead
Removed
- None
version 1.1.0
Added
OrederedMap::pushOrederedMap::unshiftOrederedMap::insertOrederedMap::replaceOrederedMap::removeByIndicesOrederedMap::removeByKeysParameterAccess::pushParanmetersParameterAccess::unshiftParamatersParameterAccess::insertParamatersParameterAccess::replaceParamaterParameterAccess::withoutParametersByKeysParameterAccess::withoutParametersByIndicesItemParserinterface to return an array representation of a Structured Field as an item.ParametersParserinterface to return an array representation of a Structured Field parameter container.DictionaryParserinterface to return an array representation of a Structured Field dictionary container.ListParserinterface to return an array representation of a Structured Field list container.InnerListParserinterface to return an array representation of a Structured Field inner list container.ValueParserinterface to return a PHP type of a Structured Field Value string representation.Parseris now part of the public APIItem::fromHttpValuenow has an optional second parameter to shift the parser implementation usedParameters::fromHttpValuenow has an optional second parameter to shift the parser implementation usedDictionary::fromHttpValuenow has an optional second parameter to shift the parser implementation usedOuterList::fromHttpValuenow has an optional second parameter to shift the parser implementation usedInnerList::fromHttpValuenow has an optional second parameter to shift the parser implementation used
Fixed
Parameters::removealso removes parameters per indicesType::fromValuethrows anInvalidArgumentexception.Type::fromValueandType::tryFromValueshould only check the PHP variable type and not take into account the variable value.
Deprecated
ParameterAccess::withoutParametersreplaced byParameterAccess::withoutParametersBykeys
Removed
- None
version 1.0.1
Added
- None
Fixed
Parserno longer instantiate anItemobjectParserinternal Date generation simplifiedValuefloat serialization simplifiedOuterList::fromHttpValue,InnerList::fromHttpValue,Dictionnary::fromHttpValuerewritten to improve decoupling fromParser- Adding missing interoperability test for the
Tokentype
Deprecated
- None
Removed
- None
version 1.0.0
Added
InnerList::fromPairto improve InnerList public API;InnerList::toPairto improve InnerList public API;InnerList::fromAssociativeto improve InnerList public API;Itemimplements theValueAccessinterface;Item::toPairto complementItem::fromPair;Item::fromDateto improve and complete the Item Date public API;Item::fromAssociativeto improve Item public API;Item::fromStringto improve Item public API;Token::toStringto return the string representation of the token.Item::new,Parameters::new,Dictionary::new,InnerList::newandOuterList::newto return a new instance
Fixed
- Improve annotation using
@phpstan-type Valueinternal class to improve Item public API;- [BC Break]
::fromAssociativeand::fromPairthe$parametersargument is now required; - [BC Break]
MemberOrderedMapinstances can no longer be added toDictionaryorOuterListinstances. - RFC restriction on eligible container members.
- Exception normalization.
Deprecated
- None
Removed
- [BC Break] Remove
Stringableautomatically converted into a string type. - [BC Break]
InnerList::fromPairParametersuseInnerList::fromPairinstead. - [BC Break]
InnerList::fromAssociativeParametersuseInnerList::fromAssociativeinstead. - [BC Break]
Valueinterface use a combination ofValueAccessandParameterAccessinstead. - [BC Break]
Token::valueis no longer public useToken::toStringinstead. - [BC Break]
Item::fromis removed useItem::fromAssociativeorItem::newinstead. - [BC Break]
Parameters::createis removed useParameters::newinstead. - [BC Break]
InnerList::fromis removed useInnerList::newinstead. - [BC Break]
OuterList::createis removed useOuterList::newinstead.
version 0.8.0
Added
Item::fromTimestamp,Item::fromDateFormat,Item::fromDateStringto improve item instantiation with dates.ParameterAccess::parameterto ease parameter members value access.InnerList::fromAssociativeParameters,InnerList::fromPairParametersto improve item instantiation with parameters.- [BC Break]
ParameterAccess::withoutAllParametersis renamedParameterAccess::withoutAnyParameter. - [BC Break]
OrderedListis renamedOuterList. - [BC Break]
MemberContainer::removemethods get added to the interface. - [BC Break]
MemberContainer::keysmethod added to the interface.
Fixed
- Test suite migrated to PHPUnit 10
- Adding Benchmark test with PHPBench
- Improve Collection immutability with method changes
- [BC Break]
ParameterAccessinterface signature updated to use theValueinterface instead of theItemimplementation. - [BC Break]
MemberList::remove,MemberOrderedMap::removeandMemberOrderedMap::keysmethods are moved to their parent interface. - [BC Break] Renamed arguments for indexation for normalization
- [BC Break]
MemberContainer::hasandMemberOrderedMap::hasPairmethods accept a variadic argument. All submitted indexes/keys should be present for the method to returntrue
Deprecated
- None
Removed
- [BC Break]
OrderedListis removed, useOuterListinstead. - [BC Break]
ParameterAccess::withoutAllParametersis removed, useParameterAccess::withoutAnyParametersinstead. - [BC Break] remove the
$parametersargument from allItemnamed constuctors except fromItem::from. - [BC Break] remove
InnerList::fromList, useInnerList::fromAssociativeParametersorInnerList::fromPairParametersinstead. - [BC Break] remove
OuterList::fromList, useOuterList::frominstead.
version 0.7.0
Added
- Support for
Stringableinstances added toItem::from, the instances will be converted to the string data type. - Support for the upcoming
Datedata type inItemrepresented as aDateTimeImmutableobject. (see https://httpwg.org/http-extensions/draft-ietf-httpbis-sfbis.html) ParameterAccessinterface with new methods to ease parameter members modification.Parameter::createnamed constructor to create a new instance without any parameter.Dictionnary::createnamed constructor to create a new instance without any parameter.TypeEnum of all supported datatype.ValueInterface is introduced withItembeing the only available implementation.MemberOrderedMap::addandMemberOrderedMap::removemethodsByteSequence::equalsandToken::equalsto easily compare type instances.StructuredFieldextends theStringableinterfaceForbiddenOperationexception to reports invalid operation on immutable value objects.
Fixed
Item::fromHttpValuenow internally uses theParserpreviously it was using its own parsing rules.Parameters::fromHttpValuenow internally uses theParserpreviously it was using its own parsing rules.- [BC Break]
::fromAssociative,::fromList,::fromPairsmethods require iterable arguments without default value. - [BC Break]
Item::valuemethod returns the Item (returns value can befloat|int|string|bool|ByteSequence|DateTimeImmutable|Token). - [BC Break]
InnerList::parametersis no longer accessible as a public readonly property. - [BC Break] Modifying container instances with
ArrayAccessmodifying methods is forbidden and will trigger aForbiddenOperationexception.
Deprecated
- None
Removed
- [BC Break]
ForbiddenStateErrorexception is removed; theInvalidArgumentexception is used instead. - [BC Break]
Item::is*methods are removed; the enumTypeis used instead. - [BC Break]
MemberContainer::clearmethod is removed without replacement. - [BC Break]
MemberOrderedMap::setandMemberOrderedMap::deletemethods remonved; useMemberOrderedMap::addandMemberOrderedMap::removeinstead