Releases: bakame-php/http-structured-fields
Releases · bakame-php/http-structured-fields
version 2.0.0
Added
Bytes
class replace theByteSequence
class.Ietf
enum.- methods
fromRFC9651
,fromRfc8941
,toRFC9651
,toRfc8941
, to ease parsing/serializing Structured Fields. - method
equals
, to allow comparison of Structured Fields DataType. - method
when
to allow conditional addition to Structured Field DataType. - methods
map
,reduce
,filter
,sort
to all containers classes. - methods
isEmpty
,isNotEmpty
to all containers classes. - methods
getByIndex
,hasIndices
,indices
to all containers classes. - methods
getByKey
,hasKeys
,indexByKey
,keyByIndex
,toAssociative
to all ordered map classes (Dictionary
andParameters
). StructuredFieldProvider
interfaceItem::parameterByKey
andItem::parameterByIndex
methods to mirror the new public API.- All
Item
named constructors have atry
equivalent which returnnull
instead of throwing an exception Parameters::valueByKey
Parameters::valueByIndex
- Added a validation mechanism to facilitate
Item
andParameters
validation against field definition. Dictionary::mergeParametersByPairs
,Dictionary::mergeParametersByAssociative
Parameters::mergeParametersByPairs
,Parameters::mergeParametersByAssociative
Fixed
- Fixed
Type
inference. - Container
IteratorAggregate
interface always uses theindex
as key; it uses to be thekey
for Ordered Map.
Deprecated
- None
Removed
- Removed the
Parser
from the public API. MemberContainer
,MemberList
,MemberOrderedMap
, and all the Parser related methods.- All deprecated methods during the version 1 cycle.
Item::parameter
replaced byItem::parameterByKey
Parameters:get
replaced byParameters::getByKey
Parameters:pair
replaced byParameters::getByIndex
Dictionary:get
replaced byDictionary::getByKey
Dictionary:pair
replaced byDictionary::getByIndex
OuterList:remove
replaced byOuterList:removeByIndices
InnerList:remove
replaced byInnerList:removeByIndices
::hasNoMember
and::hasMembers
methods have been replaced byisEmpty
andisNotEmpty
on containersDictionary::toPairs
andParameters::toPairs
ByteSequence
class replaced byBytes
classDataType::create
method use a specific DataType class instead.Value
internal class.
version 1.3.0
Added
DataType::create
returns anStructuredField
instance from aniterable
construct.DataType::serialize
returns the HTTP string representation of a structured field.
Fixed
InnerList::fromPair
should not throw if the pair is empty becuse an inner list can be emoty.
Deprecated
DataType::build
useDataType::serialize
instead.
Removed
- None
version 1.2.2
Added
- None
Fixed
Type::ByteSequence
value is renamed frombytesequence
tobinary
to comply with the RFC.
Deprecated
- None
Removed
- None
version 1.2.1
Added
- None
Fixed
Item::new
is fixed to better handle parsing with parameters values.
Deprecated
- None
Removed
- None
version 1.2.0
Added
- Support for the
DisplayString
type ByteSequence::tryFromEncoded
Token::tryFromString
OuterList::fromPairs
DataType
enumType::fromVariable
Type::tryFromVariable
Parser::new
to simplify parser usage.
Fixed
- Tests file moved under the
/tests
directory - Fix
Type::tryFromVariable
to correctly detect string type derivative. - the
Type
enum is now a baked string Enum.
Deprecated
Type::fromValue
useType::fromVariable
insteadType::tryFromValue
useType::tryFromVariable
instead
Removed
- None
version 1.1.0
Added
OrederedMap::push
OrederedMap::unshift
OrederedMap::insert
OrederedMap::replace
OrederedMap::removeByIndices
OrederedMap::removeByKeys
ParameterAccess::pushParanmeters
ParameterAccess::unshiftParamaters
ParameterAccess::insertParamaters
ParameterAccess::replaceParamater
ParameterAccess::withoutParametersByKeys
ParameterAccess::withoutParametersByIndices
ItemParser
interface to return an array representation of a Structured Field as an item.ParametersParser
interface to return an array representation of a Structured Field parameter container.DictionaryParser
interface to return an array representation of a Structured Field dictionary container.ListParser
interface to return an array representation of a Structured Field list container.InnerListParser
interface to return an array representation of a Structured Field inner list container.ValueParser
interface to return a PHP type of a Structured Field Value string representation.Parser
is now part of the public APIItem::fromHttpValue
now has an optional second parameter to shift the parser implementation usedParameters::fromHttpValue
now has an optional second parameter to shift the parser implementation usedDictionary::fromHttpValue
now has an optional second parameter to shift the parser implementation usedOuterList::fromHttpValue
now has an optional second parameter to shift the parser implementation usedInnerList::fromHttpValue
now has an optional second parameter to shift the parser implementation used
Fixed
Parameters::remove
also removes parameters per indicesType::fromValue
throws anInvalidArgument
exception.Type::fromValue
andType::tryFromValue
should only check the PHP variable type and not take into account the variable value.
Deprecated
ParameterAccess::withoutParameters
replaced byParameterAccess::withoutParametersBykeys
Removed
- None
version 1.0.1
Added
- None
Fixed
Parser
no longer instantiate anItem
objectParser
internal Date generation simplifiedValue
float serialization simplifiedOuterList::fromHttpValue
,InnerList::fromHttpValue
,Dictionnary::fromHttpValue
rewritten to improve decoupling fromParser
- Adding missing interoperability test for the
Token
type
Deprecated
- None
Removed
- None
version 1.0.0
Added
InnerList::fromPair
to improve InnerList public API;InnerList::toPair
to improve InnerList public API;InnerList::fromAssociative
to improve InnerList public API;Item
implements theValueAccess
interface;Item::toPair
to complementItem::fromPair
;Item::fromDate
to improve and complete the Item Date public API;Item::fromAssociative
to improve Item public API;Item::fromString
to improve Item public API;Token::toString
to return the string representation of the token.Item::new
,Parameters::new
,Dictionary::new
,InnerList::new
andOuterList::new
to return a new instance
Fixed
- Improve annotation using
@phpstan-type
Value
internal class to improve Item public API;- [BC Break]
::fromAssociative
and::fromPair
the$parameters
argument is now required; - [BC Break]
MemberOrderedMap
instances can no longer be added toDictionary
orOuterList
instances. - RFC restriction on eligible container members.
- Exception normalization.
Deprecated
- None
Removed
- [BC Break] Remove
Stringable
automatically converted into a string type. - [BC Break]
InnerList::fromPairParameters
useInnerList::fromPair
instead. - [BC Break]
InnerList::fromAssociativeParameters
useInnerList::fromAssociative
instead. - [BC Break]
Value
interface use a combination ofValueAccess
andParameterAccess
instead. - [BC Break]
Token::value
is no longer public useToken::toString
instead. - [BC Break]
Item::from
is removed useItem::fromAssociative
orItem::new
instead. - [BC Break]
Parameters::create
is removed useParameters::new
instead. - [BC Break]
InnerList::from
is removed useInnerList::new
instead. - [BC Break]
OuterList::create
is removed useOuterList::new
instead.
version 0.8.0
Added
Item::fromTimestamp
,Item::fromDateFormat
,Item::fromDateString
to improve item instantiation with dates.ParameterAccess::parameter
to ease parameter members value access.InnerList::fromAssociativeParameters
,InnerList::fromPairParameters
to improve item instantiation with parameters.- [BC Break]
ParameterAccess::withoutAllParameters
is renamedParameterAccess::withoutAnyParameter
. - [BC Break]
OrderedList
is renamedOuterList
. - [BC Break]
MemberContainer::remove
methods get added to the interface. - [BC Break]
MemberContainer::keys
method added to the interface.
Fixed
- Test suite migrated to PHPUnit 10
- Adding Benchmark test with PHPBench
- Improve Collection immutability with method changes
- [BC Break]
ParameterAccess
interface signature updated to use theValue
interface instead of theItem
implementation. - [BC Break]
MemberList::remove
,MemberOrderedMap::remove
andMemberOrderedMap::keys
methods are moved to their parent interface. - [BC Break] Renamed arguments for indexation for normalization
- [BC Break]
MemberContainer::has
andMemberOrderedMap::hasPair
methods accept a variadic argument. All submitted indexes/keys should be present for the method to returntrue
Deprecated
- None
Removed
- [BC Break]
OrderedList
is removed, useOuterList
instead. - [BC Break]
ParameterAccess::withoutAllParameters
is removed, useParameterAccess::withoutAnyParameters
instead. - [BC Break] remove the
$parameters
argument from allItem
named constuctors except fromItem::from
. - [BC Break] remove
InnerList::fromList
, useInnerList::fromAssociativeParameters
orInnerList::fromPairParameters
instead. - [BC Break] remove
OuterList::fromList
, useOuterList::from
instead.
version 0.7.0
Added
- Support for
Stringable
instances added toItem::from
, the instances will be converted to the string data type. - Support for the upcoming
Date
data type inItem
represented as aDateTimeImmutable
object. (see https://httpwg.org/http-extensions/draft-ietf-httpbis-sfbis.html) ParameterAccess
interface with new methods to ease parameter members modification.Parameter::create
named constructor to create a new instance without any parameter.Dictionnary::create
named constructor to create a new instance without any parameter.Type
Enum of all supported datatype.Value
Interface is introduced withItem
being the only available implementation.MemberOrderedMap::add
andMemberOrderedMap::remove
methodsByteSequence::equals
andToken::equals
to easily compare type instances.StructuredField
extends theStringable
interfaceForbiddenOperation
exception to reports invalid operation on immutable value objects.
Fixed
Item::fromHttpValue
now internally uses theParser
previously it was using its own parsing rules.Parameters::fromHttpValue
now internally uses theParser
previously it was using its own parsing rules.- [BC Break]
::fromAssociative
,::fromList
,::fromPairs
methods require iterable arguments without default value. - [BC Break]
Item::value
method returns the Item (returns value can befloat|int|string|bool|ByteSequence|DateTimeImmutable|Token
). - [BC Break]
InnerList::parameters
is no longer accessible as a public readonly property. - [BC Break] Modifying container instances with
ArrayAccess
modifying methods is forbidden and will trigger aForbiddenOperation
exception.
Deprecated
- None
Removed
- [BC Break]
ForbiddenStateError
exception is removed; theInvalidArgument
exception is used instead. - [BC Break]
Item::is*
methods are removed; the enumType
is used instead. - [BC Break]
MemberContainer::clear
method is removed without replacement. - [BC Break]
MemberOrderedMap::set
andMemberOrderedMap::delete
methods remonved; useMemberOrderedMap::add
andMemberOrderedMap::remove
instead