SerializableClosure.php
950 字节
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
<?php
namespace Illuminate\Queue;
use Opis\Closure\SerializableClosure as OpisSerializableClosure;
/**
* @deprecated This class will be removed in Laravel 9.
*/
class SerializableClosure extends OpisSerializableClosure
{
use SerializesAndRestoresModelIdentifiers;
/**
* Transform the use variables before serialization.
*
* @param array $data
* @return array
*/
protected function transformUseVariables($data)
{
foreach ($data as $key => $value) {
$data[$key] = $this->getSerializedPropertyValue($value);
}
return $data;
}
/**
* Resolve the use variables after unserialization.
*
* @param array $data
* @return array
*/
protected function resolveUseVariables($data)
{
foreach ($data as $key => $value) {
$data[$key] = $this->getRestoredPropertyValue($value);
}
return $data;
}
}