Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block 552 - 573 - possible problem with similar names #1

Open
PhocaCz opened this issue Jun 12, 2021 · 0 comments
Open

Block 552 - 573 - possible problem with similar names #1

PhocaCz opened this issue Jun 12, 2021 · 0 comments

Comments

@PhocaCz
Copy link

PhocaCz commented Jun 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant