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

windows php-cs-fixer not working #416

Closed johannes-z closed 9 years ago

johannes-z commented 9 years ago

I installed php-cs-fixer with composer globally on my windows machine. The .bat file resides in "C:\Users\AppData\Roaming\Composer\vendor\fabpot\php-cs-fixer". The command "php-cs-fixer" is recognized by the console. (I tried adding both the full path and the command-name only to the beautify settings). When executing the beautify function, nothing happens in my .php file. I took a look at the debug output, but couldn't really make anything out of it. atom-beautify version is 0.28.6 php-cs-fixer version is 1.9 atom version is 1.0.0

Glavin001 commented 9 years ago

Please run Atom Beautify - Help Debug Editor and let me know results

johannes-z commented 9 years ago

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Fri Jun 26 2015 00:34:07 GMT+0200 (Mitteleuropäische Sommerzeit).


Platform: win32

Versions

Atom Version: 1.0.0

Atom Beautify Version: 0.28.6

Original file to be beautified

Original File Path: C:\Users\Johannes\Documents\PhpStormProjects\laravel51\app\Character.php

Original File Grammar: PHP

Original File Language: PHP

Original File Contents:

<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Character
 *
 * @property-read \App\Location $location
 * @property-read \App\User $user
 * @property-write mixed $name
 */
class Character extends \Eloquent {
    use SoftDeletes;

    protected $fillable = ['location_id', 'user_id', 'name', 'avatar'];

    protected $hidden = ['user_id', 'location_id', 'created_at', 'updated_at', 'deleted_at', 'avatar', 'location'];

    protected $dates = ['deleted_at'];

    /*
     * Relationships
     */
    public function location() {
        return $this->belongsTo('App\Location');
    }

    public function messages() {
        return $this->hasMany('App\Message');
    }

    public function user() {
        return $this->belongsTo('App\User');
    }

    /*
     * Mutators
     */
    public function setNameAttribute($value) {
        $this->attributes['name'] = trim($value);
    }

}

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

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

Home Options: Options from C:\Users\Johannes\.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options: Options from EditorConfig file

{
    "_default": {}
}

Project Options: Options from .jsbeautifyrc files starting from directory C:\Users\Johannes\Documents\PhpStormProjects\laravel51\app and going up to root

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

Final Options: Final combined options that are used

{
    "indent_size": 4,
    "indent_char": " ",
    "indent_with_tabs": false,
    "cs_fixer_path": "C:\\Users\\Johannes\\AppData\\Roaming\\Composer\\vendor\\bin\\php-cs-fixer.bat",
    "fixers": "",
    "level": ""
}

Package Settings: The raw package settings options

{
    "css_align_assignments": true,
    "css_convert_quotes": "double",
    "css_force_indentation": true,
    "css_newline_between_rules": true,
    "css_selector_separator_newline": true,
    "js_break_chained_methods": true,
    "js_eval_code": true,
    "js_space_after_anon_function": true,
    "_analyticsUserId": "991fbbef-0b37-4366-96d5-7e8952ff72a4",
    "js_indent_with_tabs": false,
    "js_indent_size": 4,
    "js_indent_char": " ",
    "php_cs_fixer_path": "C:\\Users\\Johannes\\AppData\\Roaming\\Composer\\vendor\\bin\\php-cs-fixer.bat",
    "language_php_beautify_on_save": true,
    "language_html_beautify_on_save": true,
    "language_js_beautify_on_save": true,
    "analytics": true,
    "_loggerLevel": "warn",
    "beautifyEntireFileOnSave": true,
    "muteUnsupportedLanguageErrors": false,
    "muteAllErrors": false,
    "cs_configPath": "",
    "c_configPath": "",
    "cpp_configPath": "",
    "css_indent_size": 1,
    "css_indent_char": "\t",
    "css_preserve_newlines": false,
    "css_wrap_line_length": 0,
    "css_indent_comments": true,
    "d_configPath": "",
    "fortran_emacs_path": "",
    "fortran_emacs_script_path": "",
    "html_indent_inner_html": false,
    "html_indent_size": 1,
    "html_indent_char": "\t",
    "html_brace_style": "collapse",
    "html_indent_scripts": "normal",
    "html_wrap_line_length": 250,
    "html_wrap_attributes": "auto",
    "html_wrap_attributes_indent_size": 1,
    "html_preserve_newlines": true,
    "html_max_preserve_newlines": 10,
    "html_unformatted": [
        "a",
        "sub",
        "sup",
        "b",
        "i",
        "u"
    ],
    "html_end_with_newline": false,
    "java_configPath": "",
    "js_indent_level": 0,
    "js_preserve_newlines": true,
    "js_max_preserve_newlines": 10,
    "js_space_in_paren": false,
    "js_jslint_happy": false,
    "js_brace_style": "collapse",
    "js_keep_array_indentation": false,
    "js_keep_function_indentation": false,
    "js_space_before_conditional": true,
    "js_unescape_strings": false,
    "js_wrap_line_length": 0,
    "js_end_with_newline": false,
    "objectivec_configPath": "",
    "pawn_configPath": "",
    "perl_perltidy_profile": "",
    "php_fixers": "",
    "php_level": "",
    "python_max_line_length": 79,
    "python_indent_size": 1,
    "python_ignore": [
        "E24"
    ],
    "ruby_indent_size": 1,
    "ruby_indent_char": "\t",
    "rust_rustfmt_path": "",
    "sql_indent_size": 1,
    "sql_keywords": "upper",
    "sql_identifiers": "lower",
    "vala_configPath": "",
    "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_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_json_beautify_on_save": false,
    "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_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_scss_beautify_on_save": false,
    "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_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:

<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Character
 *
 * @property-read \App\Location $location
 * @property-read \App\User $user
 * @property-write mixed $name
 */
class Character extends \Eloquent {
    use SoftDeletes;

    protected $fillable = ['location_id', 'user_id', 'name', 'avatar'];

    protected $hidden = ['user_id', 'location_id', 'created_at', 'updated_at', 'deleted_at', 'avatar', 'location'];

    protected $dates = ['deleted_at'];

    /*
     * Relationships
     */
    public function location() {
        return $this->belongsTo('App\Location');
    }

    public function messages() {
        return $this->hasMany('App\Message');
    }

    public function user() {
        return $this->belongsTo('App\User');
    }

    /*
     * Mutators
     */
    public function setNameAttribute($value) {
        $this->attributes['name'] = trim($value);
    }

}

Logs:

2015-06-25T22:34:07.868Z - info: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] beautify <?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Character
 *
 * @property-read \App\Location $location
 * @property-read \App\User $user
 * @property-write mixed $name
 */
class Character extends \Eloquent {
    use SoftDeletes;

    protected $fillable = ['location_id', 'user_id', 'name', 'avatar'];

    protected $hidden = ['user_id', 'location_id', 'created_at', 'updated_at', 'deleted_at', 'avatar', 'location'];

    protected $dates = ['deleted_at'];

    /*
     * Relationships
     */
    public function location() {
        return $this->belongsTo('App\Location');
    }

    public function messages() {
        return $this->hasMany('App\Message');
    }

    public function user() {
        return $this->belongsTo('App\User');
    }

    /*
     * Mutators
     */
    public function setNameAttribute($value) {
        $this->attributes['name'] = trim($value);
    }

}
 [ { _default: { indent_size: 4, indent_char: ' ', indent_with_tabs: false } },
  { css: 
     { align_assignments: true,
       convert_quotes: 'double',
       force_indentation: true,
       newline_between_rules: true,
       selector_separator_newline: true,
       indent_size: 1,
       indent_char: '\t',
       preserve_newlines: false,
       wrap_line_length: 0,
       indent_comments: true },
    js: 
     { break_chained_methods: true,
       eval_code: true,
       space_after_anon_function: true,
       indent_with_tabs: false,
       indent_size: 4,
       indent_char: ' ',
       indent_level: 0,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       brace_style: 'collapse',
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false },
    php: 
     { cs_fixer_path: 'C:\\Users\\Johannes\\AppData\\Roaming\\Composer\\vendor\\bin\\php-cs-fixer.bat',
       fixers: '',
       level: '' },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    d: { configPath: '' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 1,
       indent_char: '\t',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 1,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false },
    java: { configPath: '' },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    python: { max_line_length: 79, indent_size: 1, ignore: [Object] },
    ruby: { indent_size: 1, indent_char: '\t' },
    rust: { rustfmt_path: '' },
    sql: { indent_size: 1, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] PHP C:\Users\Johannes\Documents\PhpStormProjects\laravel51\app\Character.php undefined
2015-06-25T22:34:07.868Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee]  indent_size=4, indent_char= , indent_with_tabs=false, align_assignments=true, convert_quotes=double, force_indentation=true, newline_between_rules=true, selector_separator_newline=true, indent_size=1, indent_char=    , preserve_newlines=false, wrap_line_length=0, indent_comments=true, break_chained_methods=true, eval_code=true, space_after_anon_function=true, indent_with_tabs=false, indent_size=4, indent_char= , indent_level=0, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, brace_style=collapse, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, end_with_newline=false, cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=, configPath=, configPath=, configPath=, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=1, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=1, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=1, ignore=[E24], indent_size=1, indent_char=  , rustfmt_path=, indent_size=1, keywords=upper, identifiers=lower, configPath=, , , , , , , , 
2015-06-25T22:34:07.868Z - verbose: [C:\Users\Johannes\.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-25T22:34:07.868Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] Language PHP supported
2015-06-25T22:34:07.868Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] getOptions selections [ 'php' ] indent_size=4, indent_char= , indent_with_tabs=false, align_assignments=true, convert_quotes=double, force_indentation=true, newline_between_rules=true, selector_separator_newline=true, indent_size=1, indent_char= , preserve_newlines=false, wrap_line_length=0, indent_comments=true, break_chained_methods=true, eval_code=true, space_after_anon_function=true, indent_with_tabs=false, indent_size=4, indent_char= , indent_level=0, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, brace_style=collapse, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, end_with_newline=false, cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=, configPath=, configPath=, configPath=, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=1, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=1, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=1, ignore=[E24], indent_size=1, indent_char=  , rustfmt_path=, indent_size=1, keywords=upper, identifiers=lower, configPath=, , , , , , , , 
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true indent_size=4, indent_char= , indent_with_tabs=false
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php indent_size=4, indent_char= , indent_with_tabs=false
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true align_assignments=true, convert_quotes=double, force_indentation=true, newline_between_rules=true, selector_separator_newline=true, indent_size=1, indent_char=  , preserve_newlines=false, wrap_line_length=0, indent_comments=true, break_chained_methods=true, eval_code=true, space_after_anon_function=true, indent_with_tabs=false, indent_size=4, indent_char= , indent_level=0, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, brace_style=collapse, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, end_with_newline=false, cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=, configPath=, configPath=, configPath=, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=1, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=1, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=1, ignore=[E24], indent_size=1, indent_char=  , rustfmt_path=, indent_size=1, keywords=upper, identifiers=lower, configPath=
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.869Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] true 
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php undefined
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options php
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.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-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] options indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.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-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\index.coffee] PHP C:\Users\Johannes\Documents\PhpStormProjects\laravel51\app\Character.php { indent_size: 4,
  indent_char: ' ',
  indent_with_tabs: false,
  cs_fixer_path: 'C:\\Users\\Johannes\\AppData\\Roaming\\Composer\\vendor\\bin\\php-cs-fixer.bat',
  fixers: '',
  level: '' } indent_size=4, indent_char= , indent_with_tabs=false, align_assignments=true, convert_quotes=double, force_indentation=true, newline_between_rules=true, selector_separator_newline=true, indent_size=1, indent_char= , preserve_newlines=false, wrap_line_length=0, indent_comments=true, break_chained_methods=true, eval_code=true, space_after_anon_function=true, indent_with_tabs=false, indent_size=4, indent_char= , indent_level=0, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, brace_style=collapse, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, unescape_strings=false, wrap_line_length=0, end_with_newline=false, cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=, configPath=, configPath=, configPath=, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=1, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=1, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, configPath=, configPath=, perltidy_profile=, max_line_length=79, indent_size=1, ignore=[E24], indent_size=1, indent_char=  , rustfmt_path=, indent_size=1, keywords=upper, identifiers=lower, configPath=, , , , , , , , 
2015-06-25T22:34:07.870Z - verbose: [C:\Users\Johannes\.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-25T22:34:07.871Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] php-cs-fixer indent_size=4, indent_char= , indent_with_tabs=false, cs_fixer_path=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, fixers=, level=
2015-06-25T22:34:07.899Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] php-cs-fixer paths 0=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, 1=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.BAT
2015-06-25T22:34:07.899Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] phpCSFixerPath C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat
2015-06-25T22:34:07.899Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] phpCSFixerPath C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat 0=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, 1=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.BAT
2015-06-25T22:34:07.899Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] tempFile temp null path=C:\Users\Johannes\AppData\Local\Temp\temp115526-2372-6vdd64, fd=3
2015-06-25T22:34:07.900Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] exeName, args: php 0=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, 1=fix, 2=undefined, 3=undefined, 4=C:\Users\Johannes\AppData\Local\Temp\temp115526-2372-6vdd64
2015-06-25T22:34:07.911Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] exePath, env: C:\web\php\php.EXE ALLUSERSPROFILE=C:\ProgramData, APPDATA=C:\Users\Johannes\AppData\Roaming, ATOM_HOME=C:\Users\Johannes\.atom, CommonProgramFiles=C:\Program Files (x86)\Common Files, CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files, CommonProgramW6432=C:\Program Files\Common Files, COMPUTERNAME=JOHANNES-PC, ComSpec=C:\Windows\system32\cmd.exe, FP_NO_HOST_CHECK=NO, GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q, HOMEDRIVE=C:, HOMEPATH=\Users\Johannes, JD2_HOME=C:\Users\Johannes\AppData\Local\JDownloader v2.0, LOCALAPPDATA=C:\Users\Johannes\AppData\Local, LOGONSERVER=\\JOHANNES-PC, NODE_ENV=production, NODE_PATH=C:\Users\Johannes\AppData\Local\atom\app-1.0.0\resources\app.asar\exports, NUMBER_OF_PROCESSORS=4, OS=Windows_NT, Path=C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\TortoiseSVN\bin;C:\web\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\web\php;C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin;C:\web\sqlite;C:\Program Files (x86)\SumatraPDF;C:\adb;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\ffmpeg\bin;C:\Program Files (x86)\HashiCorp\Vagrant\bin;C:\web\php;C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin;C:\web\sqlite;C:\Program Files (x86)\SumatraPDF;C:\Users\Johannes\AppData\Roaming\npm;C:\Program Files (x86)\SQLite;C:\Program Files (x86)\ffmpeg\bin;C:\Users\Johannes\AppData\Local\atom\bin, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY, PROCESSOR_ARCHITECTURE=x86, PROCESSOR_ARCHITEW6432=AMD64, PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel, PROCESSOR_LEVEL=6, PROCESSOR_REVISION=3c03, ProgramData=C:\ProgramData, ProgramFiles=C:\Program Files (x86), ProgramFiles(x86)=C:\Program Files (x86), ProgramW6432=C:\Program Files, PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\, PUBLIC=C:\Users\Public, SESSIONNAME=Console, SystemDrive=C:, SystemRoot=C:\Windows, TEMP=C:\Users\Johannes\AppData\Local\Temp, TMP=C:\Users\Johannes\AppData\Local\Temp, USERDOMAIN=Johannes-PC, USERDOMAIN_ROAMINGPROFILE=Johannes-PC, USERNAME=Johannes, USERPROFILE=C:\Users\Johannes, VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\, VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\, VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\, windir=C:\Windows
2015-06-25T22:34:07.912Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] spawn C:\web\php\php.EXE 0=C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat, 1=fix, 2=C:\Users\Johannes\AppData\Local\Temp\temp115526-2372-6vdd64
2015-06-25T22:34:07.942Z - debug: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] spawn done 0  @ECHO OFF
SET BIN_TARGET=%~dp0/../fabpot/php-cs-fixer/php-cs-fixer
php "%BIN_TARGET%" %*

2015-06-25T22:34:07.943Z - verbose: [C:\Users\Johannes\.atom\packages\atom-beautify\src\beautifiers\beautifier.coffee] spawn result 0 @ECHO OFF
SET BIN_TARGET=%~dp0/../fabpot/php-cs-fixer/php-cs-fixer
php "%BIN_TARGET%" %*
Glavin001 commented 9 years ago

It looks like it is working. What is the problem?

Glavin001 commented 9 years ago

Try beautifying something like:

<?php
function add($a,     $b) {
  return $a +$b; }
echo   add(1,2);

Should turn into:

<?php

function add($a,     $b)
{
    return $a + $b;
}
echo   add(1, 2);

If it doesn't work, let me know and we can reopen this. However right now it just looks like your file is already clean to php-cs-fixer's standards and so there are no visible changes.

johannes-z commented 9 years ago

Seems like it doesn't have anything to do with atom beautify. I created a test.php file on my Desktop, put in the code you suggested and ran the following command: > php C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer fix test.php

output:

SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../fabpot/php-cs-fixer"
BIN_TARGET="`pwd`/php-cs-fixer"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"

And the code is still unprocessed.

Glavin001 commented 9 years ago

Whoa. That's weird. Hope the PHP-CS-Fixer guys can help you figure that out! :smiley:

johannes-z commented 9 years ago

Running the command php-cs-fixer.bat fix test.php works perfectly - as pointed out on https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/1276. So the problem seems to be the php-cs-fixer file which does nothing but print the contents. (cause it's a bash script)

But I can't configure atom-beautify to call the .bat without sending it to php.

In otherwords - on windows (at least for me) I don't want to call the configured executable via php, but rather just call the .bat.

I hope that it's understandable what I just wrote :D

Glavin001 commented 9 years ago

@johannes-z what about what @sstok said in the comment: https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/1276#issuecomment-115561112

To execute the PHP script: php C:\Users\Johannes\AppData\Roaming\Composer\vendor\fabpot\php-cs-fixer\php-cs-fixer

So php-cs-fixer-path should be set to C:\Users\Johannes\AppData\Roaming\Composer\vendor\fabpot\php-cs-fixer\php-cs-fixer and it should work. What is strange is that you have already tried that (?).

Can you read the file C:\Users\Johannes\AppData\Roaming\Composer\vendor\bin\php-cs-fixer.bat and paste the contents here? I believe it should call php somewhere and I think there must be a bug in PHP-CS-Fixer or how Composer installed it or something strange is going on. My reasoning being, that there should be a PHP file somewhere, and we want that. So hopefully the .bat file is calling php and the correct php file and then we can just use that path.

johannes-z commented 9 years ago

That's interesting. Following the leads I found out, that composer actually installs 2 scripts into the /vendor/bin directory. So for every package you install globally (I guess), you get a bash script and a bat script, calling the actual executable for the package. (in this case /vendor/fabpot/php-cs-fixer)

Running the above command suggested by @sstok works as intended.

I checked my first post on this issue, and found out, that I used the PATH to the directory of php-cs-fixer in atom-beautify rather than the full PATH of the executable (so I was missing .../php-cs-fixer in the PHP - PHP-CS-Fixer Path).

So yes, setting the path to C:\Users\Johannes\AppData\Roaming\Composer\vendor\fabpot\php-cs-fixer\php-cs-fixer ultimately worked.

Regarding the .bat, yes it calls php <path to php-cs-fixer executable>.

HerbertPfeifer commented 5 years ago

Sorry for posting a worthless negative comment, but I have to say I've wasted hours now trying to get the simple function code beautification running with Atom and still failed though following contless of these instructions. This really shouldn't be that difficult.