Remove all the {{{ and }}} folding

This commit is contained in:
2022-11-25 20:34:27 +01:00
parent b723f47a44
commit 2d6df0d5f0
35 changed files with 0 additions and 1124 deletions
-6
View File
@@ -29,7 +29,6 @@ class Macaddresses
* @return bool
*/
public static function isMACAddress ($mac)
// {{{
{
if (! is_string ($mac))
return false;
@@ -38,7 +37,6 @@ class Macaddresses
preg_match ("/^([a-fA-F0-9]{4}[.]){2}[a-fA-F0-9]{4}$/", $mac) === 1 ||
preg_match ("/^[a-fA-F0-9]{12}$/", $mac) === 1);
}
// }}}
/** Reform the mac address with the separator.
* The provided mac MUST be without separator (can be removed by
@@ -49,14 +47,12 @@ class Macaddresses
* @return string The updated mac address with separators
*/
public static function addSeparator ($mac, $separator = ':', $nbdigit = 2)
// {{{
{
if (strspn ($mac, "0132465789ABCDEFabcdef") !== strlen ($mac))
throw new \Exception (dgettext ("domframework",
"Invalid mac address provided to addSeparator : bad chars"), 406);
return join ($separator, str_split ($mac, $nbdigit));
}
// }}}
/** Remove all the separators from the provided MAC address
* @param string $mac the mac address to update
@@ -65,9 +61,7 @@ class Macaddresses
*/
public static function removeSeparator ($mac,
$separators = array (":", "-", "."))
// {{{
{
return str_replace ($separators, '', $mac);
}
// }}}
}