I am completely new to PHP and I am trying to teach myself here and play with the prospect of creating my very own WordPress theme – YAY!
Anyway, I am running into a roadblock here and I am not certain if this is just the IDE I am using (PhpStorm), or if it is something else.
Here is what I am seeing in PhpStorm:
When I use Kint, it shows that the namespace is defined as shown in the screenshot above (namespace SavvyProSandbox):
Here is the complete code:
namespace SavvyProSandbox;
add_action('loop_start', __NAMESPACE__ . 'process_the_string');
function process_the_string()
{
$current_user = wp_get_current_user();
render_user_message($current_user->user_firstname, get_the_ID());
}
function render_user_message($first_name, $post_id)
{
d("My name is {$first_name}.");
ddd("The post ID is {$post_id}.");
}
Here is the version of PhpStorm I am currently running:
I am certain it is something quite simple for you PHP gurus out there, but since I am such a noob, it’s a bit of a brain twister for me.
Any help on this is of course greatly appreciated.
Thank you all!
2
Answers
I emailed JetBrains support and they got back to me with the fix and it is exactly what @LazyOne mentioned in the comments section above.
I simply deleted the following folder on my Mac and it resolved the issue:
~Library/Caches/JetBrains/PhpStorm2020.2
This is still an issue with later versions of PHPStorm. I just had to delete this folder to fix this very same issue with 2022.3.1 –
~Library/Caches/JetBrains/PhpStorm2022.3