homebrew-core/Formula/php-cs-fixer.rb
Alexander M. Turek 18975f5aa3 php-cs-fixer 2.15.3
Closes #44059.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
2019-09-10 10:59:21 +02:00

27 lines
787 B
Ruby

class PhpCsFixer < Formula
desc "Tool to automatically fix PHP coding standards issues"
homepage "https://cs.sensiolabs.org/"
url "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.15.3/php-cs-fixer.phar"
version "2.15.3"
sha256 "8c94ede44b66560c3867ed10ce42ec8e4eb8ce0bf7511a0802ad9963864f6c41"
bottle :unneeded
depends_on "php" if MacOS.version <= :el_capitan
def install
bin.install "php-cs-fixer.phar" => "php-cs-fixer"
end
test do
(testpath/"test.php").write <<~EOS
<?php $this->foo( 'homebrew rox' );
EOS
(testpath/"correct_test.php").write <<~EOS
<?php $this->foo('homebrew rox');
EOS
system "#{bin}/php-cs-fixer", "fix", "test.php"
assert compare_file("test.php", "correct_test.php")
end
end