Parse error: syntax error, unexpected token "public"

Converted my project and i can getting the following on when accessing the websiteParse error: syntax error, unexpected token “public”

which is the line

// User ID Filtering event
public function userIdFiltering(string &$filter): void
{
    // Enter your code here
}

any ideas?
thanks

The syntax is correct. You may have syntax error in your other server events, e.g. Row_Rendered. (There are many other server events generated before UserID_Filtering. You should check the syntax of the whole page.

any way to debug the code better? normally it tells you what line of code is wrong. i have debug also onthanks

It is syntax error, the script cannot be run, you cannot “debug” yet, you need to review the code in your server events and check the generated code, e.g. you may use any editor that support php linting.

All I have done it open the a 2024 project that was working fine with 2025 and generate the files. Could converting the project have broken the syntax

Conversion may not 100% correct, as the [migration guide](Migrating to v2025) says:
However, the conversion cannot be 100% and you’ll need to do some updates yourself.You should open the problem file in a text editor and check the syntax first, sometimes you may be just missing is “}”. As said, you better use any editor that support php linting.