Skip to content

Commit

Permalink
Update PHP to 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Luehrsen committed Feb 24, 2023
1 parent 6f8e168 commit 9085bf2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"composer/installers": true
},
"platform": {
"php": "7.4"
"php": "8.1"
}
}
}
4 changes: 2 additions & 2 deletions phpcs.override.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset name="WordPress LH Override">
<description>The only purpose of this ruleset is to override the testVersion of other rulesets.</description>
<!-- Check for cross-version support for PHP 7.4 and higher. -->
<config name="testVersion" value="7.4-"/>
<!-- Check for cross-version support for PHP 8.1 and higher. -->
<config name="testVersion" value="8.1-"/>
</ruleset>
10 changes: 10 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
the equality operator is very close to the assignment operator.
It's easy to mess up and accidentally assign to the variable you're
trying to check.
Here's the thing though. Yoda conditions just don't read correctly
in the code flow. They require you to change the way you think
about the control flow.
Rather than forcing every conditional to be backwards, why not ban
assignment from conditionals? You never really *need* to assign in
a conditional.
So, here's where I stand: no to Yoda conditions. Yes to banning
assignment in conditionals.
Thank you Human Made!
-->
<exclude name="WordPress.PHP.YodaConditions" />
Expand Down Expand Up @@ -56,5 +60,11 @@
</properties>
</rule>

<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />

<rule ref="phpcs.override.xml"/>
</ruleset>
5 changes: 5 additions & 0 deletions plugin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
"psr-4": {
"WpMunich\\lhpbpp\\": "inc/"
}
},
"config": {
"platform": {
"php": "8.1"
}
}
}
3 changes: 3 additions & 0 deletions theme/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
},
"platform": {
"php": "8.1"
}
}
}

0 comments on commit 9085bf2

Please sign in to comment.