Move into nested docroot
This commit is contained in:
parent
83a0d3a149
commit
c8b70abde9
13405 changed files with 0 additions and 0 deletions
35
web/core/modules/hal/src/Encoder/JsonEncoder.php
Normal file
35
web/core/modules/hal/src/Encoder/JsonEncoder.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\hal\Encoder;
|
||||
|
||||
use Symfony\Component\Serializer\Encoder\JsonEncoder as SymfonyJsonEncoder;
|
||||
|
||||
/**
|
||||
* Encodes HAL data in JSON.
|
||||
*
|
||||
* Simply respond to hal_json format requests using the JSON encoder.
|
||||
*/
|
||||
class JsonEncoder extends SymfonyJsonEncoder {
|
||||
|
||||
/**
|
||||
* The formats that this Encoder supports.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $format = 'hal_json';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function supportsEncoding($format) {
|
||||
return $format == $this->format;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function supportsDecoding($format) {
|
||||
return $format == $this->format;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in a new issue