Code Duplication    Length = 13-17 lines in 2 locations

src/Traits/checkedTrait.php 2 locations

@@ 51-67 (lines=17) @@
48
        }
49
50
        //Jeżeli jest kolekcją obiektów to obowiązkowo należy podać drugi parametr jakim jest nazwa pola
51
        if (is_object($value) && $oKey) {
52
            foreach($value as $v)
53
            {
54
                if (property_exists($v, $oKey))
55
                {
56
                    $prop = $v->$oKey;
57
                    if (is_bool($prop))
58
                    {
59
                        $this->checked = $prop;
60
                    } else
61
                    {
62
                        $this->checked = $prop == $this->value;
63
                    }
64
                }
65
            }
66
            return $this;
67
        }
68
69
        //Jeżeli jest obiektem
70
        if (is_object($value) && $oKey) {
@@ 70-82 (lines=13) @@
67
        }
68
69
        //Jeżeli jest obiektem
70
        if (is_object($value) && $oKey) {
71
            if (property_exists($value, $oKey))
72
            {
73
                $prop = $value->$oKey;
74
                if (is_bool($prop))
75
                {
76
                    $this->checked = $prop;
77
                } else
78
                {
79
                    $this->checked = $prop == $this->value;
80
                }
81
            }
82
        }
83
84
        if (is_bool($value)) {
85
            $this->checked = $value;