package and depencies
This commit is contained in:
@@ -33,27 +33,20 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
*/
|
||||
protected $data = [];
|
||||
|
||||
/**
|
||||
* @var ClonerInterface
|
||||
*/
|
||||
private $cloner;
|
||||
private ClonerInterface $cloner;
|
||||
|
||||
/**
|
||||
* Converts the variable into a serializable Data instance.
|
||||
*
|
||||
* This array can be displayed in the template using
|
||||
* the VarDumper component.
|
||||
*
|
||||
* @param mixed $var
|
||||
*
|
||||
* @return Data
|
||||
*/
|
||||
protected function cloneVar($var)
|
||||
protected function cloneVar(mixed $var): Data
|
||||
{
|
||||
if ($var instanceof Data) {
|
||||
return $var;
|
||||
}
|
||||
if (null === $this->cloner) {
|
||||
if (!isset($this->cloner)) {
|
||||
$this->cloner = new VarCloner();
|
||||
$this->cloner->setMaxItems(-1);
|
||||
$this->cloner->addCasters($this->getCasters());
|
||||
@@ -84,10 +77,7 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
return $casters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
public function __sleep(): array
|
||||
{
|
||||
return ['data'];
|
||||
}
|
||||
@@ -106,7 +96,7 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
/**
|
||||
* @internal to prevent implementing \Serializable
|
||||
*/
|
||||
final protected function unserialize($data)
|
||||
final protected function unserialize(string $data)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user