function FileProfilerStorage::createProfileFromData
1 call to FileProfilerStorage::createProfileFromData()
- FileProfilerStorage::doRead in vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php
File
-
vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php, line 265
Class
- FileProfilerStorage
- Storage for profiler using files.
Namespace
Symfony\Component\HttpKernel\ProfilerCode
protected function createProfileFromData(string $token, array $data, ?Profile $parent = null) : Profile {
$profile = new Profile($token);
$profile->setIp($data['ip']);
$profile->setMethod($data['method']);
$profile->setUrl($data['url']);
$profile->setTime($data['time']);
$profile->setStatusCode($data['status_code']);
$profile->setVirtualType($data['virtual_type'] ?: 'request');
$profile->setCollectors($data['data']);
if (!$parent && $data['parent']) {
$parent = $this->read($data['parent']);
}
if ($parent) {
$profile->setParent($parent);
}
foreach ($data['children'] as $token) {
if (null !== ($childProfile = $this->doRead($token, $profile))) {
$profile->addChild($childProfile);
}
}
return $profile;
}