Skip to content

Instantly share code, notes, and snippets.

@Tjitse-E
Last active March 17, 2021 12:53
Show Gist options
  • Save Tjitse-E/7f420f03078f38a7244556fe65e731f4 to your computer and use it in GitHub Desktop.
Save Tjitse-E/7f420f03078f38a7244556fe65e731f4 to your computer and use it in GitHub Desktop.
PHPunit 6 to 9, change 'protected function setup' to 'public function setup'
# Requires gsed (Mac OSX) or sed (Linux)
targets=$(grep -HRl "function setUp()" app)
for i in ${targets}; do
echo $i
/usr/local/bin/gsed -i 's/[a-zA-Z]\+ function setUp().*/protected function setUp(): void/' "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment