#[\\ReturnTypeWillChange] Error

Hello friends, I am trying to use cockpit as a library in a slim app. However, the dependency injection causes an big issue on Apache server with php 8.1.1

The error is as follows:

Deprecated: Return type of Lime\App::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/Lime/App.php on line 1158

Deprecated: Return type of Lime\App::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/Lime/App.php on line 1154

Deprecated: Return type of Lime\App::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/Lime/App.php on line 1173

Deprecated: Return type of ContainerArray::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 120

Deprecated: Return type of ContainerArray::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 115

Deprecated: Return type of ContainerArray::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 92

Deprecated: Return type of ContainerArray::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 124

Deprecated: Return type of ContainerArray::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 52

Deprecated: Return type of ContainerArray::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 60

Deprecated: Return type of ContainerArray::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /cockpit/lib/ContainerArray.php on line 405
{ "statusCode": 500, "error": { "type": "SERVER_ERROR", "description": "ERROR: Return type of MongoLite\\Cursor::rewind() should either be compatible with Iterator::rewind(): void, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice on line 248 in file \/cockpit\/lib\/MongoLite\/Cursor.php." } }

you must step by step refactoring. is a small problem.
lock at the code-position and declare types