<commit_before>###
Requires https://github.com/FriendsOfPHP/PHP-CS-Fixer
###

"use strict"
Beautifier = require('./beautifier')
path = require('path')

module.exports = class PHPCSFixer extends Beautifier

  name: 'PHP-CS-Fixer'
  link: "https://github.com/FriendsOfPHP/PHP-CS-Fixer"

  options:
    PHP: true

  beautify: (text, language, options, context) ->
    @debug('php-cs-fixer', options)

    configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
    phpCsFixerOptions = [
      "fix"
      "--rules=#{options.rules}" if options.rules
      "--config-file=#{configFile}" if configFile
    ]
    runOptions = {
      ignoreReturnCode: true
      help: {<commit_msg>Change config file option<commit_after>###
Requires https://github.com/FriendsOfPHP/PHP-CS-Fixer
###

"use strict"
Beautifier = require('./beautifier')
path = require('path')

module.exports = class PHPCSFixer extends Beautifier

  name: 'PHP-CS-Fixer'
  link: "https://github.com/FriendsOfPHP/PHP-CS-Fixer"

  options:
    PHP: true

  beautify: (text, language, options, context) ->
    @debug('php-cs-fixer', options)

    configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
    phpCsFixerOptions = [
      "fix"
      "--rules=#{options.rules}" if options.rules
      "--config=#{configFile}" if configFile
    ]
    runOptions = {
      ignoreReturnCode: true
      help: {
{'fraction_non_alphanumeric': 0.15189003436426116, 'fraction_numerical': 0.0, 'mean_word_length': 3.5077399380804954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2346657', 'n_tokens_mistral': 490, 'n_tokens_neox': 481, 'n_words': 99}