Code Duplication    Length = 9-10 lines in 3 locations

src/models/Package.php 3 locations

@@ 159-168 (lines=10) @@
156
     * @throws InvalidConfigException
157
     * @return mixed
158
     */
159
    public function getResourceValue($type)
160
    {
161
        $method = 'getResourceValue_' . $type;
162
163
        if (method_exists($this, $method)) {
164
            return call_user_func([$this, $method]);
165
        }
166
167
        throw new InvalidConfigException("Resource type \"$type\" is not described in the Package");
168
    }
169
170
    /**
171
     * @param string $type
@@ 175-183 (lines=9) @@
172
     * @throws InvalidConfigException
173
     * @return string
174
     */
175
    public function getResourceTitle($type)
176
    {
177
        $method = 'getResourceTitle_' . $type;
178
        if (method_exists($this, $method)) {
179
            return call_user_func([$this, $method]);
180
        }
181
182
        throw new InvalidConfigException("Resource type \"$type\" is not described in the Package");
183
    }
184
185
    /**
186
     * @param $type
@@ 190-199 (lines=10) @@
187
     * @throws InvalidConfigException
188
     * @return array|null
189
     */
190
    public function getOverusePrice($type)
191
    {
192
        $method = 'getResourceOveruse_' . $type;
193
        if (method_exists($this, $method)) {
194
            return call_user_func([$this, $method]);
195
        }
196
197
        throw new InvalidConfigException("Overuse getter for resource type \"$type\" is not described in the Package");
198
    }
199
200
    /**
201
     * @param string $type
202
     * @return Part|null