Skip to content

Pragma is inserted in first docblock even when not at top of file #1310

@leighman

Description

@leighman

@prettier/plugin-php v0.12.0
Playground link

Input:

<?php

class Something
{
    // other methods
  
    function whatever ()
    {
        /**
         * First docblock mid-file
         */
        $variable = 3;
    }
}

Output:

<?php

class Something
{
    // other methods

    function whatever()
    {
        /**
         * First docblock mid-file
         * @format
         */
        $variable = 3;
    }
}

Expected:

<?php
/**
 * @format
 */

class Something
{
    // other methods

    function whatever()
    {
        /**
         * First docblock mid-file
         */
        $variable = 3;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions