Php storm not hinting basic php classes anymore

So something odd has happened to one of my copies of php storm. It no longer hints built in classes of php. So for example it thinks the following doesn’t exist: (new \DateTime())->format(‘Y-m-d’); It doesn’t produce an error because it obviously existing php, but the ide is highlighting it as though \DateTime doesn’t exist in php. It normally hints at it and also for the format method but now it doesn’t for some reason. I’ve checked plugins and all the php ones are turned on, annotations works fine and any methods in the project like symfony hint just fine it’s just built in php classes like the date time one
0

Hi there,

1) What's your IDE version exactly?

2) Please try "File | Invalidate Caches...", choose top 2 options there (assuming you are using latest 2021.1.2 version) and restart IDE from that window. Let it restart and re-index that project.

0

Ok thanks, I will give it a try in the morning. I can’t remember the version from the top of my head.

0

2021.1.2 has a fix for the bug where IDE can loose all info about PHP's built-in classes/functions (bundled stubs) that was affecting some users from 2020.2 version.

If the above will not help then it can be something else: some misbehaving plugin or perhaps you may have accidentally disabled one of the stub files for such PHP core stuff ("PHP | PHP Runtime" tab)

0

请先登录再写评论。