Skip to content

Commit

Permalink
Fix PHP 8.1 incompatible return type deprecation
Browse files Browse the repository at this point in the history
The proper fix would require to actually declare the `mixed` return
type, but that is only available as of PHP 7.2.0, so we use the
`ReturnTypeWillChange` attribute, which is ignored prior to PHP 8.1.0.
  • Loading branch information
cmb69 committed Jan 14, 2022
1 parent 1475764 commit f631489
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmsimple/classes/PluginConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function __construct($language = false)
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
if (!isset($this->configs[$offset])) {
Expand All @@ -63,6 +64,7 @@ public function offsetExists($offset)
*
* @return array
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!isset($this->configs[$offset])) {
Expand All @@ -79,6 +81,7 @@ public function offsetGet($offset)
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (!isset($this->configs[$offset])) {
Expand All @@ -94,6 +97,7 @@ public function offsetSet($offset, $value)
*
* @return void
*/
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
if (!isset($this->configs[$offset])) {
Expand Down

0 comments on commit f631489

Please sign in to comment.