/
RawMessageType.php
43 lines (38 loc) · 1.08 KB
/
RawMessageType.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php namespace DCarbone\JSONToGO\Types;
/*
* Copyright (C) 2016-2017 Daniel Carbone (daniel.p.carbone@gmail.com)
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
use DCarbone\JSONToGO\Configuration;
/**
* Class RawMessageType
* @package DCarbone\JSONToGO\Types
*/
class RawMessageType extends SimpleType {
/**
* RawMessageType constructor.
*
* @param \DCarbone\JSONToGO\Configuration $configuration
* @param string $name
* @param mixed $example
*/
public function __construct(Configuration $configuration, string $name, $example) {
parent::__construct($configuration, $name, $example, 'json.RawMessage');
}
/**
* @param int $indentLevel
* @return string
*/
public function toGO(int $indentLevel = 0): string {
if (null === $this->parent()) {
return sprintf(
'type %s %s',
$this->goTypeName(),
$this->type()
);
}
return $this->type();
}
}