akalongman / sublimetext-codeformatter

Code Formatter plugin for ST2/ST3
MIT License
771 stars 131 forks source link

Error Deprectaed for PHP format #355

Open fretelweb opened 6 years ago

fretelweb commented 6 years ago

image

Sublime text 3 PHP 7.2.1

ncovercash commented 6 years ago

same

ghost commented 6 years ago

Same with me. But actually the issue is from the phpf. I've try rise the issue to the repo but still no response by maintainer. Aahh, just realize that the project currently abandoned by the maintainer.

akalongman commented 6 years ago

Maybe its time to use other libs like http://cs.sensiolabs.org/

asolopovas commented 6 years ago

+1

costapombo commented 6 years ago

+1

appinlet commented 6 years ago

@akalongman Any update on this?

akalongman commented 6 years ago

Not yet but I will fix it soon.

There is another option for CS: https://github.com/akalongman/sublimetext-codeformatter/issues/360

ghost commented 6 years ago

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

rjksn commented 6 years ago

Does anyone have a work around or update?

droptable commented 6 years ago

@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 ;)

akalongman commented 6 years ago

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

macbookandrew commented 6 years ago

PHP formatting is working great with the feature/php-fixer branch!

akalongman commented 6 years ago

I will add configuration options and the branch will be merged to master.

macbookandrew commented 6 years ago

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

akalongman commented 6 years ago

Yes, it will update and replace your folder

dompl commented 6 years ago

Is there any update on this by any chance? Thanks

akalongman commented 6 years ago

Not yet, sorry. I am very busy with my current job. But I will do my best to finish this

niladam commented 6 years ago

hi @akalongman any updates on this ?

Scarboroid commented 6 years ago

And now?

niladam commented 5 years ago

hey @akalongman -- i'm sorry you've been so busy -- but think we could get some updates on this ?:)

Thanks ;)

scottfriebel commented 5 years ago

Any updates on this yet?

qoli commented 5 years ago

+1

loro2 commented 4 years ago

+1

estebanDT30 commented 4 years ago

+1

saurabh-cimpress commented 4 years ago

+1

PwrSrg commented 4 years ago

Same issue here. Still. In 2020. 😩

chucksstein commented 4 years ago

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?

silenkee commented 4 years ago

unzip it and replace the file in Data\Packages\CodeFormatter\lib\phpbeautifier\phpf.phar phpf.zip

asccc commented 4 years ago

@silenkee does it support union-types and typed properties, or is this just another for-someones-personal-needs-patched fork of phpf?

huang-yuxin commented 4 years ago

+1

iruwl commented 3 years ago

if your default php not 5.6, you should:

  1. install php 5.6
  2. set default php to 5.6 or
  3. set php_path in codeformatter_php_options to /usr/bin/php5.6
catapricop commented 3 years ago

+1

goby1986 commented 3 years ago

+1

skizzo commented 3 years ago

Quoting @iruwl:

if your default php not 5.6, you should:

  1. install php 5.6
  2. set default php to 5.6 or
  3. 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".

Screenshot 2021-07-02 at 11 43 02

Thanks for some insights!

alpo22 commented 2 years ago

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.

suhacerci commented 2 years ago

Same issue running here. Still. In 2022

Piyush-PBR commented 1 month ago

Same issue running here. Still. In 2024