Skip to content

Commit 494093a

Browse files
mtarldnicolas-grekas
authored andcommitted
[JsonStreamer] Remove deprecated code
1 parent 5664e05 commit 494093a

File tree

3 files changed

+8
-137
lines changed

3 files changed

+8
-137
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
8.0
5+
---
6+
7+
* Remove `$streamToNativeValueTransformers` from `PropertyMetadata`
8+
49
7.4
510
---
611

Mapping/PropertyMetadata.php

Lines changed: 3 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,14 @@
2020
*/
2121
final class PropertyMetadata
2222
{
23-
private ?array $streamToNativeValueTransformers;
24-
2523
/**
26-
* @param list<string|\Closure> $valueTransformers
27-
* @param list<string|\Closure>|null $streamToNativeValueTransformers
24+
* @param list<string|\Closure> $valueTransformers
2825
*/
2926
public function __construct(
3027
private ?string $name,
3128
private Type $type,
3229
private array $valueTransformers = [],
33-
?array $streamToNativeValueTransformers = null,
3430
) {
35-
if (null !== $streamToNativeValueTransformers) {
36-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "streamToNativeValueTransformers" parameter of the "%s()" method is deprecated. Use "valueTransformers" instead.', __METHOD__);
37-
}
38-
39-
$this->streamToNativeValueTransformers = $streamToNativeValueTransformers;
4031
}
4132

4233
/**
@@ -54,7 +45,7 @@ public function getName(): ?string
5445

5546
public function withName(?string $name): self
5647
{
57-
return new self($name, $this->type, $this->valueTransformers, $this->streamToNativeValueTransformers);
48+
return new self($name, $this->type, $this->valueTransformers);
5849
}
5950

6051
public function getType(): Type
@@ -64,7 +55,7 @@ public function getType(): Type
6455

6556
public function withType(Type $type): self
6657
{
67-
return new self($this->name, $type, $this->valueTransformers, $this->streamToNativeValueTransformers);
58+
return new self($this->name, $type, $this->valueTransformers);
6859
}
6960

7061
/**
@@ -92,82 +83,4 @@ public function withAdditionalValueTransformer(string|\Closure $valueTransformer
9283

9384
return $this->withValueTransformers($valueTransformers);
9485
}
95-
96-
/**
97-
* @deprecated since Symfony 7.4, use "getValueTransformers" instead
98-
*
99-
* @return list<string|\Closure>
100-
*/
101-
public function getNativeToStreamValueTransformer(): array
102-
{
103-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "%s()" method is deprecated, use "%s::getValueTransformers()" instead.', __METHOD__, self::class);
104-
105-
return $this->valueTransformers;
106-
}
107-
108-
/**
109-
* @deprecated since Symfony 7.4, use "withValueTransformers" instead
110-
*
111-
* @param list<string|\Closure> $nativeToStreamValueTransformers
112-
*/
113-
public function withNativeToStreamValueTransformers(array $nativeToStreamValueTransformers): self
114-
{
115-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "%s()" method is deprecated, use "%s::withValueTransformers()" instead.', __METHOD__, self::class);
116-
117-
return new self($this->name, $this->type, $nativeToStreamValueTransformers, $this->streamToNativeValueTransformers);
118-
}
119-
120-
/**
121-
* @deprecated since Symfony 7.4, use "withAdditionalValueTransformer" instead
122-
*/
123-
public function withAdditionalNativeToStreamValueTransformer(string|\Closure $nativeToStreamValueTransformer): self
124-
{
125-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "%s()" method is deprecated, use "%s::withAdditionalValueTransformer()" instead.', __METHOD__, self::class);
126-
127-
$nativeToStreamValueTransformers = $this->valueTransformers;
128-
129-
$nativeToStreamValueTransformers[] = $nativeToStreamValueTransformer;
130-
$nativeToStreamValueTransformers = array_values(array_unique($nativeToStreamValueTransformers));
131-
132-
return $this->withNativeToStreamValueTransformers($nativeToStreamValueTransformers);
133-
}
134-
135-
/**
136-
* @deprecated since Symfony 7.4, use "getValueTransformers" instead
137-
*
138-
* @return list<string|\Closure>
139-
*/
140-
public function getStreamToNativeValueTransformers(): array
141-
{
142-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "%s()" method is deprecated, use "%s::getValueTransformers()" instead.', __METHOD__, self::class);
143-
144-
return $this->streamToNativeValueTransformers ?? [];
145-
}
146-
147-
/**
148-
* @deprecated since Symfony 7.4, use "withValueTransformers" instead
149-
*
150-
* @param list<string|\Closure> $streamToNativeValueTransformers
151-
*/
152-
public function withStreamToNativeValueTransformers(array $streamToNativeValueTransformers): self
153-
{
154-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "%s()" method is deprecated, use "%s::withValueTransformers()" instead.', __METHOD__, self::class);
155-
156-
return new self($this->name, $this->type, $this->valueTransformers, $streamToNativeValueTransformers);
157-
}
158-
159-
/**
160-
* @deprecated since Symfony 7.4, use "withAdditionalValueTransformer" instead
161-
*/
162-
public function withAdditionalStreamToNativeValueTransformer(string|\Closure $streamToNativeValueTransformer): self
163-
{
164-
trigger_deprecation('symfony/json-streamer', '7.4', 'The "%s()" method is deprecated, use "%s::withAdditionalValueTransformer()" instead.', __METHOD__, self::class);
165-
166-
$streamToNativeValueTransformers = $this->streamToNativeValueTransformers ?? [];
167-
168-
$streamToNativeValueTransformers[] = $streamToNativeValueTransformer;
169-
$streamToNativeValueTransformers = array_values(array_unique($streamToNativeValueTransformers));
170-
171-
return $this->withStreamToNativeValueTransformers($streamToNativeValueTransformers);
172-
}
17386
}

Tests/Mapping/PropertyMetadataTest.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)