Code Duplication    Length = 11-13 lines in 2 locations

class/providers/heartrails.php 1 location

@@ 84-96 (lines=13) @@
81
    public function setShotSize($sz)
82
    {
83
        if (isset($sz)) {
84
            if (is_array($sz)) {
85
                if (array_key_exists('width', $sz)) {
86
                    $this->image_width = (int)$sz['width'];
87
                    if (array_key_exists('height', $sz)) {
88
                        $this->image_height = (int)$sz['height'];
89
                    } else {
90
                        $this->image_height = (int)($this->image_width / $this->image_ratio);
91
                    }
92
                } else {
93
                    $this->image_width  = (int)$sz;
94
                    $this->image_height = (int)($sz / $this->image_ratio);
95
                }
96
            }
97
        }
98
    }
99

class/providers/nemui.php 1 location

@@ 85-95 (lines=11) @@
82
    public function setShotSize($sz)
83
    {
84
        if (is_array($sz)) {
85
            if (array_key_exists('width', $sz)) {
86
                $this->image_width = (int)$sz['width'];
87
                if (array_key_exists('height', $sz)) {
88
                    $this->image_height = (int)$sz['height'];
89
                } else {
90
                    $this->image_height = (int)($this->image_width / $this->image_ratio);
91
                }
92
            } else {
93
                $this->image_width  = (int)$sz;
94
                $this->image_height = (int)($sz / $this->image_ratio);
95
            }
96
        } else {
97
            $this->image_width  = (int)$sz;
98
            $this->image_height = (int)($sz / $this->image_ratio);