Skip to content

Conversation

@ziming
Copy link
Contributor

@ziming ziming commented Jun 22, 2025

Currently the listPeopleEvent method in Crisp is not consistent with the other methods in the WebsitePeople class. Such as:

  • listPeopleProfiles
  • listPeopleSegments
  • listPeopleConversations

That is, the method name should end with a plural s, but it did not.

This PR adds a listPeopleEvents() method that does the exact same thing. Then mark the listPeopleEvent() method as deprecated using PHP 8.4 deprecated attribute.

According to https://youtrack.jetbrains.com/issue/WI-62847/Option-to-allow-attributes-in-PHP-8.0-in-language-level-inspection

They are not supported in PHP < 8.0, BUT: If every attribute is on a separate line, then PHP 7.0 won't crash, it will simply ignore them.

@ziming
Copy link
Contributor Author

ziming commented Jun 22, 2025

Alternatively you can do this too since the #Deprecated attribute only get triggered in PHP 8.4 (& ignored in earlier versions). trigger_error() is more like a warning rather than a hard code stopping error to my knowledge

/**
 * @deprecated
 *
 */
public function deprecatedMethod(): void
{
    trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant