Skip to content

Commit 8da34b6

Browse files
committed
Adding missing denormalizing feature
1 parent e265ca3 commit 8da34b6

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ All Notable changes to `Csv` will be documented in this file
66

77
### Added
88

9-
- None
9+
- Support for `Closure` in constant expressions during Record Mapping.
10+
- `AbstractCsv::fromStream` to instantiate a `Reader` or a `Writer` instance from a stream or a `SplFileObject` object
11+
- `AbstractCsv::fromPath` to instantiate a `Reader` or a `Writer` instance from a path as a string or a `SplFileInfo` object
1012

1113
### Deprecated
1214

docs/9.0/reader/record-mapping.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,7 @@ Serializer\Denormalizer::unregisterAllAliases();
717717

718718
<p class="message-info">new in version <code>9.29</code></p>
719719

720-
You can directly register a callback if you are using `PHP8.5+` prior to this version the code will throw an error since using
721-
a static closure on attribute is not yet valid.
720+
You can directly register a callback if you are using `PHP8.5+` prior to this version the code will throw an error since using a static closure on attribute is not yet valid.
722721

723722
Once your code is migrated to the correct PHP version you can write the following:
724723

@@ -735,17 +734,13 @@ use League\Csv\Serializer;
735734
private ?int $amount;
736735
```
737736

738-
This will result in the same mapping as the previous example using the alias. But you no longer have to register the `alias` yourself as
739-
this is taking care of by the engine itself.
740-
741-
<p class="message-notice">Of note, if you want to re-use multiple time registering the callback casting using an
742-
explicit <code>alias</code> will always be the recommended way.</p>
737+
This will result in the same mapping as the previous example using the alias. But you no longer have to register the `alias` yourself as this is taking care of by the engine itself.
743738

739+
<p class="message-notice">Of note, if you want to re-use multiple time registering the callback casting using an explicit <code>alias</code> will always be the recommended way.</p>
744740

745741
### Implementing a TypeCasting class
746742

747-
If you need to support `Intersection` type you need to provide your own class to typecast the value according
748-
to your own rules. Since the class is not registered by default:
743+
If you need to support `Intersection` type you need to provide your own class to typecast the value according to your own rules. Since the class is not registered by default:
749744

750745
- you must configure its usage via the `MapCell` attribute `cast` argument
751746
- it won't be available during autodiscovery.

0 commit comments

Comments
 (0)