Code Duplication    Length = 9-10 lines in 3 locations

system/modules/Callbacks/models/Category.php 1 location

@@ 79-88 (lines=10) @@
76
        }
77
    }
78
79
    public function resolveViewer() {
80
        if ($this->viewer !== 'inherit') {
81
            return $this->viewer;
82
        } elseif ($this->viewer == 'inherit' && $this->category) {
83
            return $this->category->resolveViewer(true);
84
        } else {
85
            return (!empty(App::$cur->ecommerce->config['defaultCategoryView']) ? App::$cur->ecommerce->config['defaultCategoryView'] : 'itemList');
86
        }
87
    }
88
89
}
90

system/modules/Ecommerce/models/Category.php 2 locations

@@ 143-151 (lines=9) @@
140
        }
141
    }
142
143
    public function resolveTemplate() {
144
        if ($this->template !== 'inherit') {
145
            return $this->template;
146
        } elseif ($this->template == 'inherit' && $this->category) {
147
            return $this->category->resolveTemplate(true);
148
        } else {
149
            return (!empty(\App::$cur->ecommerce->config['defaultCategoryTemplate']) ? \App::$cur->ecommerce->config['defaultCategoryTemplate'] : 'current');
150
        }
151
    }
152
153
    public function resolveViewer() {
154
        if ($this->viewer !== 'inherit') {
@@ 153-162 (lines=10) @@
150
        }
151
    }
152
153
    public function resolveViewer() {
154
        if ($this->viewer !== 'inherit') {
155
            return $this->viewer;
156
        } elseif ($this->viewer == 'inherit' && $this->category) {
157
            return $this->category->resolveViewer(true);
158
        } else {
159
            return (!empty(\App::$cur->ecommerce->config['defaultCategoryView']) ? \App::$cur->ecommerce->config['defaultCategoryView'] : 'itemList');
160
        }
161
    }
162
}