Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

prettyphp reorders statements following PHP open tags and comments on the same line #99

Open
nox opened this issue Oct 30, 2014 · 1 comment

Comments

@nox
Copy link
Contributor

nox commented Oct 30, 2014

The following snippet of code from CodeIgniter is badly reordered on pretty-printing:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class myBasket extends MY_Restricted_Controller { … }

It becomes:

if (!defined('BASEPATH')) {
  exit('No direct script access allowed');
}
<?php

class myBasket extends MY_Restricted_Controller {
  …
}

This is due to PHP open tags being considered as comments in the aesthetics machinery of ast_pp_build.

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant