Skip to content

PHP: Attribute support #2055

@ancarda

Description

@ancarda

PHP 8 introduced support for Attributes: https://www.php.net/manual/en/language.attributes.overview.php

Pygments currently treats attributes as a comment, so they look like this:

<?php

#[Route('/blog', name: 'blog_', requirements: ['_locale' => 'en|es|fr'])]
final class IndexController extends AbstractController
{

Rather than this (IntelliJ):

attributes@2x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions