Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

atom-beautify & php-cs-fixer

I am a new programmer and I need your help. I'm pretty much new to Atom editor, but setup some nice packages like Atom Beautify. After using it in a html / php file I'm getting the error "Could not find 'php-cs-fixer' . The program may not be installed. The strange thing is, I did install the package php-cs-fixer but nothing happens.

My system is Windows.

Anyone got an idea how I can fix this?

like image 454
Muhammed Al-Awami Avatar asked Dec 07 '22 17:12

Muhammed Al-Awami


2 Answers

  1. You must have installed "php" usually when installing the Wamp or Xampp servers are installed by default.     

  2. Download the file "php-cs-fixer.phar" https://github.com/FriendsOfPHP/PHP-CS-Fixer

  3. In the CMD execute this command: php where.exe

  4. You get a path, that path copy in: Open Atom Packages / Atom Beautify / Settings / Executables / PHP

  1. In the same folder where the php.exe is located copy the file "php-cs-fixer.phar"

  2. Redo the previous process with the CMD and the Atom in PHP-CS-Fixer "

like image 128
Jéssica Román Largo Avatar answered Dec 10 '22 23:12

Jéssica Román Largo


I am not sure about in Windows, but on Mac and Linux, I do the following. You may be able to do this with Git Bash in Windows.

Install php-cs-fixer with Homebrew (via PHP-CS-Fixer Instructions)

brew install php-cs-fixer

Confirm php-cs-fixer was installed

which php-cs-fixer
like image 29
Ian Avatar answered Dec 10 '22 23:12

Ian