Hi,
it seems like in block (lines 552 - 573) there is not correct check for the line.
On line 552 we ask the position to be sure that the use is included but if we ask for:
use Joomla\CMS\Toolbar\Toolbar
and there is even:
use Joomla\CMS\Toolbar\ToolbarHelper in code, we get positive result.
This means:
When the $line is "use Joomla\CMS\Toolbar\ToolbarHelper", we store to $usedNamespaces "use Joomla\CMS\Toolbar\Toolbar" and when the $line is "use Joomla\CMS\Toolbar\Toolbar", it is then never stored to $fileContent because it is in $usedNamespaces variable which produces $nameSpaceExists = false and in this condition:
if ($nameSpaceExists === true)
{
$fileContent[] = $line;
}
we prevent it from writing to file.
So even it exists in $usedNamespaces, it is never written to file.
Jan
Hi,
it seems like in block (lines 552 - 573) there is not correct check for the line.
On line 552 we ask the position to be sure that the use is included but if we ask for:
use Joomla\CMS\Toolbar\Toolbarand there is even:
use Joomla\CMS\Toolbar\ToolbarHelperin code, we get positive result.This means:
When the $line is "use Joomla\CMS\Toolbar\ToolbarHelper", we store to $usedNamespaces "use Joomla\CMS\Toolbar\Toolbar" and when the $line is "use Joomla\CMS\Toolbar\Toolbar", it is then never stored to $fileContent because it is in $usedNamespaces variable which produces $nameSpaceExists = false and in this condition:
we prevent it from writing to file.
So even it exists in $usedNamespaces, it is never written to file.
Jan