Code Duplication    Length = 15-15 lines in 2 locations

src/OsDetector.php 2 locations

@@ 95-109 (lines=15) @@
92
     *
93
     * @return bool
94
     */
95
    private static function checkOSX(Os $os, UserAgent $userAgent)
96
    {
97
        if (stripos($userAgent->getUserAgentString(), 'OS X') !== false) {
98
            $os->setName($os::OSX);
99
            if (preg_match('/OS X ([\d\._]*)/i', $userAgent->getUserAgentString(), $matches)) {
100
                if (isset($matches[1])) {
101
                    $os->setVersion(str_replace('_', '.', $matches[1]));
102
                }
103
            }
104
105
            return true;
106
        }
107
108
        return false;
109
    }
110
111
    /**
112
     * Determine if the user's operating system is Windows.
@@ 192-206 (lines=15) @@
189
     *
190
     * @return bool
191
     */
192
    private static function checkWindowsPhone(Os $os, UserAgent $userAgent)
193
    {
194
        if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) {
195
            $os->setName($os::WINDOWS_PHONE);
196
            // Windows version
197
            if (preg_match('/Windows Phone ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
198
                if (isset($matches[1])) {
199
                    $os->setVersion((float)$matches[1]);
200
                }
201
            }
202
    
203
            return true;
204
        }
205
        return false;
206
    }
207
208
    /**
209
     * Determine if the user's operating system is SymbOS.