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

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

  devel do
    url 'http://download.pear.php.net/package/PHP_CodeSniffer-2.0.0a2.tgz'
    sha1 '1db15c6ae2387a4dea3589d9192b010430f3300a'
  end

  depends_on PhpMetaRequirement

  def phpcs_standards
    etc+name+'Standards'
  end

  def phpcs_script_name
    'phpcs'
  end

  def phpcbf_script_name
    'phpcbf'
  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<commit_msg>Updated CodeSniffer<commit_after>require 'formula'
require File.expand_path("../../Requirements/php-meta-requirement", __FILE__)

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

  devel do
    url 'http://download.pear.php.net/package/PHP_CodeSniffer-2.0.0RC1.tgz'
    sha1 '005c65771f2c9995159ea2bf500ef05b32d4f012'
  end

  depends_on PhpMetaRequirement

  def phpcs_standards
    etc+name+'Standards'
  end

  def phpcs_script_name
    'phpcs'
  end

  def phpcbf_script_name
    'phpcbf'
  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
{'fraction_non_alphanumeric': 0.12507305669199298, 'fraction_numerical': 0.07481005260081823, 'mean_word_length': 3.8636363636363638, 'pattern_counts': {'":': 0, '<': 9, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4523820', 'n_tokens_mistral': 760, 'n_tokens_neox': 688, 'n_words': 92}