Skip to content

Conversation

@MorphCodeBot
Copy link
Collaborator

This PR fixes the incorrect syntax highlighting of PHP arrow functions that use the 'fn' keyword.

Problem:

  • Arrow functions using 'fn' were being incorrectly treated as regular function declarations
  • This caused comments in arrow functions to be highlighted as function titles

Changes:

  • Added 'fn' to the PHP keywords list
  • Removed 'fn' from function detection keywords

Example of fixed highlighting:

$fn1 = fn($x) => $x + $y;

The arrow function is now correctly highlighted with:

  • 'fn' as a keyword
  • Parameters and variables properly recognized
  • No incorrect title detection

This change improves the syntax highlighting accuracy for modern PHP code that uses arrow functions.

Additional ticket processing details

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants