Code Duplication    Length = 19-19 lines in 2 locations

src/KnpSnappyAutodetectBundle.php 2 locations

@@ 36-54 (lines=19) @@
33
     *
34
     * @return string
35
     */
36
    private function getImageBinary()
37
    {
38
        $os = $this->detectOs();
39
40
        if ('windows' === $os) {
41
            return 'wemersonjanuario/wkhtmltox-windows-64bit/bin/wkhtmltoimage.exe';
42
        }
43
        if ('mac' === $os) {
44
            return 'messagedigital/wkhtmltoimage-osx/bin/wkhtmltoimage-osx';
45
        }
46
47
        $architecture = $this->detectArchitecture();
48
49
        return sprintf(
50
            'h4cc/wkhtmltoimage-%s/bin/wkhtmltoimage-%s',
51
            $architecture,
52
            $architecture
53
        );
54
    }
55
56
    /**
57
     * Gets wkhtmltopdf binary based on operating system and architecture.
@@ 61-79 (lines=19) @@
58
     *
59
     * @return string
60
     */
61
    private function getPdfBinary()
62
    {
63
        $os = $this->detectOs();
64
65
        if ('windows' === $os) {
66
            return 'wemersonjanuario/wkhtmltox-windows-64bit/bin/wkhtmltopdf.exe';
67
        }
68
        if ('mac' === $os) {
69
            return 'messagedigital/wkhtmltopdf-osx/bin/wkhtmltopdf-osx';
70
        }
71
72
        $architecture = $this->detectArchitecture();
73
74
        return sprintf(
75
            'h4cc/wkhtmltopdf-%s/bin/wkhtmltopdf-%s',
76
            $architecture,
77
            $architecture
78
        );
79
    }
80
81
    /**
82
     * Detects common operating systems.