We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e86fc6c commit 03b0b58Copy full SHA for 03b0b58
force_strict_types_php.sh
@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+echo "The affected files will be:"
4
+grep -R --include="*.php" "<?php" . | awk '{print $1 }' FS=":"
5
6
7
+# Change to strict types
8
+grep -R --include="*.php" "<?php" . | awk '{print $1 }' FS=":" | xargs sed -i 's/declare(strict_types=1);//g'
9
+grep -R --include="*.php" "<?php" . | awk '{print $1 }' FS=":" | xargs sed -i 's/declare(strict_types = 1);//g'
10
+grep -R --include="*.php" "<?php" . | awk '{print $1 }' FS=":" | xargs sed -i 's/<?php/<?php\n\ndeclare(strict_types=1);/g'
11
+echo "Done"
0 commit comments