8000 more typo fixes · symfony/symfony@078f7f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 078f7f3

Browse files
committed
more typo fixes
1 parent c3a711d commit 078f7f3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/Symfony/Component/Serializer/Serializer.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ public function supportsDeserialization($format)
244244
public function supportsEncoding($format)
245245
{
246246
try {
247-
$encoder = $this->getEncoder($format);
247+
$this->getEncoder($format);
248248
} catch (\RuntimeException $e) {
249249
return false;
250250
}
251251

252-
return $encoder instanceof EncoderInterface;
252+
return true;
253253
}
254254

255255
/**
@@ -258,12 +258,12 @@ public function supportsEncoding($format)
258258
public function supportsDecoding($format)
259259
{
260260
try {
261-
$encoder = $this->getEncoder($format);
261+
$this->getDecoder($format);
262262
} catch (\RuntimeException $e) {
263263
return false;
264264
}
265265

266-
return $encoder instanceof DecoderInterface;
266+
return true;
267267
}
268268

269269
/**
@@ -278,7 +278,9 @@ private function getEncoder($format)
278278
}
279279

280280
foreach ($this->encoders as $i => $encoder) {
281-
if ($encoder->supportsEncoding($format)) {
281+
if ($encoder instanceof EncoderInterface
282+
&& $encoder->supportsEncoding($format)
283+
) {
282284
$this->encoderByFormat[$format] = $i;
283285
return $encoder;
284286
}
@@ -299,7 +301,9 @@ private function getDecoder($format)
299301
}
300302

301303
foreach ($this->encoders as $i => $encoder) {
302-
if ($encoder->supportsDecoding($format)) {
304+
if ($encoder instanceof DecoderInterface
305+
&& $encoder->supportsDecoding($format)
306+
) {
303307
$this->decoderByFormat[$format] = $i;
304308
return $encoder;
305309
}

0 commit comments

Comments
 (0)
0