From 3690cc71bfe8dc3b6daeef356939fac95348f0a8 Mon Sep 17 00:00:00 2001 From: ignace nyamagana butera Date: Sat, 16 Dec 2023 12:03:20 +0100 Subject: [PATCH] Prepare 9.13.0 release --- CHANGELOG.md | 10 +++++----- docs/9.0/reader/record-mapping.md | 10 +++++----- src/Serializer/CallbackCasting.php | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee757ce..70ccdf13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,14 @@ All Notable changes to `Csv` will be documented in this file -## [Next] - TBD +## [9.13.0](https://github.com/thephpleague/csv/compare/9.12.0...9.13.0) - 2023-12-16 ### Added -- `SwapDelimiter` stream filter to allow working with multibyte CSV delimiter -- `League\Csv\Serializer\AfterMapping` to work around the limitation aroud constructor usage. -- `Denormalizer` can register type alias to simplify callback usage. -- `League\Csv\Serializer\MapCell` has a new property `ignore` to qllow ignoring a property or a method typcasting during conversion. +- `League\Csv\SwapDelimiter` stream filter to allow working with multibyte CSV delimiter +- `League\Csv\Serializer\AfterMapping` to work around the limitation of not using the class constructor during denormalization. +- `League\Csv\Serializer\Denormalizer` to allow registering type alias to improve callback usage. +- `League\Csv\Serializer\MapCell` has a new property `ignore` to allow ignoring a property or a method during denormalization. ### Deprecated diff --git a/docs/9.0/reader/record-mapping.md b/docs/9.0/reader/record-mapping.md index 1dc02716..5cd90628 100644 --- a/docs/9.0/reader/record-mapping.md +++ b/docs/9.0/reader/record-mapping.md @@ -158,13 +158,13 @@ It can be used on class properties and methods regardless of their visibility an The attribute can take up to four (4) arguments which are all optional: -- The `column` argument tells the engine which record key to use via its numeric or name. If not present the property name or the name of the first argument of the `setter` method will be used. In such case, you are required to specify the property names information. -- The `cast` argument which accept the name of a class implementing the `TypeCasting` interface and responsible for type casting the record value. If not present, the mechanism will try to resolve the typecasting based on the property or method argument type. -- The `options` argument enables controlling typecasting by providing extra arguments to `TypeCasting::setOptions` method. The argument expects an associative array and relies on named arguments to inject its value to the method. -- The `ignore` arguemnt which is a boolean control if the property or method should be completely ignored by the mechanism. By default its value is `false`. This property takes precedence over all the other properties of the attribute once set to `true`. +- The `column` a string or an integer that tells the engine which record key to use via its offset or key. If not present the property name or the name of the first argument of the `setter` method will be used. In such case, you are required to specify the property names information. +- The `cast` a string which represents the name of a class implementing the `TypeCasting` interface or an alias and responsible for type casting the record value. If not present, the mechanism will try to resolve the typecasting based on the property or method argument type. +- The `options` an associative array to improve typecasting by providing extra options per class/alias. The argument expects an associative array and relies on named arguments to inject its value to the method. +- The `ignore` a boolean which control if the property or method should be completely ignored by the mechanism. By default, its value is `false`. This property takes precedence over all the other properties of the attribute once set to `true`.

The ignore argument was added in version 9.13.0

-

You can use the mechanism on a CSV without a header row but it requires +

You can use the mechanism on a CSV without a header row but it requires adding a MapCell attribute on each property or method needed for the conversion. Or you can use the optional second argument of TabularDataReader::getObjects to specify the header value, just like with TabularDataReader::getRecords

diff --git a/src/Serializer/CallbackCasting.php b/src/Serializer/CallbackCasting.php index e23e633f..a1e5b74a 100644 --- a/src/Serializer/CallbackCasting.php +++ b/src/Serializer/CallbackCasting.php @@ -25,6 +25,7 @@ use function class_exists; /** + * @internal Container for registering Closure as type and/or type alias casting * @template TValue */ final class CallbackCasting implements TypeCasting