Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Dec 21, 2023
1 parent 67d8134 commit 8d777e1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Models/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,32 @@ public static function content(Model $model, string $field)
'[store_street_line_1]' => Rapidez::config('general/store_information/street_line1'),
'[store_street_line_2]' => Rapidez::config('general/store_information/street_line2'),
'[store_city]' => Rapidez::config('general/store_information/city'),
'[store_postcode]' => Rapidez::config('general/store_information/postcode')
'[store_postcode]' => Rapidez::config('general/store_information/postcode'),
]));

// Remove double spaces
return preg_replace('/\s+/', ' ', $value);
}

protected static function getModelType(Model $model) {
protected static function getModelType(Model $model)
{
return match (true) {
$model instanceof Product => 1,
$model instanceof Product => 1,
$model instanceof Category => 2
};
}

protected static function getReplaceKeys(string $value) {
protected static function getReplaceKeys(string $value)
{
preg_match_all('/\[(.*?)\]/', $value, $matches);

return $matches[0];
}

protected static function getReplaceValue(Model $model, string $replaceKey) {
protected static function getReplaceValue(Model $model, string $replaceKey)
{
$replace = match (true) {
$model instanceof Product => str_replace('product_', '', $replaceKey),
$model instanceof Product => str_replace('product_', '', $replaceKey),
$model instanceof Category => str_replace('category_', '', $replaceKey)
};

Expand Down

0 comments on commit 8d777e1

Please sign in to comment.