1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
<?php
declare(strict_types=1);
namespace DoctrineTest\InstantiatorTestAsset;
use BadMethodCallException;
use Serializable;
/**
* Base serializable test asset
*/
class SimpleSerializableAsset implements Serializable
{
/**
* Constructor - should not be called
*
* @throws BadMethodCallException
*/
public function __construct()
{
throw new BadMethodCallException('Not supposed to be called!');
}
public function serialize(): string
{
return '';
}
/**
* {@inheritDoc}
*
* Should not be called
*
* @throws BadMethodCallException
*/
public function unserialize(string $serialized): void
{
throw new BadMethodCallException('Not supposed to be called!');
}
/** @return mixed[] */
public function __serialize(): array
{
return [];
}
/** @param mixed[] $data */
public function __unserialize(array $data): void
{
throw new BadMethodCallException('Not supposed to be called!');
}
}
|