Skip to content

reuse addHeader broken for PHP #436

@Potherca

Description

@Potherca

When calling reuse addheader on PHP files the comment header is placed outside the <?php tag, which is incorrect.

To demonstrate, assume we have an example file with this content:

<?php

// some code here

Then this happens:

Multiline Comment

Command

reuse addheader --license="MIT" ./example.php --multi-line

Expected
<?php

/*
 * SPDX-License-Identifier: MIT
 */

Actual
 /*
  * SPDX-License-Identifier: MIT
  */

 <?php

Single line Comment

Command

reuse addheader --license="MIT" ./example.php

Expected
<?php

// SPDX-License-Identifier: MIT

Actual
// SPDX-License-Identifier: MIT

 <?php

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomment-stylesRequest for a new comment style, or fixing a bug with thesegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions