skip to Main Content

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:

enter image description here

When I use Kint, it shows that the namespace is defined as shown in the screenshot above (namespace SavvyProSandbox):

enter image description here

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:

enter image description here

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


  1. Chosen as BEST ANSWER

    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


  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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search