Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 469 Bytes

YamlTypeEncoder.md

File metadata and controls

28 lines (18 loc) · 469 Bytes

YamlTypeEncoder

<?php

use Chubbyphp\DecodeEncode\Encoder\YamlTypeEncoder;

$encoderType = new YamlTypeEncoder();

echo $encoderType->getContentType();
// 'application/x-yaml'

echo $encoderType->encode(['name' => 'php']);
// 'name: php'

with custom content type

<?php

use Chubbyphp\DecodeEncode\Encoder\YamlTypeEncoder;

$encoderType = new YamlTypeEncoder('application/yaml');

echo $encoderType->getContentType();
// 'application/yaml'