Skip to content

Commit

Permalink
PSR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 3, 2015
1 parent 3f33e97 commit dc65475
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions system/src/Grav/Common/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public static function mergeObjects($obj1, $obj2)
* @param $dir
* @return bool
*/
public static function rrmdir($dir) {
public static function rrmdir($dir)
{
$files = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS),
\RecursiveIteratorIterator::CHILD_FIRST
Expand All @@ -55,9 +56,13 @@ public static function rrmdir($dir) {
/** @var \DirectoryIterator $fileinfo */
foreach ($files as $fileinfo) {
if ($fileinfo->isDir()) {
if (false === rmdir($fileinfo->getRealPath())) return false;
if (false === rmdir($fileinfo->getRealPath())) {
return false;
}
} else {
if (false === unlink($fileinfo->getRealPath())) return false;
if (false === unlink($fileinfo->getRealPath())) {
return false;
}
}
}

Expand All @@ -74,7 +79,8 @@ public static function rrmdir($dir) {
* @param bool $considerHtml
* @return string
*/
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
$open_tags = array();
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
Expand Down

0 comments on commit dc65475

Please sign in to comment.