Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 454 forks source link

Always returns Could not find 'php-cs-fixer'. The program may not be installed for PHP #394

Closed dtomasch closed 8 years ago

dtomasch commented 9 years ago

Installed the php-cs-fixer pacakge; still cannot get it to beautify PHP

Glavin001 commented 9 years ago

Did you see the message:

See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions. You can configure Atom Beautify with the absolute path to 'php-cs-fixer.phar' by setting 'PHP - CS Fixer Path' in the Atom Beautify package settings.

? If not, then there is a big issue that I should look into because it should tell you to setup Atom Beautify and configure it for PHP-CS-Fixer.

Have you configured Atom Beautify with the absolute path to php-cs-fixer.phar as the message indicates? See https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#php---php-cs-fixer-path-1 for options.

dtomasch commented 9 years ago

I do see that error yes.

Then I install PHP-CS-Fixer.

Last night I tried it via Atom settings. I was experimenting and had it in my downloads folder. Set the path in the PHP-CS-FIXER to Users/username/Downloads/

Tried it as the path to the folder, also tried it as Users/username/Downloads/php-cs-fixer which also created the same Uncaught Error.

Today, tried installing everything via the command line (Beautify and PHP-CS-Fixer and it's dependencies) and followed all the commands listed there for installation. Neither package worked for PHP.

Set the path in Beautify as /Users/username/php-cs-fixer.phar, /Users/username/php-cs-fixer, /Users/username/ -- none of which worked either.

All gave me the same "Could not find 'php-cs-fixer'. The program may not be installed." Error.

I'm probably making some stupid error on setting the path or such so hopefully someone can point out what I'm missing...

Glavin001 commented 9 years ago

It looks like you are running on Mac. Mac does not use the PHP-CS-Fixer Path as it does not need it to work, it was added for the many Windows users who were having problems -- in fact after v0.27.13 release (see #375 ) there should no longer be any problems automatically detecting php-cs-fixer, so long as it is setup properly.

So this usually indicates that the Mac is not setup properly. Let's try and figure this out.

Could you open your Terminal and confirm:

dtomasch commented 9 years ago

Thanks.

Here are what was returned:

  1. which php: /usr/bin/php
  2. which php-cs-fixer: no output
  3. Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Thu Jun 11 2015 14:25:31 GMT-0400 (EDT).


Platform: darwin

Versions

Atom Version: 0.208.0

Atom Beautify Version: 0.28.2

Original file to be beautified

Original File Path: /Users/username/Documents/phpinfo.php

Original File Grammar: PHP

Original File Contents:

phpinfo()

Beautification options

Editor Options: Options from Atom Editor settings

{
    "_default": {
        "indent_size": 4,
        "indent_char": " ",
        "indent_with_tabs": false
    }
}

Config Options: Options from Atom Beautify package settings

{
    "php": {
        "cs_fixer_path": "/Users/username/",
        "fixers": "linefeed,-short_tag,indentation",
        "level": ""
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "css": {
        "indent_size": 4,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false,
        "wrap_line_length": 0,
        "indent_comments": true,
        "force_indentation": false,
        "convert_quotes": "none",
        "align_assignments": false
    },
    "d": {
        "configPath": ""
    },
    "fortran": {
        "emacs_path": "",
        "emacs_script_path": ""
    },
    "html": {
        "indent_inner_html": false,
        "indent_size": 4,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 4,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false
    },
    "java": {
        "configPath": ""
    },
    "js": {
        "indent_size": 4,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 4,
        "ignore": [
            "E24"
        ]
    },
    "ruby": {
        "indent_size": 4
    },
    "rust": {
        "rustfmt_path": ""
    },
    "sql": {
        "indent_size": 4,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options: Options from /Users/username/.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options: Options from EditorConfig file

{
    "_default": {}
}

Project Options: Options from .jsbeautifyrc files starting from directory /Users/username/Documents and going up to root

[
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    }
]

Results

Beautified File Contents:

Error: Could not find 'php-cs-fixer'. The program may not be installed.

Logs:

2015-06-11T18:25:31.095Z - info: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautify phpinfo()
 [ { _default: { indent_size: 4, indent_char: ' ', indent_with_tabs: false } },
  { php: 
     { cs_fixer_path: '/Users/username/',
       fixers: 'linefeed,-short_tag,indentation',
       level: '' },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    css: 
     { indent_size: 4,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false,
       wrap_line_length: 0,
       indent_comments: true,
       force_indentation: false,
       convert_quotes: 'none',
       align_assignments: false },
    d: { configPath: '' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 4,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 4,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false },
    java: { configPath: '' },
    js: 
     { indent_size: 4,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       space_after_anon_function: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    python: { max_line_length: 79, indent_size: 4, ignore: [Object] },
    ruby: { indent_size: 4 },
    rust: { rustfmt_path: '' },
    sql: { indent_size: 4, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] PHP /Users/username/Documents/phpinfo.php
2015-06-11T18:25:31.095Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee]  indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=, configPath=, configPath=, configPath=, indent_size=4, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=4, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=4, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, indent_size=4, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=4, rustfmt_path=, indent_size=4, keywords=upper, identifiers=lower, configPath=, , , , , 
2015-06-11T18:25:31.096Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] [ { name: 'PHP',
    namespace: 'php',
    grammars: [ 'PHP' ],
    extensions: [ 'php' ],
    options: { cs_fixer_path: [Object], fixers: [Object], level: [Object] },
    beautifiers: [ 'PHP-CS-Fixer' ] } ] 'PHP' 'php'
2015-06-11T18:25:31.098Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] [ 'php' ] indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=, configPath=, configPath=, configPath=, indent_size=4, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=4, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=4, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, indent_size=4, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=4, rustfmt_path=, indent_size=4, keywords=upper, identifiers=lower, configPath=, , , , , 
2015-06-11T18:25:31.098Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true indent_size=4, indent_char= , indent_with_tabs=false
2015-06-11T18:25:31.098Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-06-11T18:25:31.098Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php indent_size=4, indent_char= , indent_with_tabs=false
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=, configPath=, configPath=, configPath=, indent_size=4, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=4, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=4, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, indent_size=4, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=4, rustfmt_path=, indent_size=4, keywords=upper, identifiers=lower, configPath=
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true 
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true 
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-06-11T18:25:31.099Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true 
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true 
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true 
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-06-11T18:25:31.100Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] PHP name=PHP, namespace=php, grammars=[PHP], extensions=[php], title=PHP - PHP-CS-Fixer Path, type=string, default=, description=Path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer), beautifiers=[PHP-CS-Fixer], type=string, default=, description=Add fixer(s). i.e. linefeed,-short_tag,indentation (Supported by PHP-CS-Fixer), title=PHP - Fixers, beautifiers=[PHP-CS-Fixer], type=string, default=, description=By default, all PSR-2 fixers and some additional ones are run. (Supported by PHP-CS-Fixer), title=PHP - Level, beautifiers=[PHP-CS-Fixer], beautifiers=[PHP-CS-Fixer]
2015-06-11T18:25:31.101Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=
2015-06-11T18:25:31.101Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautifiers silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, languages=[PHP]
2015-06-11T18:25:31.101Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] PHP /Users/username/Documents/phpinfo.php { indent_size: 4,
  indent_char: ' ',
  indent_with_tabs: false,
  cs_fixer_path: '/Users/username/',
  fixers: 'linefeed,-short_tag,indentation',
  level: '' } indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=, configPath=, configPath=, configPath=, indent_size=4, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, convert_quotes=none, align_assignments=false, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=4, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=4, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, indent_size=4, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=4, rustfmt_path=, indent_size=4, keywords=upper, identifiers=lower, configPath=, , , , , 
2015-06-11T18:25:31.102Z - verbose: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautifier PHP-CS-Fixer silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, languages=[PHP]
2015-06-11T18:25:31.106Z - debug: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] php-cs-fixer indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=/Users/username/, fixers=linefeed,-short_tag,indentation, level=
2015-06-11T18:25:31.113Z - debug: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] tempFile temp null path=/var/folders/v6/z45sxs348xl0x3001s7bhxqr0000gn/T/temp115511-44129-1r5pfxf, fd=41
2015-06-11T18:25:31.115Z - debug: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] exeName, args: php-cs-fixer 0=fix, 1=undefined, 2=--fixers=linefeed,-short_tag,indentation, 3=/var/folders/v6/z45sxs348xl0x3001s7bhxqr0000gn/T/temp115511-44129-1r5pfxf
2015-06-11T18:25:31.133Z - debug: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] exePath, env: php-cs-fixer SHELL=/bin/bash, TMPDIR=/var/folders/v6/z45sxs348xl0x3001s7bhxqr0000gn/T/, Apple_PubSub_Socket_Render=/tmp/launch-xR74gI/Render, ATOM_HOME=/Users/username/.atom, USER=username, SSH_AUTH_SOCK=/tmp/launch-PJ8RxK/Listeners, __CF_USER_TEXT_ENCODING=0x1F5:0:0, GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q, __CHECKFIX1436934=1, PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/ImageMagick/bin, PWD=/, NODE_PATH=/Users/username/username/TEMP/Atom.app/Contents/Resources/app.asar/exports, NODE_ENV=production, SHLVL=1, HOME=/Users/username, LOGNAME=username, SECURITYSESSIONID=186a5, _=/usr/bin/env
2015-06-11T18:25:31.133Z - debug: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] spawn php-cs-fixer 0=fix, 1=--fixers=linefeed,-short_tag,indentation, 2=/var/folders/v6/z45sxs348xl0x3001s7bhxqr0000gn/T/temp115511-44129-1r5pfxf
2015-06-11T18:25:31.138Z - debug: [/Users/username/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] error Error: spawn php-cs-fixer ENOENT
    at exports._errnoException (util.js:734:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1035:32)
    at child_process.js:1127:20
    at process._tickCallback (node.js:357:13)
Glavin001 commented 9 years ago
  1. which php-cs-fixer: no output

This makes total sense why it's not working then. It's not even setup properly.

You need to add the directory you installed php-cs-fixer to your PATH. Did you use Composer or Homebrew? I use Homebrew, which is easy:

That should do it.

You can test installation again with which php-cs-fixer if that does not work then talk to the PHP guys about getting php-cs-fixer setup properly and showing up in your PATH environment variable.

dtomasch commented 9 years ago

Makes sense and I did finally get it to work. I couldn't seem to get the homebrew option to install successfully, but the Composer version worked fine.

I'm adding my steps here so it's documented for anyone else who might have this problem.

1. Install Composer (https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) Run: $ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer

2. Install PHP-CS-Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer) Run: $ curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer $ sudo chmod a+x php-cs-fixer $ sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer

That got everything working for me.

Glavin001 commented 9 years ago

Excellent! Thank you for documenting. I am working on Beautifier-specific documentation and will add your findings to those docs. I also am currently developing improvements to Atom Beautify for how it notifies users when there are problems, and tries to help them debug the issues.

Here is a sample error message:

Could not find 'php-cs-fixer'. The program may not be installed. See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions. Your program is properly installed if running 'which php-cs-fixer' in your Terminal returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable. Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=php-cs-fixer&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help.

What else do you think needs to be said to make sure other users do not create so many Issues on Atom Beautify and instead use the error message as guidance to resolve their problem on their own? I find myself writing the exact same comments in Issues and I want to automate this a lot more and encourage users (who are supposedly developers) to problem solve on their own. If I can give them sufficient information of what is going on, then maybe they could get it working on their own, without posting an issue and waiting for me to reply and debug with them over many days.

/cc #311 #165

Glavin001 commented 9 years ago

Published the above changes to v0.28.3

dtomasch commented 9 years ago

Yeah, the previous error message wasn't really actionable or easy to understand.

Take it or leave it, but I would say something like the below — this isn't exactly perfect, but I think it would get some of the multiple requests off your plate (also, I'm coming from the Mac so I don't know if this all is accurate for Windows, etc.)

In Atom:

Could not find 'php-cs-fixer'. PHP-CS-Fixer is required in order to beautify PHP. Either PHP-CS-Fixer is not installed, or you need to specify it's path in Atom Beautify Settings. For more information see [insert url].

Web-side Documentation:

Error: Could not find 'php-cs-fixer'. PHP-CS-Fixer is required in order to beautify PHP with Atom Beautify.

If you are recieving this error message, it could mean that PHP-CS-Fixer is not installed correctly, or that you need to specify it's path in Atom Beautify Settings.

WHAT TO DO

1 Ensure that PHP is running on your system. In your terminal, run which php. Your output should be something like /usr/bin/php. If you get no output, install and set up PHP: http://php.net/manual/en/install.php

2 Check if PHP-CS-Fixer is installed In your terminal, run which php-cs-fixer. Your output should be something like /usr/bin/php-cs-fixer. If you get no output, install PHP-CS-Fixer: https://github.com/FriendsOfPHP/PHP-CS-Fixer, or use these three terminal commands:

$ curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer $ sudo chmod a+x php-cs-fixer $ sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer

3 Specify the path to php-cs-fixer in Atom Beautify Settings. [One thing that was not clear to me was if you specified that path to the FOLDER or to the executable. I'm still not clear on that as like you said, isn't needed on the Mac. But it should be specified here, and probably in the settings panel, somehting like "specify the path to the directory which contains…" or "specific the path to the executable, including the actual file name of the executable in the path, example… etc. There may be a better way to say that but I don't know what the term is. Clarity trumps everything though.]

Glavin001 commented 9 years ago

Thanks for your feedback, @dtomasch! I am currently adding some more tests, however once I am done that I will be going back to documentation and bringing over what you said into the official docs. Thanks!

BMOv2600 commented 9 years ago

FWIW, I just went through this thread and following the conversation helped me solve my issue.

Glavin001 commented 9 years ago

Great to hear @BMOv2600!

I want to go back to the above conversation and

gddabe commented 9 years ago

I am so sorry that I have to bump this thread up again.

I followed this thread's step but still can't make it work.

~
└▪ which php-cs-fixer
/usr/local/bin/php-cs-fixer
~
└▪ which php
/usr/local/bin/php
~
└▪ echo $PATH
/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/local/sbin:/Users/username/.dotfiles/bin:/Users/username/.rbenv/shims:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/local/sbin:/Users/username/.dotfiles/bin:/Users/username/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Sat Aug 29 2015 23:26:13 GMT+0800 (HKT).


Platform: darwin

Versions

Atom Version: 1.0.9

Atom Beautify Version: 0.28.11

Original file to be beautified

Original File Path: /Volumes/MacHDD/downloads/test1.php

Original File Grammar: PHP

Original File Language: PHP

Original File Contents:

<?

phpinfo();

?>

Beautification options

Editor Options: Options from Atom Editor settings

{
    "_default": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_with_tabs": false
    }
}

Config Options: Options from Atom Beautify package settings

{
    "css": {
        "convert_quotes": "single",
        "indent_size": 2,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false,
        "wrap_line_length": 0,
        "indent_comments": true,
        "force_indentation": false,
        "align_assignments": false
    },
    "html": {
        "end_with_newline": true,
        "max_preserve_newlines": 2,
        "indent_inner_html": false,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ]
    },
    "js": {
        "end_with_newline": true,
        "eval_code": true,
        "indent_size": 2,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "unescape_strings": false,
        "wrap_line_length": 0
    },
    "php": {
        "cs_fixer_path": "/usr/local/bin/php-cs-fixer",
        "fixers": "",
        "level": ""
    },
    "arduino": {
        "configPath": ""
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "d": {
        "configPath": ""
    },
    "gherkin": {
        "indent_size": 2,
        "indent_char": " "
    },
    "fortran": {
        "emacs_path": "",
        "emacs_script_path": ""
    },
    "java": {
        "configPath": ""
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 4,
        "ignore": [
            "E24"
        ]
    },
    "ruby": {
        "indent_size": 2,
        "indent_char": " "
    },
    "rust": {
        "rustfmt_path": ""
    },
    "sql": {
        "indent_size": 2,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options: Options from /Users/username/.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options: Options from EditorConfig file

{
    "_default": {}
}

Project Options: Options from .jsbeautifyrc files starting from directory /Volumes/MacHDD/downloads and going up to root

[
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    }
]

Final Options: Final combined options that are used

{
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false
}

Package Settings: The raw package settings options

{
    "_analyticsUserId": "c603447f-e71c-455b-a0cc-49a42d18aaa6",
    "analytics": false,
    "css_convert_quotes": "single",
    "html_end_with_newline": true,
    "language_html_beautify_on_save": true,
    "language_scss_beautify_on_save": true,
    "language_js_beautify_on_save": true,
    "js_end_with_newline": true,
    "js_eval_code": true,
    "html_max_preserve_newlines": 2,
    "language_json_beautify_on_save": true,
    "php_cs_fixer_path": "/usr/local/bin/php-cs-fixer",
    "_loggerLevel": "warn",
    "beautifyEntireFileOnSave": true,
    "muteUnsupportedLanguageErrors": false,
    "muteAllErrors": false,
    "arduino_configPath": "",
    "cs_configPath": "",
    "c_configPath": "",
    "cpp_configPath": "",
    "css_indent_size": 2,
    "css_indent_char": " ",
    "css_selector_separator_newline": false,
    "css_newline_between_rules": false,
    "css_preserve_newlines": false,
    "css_wrap_line_length": 0,
    "css_indent_comments": true,
    "css_force_indentation": false,
    "css_align_assignments": false,
    "d_configPath": "",
    "gherkin_indent_size": 2,
    "gherkin_indent_char": " ",
    "fortran_emacs_path": "",
    "fortran_emacs_script_path": "",
    "html_indent_inner_html": false,
    "html_indent_size": 2,
    "html_indent_char": " ",
    "html_brace_style": "collapse",
    "html_indent_scripts": "normal",
    "html_wrap_line_length": 250,
    "html_wrap_attributes": "auto",
    "html_wrap_attributes_indent_size": 2,
    "html_preserve_newlines": true,
    "html_unformatted": [
        "a",
        "sub",
        "sup",
        "b",
        "i",
        "u"
    ],
    "java_configPath": "",
    "js_indent_size": 2,
    "js_indent_char": " ",
    "js_indent_level": 0,
    "js_indent_with_tabs": false,
    "js_preserve_newlines": true,
    "js_max_preserve_newlines": 10,
    "js_space_in_paren": false,
    "js_jslint_happy": false,
    "js_space_after_anon_function": false,
    "js_brace_style": "collapse",
    "js_break_chained_methods": false,
    "js_keep_array_indentation": false,
    "js_keep_function_indentation": false,
    "js_space_before_conditional": true,
    "js_unescape_strings": false,
    "js_wrap_line_length": 0,
    "objectivec_configPath": "",
    "pawn_configPath": "",
    "perl_perltidy_profile": "",
    "php_fixers": "",
    "php_level": "",
    "python_max_line_length": 79,
    "python_indent_size": 4,
    "python_ignore": [
        "E24"
    ],
    "ruby_indent_size": 2,
    "ruby_indent_char": " ",
    "rust_rustfmt_path": "",
    "sql_indent_size": 2,
    "sql_keywords": "upper",
    "sql_identifiers": "lower",
    "vala_configPath": "",
    "language_arduino_disabled": false,
    "language_arduino_default_beautifier": "Uncrustify",
    "language_arduino_beautify_on_save": false,
    "language_cs_disabled": false,
    "language_cs_default_beautifier": "Uncrustify",
    "language_cs_beautify_on_save": false,
    "language_c_disabled": false,
    "language_c_default_beautifier": "Uncrustify",
    "language_c_beautify_on_save": false,
    "language_coffeescript_disabled": false,
    "language_coffeescript_default_beautifier": "coffee-fmt",
    "language_coffeescript_beautify_on_save": false,
    "language_cpp_disabled": false,
    "language_cpp_default_beautifier": "Uncrustify",
    "language_cpp_beautify_on_save": false,
    "language_css_disabled": false,
    "language_css_default_beautifier": "JS Beautify",
    "language_css_beautify_on_save": false,
    "language_csv_disabled": false,
    "language_csv_default_beautifier": "Pretty Diff",
    "language_csv_beautify_on_save": false,
    "language_d_disabled": false,
    "language_d_default_beautifier": "Uncrustify",
    "language_d_beautify_on_save": false,
    "language_ejs_disabled": false,
    "language_ejs_default_beautifier": "Pretty Diff",
    "language_ejs_beautify_on_save": false,
    "language_erb_disabled": false,
    "language_erb_default_beautifier": "Pretty Diff",
    "language_erb_beautify_on_save": false,
    "language_gherkin_disabled": false,
    "language_gherkin_default_beautifier": "Gherkin formatter",
    "language_gherkin_beautify_on_save": false,
    "language_go_disabled": false,
    "language_go_default_beautifier": "gofmt",
    "language_go_beautify_on_save": false,
    "language_fortran_disabled": false,
    "language_fortran_default_beautifier": "Fortran Beautifier",
    "language_fortran_beautify_on_save": false,
    "language_handlebars_disabled": false,
    "language_handlebars_default_beautifier": "JS Beautify",
    "language_handlebars_beautify_on_save": false,
    "language_html_disabled": false,
    "language_html_default_beautifier": "JS Beautify",
    "language_java_disabled": false,
    "language_java_default_beautifier": "Uncrustify",
    "language_java_beautify_on_save": false,
    "language_js_disabled": false,
    "language_js_default_beautifier": "JS Beautify",
    "language_json_disabled": false,
    "language_json_default_beautifier": "JS Beautify",
    "language_jsx_disabled": false,
    "language_jsx_default_beautifier": "Pretty Diff",
    "language_jsx_beautify_on_save": false,
    "language_less_disabled": false,
    "language_less_default_beautifier": "Pretty Diff",
    "language_less_beautify_on_save": false,
    "language_markdown_disabled": false,
    "language_markdown_default_beautifier": "Tidy Markdown",
    "language_markdown_beautify_on_save": false,
    "language_marko_disabled": false,
    "language_marko_default_beautifier": "JS Beautify",
    "language_marko_beautify_on_save": false,
    "language_mustache_disabled": false,
    "language_mustache_default_beautifier": "JS Beautify",
    "language_mustache_beautify_on_save": false,
    "language_objectivec_disabled": false,
    "language_objectivec_default_beautifier": "Uncrustify",
    "language_objectivec_beautify_on_save": false,
    "language_pawn_disabled": false,
    "language_pawn_default_beautifier": "Uncrustify",
    "language_pawn_beautify_on_save": false,
    "language_perl_disabled": false,
    "language_perl_default_beautifier": "Perltidy",
    "language_perl_beautify_on_save": false,
    "language_php_disabled": false,
    "language_php_default_beautifier": "PHP-CS-Fixer",
    "language_php_beautify_on_save": false,
    "language_puppet_disabled": false,
    "language_puppet_default_beautifier": "puppet-lint",
    "language_puppet_beautify_on_save": false,
    "language_python_disabled": false,
    "language_python_default_beautifier": "autopep8",
    "language_python_beautify_on_save": false,
    "language_ruby_disabled": false,
    "language_ruby_default_beautifier": "Rubocop",
    "language_ruby_beautify_on_save": false,
    "language_rust_disabled": false,
    "language_rust_default_beautifier": "rustfmt",
    "language_rust_beautify_on_save": false,
    "language_sass_disabled": false,
    "language_sass_default_beautifier": "Pretty Diff",
    "language_sass_beautify_on_save": false,
    "language_scss_disabled": false,
    "language_scss_default_beautifier": "Pretty Diff",
    "language_spacebars_disabled": false,
    "language_spacebars_default_beautifier": "Pretty Diff",
    "language_spacebars_beautify_on_save": false,
    "language_sql_disabled": false,
    "language_sql_default_beautifier": "sqlformat",
    "language_sql_beautify_on_save": false,
    "language_svg_disabled": false,
    "language_svg_default_beautifier": "Pretty Diff",
    "language_svg_beautify_on_save": false,
    "language_swig_disabled": false,
    "language_swig_default_beautifier": "Pretty Diff",
    "language_swig_beautify_on_save": false,
    "language_tss_disabled": false,
    "language_tss_default_beautifier": "Pretty Diff",
    "language_tss_beautify_on_save": false,
    "language_twig_disabled": false,
    "language_twig_default_beautifier": "Pretty Diff",
    "language_twig_beautify_on_save": false,
    "language_typescript_disabled": false,
    "language_typescript_default_beautifier": "TypeScript Formatter",
    "language_typescript_beautify_on_save": false,
    "language_vala_disabled": false,
    "language_vala_default_beautifier": "Uncrustify",
    "language_vala_beautify_on_save": false,
    "language_visualforce_disabled": false,
    "language_visualforce_default_beautifier": "Pretty Diff",
    "language_visualforce_beautify_on_save": false,
    "language_xml_disabled": false,
    "language_xml_default_beautifier": "Pretty Diff",
    "language_xml_beautify_on_save": false
}

Results

Beautified File Contents:

Error: Could not find 'php-cs-fixer'. The program may not be installed.

Logs:

2015-08-29T15:26:13.671Z - info: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautify <?

phpinfo();

?>
 [ { _default: { indent_size: 2, indent_char: ' ', indent_with_tabs: false } },
  { css:
     { convert_quotes: 'single',
       indent_size: 2,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false,
       wrap_line_length: 0,
       indent_comments: true,
       force_indentation: false,
       align_assignments: false },
    html:
     { end_with_newline: true,
       max_preserve_newlines: 2,
       indent_inner_html: false,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       unformatted: [Object] },
    js:
     { end_with_newline: true,
       eval_code: true,
       indent_size: 2,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       space_after_anon_function: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       unescape_strings: false,
       wrap_line_length: 0 },
    php:
     { cs_fixer_path: '/usr/local/bin/php-cs-fixer',
       fixers: '',
       level: '' },
    arduino: { configPath: '' },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    d: { configPath: '' },
    gherkin: { indent_size: 2, indent_char: ' ' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    java: { configPath: '' },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    python: { max_line_length: 79, indent_size: 4, ignore: [Object] },
    ruby: { indent_size: 2, indent_char: ' ' },
    rust: { rustfmt_path: '' },
    sql: { indent_size: 2, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] PHP /Volumes/MacHDD/downloads/test1.php undefined
2015-08-29T15:26:13.671Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee]  indent_size=2, indent_char= , indent_with_tabs=false, convert_quotes=single, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, align_assignments=false, end_with_newline=true, max_preserve_newlines=2, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, unformatted=[a, sub, sup, b, i, u], end_with_newline=true, eval_code=true, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=, configPath=, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=2, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , ,
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] [ { name: 'PHP',
    namespace: 'php',
    grammars: [ 'PHP' ],
    extensions: [ 'php' ],
    options: { cs_fixer_path: [Object], fixers: [Object], level: [Object] },
    beautifiers: [ 'PHP-CS-Fixer' ] } ] 'PHP' 'php'
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] Language PHP supported
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] getOptions selections [ 'php' ] indent_size=2, indent_char= , indent_with_tabs=false, convert_quotes=single, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, align_assignments=false, end_with_newline=true, max_preserve_newlines=2, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, unformatted=[a, sub, sup, b, i, u], end_with_newline=true, eval_code=true, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=, configPath=, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=2, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , ,
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true indent_size=2, indent_char= , indent_with_tabs=false
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php indent_size=2, indent_char= , indent_with_tabs=false
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true convert_quotes=single, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, align_assignments=false, end_with_newline=true, max_preserve_newlines=2, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, unformatted=[a, sub, sup, b, i, u], end_with_newline=true, eval_code=true, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=, configPath=, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=2, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true
2015-08-29T15:26:13.672Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] true
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php undefined
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options php
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] PHP name=PHP, namespace=php, grammars=[PHP], extensions=[php], title=PHP - PHP-CS-Fixer Path, type=string, default=, description=Path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer), beautifiers=[PHP-CS-Fixer], type=string, default=, description=Add fixer(s). i.e. linefeed,-short_tag,indentation (Supported by PHP-CS-Fixer), title=PHP - Fixers, beautifiers=[PHP-CS-Fixer], type=string, default=, description=By default, all PSR-2 fixers and some additional ones are run. (Supported by PHP-CS-Fixer), title=PHP - Level, beautifiers=[PHP-CS-Fixer], beautifiers=[PHP-CS-Fixer]
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] options indent_size=2, indent_char= , indent_with_tabs=false, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=
2015-08-29T15:26:13.673Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautifiers silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, languages=[PHP], PATH=/usr/bin:/bin:/usr/sbin:/sbin, SECURITYSESSIONID=186a7, USER=username, LOGNAME=username, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.X2e3Q8ctfW/Listeners, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.jyqkehTTrS/Render, SHELL=/usr/local/bin/zsh, HOME=/Users/username, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, TMPDIR=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/, XPC_SERVICE_NAME=0, XPC_FLAGS=0x0, GOOGLE_API_KEY=, ATOM_HOME=/Users/username/Dropbox/Mackup/.atom, NODE_PATH=/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/exports, NODE_ENV=production, SHLVL=0, PWD=/, OLDPWD=/, ZSH=/Users/username/.dotfiles, PROJECTS=/Users/username/Projects, LESSHISTFILE=/dev/null, SSH_HOST=, MANPATH=/usr/local/opt/coreutils/libexec/gnuman:/usr/local/man:/usr/local/git/man:, EDITOR=atom, PS1=%3~$(git_info_for_prompt)%# , TERM=xterm-256color, LS_COLORS=no, MANPAGER=less -X, PROMPT=, %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(git_dirty)$(need_push)=undefined, %{$fg_bold[red]%}└▪%{$reset_color%} =undefined, _=/usr/local/opt/coreutils/libexec/gnubin/env, _envCacheDate=Sat Aug 29 2015 23:24:28 GMT+0800 (HKT)
2015-08-29T15:26:13.674Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] PHP /Volumes/MacHDD/downloads/test1.php { indent_size: 2,
  indent_char: ' ',
  indent_with_tabs: false,
  cs_fixer_path: '/usr/local/bin/php-cs-fixer',
  fixers: '',
  level: '' } indent_size=2, indent_char= , indent_with_tabs=false, convert_quotes=single, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, wrap_line_length=0, indent_comments=true, force_indentation=false, align_assignments=false, end_with_newline=true, max_preserve_newlines=2, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, unformatted=[a, sub, sup, b, i, u], end_with_newline=true, eval_code=true, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=, configPath=, configPath=, configPath=, configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=4, ignore=[E24], indent_size=2, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , ,
2015-08-29T15:26:13.674Z - verbose: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautifier PHP-CS-Fixer silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, silly=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, debug=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, verbose=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, info=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, warn=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, error=function (msg) {
      // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
      var args = [level].concat(Array.prototype.slice.call(arguments));
      target.log.apply(target, args);
    }, onLogging=function (handler) {
        var subscription;
        subscription = emitter.on('logging', handler);
        return subscription;
      }, languages=[PHP], PATH=/usr/bin:/bin:/usr/sbin:/sbin, SECURITYSESSIONID=186a7, USER=username, LOGNAME=username, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.X2e3Q8ctfW/Listeners, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.jyqkehTTrS/Render, SHELL=/usr/local/bin/zsh, HOME=/Users/username, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, TMPDIR=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/, XPC_SERVICE_NAME=0, XPC_FLAGS=0x0, GOOGLE_API_KEY=, ATOM_HOME=/Users/username/Dropbox/Mackup/.atom, NODE_PATH=/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/exports, NODE_ENV=production, SHLVL=0, PWD=/, OLDPWD=/, ZSH=/Users/username/.dotfiles, PROJECTS=/Users/username/Projects, LESSHISTFILE=/dev/null, SSH_HOST=, MANPATH=/usr/local/opt/coreutils/libexec/gnuman:/usr/local/man:/usr/local/git/man:, EDITOR=atom, PS1=%3~$(git_info_for_prompt)%# , TERM=xterm-256color, LS_COLORS=no, MANPAGER=less -X, PROMPT=, %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(git_dirty)$(need_push)=undefined, %{$fg_bold[red]%}└▪%{$reset_color%} =undefined, _=/usr/local/opt/coreutils/libexec/gnubin/env, _envCacheDate=Sat Aug 29 2015 23:24:28 GMT+0800 (HKT)
2015-08-29T15:26:13.675Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] php-cs-fixer indent_size=2, indent_char= , indent_with_tabs=false, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level=
2015-08-29T15:26:13.680Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] tempFile temp null path=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p, fd=47
2015-08-29T15:26:13.680Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] exeName, args: php-cs-fixer 0=fix, 1=undefined, 2=undefined, 3=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p
2015-08-29T15:26:14.060Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] exePath, env: php-cs-fixer PATH=/usr/bin:/bin:/usr/sbin:/sbin, SECURITYSESSIONID=186a7, USER=username, LOGNAME=username, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.X2e3Q8ctfW/Listeners, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.jyqkehTTrS/Render, SHELL=/usr/local/bin/zsh, HOME=/Users/username, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, TMPDIR=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/, XPC_SERVICE_NAME=0, XPC_FLAGS=0x0, GOOGLE_API_KEY=, ATOM_HOME=/Users/username/Dropbox/Mackup/.atom, NODE_PATH=/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/exports, NODE_ENV=production, SHLVL=0, PWD=/, OLDPWD=/, ZSH=/Users/username/.dotfiles, PROJECTS=/Users/username/Projects, LESSHISTFILE=/dev/null, SSH_HOST=, MANPATH=/usr/local/opt/coreutils/libexec/gnuman:/usr/local/man:/usr/local/git/man:, EDITOR=atom, PS1=%3~$(git_info_for_prompt)%# , TERM=xterm-256color, LS_COLORS=no, MANPAGER=less -X, PROMPT=, %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(git_dirty)$(need_push)=undefined, %{$fg_bold[red]%}└▪%{$reset_color%} =undefined, _=/usr/local/opt/coreutils/libexec/gnubin/env
2015-08-29T15:26:14.060Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] spawn php-cs-fixer 0=fix, 1=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p
2015-08-29T15:26:14.067Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] error Error: spawn php-cs-fixer ENOENT
  at exports._errnoException (util.js:734:11)
  at Process.ChildProcess._handle.onexit (child_process.js:1035:32)
  at child_process.js:1127:20
  at process._tickCallback (node.js:357:13)

2015-08-29T15:26:14.067Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] error Error: spawn php-cs-fixer ENOENT
  at exports._errnoException (util.js:734:11)
  at Process.ChildProcess._handle.onexit (child_process.js:1035:32)
  at child_process.js:1127:20
  at process._tickCallback (node.js:357:13)
Glavin001 commented 9 years ago

@gddabe : I think the problem is with your PATH environment variable still.

You noted that it should be:

└▪ echo $PATH /usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/local/sbin:/Users/username/.dotfiles/bin:/Users/username/.rbenv/shims:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/local/sbin:/Users/username/.dotfiles/bin:/Users/username/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

However, when I look at the debugging logs:

2015-08-29T15:26:13.675Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] php-cs-fixer indent_size=2, indent_char= , indent_with_tabs=false, cs_fixer_path=/usr/local/bin/php-cs-fixer, fixers=, level= 2015-08-29T15:26:13.680Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] tempFile temp null path=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p, fd=47 2015-08-29T15:26:13.680Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] exeName, args: php-cs-fixer 0=fix, 1=undefined, 2=undefined, 3=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p 2015-08-29T15:26:14.060Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] exePath, env: php-cs-fixer PATH=/usr/bin:/bin:/usr/sbin:/sbin, SECURITYSESSIONID=186a7, USER=username, LOGNAME=username, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.X2e3Q8ctfW/Listeners, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.jyqkehTTrS/Render, SHELL=/usr/local/bin/zsh, HOME=/Users/username, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, TMPDIR=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/, XPC_SERVICE_NAME=0, XPC_FLAGS=0x0, GOOGLE_API_KEY=, ATOM_HOME=/Users/username/Dropbox/Mackup/.atom, NODE_PATH=/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/exports, NODE_ENV=production, SHLVL=0, PWD=/, OLDPWD=/, ZSH=/Users/username/.dotfiles, PROJECTS=/Users/username/Projects, LESSHISTFILE=/dev/null, SSH_HOST=, MANPATH=/usr/local/opt/coreutils/libexec/gnuman:/usr/local/man:/usr/local/git/man:, EDITOR=atom, PS1=%3~$(git_info_for_prompt)%# , TERM=xterm-256color, LS_COLORS=no, MANPAGER=less -X, PROMPT=, %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(git_dirty)$(need_push)=undefined, %{$fg_bold[red]%}└▪%{$resetcolor%} =undefined, =/usr/local/opt/coreutils/libexec/gnubin/env 2015-08-29T15:26:14.060Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] spawn php-cs-fixer 0=fix, 1=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p 2015-08-29T15:26:14.067Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] error Error: spawn php-cs-fixer ENOENT

It shows a few things:

2015-08-29T15:26:14.060Z - debug: [/Users/username/Dropbox/Mackup/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee] spawn php-cs-fixer 0=fix, 1=/var/folders/9w/r9hkmz1562v6qgmmxt2sk0p80000gn/T/temp115729-3974-1bk6x2p

I just ran mine, which is setup and working, and the log line look like:

beautifiers/beautifier.coffee [debug]: spawn /usr/local/bin/php-cs-fixer ["fix", "/var/folders/lw/ct2vyvzs04gd_l8bn8794t800000gn/T/temp115729-38949-ghvmhr"]

Note the difference, spawn /usr/local/bin/php-cs-fixer versus spawn php-cs-fixer. The latter being Atom Beautify's last attempt to let the shell find the executable, which usually is a bad sign because Atom Beautify should be able to find it given a proper PATH environment variable.

Could you verify that your PATH environment variable is saved properly? For instance, try restarting your Terminal and running echo $PATH again. Is it still correct? I'd recommend taking a look at you .bashrc file. Read http://unix.stackexchange.com/a/129144/108635 for more details.

Let me know if you have any more questions. I hope this resolves your problem. I believe that the issue is that you need to store your changes to your PATH in the ~/.bashrc file.

gddabe commented 9 years ago

@Glavin001 thanks for your reply! But that's weird, no matter how many times i restart my iterm2, I got the $PATH shown correctly with /usr/local/bin placed at the front. I am using zsh instead of bash, would it be the reason of failure? I've even run this

export PATH=/usr/local/bin:$PATH

to double ensure it is set. But still no luck. I also switch back to /bin/bash, and the $PATH also looks good.

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
gddabe commented 9 years ago

Your know what, after several hours of researching, I was just too frustrated because of this, I reinstall atom and BOOM! It works all of a sudden! That's soooooo weird. But who cares, it works now, thanks for you support @Glavin001!

Glavin001 commented 9 years ago

Glad to hear it is working now! Let me know if you have any more questions :smiley: .

dtomasch commented 8 years ago

After debugging all of that last year, now I can't get this working again… despite walking thru all of my own original documented instructions. It doesn't fail with an error like it used to, and php-cs-fixer is installed. What data do you need to help debug?

Glavin001 commented 8 years ago

What data do you need to help debug?

@dtomasch : Follow the How to create debug.md Gist instructions found at https://github.com/Glavin001/atom-beautify/blob/master/ISSUE_TEMPLATE.md#how-to-create-debugmd-gist and provide a link to your Gist with the debugging information. Thanks.

dtomasch commented 8 years ago

Thanks! Here's the link: https://gist.github.com/dtomasch/bb9a62d17b7629f63277c3d498c445bf

Glavin001 commented 8 years ago

@dtomasch : What do you think is wrong? What do you expect to happen? The logs indicate that Atom-Beautify is working correctly and php-cs-fixer has completed.

In your logs:

spawn /usr/local/bin/php-cs-fixer 0=fix, 1=/var/folders/nm/xlqpgv896f3cv8mjtl9b0qcr0000gn/T/temp116314-5617-qh4653 spawn done 0 Fixed all files in 0.023 seconds, 6.000 MB memory used

dtomasch commented 8 years ago

@Glavin001 — insteresting. The outpout doesn't repopulate the current document. So effectively it's not doing anything to my php file.

See below:

Original PHP file (partial, used as in include): next-event php -users-dtomasch-sites-potomac ex

Saved as html and run beautify: next-event html -users-dtomasch-sites-potomac ex

Beautify on the php file (no change): next-event php -users-dtomasch-sites-potomac ex

Glavin001 commented 8 years ago

It looks like the contents is all HTML. I'd suppose that PHP-CS-Fixer is not handling any of the HTML? You could ask them at https://github.com/FriendsOfPHP/PHP-CS-Fixer

Issue #457 may also be related and this comment describes my future plans: https://github.com/Glavin001/atom-beautify/issues/457#issuecomment-204499368

dtomasch commented 8 years ago

That makes sense; I did think I had it working.

This is def part of issue #457 — the other solution is to change your grammar but that's a bit of a pain.

(I didn't mean to close this issue necessarily)

saeedvz commented 8 years ago

@dtomasch Thank you...! your document is excellent

raipratik commented 8 years ago

easy fix: http://tzfrs.de/2015/01/automatically-format-code-to-match-psr-standards-with-phpstorm/

xucaen commented 8 years ago

So it would seem that everyone here has resolved the issues on Linux. But what about Windows? Today, I installed Atom, I have php installed (xampp) and I installed both atom-beautify and php-cs-fixer. Here is the error I get:

Could not find 'php-cs-fixer'. The program may not be installed. See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions. You can configure Atom Beautify with the absolute path to 'php-cs-fixer.phar' by setting 'PHP - CS Fixer Path' in the Atom Beautify package settings. Your program is properly installed if running 'where.exe php-cs-fixer' in your CMD prompt returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable. Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=php-cs-fixer&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help. Hide Stack Trace Error: Could not find 'php-cs-fixer'. The program may not be installed. at PHPCSFixer.module.exports.Beautifier.commandNotFoundError (file:///C:/Users/jbarrett/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:204:14) at file:///C:/Users/jbarrett/.atom/packages/atom-beautify/src/beautifiers/php-cs-fixer.coffee:56:28 at tryCatcher (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:510:31) at Promise._settlePromise (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:567:18) at Promise._settlePromise0 (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:612:10) at Promise._settlePromises (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:691:18) at Promise._fulfill (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:636:18) at PromiseArray._resolve (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise_array.js:125:19) at PromiseArray._promiseFulfilled (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise_array.js:143:14) at Promise._settlePromise (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:572:26) at Promise._settlePromise0 (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:612:10) at Promise._settlePromises (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:691:18) at Async._drainQueue (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:138:16) at Async._drainQueues (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:148:10) at Async.drainQueues (C:\Users\jbarrett.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:17:14)

acrolink commented 7 years ago

@xucaen

Seems that it simply does not word on Windows.. Tells me not found..

cnochx commented 7 years ago

For macOS Sierra I had this problem also.

$ which php 
-> no entry

I fix the problem in this way:

• Install Homebrew: http://brew.sh/

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

• Install Homebrew/php: https://github.com/Homebrew/homebrew-php#installation

$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/homebrew-php

• Install php-cs-fixer:

$ brew install php-cs-fixer

• I check the installation after:

$ which php-cs-fixer

• Finally I see the path:

/usr/local/bin/php-cs-fixer

In the End I can use this beauty… Thank you very much for the workaround!

Brieg commented 7 years ago

+1

Glavin001 commented 7 years ago

I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance.

yaser-alazm commented 7 years ago

@dtomasch @Glavin001 where should I apply those commands ? what is the path I must apply those commands in in order to check php-cs-fixer or install it ?

sukrosono commented 6 years ago

hmm, on windows: composer global require friendsofphp/php-cs-fixer && restart atom fix the problem, for now at least.

cpjeanpaul commented 6 years ago

Not working to me too :(

which php: /usr/bin/php
which php-cs-fixer: /home/jean/.composer/vendor/bin/php-cs-fixer
echo $PATH: /home/jean/bin:/home/jean/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jean/.composer/vendor/bin

Here is log: https://gist.github.com/cpjeanpaul/c4aa6e81182d19a59b703b5cfa5a24fa Any idea?

Glavin001 commented 6 years ago

@cpjeanpaul : In your logs I see:

2018-03-02T12:46:00.209Z - debug: [] spawn /home/jean/.composer/vendor/bin/php-cs-fixer 0=fix, 1=--allow-risky=no, 2=--using-cache=no, 3=temp11822-19050-10yf7ad.3w8rebfbt9.php
2018-03-02T12:46:00.281Z - debug: [] spawn done 0 Loaded config default.

Files that were not fixed due to errors reported during linting before fixing:
   1) /tmp/temp11822-19050-10yf7ad.3w8rebfbt9.php

Fixed all files in 0.001 seconds, 8.000 MB memory used

2018-03-02T12:46:00.282Z - verbose: [] spawn result, returnCode 0

Files that were not fixed due to errors reported during linting before fixing: is an error thrown from PHP-CS-Fixer. I recommend you ask about it over at https://github.com/FriendsOfPHP/PHP-CS-Fixer

cpjeanpaul commented 6 years ago

I think there are some problemes with v2.x. Now I'm using 1.x and is working. Thank you for your patience ;)

mrblini commented 6 years ago

Thank you so much @dtomasch I also got it fixed the way you showed!

AsmaGargouri commented 6 years ago

@brutalcrozt Thanks, composer global require friendsofphp/php-cs-fixer worked for me !

G33kNoob commented 4 years ago

@brutalcrozt Thanks, composer global require friendsofphp/php-cs-fixer worked for me !

Thanks its work

zaidiyasser commented 4 years ago

Could not find 'php-cs-fixer'. The program may not be installed.

See php-cs-fixer installation instructions at https://github.com/Glavin001/atom-beautify#beautifiers or go to https://github.com/FriendsOfPHP/PHP-CS-Fixer Your program is properly installed if running 'where.exe php-cs-fixer' in your CMD prompt returns an absolute path to the executable. Hide Stack Trace Error: Could not find 'php-cs-fixer'. The program may not be installed. at Function.Executable.commandNotFoundError (file:///C:/Users/Yasser/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:277:10) at HybridExecutable.Executable.commandNotFoundError (file:///C:/Users/Yasser/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:269:18) at file:///C:/Users/Yasser/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:197:22 at tryCatcher (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:725:18) at _drainQueueStep (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:102:5) at Async.drainQueues (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:15:14) at process._tickCallback (internal/process/next_tick.js:68:7)

zaidiyasser commented 4 years ago

how to solve this problem Could not find 'php-cs-fixer'. The program may not be installed. See php-cs-fixer installation instructions at https://github.com/Glavin001/atom-beautify#beautifiers or go to https://github.com/FriendsOfPHP/PHP-CS-Fixer Your program is properly installed if running 'where.exe php-cs-fixer' in your CMD prompt returns an absolute path to the executable. Hide Stack Trace Error: Could not find 'php-cs-fixer'. The program may not be installed. at Function.Executable.commandNotFoundError (file:///C:/Users/Yasser/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:277:10) at HybridExecutable.Executable.commandNotFoundError (file:///C:/Users/Yasser/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:269:18) at file:///C:/Users/Yasser/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:197:22 at tryCatcher (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:725:18) at _drainQueueStep (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:102:5) at Async.drainQueues (C:\Users\Yasser.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:15:14) at process._tickCallback (internal/process/next_tick.js:68:7)

asadProfile commented 4 years ago

Just Only this command working perfectly $composer global require friendsofphp/php-cs-fixer Everything fixed!

Hailv commented 2 years ago

Makes sense and I did finally get it to work. I couldn't seem to get the homebrew option to install successfully, but the Composer version worked fine.

I'm adding my steps here so it's documented for anyone else who might have this problem.

1. Install Composer (https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) Run: $ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer

2. Install PHP-CS-Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer) Run: $ curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer $ sudo chmod a+x php-cs-fixer $ sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer

That got everything working for me.

it's working for me, thanks.