Code Duplication    Length = 12-12 lines in 2 locations

src/Intraface/Pdf.php 2 locations

@@ 102-113 (lines=12) @@
99
     *
100
     * @return void
101
     */
102
    public function setX($value)
103
    {
104
        if (is_int($value)) {
105
            $this->value['x'] = $this->get('margin_left') + $value;
106
        } elseif (is_string($value) && substr($value, 0, 1) == "+") {
107
            $this->value['x'] +=  intval(substr($value, 1));
108
        } elseif (is_string($value) && substr($value, 0, 1) == "-") {
109
            $this->value['x'] -= intval(substr($value, 1));
110
        } else {
111
            throw new Exception('Ugyldig værdi i setX: '.$value);
112
        }
113
    }
114
115
    /**
116
     * Sets the y
@@ 122-133 (lines=12) @@
119
     *
120
     * @return void
121
     */
122
    public function setY($value)
123
    {
124
        if (is_int($value)) {
125
            $this->value['y'] = $this->page_height - $this->get('margin_top') - $value;
126
        } elseif (is_string($value) && substr($value, 0, 1) == "+") {
127
            $this->value['y'] += intval(substr($value, 1));
128
        } elseif (is_string($value) && substr($value, 0, 1) == "-") {
129
            $this->value['y'] -= intval(substr($value, 1));
130
        } else {
131
            throw new Exception("Ugyldig værdi i setY: ".$value);
132
        }
133
    }
134
135
    /**
136
     * Adds the header to the document