<commit_before>class PhpCsFixer < Formula
  desc "Tool to automatically fix PHP coding standards issues"
  homepage "https://cs.symfony.com/"
  url "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.9.1/php-cs-fixer.phar"
  sha256 "37f4a839ef1e0c071675cdf8951f773edbd26cdb1c9c98f362b6b6e5905e14e1"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, all: "759eb7f5e66af70d647a52a547b90915690cd709be7152341b3ace25ce989e8b"
  end

  depends_on "php"

  def install
    libexec.install "php-cs-fixer.phar"

    (bin/"php-cs-fixer").write <<~EOS
      #!#{Formula["php"].opt_bin}/php
      <?php require '#{libexec}/php-cs-fixer.phar';
    EOS
  end

  test do
    (testpath/"test.php").write <<~EOS
      <?php $this->foo(   'homebrew rox'   );
    EOS
    (testpath/"correct_test.php").write <<~EOS
      <?php
<commit_msg>php-cs-fixer: update 3.9.1 bottle.<commit_after>class PhpCsFixer < Formula
  desc "Tool to automatically fix PHP coding standards issues"
  homepage "https://cs.symfony.com/"
  url "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.9.1/php-cs-fixer.phar"
  sha256 "37f4a839ef1e0c071675cdf8951f773edbd26cdb1c9c98f362b6b6e5905e14e1"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, all: "aa953732bbd32b05a94b1b7b15a2b41d7f829ef9c0beda2232134e817a891770"
  end

  depends_on "php"

  def install
    libexec.install "php-cs-fixer.phar"

    (bin/"php-cs-fixer").write <<~EOS
      #!#{Formula["php"].opt_bin}/php
      <?php require '#{libexec}/php-cs-fixer.phar';
    EOS
  end

  test do
    (testpath/"test.php").write <<~EOS
      <?php $this->foo(   'homebrew rox'   );
    EOS
    (testpath/"correct_test.php").write <<~EOS
      <?php

{'fraction_non_alphanumeric': 0.1386481802426343, 'fraction_numerical': 0.10514153668399769, 'mean_word_length': 3.6684636118598384, 'pattern_counts': {'":': 0, '<': 23, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3674421', 'n_tokens_mistral': 821, 'n_tokens_neox': 730, 'n_words': 111}