Skip to content

Commit

Permalink
PSR-2 compliancy - Code must use 4 spaces for indenting and Visibilit…
Browse files Browse the repository at this point in the history
…y must be declared on all properties and methods
  • Loading branch information
g-scalvini committed Jul 31, 2023
1 parent 5fa66ce commit f354351
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
17 changes: 9 additions & 8 deletions HTML/Safe.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
Expand Down Expand Up @@ -669,9 +670,9 @@ public function parse($doc)
* @return string Decoded document
* @access private
*/
function repackUTF7($str)
public function repackUTF7($str)
{
return preg_replace_callback('!\+([0-9a-zA-Z/]+)\-!', array($this, 'repackUTF7Callback'), $str);
return preg_replace_callback('!\+([0-9a-zA-Z/]+)\-!', array($this, 'repackUTF7Callback'), $str);
}

/**
Expand All @@ -681,11 +682,11 @@ function repackUTF7($str)
* @return string Recoded string
* @access private
*/
function repackUTF7Callback($str)
public function repackUTF7Callback($str)
{
$str = base64_decode($str[1]);
$str = preg_replace_callback('/^((?:\x00.)*)((?:[^\x00].)+)/', array($this, 'repackUTF7Back'), $str);
return preg_replace('/\x00(.)/', '$1', $str);
$str = base64_decode($str[1]);
$str = preg_replace_callback('/^((?:\x00.)*)((?:[^\x00].)+)/', array($this, 'repackUTF7Back'), $str);
return preg_replace('/\x00(.)/', '$1', $str);
}

/**
Expand All @@ -695,8 +696,8 @@ function repackUTF7Callback($str)
* @return string Recoded string
* @access private
*/
function repackUTF7Back($str)
public function repackUTF7Back($str)
{
return $str[1].'+'.rtrim(base64_encode($str[2]), '=').'-';
return $str[1].'+'.rtrim(base64_encode($str[2]), '=').'-';
}
}
1 change: 1 addition & 0 deletions tests/HTML_SafeTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

require_once 'PHPUnit/Framework/TestCase.php';
require_once 'HTML/Safe.php';

Expand Down

0 comments on commit f354351

Please sign in to comment.