package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -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)
{
}
}