PhpGetBrowser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Crossjoin\Browscap\Formatter;
5
6
/**
7
 * Class PhpGetBrowser
8
 *
9
 * @package Crossjoin\Browscap\Formatter
10
 * @author Christoph Ziegenberg <[email protected]>
11
 * @link https://github.com/crossjoin/browscap
12
 */
13
class PhpGetBrowser extends Formatter
14
{
15
    /**
16
     * PhpGetBrowser constructor.
17
     *
18
     * @param bool $returnArray
19
     */
20
    public function __construct(bool $returnArray = false)
21
    {
22
        $options = self::KEY_LOWER | self::VALUE_BOOLEAN_TO_STRING | self::VALUE_REG_EXP_LOWER;
23
        if ($returnArray) {
24
            $options |= self::RETURN_ARRAY;
25
        } else {
26
            $options |= self::RETURN_OBJECT;
27
        }
28
        parent::__construct($options);
29
    }
30
}
31