Code Duplication    Length = 15-15 lines in 2 locations

src/OsDetector.php 2 locations

@@ 121-135 (lines=15) @@
118
     *
119
     * @return bool
120
     */
121
    private static function checkOSX(Os $os, UserAgent $userAgent)
122
    {
123
        if (stripos($userAgent->getUserAgentString(), 'OS X') !== false) {
124
            $os->setName($os::OSX);
125
            if (preg_match('/OS X ([\d\._]*)/i', $userAgent->getUserAgentString(), $matches)) {
126
                if (isset($matches[1])) {
127
                    $os->setVersion(str_replace('_', '.', $matches[1]));
128
                }
129
            }
130
131
            return true;
132
        }
133
134
        return false;
135
    }
136
137
    /**
138
     * Determine if the user's operating system is Windows.
@@ 222-236 (lines=15) @@
219
     *
220
     * @return bool
221
     */
222
    private static function checkWindowsPhone(Os $os, UserAgent $userAgent)
223
    {
224
        if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) {
225
            $os->setName($os::WINDOWS_PHONE);
226
            // Windows version
227
            if (preg_match('/Windows Phone ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
228
                if (isset($matches[1])) {
229
                    $os->setVersion((float)$matches[1]);
230
                }
231
            }
232
    
233
            return true;
234
        }
235
        return false;
236
    }
237
238
    /**
239
     * Determine if the user's operating system is SymbOS.