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.13.1/php-cs-fixer.phar" version "2.13.1" sha256 "04cfdffa62a95702c1ecb315e160f0470e4d0fa477cbf27182c3340948c0c97b" 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 foo( 'homebrew rox' ); EOS (testpath/"correct_test.php").write <<~EOS foo('homebrew rox'); EOS system "#{bin}/php-cs-fixer", "fix", "test.php" assert compare_file("test.php", "correct_test.php") end end