This repository has been archived by the owner on Feb 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Format php code stored in string #23
Comments
+1 |
I recently took a look at the tests and found that sorting a string would be this easy: I am guessing its exactly the same for header formatting, so may I suggest you take a look at the tests yourself? Logically it needs to be tested somehow so thats where I would go first. |
closing as @matt-usurp already answered it properly :) |
Maybe we should put it on docs, since this functionality will be used often.
…On Sat, Nov 26, 2016 at 6:33 PM, Marc Morera ***@***.***> wrote:
closing as @matt-usurp <https://github.com/matt-usurp> already answered
it properly :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHtXVjU1zwIEMwTWDtrosUasyzOtd5kks5rCBkMgaJpZM4JD2Ug>
.
--
Thanks,
Rizky
|
The above link is dead. Would be nice to see examples. |
This should be the link: https://github.com/mmoreram/php-formatter/blob/master/tests/PHPFormatter/Fixer/UseSortFixerTest.php |
Thanks but it's hard to figure out how to use it. $code = file_get_contents( __DIR__ .'/test-code.php' );
use Mmoreram\PHPFormatter\Fixer\UseSortFixer;
use Mmoreram\PHPFormatter\Fixer\StrictFixer;
$useSortFixer = new UseSortFixer();
print_r($useSortFixer->fix($code));
$strictFixer = new StrictFixer(true);
print_r($strictFixer->fix($code)); But this doesn't seem to fix anything, especially indents. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How do i format php code stored in string?
The text was updated successfully, but these errors were encountered: