Open fretelweb opened 6 years ago
same
Maybe its time to use other libs like http://cs.sensiolabs.org/
+1
+1
@akalongman Any update on this?
Not yet but I will fix it soon.
There is another option for CS: https://github.com/akalongman/sublimetext-codeformatter/issues/360
I still vote for CS, because it has more maintainer. Just afraid another fork of phpfmt got abandoned again by the maintainer. But idk how big is the effort to switch to CS. We glad to help anyway. :D
Does anyone have a work around or update?
@akalongman
https://github.com/phpfmt-next/fmt
This package is also used by some vscode plugins. Looks promising. I have already replaced the bundled fmt.phar with this one on my system -> works so far ;)
Integration of PHP-CS-FIXER is almost done, you can install dev version from the branch https://github.com/akalongman/sublimetext-codeformatter/tree/feature/php-fixer and test it. Now its formats with PSR-2 format but will be added configuring very soon
PHP formatting is working great with the feature/php-fixer
branch!
I will add configuration options and the branch will be merged to master.
Thanks! I’ve just started using ST. If I cloned this repo into the packages folder, do you know if it’ll automatically update when the newer package is available?
Thanks
Yes, it will update and replace your folder
Is there any update on this by any chance? Thanks
Not yet, sorry. I am very busy with my current job. But I will do my best to finish this
hi @akalongman any updates on this ?
And now?
hey @akalongman -- i'm sorry you've been so busy -- but think we could get some updates on this ?:)
Thanks ;)
Any updates on this yet?
+1
+1
+1
+1
Same issue here. Still. In 2020. 😩
I'd like to use CodeFormatter but still getting this 'each' error with php v7.3.5. Is there any hope of a fix soon or any work-around?
unzip it and replace the file in Data\Packages\CodeFormatter\lib\phpbeautifier\phpf.phar phpf.zip
@silenkee does it support union-types and typed properties, or is this just another for-someones-personal-needs-patched fork of phpf?
+1
if your default php not 5.6, you should:
+1
+1
Quoting @iruwl:
if your default php not 5.6, you should:
- install php 5.6
- set default php to 5.6 or
- set php_path in codeformatter_php_options to /usr/bin/php5.6
How exactly are you installing php 5.6 so it ends up in the directory you specified?
When installing/updating PHP following the instructions in this tutorial,
brew tap shivammathur/php
brew install shivammathur/php/php@5.6
PHP ends up in /usr/local/opt/php@5.6
, now when I set this as the value for php_path
in my settings:
{
"codeformatter_php_options":
{
// ...
"php_path": "/usr/local/opt/php@5.6"
// ...
},
}
I get the error "Format error: [Errno 13] Permission Denied".
Thanks for some insights!
I am using PHP 7.4, but I had to also install PHP 5.6 (via Homebrew) to get CodeFormatter to work:
brew tap shivammathur/php
brew install shivammathur/php/php@5.6
and told CodeFormatter to use that old version of PHP:
{
"codeformatter_php_options": {
"php_path": "/usr/local/Cellar/php@5.6/5.6.40_4/bin/php",
...
Hope this saves someone else some time.
Same issue running here. Still. In 2022
Same issue running here. Still. In 2024
Sublime text 3 PHP 7.2.1