syntax error, expecting variable (T_VARIABLE) in Search Plus Custom Mapping I’m looking for a little help with Custom Mapping for the Search Plus plugin. I think(?) I'm getting pretty close, but stuck on something (and I do front end web design, so this is just over my head) I’m using https://transition.topshelfcraft.com/software/craft/searchplus/usage/hooks-events as a reference and used https://pluginfactory.io to create the plugin.

Per the instructions in the documentation above, I’ve added this to the bottom of the plugin :

public function searchPlus_addAlgoliaMapping()
{
    $ret = [];
    $ret['name'] = 'GHCC Staff Mapping2';
    $ret['handle'] = 'GHCC_Staff2';
    $ret['description'] = 'Mapping for Staff Page';
    $ret['method'] = 'example.testMapping';
    return $ret;
}

public function testMapping(element)
{
    $ret = [];

    $ret['objectID'] = $entry-&gt;id;
    $ret['title'] = $entry-&gt;title;
    $ret['activityId'] = $entry-&gt;id;
    $ret['id'] = $entry-&gt;id;
    $ret['slug'] = $entry-&gt;slug;
    $ret['url'] = $entry-&gt;url;
    $ret['uri'] = '/' . $entry-&gt;uri;

return $ret;
}


But am getting an error: syntax error, unexpected ')', expecting variable (T_VARIABLE) referencing line 186  public function testMapping(element)

Was wondering if anyone had any tips

Thanks!
That is a typo in the plugin's documentation.

public function testMapping(element)


should be

public function testMapping($element)


since $element is a PHP variable.