Ben Harvey
Ben Harvey

Reputation: 1843

sublime phpfmt stopped working missing php-cs-fixer

I have been using the sublime-phpfmt plugin without issue for a while now but have been getting the following error:

engine file is missing: /Users/iMac/Library/Application Support/Sublime Text 3/Packages/phpfmt/php-cs-fixer

I installed php-cs-fixer globally and have put the php-cs-fixer.phar file into the local directory as instructed in the readme, but it's still coming up like this. The output of the console is as follows:

FileNotFoundError: [Errno 2] No such file or directory: 'phpcs'

I don't know anything about python, but is it looking for a different file or something?

Edit

It seems like there has been some argy-bargy with the plugin, details here https://news.ycombinator.com/item?id=11896851 and https://github.com/nanch/sublime-phpfmt with the general consensus being to manually install the package and checkout an old commit like so:

  1. Remove phpfmt from package control (if you installed it that way)
  2. Clone https://github.com/nanch/sublime-phpfmt.git into your packages directory (~/Library/Application Support/Sublime Text 3/Packages on mac)
  3. cd into sublime-phpfmt and git checkout 6125cf9

That worked for me, and it will also not auto-update (as far as I can tell).

Upvotes: 2

Views: 1132

Answers (1)

Sigismund
Sigismund

Reputation: 1082

This can be solved by downloading php-cs-fixer.phar and creating link to it in /Packages/phpfmt/php-cs-fixer.

ln -s php-cs-fixer.phar ~/.config/sublime-text-3/Packages/phpfmt/php-cs-fixer

Don't know what changed but this seems to work.

Upvotes: 3

Related Questions