SimpleString::getMediaType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @package     i3Soft\CDA
4
 * @author      Peter Gee <https://github.com/pgee70>
5
 * @link        https://github.com/pgee70/cda
6
 *
7
 */
8
9
10
namespace i3Soft\CDA\DataType\TextAndMultimedia;
11
12
13
class SimpleString extends BinaryData
14
{
15
16
  /**
17
   * SimpleString constructor.
18
   *
19
   * @param $content
20
   */
21
  public function __construct ($content)
22
  {
23
    $this->setContent($content);
24
  }
25
26
  /**
27
   * @param $content
28
   *
29
   * @return BinaryData|void
30
   */
31
  public function setContent ($content)
32
  {
33
    if (!\is_string($content))
34
    {
35
      throw new \InvalidArgumentException('the data should be a string, ' . \gettype($content) . ' given.');
36
    }
37
    parent::setContent($content);
38
  }
39
40
  /**
41
   * @return string
42
   */
43
  public function getMediaType (): string
44
  {
45
    return 'text';
46
  }
47
}