Code Duplication    Length = 14-15 lines in 4 locations

src/Device/DistillerParameters/FontTrait.php 1 location

@@ 52-65 (lines=14) @@
49
     *
50
     * @return string
51
     */
52
    public function getCannotEmbedFontPolicy()
53
    {
54
        $value = $this->getArgumentValue('-dCannotEmbedFontPolicy');
55
        if (null === $value) {
56
            switch ($this->getPdfSettings()) {
57
                case PdfSettings::PREPRESS:
58
                    return CannotEmbedFontPolicy::ERROR;
59
                default:
60
                    return CannotEmbedFontPolicy::WARNING;
61
            }
62
        }
63
64
        return ltrim($value, '/');
65
    }
66
67
    /**
68
     * Set cannot embed font policy

src/Device/DistillerParameters/MonoImageCompressionTrait.php 2 locations

@@ 204-217 (lines=14) @@
201
     *
202
     * @return string
203
     */
204
    public function getMonoImageDownsampleType()
205
    {
206
        $value = $this->getArgumentValue('-dMonoImageDownsampleType');
207
        if (null === $value) {
208
            switch ($this->getPdfSettings()) {
209
                case PdfSettings::PREPRESS:
210
                    return ImageDownsampleType::BICUBIC;
211
                default:
212
                    return ImageDownsampleType::SUBSAMPLE;
213
            }
214
        }
215
216
        return ltrim($value, '/');
217
    }
218
219
    /**
220
     * Set monochrome image downsample type
@@ 281-295 (lines=15) @@
278
     *
279
     * @return int
280
     */
281
    public function getMonoImageResolution()
282
    {
283
        $value = $this->getArgumentValue('-dMonoImageResolution');
284
        if (null === $value) {
285
            switch ($this->getPdfSettings()) {
286
                case PdfSettings::PRINTER:
287
                case PdfSettings::PREPRESS:
288
                    return 1200;
289
                default:
290
                    return 300;
291
            }
292
        }
293
294
        return intval($value);
295
    }
296
297
    /**
298
     * Set monochrome image resolution

src/Device/DistillerParametersTrait.php 1 location

@@ 133-146 (lines=14) @@
130
     *
131
     * @return float
132
     */
133
    public function getCompatibilityLevel()
134
    {
135
        $value = $this->getArgumentValue('-dCompatibilityLevel');
136
        if (null === $value) {
137
            switch ($this->getPdfSettings()) {
138
                case PdfSettings::SCREEN:
139
                    return 1.3;
140
                default:
141
                    return 1.4;
142
            }
143
        }
144
145
        return floatval($value);
146
    }
147
148
    /**
149
     * Set compatibility level