<commit_before>require 'formula'
require File.expand_path("../../Requirements/php-meta-requirement", Pathname.new(__FILE__).realpath)

class PhpCodeSniffer < Formula
  homepage 'http://pear.php.net/package/PHP_CodeSniffer'
  url 'http://download.pear.php.net/package/PHP_CodeSniffer-1.5.1.tgz'
  sha1 'a68b66cc1a88b7f5359270ab72292fff33587b00'

  depends_on PhpMetaRequirement

  def phpcs_standards
    etc+name+'Standards'
  end

  def phpcs_script_name
    'phpcs'
  end

  def install
    prefix.install Dir["PHP_CodeSniffer-#{version}/*"]
    (libexec+phpcs_script_name).write <<-EOS.undent
      #!/bin/sh
      /usr/bin/env php "#{prefix}/scripts/phpcs" "$@"
    EOS
    chmod 0755, libexec+phpcs_script_name
    bin.install_symlink libexec+phpcs_script_name

    # Create a place for other formulas to link their standards.
    phpcs_standards.mkpath
    system bin+phpcs_script_name, '--config-set', 'installed_paths', phpcs_standards
  end

  def caveats; <<-EOS.undent
    Verify your installation by running:

      #{phpcs_script_name} --version

    You can read more about phpcs by running:

      brew home #{name}

    EOS
  end
end


<commit_msg>PHP CodeSniffer 1.5.2<commit_after>require 'formula'
require File.expand_path("../../Requirements/php-meta-requirement", Pathname.new(__FILE__).realpath)

class PhpCodeSniffer < Formula
  homepage 'http://pear.php.net/package/PHP_CodeSniffer'
  url 'http://download.pear.php.net/package/PHP_CodeSniffer-1.5.2.tgz'
  sha1 '0b804d3645592b29ddc8a193a9c288e613e22a49'

  devel do
    url 'http://download.pear.php.net/package/PHP_CodeSniffer-2.0.0a1.tgz'
    sha1 'd7f9dd747aeafc0750e471a7c3c35a4b640427e8'
  end

  depends_on PhpMetaRequirement

  def phpcs_standards
    etc+name+'Standards'
  end

  def phpcs_script_name
    'phpcs'
  end

  def install
    prefix.install Dir["PHP_CodeSniffer-#{version}/*"]
    (libexec+phpcs_script_name).write <<-EOS.undent
      #!/bin/sh
      /usr/bin/env php "#{prefix}/scripts/phpcs" "$@"
    EOS
    chmod 0755, libexec+phpcs_script_name
    bin.install_symlink libexec+phpcs_script_name

    # Create a place for other formulas to link their standards.
    phpcs_standards.mkpath
    system bin+phpcs_script_name, '--config-set', 'installed_paths', phpcs_standards
  end

  def caveats; <<-EOS.undent
    Install the alpha release of PHP CodeSniffer with the --devel option.

    Verify your installation by running:

      #{phpcs_script_name} --version

    You can read more about phpcs by running:

      brew home #{name}

    EOS
  end
end
{'fraction_non_alphanumeric': 0.10693301997649823, 'fraction_numerical': 0.04034469251860556, 'mean_word_length': 3.6436363636363636, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4009460', 'n_tokens_mistral': 1003, 'n_tokens_neox': 929, 'n_words': 182}