draliragab Thank you for the test case.
This is valid error; using a trait is not the same as extending a class - i.e. trait is not parent.
By re-defining getSlugOptions() method, you effectively ignore the same method from HasSlug trait. You are not overriding it.
This is the actual output from PHP 8.3.12:
trait T1
{
function foo() { }
}
class CT
{
use T1;
#[\Override()]
function foo() { }
}
Output:
Fatal error: CT::foo() has #[\Override] attribute, but no matching parent method exists in /home/user/scripts/code.php on line 15
Note, PHP <= 8.2 ignores the [Override] attribute and won't report any error yet. You can play around on https://onlinephp.io/c/d15ce5 to et prepared for PHP 8.3 and newer :)