povils/phpmnd

Extension support for Exceptions possible?

ayacoo opened this issue · 4 comments

Hi, at first: I'm completely new to this package and I'm pleased about the possibilities! :-)

Currently I have this piece of code:

            throw new InvalidArgumentException(
                'Exception message',
                1583854980
            );

This position is found from phpmnd and apparently no extension is active here, tested with setting "all".

Is it possible and useful to add an extension for this? Or how would you handle this case?

Hi :) Thanks for taking the time to submit this issue.

The argument exception would cover this. What is the command you were using to check this ?
Peek 2021-03-24 21-05

Oh, sorry, I have expressed myself in a misleading way..

In that case, I would like to ignore these number. We often have such exceptions and with a timestamp we cover the error. This is legitimate for us and we don't want to replace it with $x constants ;-)

You can use --ignore-funcs which will allow these to be wrapped in intval(1583854980) and not picked up.

If there's lots though I'm not sure that's useful.

I'm not sure I fully understand what it is your trying to do ? I assume your hard coding a timestamp when the exception was created (guessing at that number ?) if so wouldn't

            throw new InvalidArgumentException(
                'Exception message',
               strtotime('Tue Mar 10 2020 15:43:00 GMT+0000')
           );

be more expressive ?

The timestamp is used as a unique code to find the expression. It could also be a random number. So the solution with intval is a smart solution.

Thanks for your answer and time! :-)