Skip to content
Snippets Groups Projects
Commit 6f7d2ef1 authored by catch's avatar catch
Browse files

Issue #3232832 by daffie, longwave: [Symfony 6] Add various type hints to...

Issue #3232832 by daffie, longwave: [Symfony 6] Add various type hints to Drupal\serialization\Encoder\JsonEncoder::supportsEncoding() and ::supportsDecoding() and Drupal\serialization\Encoder\XmlEncoder::supportsEncoding(), ::encode(), ::decode() and ::supportsDecoding()
parent a7825ea9
No related branches found
No related tags found
No related merge requests found
......@@ -37,14 +37,14 @@ public function __construct(JsonEncode $encodingImpl = NULL, JsonDecode $decodin
/**
* {@inheritdoc}
*/
public function supportsEncoding($format) {
public function supportsEncoding($format): bool {
return in_array($format, static::$format);
}
/**
* {@inheritdoc}
*/
public function supportsDecoding($format) {
public function supportsDecoding($format): bool {
return in_array($format, static::$format);
}
......
......@@ -64,28 +64,28 @@ public function setBaseEncoder($encoder) {
/**
* {@inheritdoc}
*/
public function encode($data, $format, array $context = []) {
public function encode($data, $format, array $context = []): string {
return $this->getBaseEncoder()->encode($data, $format, $context);
}
/**
* {@inheritdoc}
*/
public function supportsEncoding($format) {
public function supportsEncoding($format): bool {
return in_array($format, static::$format);
}
/**
* {@inheritdoc}
*/
public function decode($data, $format, array $context = []) {
public function decode($data, $format, array $context = []): mixed {
return $this->getBaseEncoder()->decode($data, $format, $context);
}
/**
* {@inheritdoc}
*/
public function supportsDecoding($format) {
public function supportsDecoding($format): bool {
return in_array($format, static::$format);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment