Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8dac42c

Browse filesBrowse files
javaDeveloperKidchalasr
javaDeveloperKid
authored andcommitted
fix typo in AbstractNormalizerContextBuilder::withDefaultContructorArguments()
1 parent 572209f commit 8dac42c
Copy full SHA for 8dac42c

File tree

3 files changed

+18
-5
lines changed
Filter options

3 files changed

+18
-5
lines changed

‎src/Symfony/Component/Serializer/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* Add `Default` and "class name" default groups
1010
* Add `AbstractNormalizer::FILTER_BOOL` context option
1111
* Add `CamelCaseToSnakeCaseNameConverter::REQUIRE_SNAKE_CASE_PROPERTIES` context option
12+
* Deprecate `AbstractNormalizerContextBuilder::withDefaultContructorArguments(?array $defaultContructorArguments)`, use `withDefaultConstructorArguments(?array $defaultConstructorArguments)` instead (note the missing `s` character in Contructor word in deprecated method)
1213

1314
7.0
1415
---

‎src/Symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php
+16-4Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,29 @@ public function withAllowExtraAttributes(?bool $allowExtraAttributes): static
104104
}
105105

106106
/**
107-
* Configures an hashmap of classes containing hashmaps of constructor argument => default value.
107+
* @deprecated since Symfony 7.1, use withDefaultConstructorArguments(?array $defaultConstructorArguments)" instead
108+
*
109+
* @param array<class-string, array<string, mixed>>|null $defaultContructorArguments
110+
*/
111+
public function withDefaultContructorArguments(?array $defaultContructorArguments): static
112+
{
113+
trigger_deprecation('symfony/serializer', '7.1', 'The "%s()" method is deprecated, use "withDefaultConstructorArguments(?array $defaultConstructorArguments)" instead.', __METHOD__);
114+
115+
return self::withDefaultConstructorArguments($defaultContructorArguments);
116+
}
117+
118+
/**
119+
* Configures a hashmap of classes containing hashmaps of constructor argument => default value.
108120
*
109121
* The names need to match the parameter names in the constructor arguments.
110122
*
111123
* Eg: [Foo::class => ['foo' => true, 'bar' => 0]]
112124
*
113-
* @param array<class-string, array<string, mixed>>|null $defaultContructorArguments
125+
* @param array<class-string, array<string, mixed>>|null $defaultConstructorArguments
114126
*/
115-
public function withDefaultContructorArguments(?array $defaultContructorArguments): static
127+
public function withDefaultConstructorArguments(?array $defaultConstructorArguments): static
116128
{
117-
return $this->with(AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS, $defaultContructorArguments);
129+
return $this->with(AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS, $defaultConstructorArguments);
118130
}
119131

120132
/**

‎src/Symfony/Component/Serializer/Tests/Context/Normalizer/AbstractNormalizerContextBuilderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Tests/Context/Normalizer/AbstractNormalizerContextBuilderTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testWithers(array $values)
4141
->withGroups($values[AbstractNormalizer::GROUPS])
4242
->withAttributes($values[AbstractNormalizer::ATTRIBUTES])
4343
->withAllowExtraAttributes($values[AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES])
44-
->withDefaultContructorArguments($values[AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS])
44+
->withDefaultConstructorArguments($values[AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS])
4545
->withCallbacks($values[AbstractNormalizer::CALLBACKS])
4646
->withCircularReferenceHandler($values[AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER])
4747
->withIgnoredAttributes($values[AbstractNormalizer::IGNORED_ATTRIBUTES])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.