Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 473 Bytes

YamlTypeDecoder.md

File metadata and controls

28 lines (18 loc) · 473 Bytes

YamlTypeDecoder

<?php

use Chubbyphp\DecodeEncode\Decoder\YamlTypeDecoder;

$decoderType = new YamlTypeDecoder();

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

print_r($decoderType->decode('name: php'));
// ['name' => 'php']

with custom content type

<?php

use Chubbyphp\DecodeEncode\Decoder\YamlTypeDecoder;

$decoderType = new YamlTypeDecoder('application/yaml');

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