Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@7.1.rb
php@7.1: undefined method `service' for #<Class:0x00007f968a9d5f80>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@8.2.rb
php@8.2: undefined method `service' for #<Class:0x00007f968aa0c828>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php-debug.rb
php-debug: undefined method `service' for #<Class:0x00007f968aa3c0c8>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@8.1-zts.rb
php@8.1-zts: undefined method `service' for #<Class:0x00007f968aa7f210>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@7.0-debug-zts.rb
php@7.0-debug-zts: undefined method `service' for #<Class:0x00007f968aaa5cd0>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@8.0-debug-zts.rb
php@8.0-debug-zts: undefined method `service' for #<Class:0x00007f968a947230>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@7.1-debug-zts.rb
php@7.1-debug-zts: undefined method `service' for #<Class:0x00007f96a009c700>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@7.4-zts.rb
php@7.4-zts: undefined method `service' for #<Class:0x00007f968a9e4210>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@8.1-debug-zts.rb
php@8.1-debug-zts: undefined method `service' for #<Class:0x00007f968aa77b28>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@8.0-debug.rb
php@8.0-debug: undefined method `service' for #<Class:0x00007f967811a628>
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/shivammathur/homebrew-php/Formula/php@8.1-debug.rb
php@8.1-debug: undefined method `service' for #<Class:0x00007f96a00a6570>
Error: Cannot tap shivammathur/php: invalid syntax in tap!
解决方法
brew untap exolnet/deprecated
brew tap --repair
brew update
brew tap shivammathur/php
brew install shivammathur/php/php@8.3
brew link --overwrite --force shivammathur/php/php@8.3
原文出处https://github.com/shivammathur/homebrew-php/discussions/743