XF 2.2 Code Event Listener error following add-on demo

Sledge850

Member
I'm following the demo:

When I try to save the code event listener I get this error:
"Callback Demo\Portal\Listener::forumEntityStructure is invalid (error_invalid_class)."

I've already created the Listener.php file in:
"public\forums\src\addons\Demo\Portal"

Heres the contents of Listener.php:
PHP:
<?php

namespace Demo\Portal;

use XF\Mvc\Entity\Entity;

class Listener
{
    public static function forumEntityStructure(\XF\Mvc\Entity\Manager $em, \XF\Mvc\Entity\Structure &$structure)
    {

    }
}

What am I missing?

Edit:
This is what I'm trying to add in the admin cp which is exactly what the demo says to use.

1614634188420.webp

Thanks
 
Top Bottom