Допокрытие ArrayAccess-методов

This commit is contained in:
2021-12-12 11:09:12 +08:00
parent b4af189292
commit 294a3ef2f3
4 changed files with 68 additions and 20 deletions

View File

@@ -7,11 +7,12 @@
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
*/
declare(strict_types = 1);
declare(strict_types=1);
namespace AtolOnline\Entities;
use ArrayAccess;
use BadMethodCallException;
use Illuminate\Contracts\Support\Arrayable;
use JsonSerializable;
use Stringable;
@@ -65,7 +66,7 @@ abstract class Entity implements JsonSerializable, Stringable, Arrayable, ArrayA
*/
public function offsetSet(mixed $offset, mixed $value)
{
throw new \BadMethodCallException(
throw new BadMethodCallException(
'Объект ' . static::class . ' нельзя изменять как массив. Следует использовать сеттеры.'
);
}
@@ -75,7 +76,7 @@ abstract class Entity implements JsonSerializable, Stringable, Arrayable, ArrayA
*/
public function offsetUnset(mixed $offset): void
{
throw new \BadMethodCallException(
throw new BadMethodCallException(
'Объект ' . static::class . ' нельзя изменять как массив. Следует использовать сеттеры.'
);
}