Move the whole compiler GET of the component object to now use the container->component object/class.
This commit is contained in:
@@ -176,7 +176,7 @@ abstract class Helper
|
||||
if (($helper = self::get($option, false)) !== false &&
|
||||
method_exists($helper, $method))
|
||||
{
|
||||
// we know this is bad...
|
||||
// we know this is not ideal...
|
||||
// so we need to move these
|
||||
// functions to their own classes
|
||||
return call_user_func_array([$helper, $method], $arguments);
|
||||
|
@@ -70,7 +70,7 @@ abstract class FileHelper
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$tmp = array();
|
||||
$tmp['name'] = str_replace('./', '', $file);
|
||||
$tmp['name'] = str_replace('./', '', (string) $file);
|
||||
$tmp['data'] = self::getContent($file);
|
||||
$tmp['time'] = filemtime($file);
|
||||
$zipArray[] = $tmp;
|
||||
@@ -222,7 +222,7 @@ abstract class FileHelper
|
||||
chdir($joomla);
|
||||
|
||||
// return array of files
|
||||
return array_map( function($file) { return str_replace('./', '/', $file); }, (array) ArrayHelper::merge($files));
|
||||
return array_map( fn($file) => str_replace('./', '/', (string) $file), (array) ArrayHelper::merge($files));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ abstract class FileHelper
|
||||
$filePath = Helper::getParams()->get($target, $default);
|
||||
|
||||
// check the file path (revert to default only of not a hidden file path)
|
||||
if ('hiddenfilepath' !== $target && strpos($filePath, JPATH_SITE) === false)
|
||||
if ('hiddenfilepath' !== $target && strpos((string) $filePath, (string) JPATH_SITE) === false)
|
||||
{
|
||||
$filePath = $default;
|
||||
}
|
||||
@@ -297,9 +297,9 @@ abstract class FileHelper
|
||||
// return the url
|
||||
if ('url' === $type)
|
||||
{
|
||||
if (\strpos($filePath, JPATH_SITE) !== false)
|
||||
if (\strpos((string) $filePath, (string) JPATH_SITE) !== false)
|
||||
{
|
||||
$filePath = trim( str_replace( JPATH_SITE, '', $filePath), '/');
|
||||
$filePath = trim( str_replace( JPATH_SITE, '', (string) $filePath), '/');
|
||||
|
||||
return Uri::root() . $filePath . '/' . $fileName;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ abstract class FileHelper
|
||||
}
|
||||
|
||||
// sanitize the path
|
||||
return '/' . trim( $filePath, '/' ) . '/' . $fileName;
|
||||
return '/' . trim((string) $filePath, '/' ) . '/' . $fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -91,7 +91,7 @@ abstract class MathHelper
|
||||
// loop the values and run bcadd
|
||||
foreach($array as $val)
|
||||
{
|
||||
$value = bcadd($value, $val, $scale);
|
||||
$value = bcadd($value, (string) $val, $scale);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ abstract class StringHelper
|
||||
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
|
||||
|
||||
// http://stackoverflow.com/a/2021729/1429677
|
||||
return preg_replace('/\s+/', ' ', $string);
|
||||
return preg_replace('/\s+/', ' ', (string) $string);
|
||||
}
|
||||
// remove all other characters
|
||||
$string = trim((string) $string);
|
||||
@@ -134,18 +134,18 @@ abstract class StringHelper
|
||||
// remove all and keep only characters
|
||||
if ($keepOnlyCharacters)
|
||||
{
|
||||
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
||||
$string = preg_replace("/[^A-Za-z ]/", '', (string) $string);
|
||||
}
|
||||
// keep both numbers and characters
|
||||
else
|
||||
{
|
||||
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
|
||||
$string = preg_replace("/[^A-Za-z0-9 ]/", '', (string) $string);
|
||||
}
|
||||
// select final adaptations
|
||||
if ($type === 'L' || $type === 'strtolower')
|
||||
{
|
||||
// replace white space with underscore
|
||||
$string = preg_replace('/\s+/', (string) $spacer, $string);
|
||||
$string = preg_replace('/\s+/', (string) $spacer, (string) $string);
|
||||
// default is to return lower
|
||||
return strtolower($string);
|
||||
}
|
||||
|
Reference in New Issue
Block a user