Skip to content

Commit

Permalink
Fix errors within getFormatedPhone method
Browse files Browse the repository at this point in the history
  • Loading branch information
javangriff committed Nov 10, 2021
1 parent 0c1b50f commit 8d82246
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/twigextensions/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public function svgPlaceholder($width, $height = null)
return 'data:image/svg+xml;base64,' . base64_encode($src);
}

public function getFormattedPhone($value)
public function getFormattedPhone($phone)
{
// Strip out any non-numbers
$formattedPhone = str_replace('/[^0-9]/', '', $phone);
$formattedPhone = preg_replace('/[^0-9]/', '', $phone);

// Format area code, and prepend '+61'
$formattedPhone = str_replace('/^0/', '+61', $formattedPhone);
$formattedPhone = preg_replace('/^0/', '+61', $formattedPhone);

return $formattedPhone;
}
Expand Down

0 comments on commit 8d82246

Please sign in to comment.