Code Duplication    Length = 4-4 lines in 2 locations

src/Models/Discount.php 2 locations

@@ 152-155 (lines=4) @@
149
150
        $type = [];
151
152
        if(str_contains($action->type,'fixed')){
153
            $type['type'] = 'cash';
154
            $type['value'] = json_decode($action->configuration, true)['amount'] / 100;
155
        }
156
157
        if(str_contains($action->type,'percentage')){
158
            $type['type'] = 'percentage';
@@ 157-160 (lines=4) @@
154
            $type['value'] = json_decode($action->configuration, true)['amount'] / 100;
155
        }
156
157
        if(str_contains($action->type,'percentage')){
158
            $type['type'] = 'percentage';
159
            $type['value'] = json_decode($action->configuration, true)['percentage'] / 10;
160
        }
161
162
        return $type;
163
    }