Move the whole compiler GET of the component object to now use the container->component object/class.
This commit is contained in:
@@ -263,7 +263,7 @@ class Dispenser implements DispenserInterface
|
||||
$script .= $prefix . str_replace(
|
||||
array_keys($this->placeholder->active),
|
||||
array_values($this->placeholder->active),
|
||||
$this->hub[$first][$second]
|
||||
(string) $this->hub[$first][$second]
|
||||
) . $suffix;
|
||||
// clear some memory
|
||||
if ($unset)
|
||||
|
@@ -135,18 +135,18 @@ class External implements ExternalInterface
|
||||
// example: >{3|4
|
||||
// will cut 3 rows at top and 4 rows at bottom
|
||||
// if the external code has 8 or more lines
|
||||
if (($pos = strpos($target, '>{')) !== false)
|
||||
if (($pos = strpos((string) $target, '>{')) !== false)
|
||||
{
|
||||
// the length
|
||||
$target_len = strlen($target);
|
||||
$target_len = strlen((string) $target);
|
||||
// where to cut
|
||||
$cutting = $target_len - $pos;
|
||||
// get the sequence
|
||||
$sequence = substr($target, "-$cutting");
|
||||
$sequence = substr((string) $target, "-$cutting");
|
||||
// remove from the URL
|
||||
$target_url = str_replace($sequence, '', $target);
|
||||
$target_url = str_replace($sequence, '', (string) $target);
|
||||
// set the cut key for this target if not set
|
||||
$this->cutter[trim($target)] = str_replace('>{', '', $sequence);
|
||||
$this->cutter[trim((string) $target)] = str_replace('>{', '', $sequence);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -327,7 +327,7 @@ class Extractor implements ExtractorInterface
|
||||
|
||||
// make sure we have the path correct (the script file is not in admin path for example)
|
||||
// there may be more... will nead to keep our eye on this... since files could be moved during install
|
||||
$file = str_replace('./', '', $file); # TODO (windows path issues)
|
||||
$file = str_replace('./', '', (string) $file); # TODO (windows path issues)
|
||||
|
||||
if ($file !== 'script.php')
|
||||
{
|
||||
@@ -366,10 +366,10 @@ class Extractor implements ExtractorInterface
|
||||
|
||||
// check if the ending placeholder was found
|
||||
if (isset($reading[$targetKey]) && $reading[$targetKey]
|
||||
&& ((trim($lineContent) === $end
|
||||
|| strpos($lineContent, $end) !== false)
|
||||
|| (trim($lineContent) === $endHTML
|
||||
|| strpos($lineContent, $endHTML) !== false)))
|
||||
&& ((trim((string) $lineContent) === $end
|
||||
|| strpos((string) $lineContent, $end) !== false)
|
||||
|| (trim((string) $lineContent) === $endHTML
|
||||
|| strpos((string) $lineContent, $endHTML) !== false)))
|
||||
{
|
||||
// trim the placeholder and if there is still data then load it
|
||||
if (isset($endReplace)
|
||||
@@ -411,7 +411,7 @@ class Extractor implements ExtractorInterface
|
||||
|
||||
$this->new[$pointer[$targetKey]][]
|
||||
= $this->db->quote(
|
||||
base64_encode($c0de)
|
||||
base64_encode((string) $c0de)
|
||||
); // 'code'
|
||||
|
||||
if ($_type == 2)
|
||||
@@ -438,7 +438,7 @@ class Extractor implements ExtractorInterface
|
||||
|
||||
$this->existing[$pointer[$targetKey]]['fields'][]
|
||||
= $this->db->quoteName('code') . ' = '
|
||||
. $this->db->quote(base64_encode($c0de));
|
||||
. $this->db->quote(base64_encode((string) $c0de));
|
||||
|
||||
if ($_type == 2)
|
||||
{
|
||||
@@ -490,8 +490,8 @@ class Extractor implements ExtractorInterface
|
||||
|
||||
// see if the custom code line starts now with PHP/JS comment type
|
||||
if ((!isset($reading[$targetKey]) || !$reading[$targetKey])
|
||||
&& (($i === 1 && trim($lineContent) === $start)
|
||||
|| strpos($lineContent, $start) !== false))
|
||||
&& (($i === 1 && trim((string) $lineContent) === $start)
|
||||
|| strpos((string) $lineContent, $start) !== false))
|
||||
{
|
||||
$commentType = 1; // PHP/JS type
|
||||
$startReplace = $start;
|
||||
@@ -500,8 +500,8 @@ class Extractor implements ExtractorInterface
|
||||
// see if the custom code line starts now with HTML comment type
|
||||
elseif ((!isset($reading[$targetKey])
|
||||
|| !$reading[$targetKey])
|
||||
&& (($i === 1 && trim($lineContent) === $startHTML)
|
||||
|| strpos($lineContent, $startHTML) !== false))
|
||||
&& (($i === 1 && trim((string) $lineContent) === $startHTML)
|
||||
|| strpos((string) $lineContent, $startHTML) !== false))
|
||||
{
|
||||
$commentType = 2; // HTML type
|
||||
$startReplace = $startHTML;
|
||||
@@ -512,7 +512,7 @@ class Extractor implements ExtractorInterface
|
||||
if ($commentType > 0)
|
||||
{
|
||||
// if we have all on one line we have a problem (don't load it TODO)
|
||||
if (strpos($lineContent, $endReplace) !== false)
|
||||
if (strpos((string) $lineContent, (string) $endReplace) !== false)
|
||||
{
|
||||
// reset found comment type
|
||||
$commentType = 0;
|
||||
|
@@ -158,7 +158,7 @@ class Paths
|
||||
if (($path = $this->getModulePath($module_id)) !== false)
|
||||
{
|
||||
// set the path
|
||||
$local_paths['module_' . str_replace('/', '_', $path)] = $path;
|
||||
$local_paths['module_' . str_replace('/', '_', (string) $path)] = $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class Paths
|
||||
if (($path = $this->getPluginPath($plugin_id)) !== false)
|
||||
{
|
||||
// set the path
|
||||
$local_paths['plugin_' . str_replace('/', '_', $path)] = JPATH_ROOT . '/plugins/' . $path;
|
||||
$local_paths['plugin_' . str_replace('/', '_', (string) $path)] = JPATH_ROOT . '/plugins/' . $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,8 @@ class Paths
|
||||
{
|
||||
$addjoomla_modules = (JsonHelper::check(
|
||||
$addjoomla_modules
|
||||
)) ? json_decode($addjoomla_modules, true) : null;
|
||||
)) ? json_decode((string) $addjoomla_modules, true) : null;
|
||||
|
||||
if (ArrayHelper::check($addjoomla_modules))
|
||||
{
|
||||
$joomla_modules = array_filter(
|
||||
@@ -226,9 +227,7 @@ class Paths
|
||||
if (ArrayHelper::check($joomla_modules))
|
||||
{
|
||||
return array_map(
|
||||
function ($array) {
|
||||
return (int) $array['module'];
|
||||
}, $joomla_modules
|
||||
fn($array) => (int) $array['module'], $joomla_modules
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -283,7 +282,7 @@ class Paths
|
||||
$module->name
|
||||
);
|
||||
// set module folder name
|
||||
$module->folder_name = 'mod_' . strtolower($module->code_name);
|
||||
$module->folder_name = 'mod_' . strtolower((string) $module->code_name);
|
||||
|
||||
// set the lang key
|
||||
$this->extractor->langKeys[strtoupper($module->folder_name)] =
|
||||
@@ -322,7 +321,8 @@ class Paths
|
||||
{
|
||||
$addjoomla_plugins = (JsonHelper::check(
|
||||
$addjoomla_plugins
|
||||
)) ? json_decode($addjoomla_plugins, true) : null;
|
||||
)) ? json_decode((string) $addjoomla_plugins, true) : null;
|
||||
|
||||
if (ArrayHelper::check($addjoomla_plugins))
|
||||
{
|
||||
$joomla_plugins = array_filter(
|
||||
@@ -341,9 +341,7 @@ class Paths
|
||||
if (ArrayHelper::check($joomla_plugins))
|
||||
{
|
||||
return array_map(
|
||||
function ($array) {
|
||||
return (int) $array['plugin'];
|
||||
}, $joomla_plugins
|
||||
fn($array) => (int) $array['plugin'], $joomla_plugins
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -408,9 +406,9 @@ class Paths
|
||||
);
|
||||
|
||||
// set plugin folder name
|
||||
$plugin->group = strtolower($plugin->group);
|
||||
$plugin->group = strtolower((string) $plugin->group);
|
||||
// set plugin file name
|
||||
$plugin->file_name = strtolower($plugin->code_name);
|
||||
$plugin->file_name = strtolower((string) $plugin->code_name);
|
||||
|
||||
// set the lang key
|
||||
$this->extractor->langKeys['PLG_' . strtoupper(
|
||||
|
@@ -136,7 +136,7 @@ class Gui implements GuiInterface
|
||||
$config['prefix'] = PHP_EOL;
|
||||
}
|
||||
// add placeholder based on type of code
|
||||
switch (strtolower($config['type']))
|
||||
switch (strtolower((string) $config['type']))
|
||||
{
|
||||
// adding with html commenting
|
||||
case 'html':
|
||||
@@ -220,7 +220,7 @@ class Gui implements GuiInterface
|
||||
$object = new \stdClass();
|
||||
$object->id = $id;
|
||||
$object->{$field} = base64_encode(
|
||||
$code
|
||||
(string) $code
|
||||
); // (TODO) this may not always work...
|
||||
// update the value in GUI
|
||||
$this->db->updateObject(
|
||||
|
Reference in New Issue
Block a user