get rid of most of the checkstyle warnings

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-24 13:50:45 +01:00
parent 30f5902b88
commit 7416a41a42
41 changed files with 129 additions and 119 deletions

View File

@@ -55,16 +55,10 @@ class IdnaWrapper
*/
public function encode($to_encode)
{
$to_encode = $this->is_utf8($to_encode) ? $to_encode : utf8_encode($to_encode);
$to_encode = $this->isUtf8($to_encode) ? $to_encode : utf8_encode($to_encode);
return $this->idna_converter->encode($to_encode);
}
public function encode_uri($to_encode)
{
$to_encode = $this->is_utf8($to_encode) ? $to_encode : utf8_encode($to_encode);
return $this->idna_converter->encodeUri($to_encode);
}
/**
* Decode a domain name, a email address or a list of one of both.
*
@@ -87,7 +81,7 @@ class IdnaWrapper
*
* @return boolean
*/
private function is_utf8($string = null)
private function isUtf8($string = null)
{
if (function_exists("mb_detect_encoding")) {
if (mb_detect_encoding($string, 'UTF-8, ISO-8859-1') === 'UTF-8') {