Skip to content

Conversation

promatik
Copy link
Contributor

Hi @jasonmccreary!

My last PR (#488) introduced a possible problem on Trace command, so I'm here to fix it!

We found that non valid files, like a .zip file, breaks the Trace command, it generates an empty entry with a backslash ("\"), and class_exists breaks with that string.

It's a rare situation, but when it happens developers have no feedback about it.
This PR fixes it.

@tabacitu
Copy link
Contributor

@promatik any chance we can have a test for this? It would prove the problem AND make sure it doesn't break in the future... 👀

@promatik
Copy link
Contributor Author

promatik commented Sep 3, 2021

@tabacitu did it 👌

@jasonmccreary, I just added a full test to the Trace command.
It was not possible to test the changed function individually, because it's a private function, it makes only sense to test the whole Trace command.

Please note that Trace uses the database to retrieve each column information, now to run the tests one must have sqlite on their system and the extension must be installed and enable on php – it probably already is, any way here is the command;

sudo apt-get install php7.4-sqlite

@jasonmccreary
Copy link
Collaborator

Why wouldn't we limit to just .php extensions?

@promatik
Copy link
Contributor Author

promatik commented Sep 9, 2021

Did it, makes total sense 👌
And its a performance improvement because the file is not even read.

@jasonmccreary jasonmccreary merged commit 9c32489 into laravel-shift:master Sep 9, 2021
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

Successfully merging this pull request may close these issues.

3 participants