GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

StringObject   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 65
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A setStringData() 0 4 1
A getStringData() 0 4 1
A jsonSerialize() 0 4 1
A __toString() 0 4 1
1
<?php
2
/**
3
 * PHP Exif General String ValueObject
4
 *
5
 * @link        http://github.com/PHPExif/php-exif-common for the canonical source repository
6
 * @copyright   Copyright (c) 2016 Tom Van Herreweghe <[email protected]>
7
 * @license     http://github.com/PHPExif/php-exif-common/blob/master/LICENSE MIT License
8
 * @category    PHPExif
9
 * @package     Common
10
 * @codeCoverageIgnore
11
 */
12
13
namespace PHPExif\Common\Data\ValueObject;
14
15
use \InvalidArgumentException;
16
use \JsonSerializable;
17
use \RuntimeException;
18
19
/**
20
 * String Object
21
 *
22
 * Abstract class for objects with only String data
23
 *
24
 * @category    PHPExif
25
 * @package     Common
26
 */
27
abstract class StringObject implements JsonSerializable
28
{
29
    /**
30
     * Contains the string data
31
     *
32
     * @var string
33
     */
34
    protected $stringData;
35
36
    /**
37
     * @param string $stringData
38
     *
39
     * @throws InvalidArgumentException If given argument is not a string
40
     */
41
    public function __construct($stringData)
42
    {
43
        if (!is_string($stringData)) {
44
            throw new InvalidArgumentException('Given data is not a string');
45
        }
46
47
        $this->setStringData($stringData);
48
    }
49
50
    /**
51
     * Sets the stringData
52
     *
53
     * @param string $stringData
54
     *
55
     * @return void
56
     */
57
    protected function setStringData($stringData)
58
    {
59
        $this->stringData = $stringData;
60
    }
61
62
    /**
63
     * Getter for stringData
64
     *
65
     * @return string
66
     */
67
    public function getStringData()
68
    {
69
        return $this->stringData;
70
    }
71
72
    /**
73
     * @inheritDoc
74
     *
75
     * @return string
76
     */
77
    public function jsonSerialize()
78
    {
79
        return (string) $this;
80
    }
81
82
    /**
83
     * Returns string representation
84
     *
85
     * @return string
86
     */
87
    public function __toString()
88
    {
89
        return $this->getStringData();
90
    }
91
}
92