Code Duplication    Length = 14-15 lines in 5 locations

src/Device/DistillerParametersTrait.php 1 location

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

src/Device/DistillerParameters/ColorConversionTrait.php 1 location

@@ 407-421 (lines=15) @@
404
     *
405
     * @return string
406
     */
407
    public function getUcrAndBgInfo()
408
    {
409
        $value = $this->getArgumentValue('-dUCRandBGInfo');
410
        if (null === $value) {
411
            switch ($this->getPdfSettings()) {
412
                case PdfSettings::PRINTER:
413
                case PdfSettings::PREPRESS:
414
                    return UcrAndBgInfo::PRESERVE;
415
                default:
416
                    return UcrAndBgInfo::REMOVE;
417
            }
418
        }
419
420
        return ltrim($value, '/');
421
    }
422
423
    /**
424
     * Set UCR and BG info

src/Device/DistillerParameters/FontTrait.php 1 location

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

src/Device/DistillerParameters/MonoImageCompressionTrait.php 2 locations

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