Checking for missing brackets doesn't work
I'm new to phpStorm and thought I would try it out. One of the things I find important for a php IDE to do it find missing brackets.
I thought I'd just do a simple test on how well it could find a missing '}' bracket. See my attached image. It failed to find it. This is a small, simple test.php file.
Did I not do something right in trying to get phpStorm to find the missing cracket or is phpStrom just not able to do it (despite the developers saying that it can)?
Attachment(s):
0.jpg
Please sign in to leave a comment.
From the PHP language's point of view (and PhpStorm as a PHP IDE), firstly, it is a "missing statement" before an else operator. Then, all done right on your screenshot.
Well, as far as I see there is an error message...
Please elaborate what message did you expect to get from IDE, at what point in code and why do you think current behavior is wrong.
I expected one of two things from phpStorm:
1. Find and set the cursor on the line where the missing "{" bracket is.
or
2. Find and display the line number where the missing "{" bracket is.
phpStorm did not do either one. Therefore, advertising that phpStorm can "locate missing brackets" means it has a bug since it can't find a missing bracket in a simple php file.
Missing statements are irrelevant. I'm checking for missing brackets. phpStorm has a find missing brackets feature so that's what I'm testing and it failed to find the missing bracket.
This is a valid php statement:
if ($php_flag == 0)
{
}
else
{
print 'test';
}
This is not a valid php statement:
if ($php_flag == 0)
{
else
{
print 'test';
}
phpStorm should have been able to flag the offending line number.
Well, if you sure that this is a bug..
Please file feature requests and bug reports to issue tracker