fix: PHP 8.1 deprecation warnings (#3384)

This commit is contained in:
Sami Mazouz 2022-04-19 21:14:52 +01:00 committed by GitHub
parent 09bed537b3
commit be2da3e12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -37,7 +37,6 @@
},
"require": {
"php": ">=7.3",
"axy/sourcemap": "^0.1.4",
"components/font-awesome": "^5.14.0",
"dflydev/fig-cookies": "^3.0.0",
"doctrine/dbal": "^2.7",
@ -75,6 +74,8 @@
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"s9e/text-formatter": "^2.3.6",
"sycho/json-api": "^0.5.0",
"sycho/sourcemap": "^2.0.0",
"symfony/config": "^5.2.2",
"symfony/console": "^5.2.2",
"symfony/event-dispatcher": "^5.2.2",
@ -82,7 +83,6 @@
"symfony/polyfill-intl-messageformatter": "^1.22.0",
"symfony/translation": "^5.1.5",
"symfony/yaml": "^5.2.2",
"tobscure/json-api": "^0.3.0",
"wikimedia/less.php": "^3.0"
},
"require-dev": {

View File

@ -53,22 +53,23 @@ class Config implements ArrayAccess
}
}
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return Arr::get($this->data, $offset);
}
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return Arr::has($this->data, $offset);
}
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
throw new RuntimeException('The Config is immutable');
}
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
throw new RuntimeException('The Config is immutable');
}