Skip to content

Commit

Permalink
Fix Json addition
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Nov 24, 2024
1 parent 097b3b2 commit 61fb216
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ All Notable changes to `Csv` will be documented in this file

### Added

- None
- `JsonConverter::withPrettyPrint` now accepts an optional `$identSize` parameter as its unique parameter.

### Deprecated

- `JsonConverter::indentSize`

### Fixed

- `JsonConverter::withPrettyPrint` now accepts the `$identSize` as its unique parameter.
- Adding support for `callable` in the `Query\Constraint` namespace.
- `HttpHeaders::forFileDownload` to be inline with RFC2183 and Header name and value best practices.
- Adding forgotten support for `callable` in the `Query\Constraint` namespace.
- Fix `HttpHeaders::forFileDownload` to be inline with RFC2183 and HTTP field name and value best practices.

### Remove

Expand Down
7 changes: 3 additions & 4 deletions docs/9.0/converter/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $converter->useHexQuot(); // returns false the flag is not used
$converter->flags; //returns the actual flags value (as used by json_encode)
```

<p class="message-info">Starting with version <code>9.18.1</code> use
<p class="message-info">Starting with version <code>9.19.0</code> use
<code>JsonConverter::withPrettyPrint</code> to directly set the indent size with the argument <code>$identSize</code>
to its call</p>

Expand All @@ -96,7 +96,7 @@ $converter->depth; //returns the actual depth value (as used by json_encode)

### Json encode indentation

<p class="message-warning">This method is deprecated as of version <code>9.18.1</code> use
<p class="message-warning">This method is deprecated as of version <code>9.19.0</code> use
<code>JsonConverter::withPrettyPrint</code> instead and add the <code>$identSize</code> argument
to its call</p>

Expand Down Expand Up @@ -170,10 +170,9 @@ $document->setHeaderOffset(0);

CharsetConverter::addTo($document, 'iso-8859-15', 'utf-8');
$converter = JsonConverter::create()
->withPrettyPrint()
->withPrettyPrint(2)
->withUnescapedSlashes()
->depth(2)
->indentSize(2)
->formatter(function (array $row) {
$row['nombre'] = (int) $row['nombre'];
$row['annee'] = (int) $row['annee'];
Expand Down
4 changes: 2 additions & 2 deletions src/JsonConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,14 @@ public function convert(iterable $records): Iterator
* DEPRECATION WARNING! This method will be removed in the next major point release.
*
* @see JsonConverter::withPrettyPrint()
* @deprecated Since version 9.18.1
* @deprecated Since version 9.19.0
* @codeCoverageIgnore
*
* Set the indentation size.
*
* @param int<1, max> $indentSize
*/
#[Deprecated(message:'use League\Csv\JsonConverter::withPrettyPrint() instead', since:'league/csv:9.18.1')]
#[Deprecated(message:'use League\Csv\JsonConverter::withPrettyPrint() instead', since:'league/csv:9.19.0')]
public function indentSize(int $indentSize): self
{
return match ($indentSize) {
Expand Down

0 comments on commit 61fb216

Please sign in to comment.