Skip to content

PHPCBF can break a require_once statement with a space before the open parenthesis #809

@boxrec

Description

@boxrec

foo.php

<?php //require_once('regions.php'); require_once (dirname(__FILE__) . '/regions.php'); // common may be called from other dirs 

phpcbf --version
PHP_CodeSniffer version 2.4.0 (stable) by Squiz (http://www.squiz.net)

phpcbf foo.php
Changing into directory /home/john/public_html/v3
Processing foo.php [PHP => 17 tokens in 3 lines]... DONE in 0ms (2 fixable violations)
=> Fixing file: 0/2 violations remaining [made 2 passes]... DONE in 2ms

foo.php

<?php //require_once('regions.php'); require_oncedirname(__FILE__) . '/regions.php'; // common may be called from other dirs 

php foo.php
PHP Fatal error: Call to undefined function require_oncedirname() in /home/john/public_html/v3/foo.php on line 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