<commit_before>class Phpstan < Formula
  desc "PHP Static Analysis Tool"
  homepage "https://github.com/phpstan/phpstan"
  url "https://github.com/phpstan/phpstan/releases/download/0.12.97/phpstan.phar"
  sha256 "bfaabace705c7592f3c2d8b0ce248db061829e77c7e317b0614c9906d8a3f11e"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "372a9d4e836a5c71e750b25509693220b241d118fc9e5e33f1fb81e8adb88c31"
    sha256 cellar: :any_skip_relocation, big_sur:       "4052cfc4bfd7a9e7ac2432fbfad844926c520b936d4c9856ce0ffcae7b3332a1"
    sha256 cellar: :any_skip_relocation, catalina:      "4052cfc4bfd7a9e7ac2432fbfad844926c520b936d4c9856ce0ffcae7b3332a1"
    sha256 cellar: :any_skip_relocation, mojave:        "4052cfc4bfd7a9e7ac2432fbfad844926c520b936d4c9856ce0ffcae7b3332a1"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "372a9d4e836a5c71e750b25509693220b241d118fc9e5e33f1fb81e8adb88c31"
  end

  depends_on "php" => :test

  # Keg-relocation breaks the formula when it replaces `/usr/local` with a non-default prefix
  on_macos do
    pour_bottle? only_if: :default_prefix if Hardware::CPU.intel?
  end

  def install
    bin.install "phpstan.phar" => "phpstan"
  end

  test do
    (testpath/"src/autoload.php").write <<~EOS
      <?php
      spl_autoload_register(
          function($class) {
              static $classes = null;
              if ($classes === null) {<commit_msg>phpstan 0.12.98<commit_after>class Phpstan < Formula
  desc "PHP Static Analysis Tool"
  homepage "https://github.com/phpstan/phpstan"
  url "https://github.com/phpstan/phpstan/releases/download/0.12.98/phpstan.phar"
  sha256 "91b69b15e34ef27a51ccd5ebe5765c850166bb570980035c6bb633375330d51f"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "372a9d4e836a5c71e750b25509693220b241d118fc9e5e33f1fb81e8adb88c31"
    sha256 cellar: :any_skip_relocation, big_sur:       "4052cfc4bfd7a9e7ac2432fbfad844926c520b936d4c9856ce0ffcae7b3332a1"
    sha256 cellar: :any_skip_relocation, catalina:      "4052cfc4bfd7a9e7ac2432fbfad844926c520b936d4c9856ce0ffcae7b3332a1"
    sha256 cellar: :any_skip_relocation, mojave:        "4052cfc4bfd7a9e7ac2432fbfad844926c520b936d4c9856ce0ffcae7b3332a1"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "372a9d4e836a5c71e750b25509693220b241d118fc9e5e33f1fb81e8adb88c31"
  end

  depends_on "php" => :test

  # Keg-relocation breaks the formula when it replaces `/usr/local` with a non-default prefix
  on_macos do
    pour_bottle? only_if: :default_prefix if Hardware::CPU.intel?
  end

  def install
    bin.install "phpstan.phar" => "phpstan"
  end

  test do
    (testpath/"src/autoload.php").write <<~EOS
      <?php
      spl_autoload_register(
          function($class) {
              static $classes = null;
              if ($classes === null) {
{'fraction_non_alphanumeric': 0.08374384236453201, 'fraction_numerical': 0.18754398311048556, 'mean_word_length': 4.531128404669261, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '2178567', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1219, 'n_words': 173}